MagicData.fromJson constructor

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

Implementation

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