Skip to content

Commit

Permalink
fix: ensure output values exist
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhu committed Aug 19, 2024
1 parent 91c103b commit 0c3dc98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ export function parseSmartContractWalletTx({

const inputLog = logs.find((log) => log.symbol === wrappedNativeAsset);

if (inputLog) {
if (inputLog && output) {
return {
tokenIn: {
address: NATIVE_TOKEN_ADDRESS,
amount: inputLog.amount,
symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId],
},
tokenOut: {
address: output?.address,
amount: output?.amount,
symbol: output?.symbol,
address: output.address,
amount: output.amount,
symbol: output.symbol,
},
};
} else {
Expand Down

0 comments on commit 0c3dc98

Please sign in to comment.