CoinbaseData.fromJson constructor

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

Implementation

factory CoinbaseData.fromJson(Map<String, dynamic> json) {
  return CoinbaseData(
    address: json['address'].toString(),
    chainName: json['chain'].toString(),
    chainId: int.parse(json['networkId'].toString()),
    self: (json['self'] != null)
        ? ConnectionMetadata.fromJson(json['self'])
        : null,
    peer: (json['peer'] != null)
        ? ConnectionMetadata.fromJson(json['peer'])
        : null,
  );
}