Skip to content

Commit

Permalink
[Redesign] Adding a temp solution for token config retrieval for the …
Browse files Browse the repository at this point in the history
…ones with universal address (#2827)

Signed-off-by: Emre Bogazliyanlioglu <[email protected]>
  • Loading branch information
emreboga authored Oct 10, 2024
1 parent 872b808 commit 3a47a09
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions wormhole-connect/src/hooks/useTransactionHistoryWHScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,21 @@ const useTransactionHistoryWHScan = (

const tokenChain = chainIdToChain(tokenChainId);

const tokenConfig = getTokenById({
let tokenConfig = getTokenById({
chain: tokenChain,
address: standarizedProperties.tokenAddress,
});

// Skip if we don't have the source token
if (!tokenConfig) {
return;
// IMPORTANT:
// If we don't have the token config from the token address,
// we can check if we can use the symbol to get it.
// So far this case is only for SUI and APT
if (data?.symbol && config.tokens[data.symbol]) {
tokenConfig = config.tokens[data.symbol];
} else {
return;
}
}

const toChain = chainIdToChain(toChainId) as Chain;
Expand Down

0 comments on commit 3a47a09

Please sign in to comment.