From 00a85d336026ecca99cd4c0062e8b79c8ebb4e13 Mon Sep 17 00:00:00 2001 From: Max Turcan Date: Wed, 4 May 2022 09:36:02 -0700 Subject: [PATCH 1/2] adding trs balance property --- modules/bitgo/src/v2/wallet.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/bitgo/src/v2/wallet.ts b/modules/bitgo/src/v2/wallet.ts index ee74938c1c..1cef0c0202 100644 --- a/modules/bitgo/src/v2/wallet.ts +++ b/modules/bitgo/src/v2/wallet.ts @@ -445,9 +445,11 @@ export interface WalletData { balance: number; confirmedBalance: number; spendableBalance: number; + trsBalance: number; balanceString: string; confirmedBalanceString: string; spendableBalanceString: string; + trsBalanceString: string; coin: string; label: string; keys: string[]; @@ -663,6 +665,15 @@ export class Wallet { return this._wallet.spendableBalanceString; } + /** + * Get a string representation of the TRS balance of this wallet + * + * This is useful when balances have the potential to overflow standard javascript numbers + */ + trsBalanceString(): string { + return this._wallet.trsBalanceString; + } + /** * Get the coin identifier for the type of coin this wallet holds */ From 38524646b304a7b025ae1c778a60ce995c9d1d40 Mon Sep 17 00:00:00 2001 From: Max Turcan Date: Wed, 4 May 2022 09:36:02 -0700 Subject: [PATCH 2/2] feat: Adding TRS balance property to wallet This property is required for reporting features CLOSES Ticket: BG-45329 --- modules/bitgo/src/v2/wallet.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/bitgo/src/v2/wallet.ts b/modules/bitgo/src/v2/wallet.ts index ee74938c1c..1cef0c0202 100644 --- a/modules/bitgo/src/v2/wallet.ts +++ b/modules/bitgo/src/v2/wallet.ts @@ -445,9 +445,11 @@ export interface WalletData { balance: number; confirmedBalance: number; spendableBalance: number; + trsBalance: number; balanceString: string; confirmedBalanceString: string; spendableBalanceString: string; + trsBalanceString: string; coin: string; label: string; keys: string[]; @@ -663,6 +665,15 @@ export class Wallet { return this._wallet.spendableBalanceString; } + /** + * Get a string representation of the TRS balance of this wallet + * + * This is useful when balances have the potential to overflow standard javascript numbers + */ + trsBalanceString(): string { + return this._wallet.trsBalanceString; + } + /** * Get the coin identifier for the type of coin this wallet holds */