From 3619df67148eb59ab6db60aff7fac4657b7a40a4 Mon Sep 17 00:00:00 2001 From: vorujack Date: Tue, 5 Dec 2023 00:24:43 +0330 Subject: [PATCH] fix bug when getting address balance --- packages/abstract-chain/lib/AbstractChain.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/abstract-chain/lib/AbstractChain.ts b/packages/abstract-chain/lib/AbstractChain.ts index 615a1a3..5aceaa6 100644 --- a/packages/abstract-chain/lib/AbstractChain.ts +++ b/packages/abstract-chain/lib/AbstractChain.ts @@ -171,7 +171,9 @@ abstract class AbstractChain { * @returns an object containing the amount of each asset */ getAddressAssets = async (address: string): Promise => - await this.network.getAddressAssets(address); + address === '' + ? Promise.resolve({ nativeToken: 0n, tokens: [] }) + : this.network.getAddressAssets(address); /** * gets the amount of each asset in the lock address