From 1305b9f37c4af16401cf7ece049203bbd33d7a39 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 7 Apr 2023 14:13:28 -0600 Subject: [PATCH] token balance json serialization fix --- lib/models/token_balance.dart | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/lib/models/token_balance.dart b/lib/models/token_balance.dart index 727a29d11..f2606f04d 100644 --- a/lib/models/token_balance.dart +++ b/lib/models/token_balance.dart @@ -16,38 +16,13 @@ class TokenBalance extends Balance { final String contractAddress; - // @override - // Decimal getTotal({bool includeBlocked = false}) => - // Format.satoshisToEthTokenAmount( - // includeBlocked ? total : total - blockedTotal, - // decimalPlaces, - // ); - // - // @override - // Decimal getSpendable() => Format.satoshisToEthTokenAmount( - // spendable, - // decimalPlaces, - // ); - // - // @override - // Decimal getPending() => Format.satoshisToEthTokenAmount( - // pendingSpendable, - // decimalPlaces, - // ); - // - // @override - // Decimal getBlocked() => Format.satoshisToEthTokenAmount( - // blockedTotal, - // decimalPlaces, - // ); - @override String toJsonIgnoreCoin() => jsonEncode({ "contractAddress": contractAddress, - "total": total, - "spendable": spendable, - "blockedTotal": blockedTotal, - "pendingSpendable": pendingSpendable, + "total": total.toJsonString(), + "spendable": spendable.toJsonString(), + "blockedTotal": blockedTotal.toJsonString(), + "pendingSpendable": pendingSpendable.toJsonString(), }); factory TokenBalance.fromJson(