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
|
||||
String toJsonIgnoreCoin() => jsonEncode({
|
||||
"contractAddress": contractAddress,
|
||||
"decimalPlaces": decimalPlaces,
|
||||
"total": total,
|
||||
"spendable": spendable,
|
||||
|
@ -55,12 +56,10 @@ class TokenBalance extends Balance {
|
|||
|
||||
factory TokenBalance.fromJson(
|
||||
String json,
|
||||
String contractAddress,
|
||||
int decimalPlaces,
|
||||
) {
|
||||
final decoded = jsonDecode(json);
|
||||
return TokenBalance(
|
||||
contractAddress: contractAddress,
|
||||
contractAddress: decoded["contractAddress"] as String,
|
||||
decimalPlaces: decoded["decimalPlaces"] as int,
|
||||
total: decoded["total"] as int,
|
||||
spendable: decoded["spendable"] as int,
|
||||
|
|
Loading…
Reference in a new issue