From 67c554d05eb57224055974f36bf094cf26f64097 Mon Sep 17 00:00:00 2001 From: noiach Date: Tue, 10 Nov 2020 17:38:40 +1100 Subject: [PATCH] fix(FIL): return balance correctly --- src/handlers/FIL/FILHandler.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/handlers/FIL/FILHandler.ts b/src/handlers/FIL/FILHandler.ts index 4bb5711..ff4ce8f 100644 --- a/src/handlers/FIL/FILHandler.ts +++ b/src/handlers/FIL/FILHandler.ts @@ -74,18 +74,18 @@ export class FILHandler asset: Asset, options: BalanceOptions = {} ): Promise => - (await this.getBalanceInSats(asset, options)).dividedBy( - new BigNumber(10).exponentiatedBy(this.decimals) + new BigNumber( + await this.sharedState.filecoin.getBalance( + (options && options.address) || (await this.address(asset)) + ) ); public readonly getBalanceInSats = async ( asset: Asset, options: BalanceOptions = {} ): Promise => - new BigNumber( - await this.sharedState.filecoin.getBalance( - (options && options.address) || (await this.address(asset)) - ) + (await this.getBalance(asset, options)).multipliedBy( + new BigNumber(10).exponentiatedBy(this.decimals) ); // Transfer