2023-12-02 09:42:00 +00:00
|
|
|
import 'package:cw_zano/api/model/balance.dart';
|
|
|
|
|
|
|
|
class Wi {
|
|
|
|
final String address;
|
|
|
|
final List<Balance> balances;
|
|
|
|
final bool isAuditable;
|
|
|
|
final bool isWatchOnly;
|
|
|
|
final int minedTotal;
|
|
|
|
final String path;
|
|
|
|
final String viewSecKey;
|
|
|
|
|
|
|
|
Wi(
|
|
|
|
{required this.address,
|
|
|
|
required this.balances,
|
|
|
|
required this.isAuditable,
|
|
|
|
required this.isWatchOnly,
|
|
|
|
required this.minedTotal,
|
|
|
|
required this.path,
|
|
|
|
required this.viewSecKey});
|
|
|
|
|
|
|
|
factory Wi.fromJson(Map<String, dynamic> json) => Wi(
|
2024-03-08 10:50:34 +00:00
|
|
|
address: json['address'] as String? ?? '',
|
|
|
|
balances: (json['balances'] as List<dynamic>? ?? [])
|
2023-12-02 09:42:00 +00:00
|
|
|
.map((e) => Balance.fromJson(e as Map<String, dynamic>))
|
|
|
|
.toList(),
|
2024-03-08 10:50:34 +00:00
|
|
|
isAuditable: json['is_auditable'] as bool? ?? false,
|
|
|
|
isWatchOnly: json['is_watch_only'] as bool? ?? false,
|
|
|
|
minedTotal: json['mined_total'] as int? ?? 0,
|
|
|
|
path: json['path'] as String? ?? '',
|
|
|
|
viewSecKey: json['view_sec_key'] as String? ?? '',
|
2023-12-02 09:42:00 +00:00
|
|
|
);
|
|
|
|
}
|