Account.fromJson constructor

Account.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Account.fromJson(Map<String, dynamic> json) {
  String walletType = "";
  if (json.containsKey("walletType") && json['walletType'] != null) {
    walletType = (json['walletType'] as Map<String, dynamic>).keys.first;
  }
  return Account(
    json['publicAddress'],
    json['name'],
    json['url'],
    json['icons'] != null
        ? List<String>.from(json['icons'].map((x) => x))
        : null,
    json['description'],
    json['mnemonic'],
    json['chainId'],
    walletType,
  );
}