Skip to content

Commit

Permalink
fix: handle invalid denom_traces query, ignoring failed asset
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Sep 15, 2022
1 parent 9ec3d2f commit 843a41b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion core/src/clients/wallets/cosmos/CosmosWalletProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,25 @@ export abstract class CosmosWalletProvider extends WalletProvider<EncodeObject>
// If it's not in the master list of all denom traces, that list may just be outdated...
// Newly minted tokens aren't added to the master list immediately.
// @ts-ignore
denomTrace = await this.getDenomTraceCached(chain, coin.denom);
try {
const cachedDenomTrace = await this.getDenomTraceCached(
chain,
coin.denom,
);

if (cachedDenomTrace) {
denomTrace = cachedDenomTrace;
}
} catch (error) {
console.log(
"failed to get denom_traces for asset, ignoring balance:",
{
chain: chain.chainConfig.chainId,
denom: coin.denom,
},
);
// invalid token, ignore
}
}

if (!denomTrace) {
Expand Down

0 comments on commit 843a41b

Please sign in to comment.