From 94b7dbc52e962b5e3e4819acbee39dc420d1d7ea Mon Sep 17 00:00:00 2001 From: Dinshaw Kothari Date: Fri, 4 Aug 2023 17:17:12 +0530 Subject: [PATCH] fix(abstract-cosmos): getAccountBalance fix Ticket: WIN-180 --- modules/abstract-cosmos/src/cosmosCoin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/abstract-cosmos/src/cosmosCoin.ts b/modules/abstract-cosmos/src/cosmosCoin.ts index 75aff0b736..4689f32c8d 100644 --- a/modules/abstract-cosmos/src/cosmosCoin.ts +++ b/modules/abstract-cosmos/src/cosmosCoin.ts @@ -555,7 +555,8 @@ export class CosmosCoin extends BaseCoin { if (response.status !== 200) { throw new Error('Account not found'); } - return response.body.balances[0].amount; + const balance = response.body.balances.find((item) => item.denom === this.getDenomination()); + return balance.amount; } /**