| 1 | import 'package:cw_zano/api/model/balance.dart'; |
| 2 | |
| 3 | class Wi { |
| 4 | final String address; |
| 5 | final List<Balance> balances; |
| 6 | final bool isAuditable; |
| 7 | final bool isWatchOnly; |
| 8 | final int minedTotal; |
| 9 | final String path; |
| 10 | final String viewSecKey; |
| 11 | |
| 12 | Wi( |
| 13 | {required this.address, |
| 14 | required this.balances, |
| 15 | required this.isAuditable, |
| 16 | required this.isWatchOnly, |
| 17 | required this.minedTotal, |
| 18 | required this.path, |
| 19 | required this.viewSecKey}); |
| 20 | |
| 21 | factory Wi.fromJson(Map<String, dynamic> json) => Wi( |
| 22 | address: json['address'] as String? ?? '', |
| 23 | balances: (json['balances'] as List<dynamic>? ?? []) |
| 24 | .map((e) => Balance.fromJson(e as Map<String, dynamic>)) |
| 25 | .toList(), |
| 26 | isAuditable: json['is_auditable'] as bool? ?? false, |
| 27 | isWatchOnly: json['is_watch_only'] as bool? ?? false, |
| 28 | minedTotal: json['mined_total'] as int? ?? 0, |
| 29 | path: json['path'] as String? ?? '', |
| 30 | viewSecKey: json['view_sec_key'] as String? ?? '', |
| 31 | ); |
| 32 | } |