Skip to content

Commit

Permalink
add TokenBalanceData.locked & TokenBalanceData.reserved
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Jul 13, 2021
1 parent 4178980 commit 0996e11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/api/apiRecovery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class ApiRecovery {
return null;
}

Future<List> queryRecoverableList(List<String> addresses) async {
Future<List<RecoveryInfo>> queryRecoverableList(
List<String> addresses) async {
final List res = await service.queryRecoverableList(addresses);
return res
.map((e) => RecoveryInfo.fromJson(Map<String, dynamic>.of(e)))
.map((e) => RecoveryInfo.fromJson(Map<String, dynamic>.of(e ?? {})))
.toList();
}

Expand Down
4 changes: 2 additions & 2 deletions lib/api/types/recoveryInfo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class RecoveryInfo extends _RecoveryInfo {
info.address = json['address'];
info.delayPeriod = json['delayPeriod'];
info.threshold = json['threshold'];
info.friends = List<String>.from(json['friends']);
info.deposit = BigInt.parse(json['deposit'].toString());
info.friends = List<String>.from(json['friends'] ?? []);
info.deposit = BigInt.parse((json['deposit'] ?? 0).toString());
return info;
}
}
Expand Down
4 changes: 4 additions & 0 deletions lib/plugin/store/balances.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ class TokenBalanceData {
this.symbol,
this.decimals,
this.amount,
this.locked,
this.reserved,
this.detailPageRoute,
});

final String name;
final String symbol;
final int decimals;
final String amount;
final String locked;
final String reserved;

final String detailPageRoute;
}

0 comments on commit 0996e11

Please sign in to comment.