CakeWallet/cw_core/lib/n2_node.dart
Matthew Fosse fce6394bca
Cw 602 nano bad rep (#1356)
* add support for paths in node settings

* update translations and fixes

* fix node path

* add rep warning flag

* update translations

* code cleanup [skip ci]

* add additional node options

* add migration

* update transaction history rpc to be under the limit

* review fixes [skip ci]

* [skip ci] updates

* move n2_node.dart

* minor code improvements

* more minor code cleanup
2024-04-12 14:36:42 +02:00

31 lines
715 B
Dart

class N2Node {
N2Node({
this.weight,
this.uptime,
this.score,
this.account,
this.alias,
});
String? uptime;
double? weight;
int? score;
String? account;
String? alias;
factory N2Node.fromJson(Map<String, dynamic> json) => N2Node(
weight: double.tryParse((json['weight'] as num).toString()),
uptime: json['uptime'] as String?,
score: json['score'] as int?,
account: json['rep_address'] as String?,
alias: json['alias'] as String?,
);
Map<String, dynamic> toJson() => <String, dynamic>{
'uptime': uptime,
'weight': weight,
'score': score,
'rep_address': account,
'alias': alias,
};
}