From 93b73d720e0ed9ecf44f1fbb8521a7020549c5c1 Mon Sep 17 00:00:00 2001 From: Michael Wallace Date: Fri, 29 Nov 2024 15:20:12 +1100 Subject: [PATCH] fix: erc20 discovery balance --- .../tokenscript-viewer/src/integration/discoveryAdapter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/tokenscript-viewer/src/integration/discoveryAdapter.ts b/javascript/tokenscript-viewer/src/integration/discoveryAdapter.ts index 8f75a32..d4665b6 100644 --- a/javascript/tokenscript-viewer/src/integration/discoveryAdapter.ts +++ b/javascript/tokenscript-viewer/src/integration/discoveryAdapter.ts @@ -173,9 +173,9 @@ export class DiscoveryAdapter implements ITokenDiscoveryAdapter { // Rework so collection data API isn't required for erc20 } else if (tokenData.length > 0) { token.name = tokenData[0].title; - token.balance = tokenData[0].data?.balance ? BigInt(tokenData[0].data?.balance) : 0; + token.balance = tokenData[0].balance ? BigInt(tokenData[0].balance) : 0; token.symbol = tokenData[0].symbol; - token.decimals = tokenData[0].data?.decimals; + token.decimals = tokenData[0].decimals; } else { token.name = collectionData.title; token.balance = 0;