From ccf00b86b94d550beca76d4e0f3b27eef682a641 Mon Sep 17 00:00:00 2001 From: Tom Haile Date: Wed, 5 Feb 2025 18:19:05 -0600 Subject: [PATCH] evmAddress is not on TokenInfo type, updating tokenlist.d.ts doesnt help, it's a local file, adding check for evmAddress property --- src/ui/views/TokenDetail/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/views/TokenDetail/index.tsx b/src/ui/views/TokenDetail/index.tsx index 97730957..0b05a0fb 100644 --- a/src/ui/views/TokenDetail/index.tsx +++ b/src/ui/views/TokenDetail/index.tsx @@ -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); }