Skip to content

Commit

Permalink
fix: Fix solana token check issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Halibao-Lala committed Jan 7, 2025
1 parent a42552c commit 7d24bac
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions packages/canonical-bridge-sdk/src/debridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,23 @@ export class DeBridge {
fromTokenList.status === 'fulfilled' &&
toTokenList.status === 'fulfilled'
) {
const fromToken =
fromTokenList?.value?.data.tokens[fromTokenAddress.toLowerCase()];
const toToken =
toTokenList?.value?.data.tokens[toTokenAddress.toLowerCase()];
const fromTokenAddr =
fromChainType === 'solana'
? fromTokenAddress
: fromTokenAddress.toLowerCase();
const toTokenAddr =
toChainType === 'solana'
? toTokenAddress
: toTokenAddress.toLowerCase();
const fromToken = fromTokenList?.value?.data.tokens[fromTokenAddr];
const toToken = toTokenList?.value?.data.tokens[toTokenAddr];

if (!toToken) {
console.log('Can not find toToken info');
}
if (!fromToken) {
console.log('Can not find fromToken info');
}
if (
!!fromToken &&
fromToken?.address.toLowerCase() === fromTokenAddress.toLowerCase() &&
Expand Down

0 comments on commit 7d24bac

Please sign in to comment.