From 7e32627d41fd29ef6a1b66e6ea0379c8e5b8ec9a Mon Sep 17 00:00:00 2001 From: Redm4x <2829180+Redm4x@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:43:02 -0500 Subject: [PATCH] fix(analytics): treat missing denom as balance of 0 --- apps/indexer/src/monitors/addressBalanceMonitor.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/indexer/src/monitors/addressBalanceMonitor.ts b/apps/indexer/src/monitors/addressBalanceMonitor.ts index f0fa9c599..09bbef70f 100644 --- a/apps/indexer/src/monitors/addressBalanceMonitor.ts +++ b/apps/indexer/src/monitors/addressBalanceMonitor.ts @@ -19,10 +19,6 @@ export class AddressBalanceMonitor { const [targetAddress, targetToken] = monitoredValue.target.split("|"); const balance = await this.getBalance(targetAddress, targetToken); - if (balance === null) { - throw new Error("Unable to get balance for " + monitoredValue.target); - } - monitoredValue.value = balance.toString(); monitoredValue.lastUpdateDate = new Date(); await monitoredValue.save(); @@ -36,7 +32,7 @@ export class AddressBalanceMonitor { const balance = response.data.balances.find(x => x.denom === (denom || activeChain.udenom)); if (!balance) { - return null; + return 0; } return parseInt(balance.amount);