Skip to content

Commit

Permalink
evmAddress is not on TokenInfo type, updating tokenlist.d.ts doesnt h…
Browse files Browse the repository at this point in the history
…elp, it's a local file, adding check for evmAddress property
  • Loading branch information
bthaile committed Feb 6, 2025
1 parent 5785b31 commit ccf00b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ui/views/TokenDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ const TokenDetail = () => {
if (price) {
setPrice(price);
}
const evmPrice = await usewallet.openapi.getPricesByEvmaddress(
tokenResult!.evmAddress!,
data
);
// TokenInfo does have evmAddress, sometimes, check first
const addressToCheck =
'evmAddress' in tokenResult! ? (tokenResult as any).evmAddress : tokenResult!.address;
const evmPrice = await usewallet.openapi.getPricesByEvmaddress(addressToCheck, data);
if (evmPrice) {
setPrice(evmPrice);
}
Expand Down

0 comments on commit ccf00b8

Please sign in to comment.