token balance json serialization fix

This commit is contained in:
julian 2023-04-07 14:13:28 -06:00
parent 387e2d8403
commit 1305b9f37c

View file

@ -16,38 +16,13 @@ class TokenBalance extends Balance {
final String contractAddress; 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 @override
String toJsonIgnoreCoin() => jsonEncode({ String toJsonIgnoreCoin() => jsonEncode({
"contractAddress": contractAddress, "contractAddress": contractAddress,
"total": total, "total": total.toJsonString(),
"spendable": spendable, "spendable": spendable.toJsonString(),
"blockedTotal": blockedTotal, "blockedTotal": blockedTotal.toJsonString(),
"pendingSpendable": pendingSpendable, "pendingSpendable": pendingSpendable.toJsonString(),
}); });
factory TokenBalance.fromJson( factory TokenBalance.fromJson(