mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 18:44:31 +00:00
json serialize fix
This commit is contained in:
parent
508fc48462
commit
5bf18a541a
1 changed files with 2 additions and 3 deletions
|
@ -46,6 +46,7 @@ class TokenBalance extends Balance {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toJsonIgnoreCoin() => jsonEncode({
|
String toJsonIgnoreCoin() => jsonEncode({
|
||||||
|
"contractAddress": contractAddress,
|
||||||
"decimalPlaces": decimalPlaces,
|
"decimalPlaces": decimalPlaces,
|
||||||
"total": total,
|
"total": total,
|
||||||
"spendable": spendable,
|
"spendable": spendable,
|
||||||
|
@ -55,12 +56,10 @@ class TokenBalance extends Balance {
|
||||||
|
|
||||||
factory TokenBalance.fromJson(
|
factory TokenBalance.fromJson(
|
||||||
String json,
|
String json,
|
||||||
String contractAddress,
|
|
||||||
int decimalPlaces,
|
|
||||||
) {
|
) {
|
||||||
final decoded = jsonDecode(json);
|
final decoded = jsonDecode(json);
|
||||||
return TokenBalance(
|
return TokenBalance(
|
||||||
contractAddress: contractAddress,
|
contractAddress: decoded["contractAddress"] as String,
|
||||||
decimalPlaces: decoded["decimalPlaces"] as int,
|
decimalPlaces: decoded["decimalPlaces"] as int,
|
||||||
total: decoded["total"] as int,
|
total: decoded["total"] as int,
|
||||||
spendable: decoded["spendable"] as int,
|
spendable: decoded["spendable"] as int,
|
||||||
|
|
Loading…
Reference in a new issue