Wallet.fromJson constructor

Wallet.fromJson(
  1. Map<String, dynamic> json,
  2. Uint8List privateKey
)

Creates a new Wallet instance from the given json and privateKey.

Implementation

factory Wallet.fromJson(Map<String, dynamic> json, Uint8List privateKey) {
  final address =
      Uint8List.fromList(hex.decode(json['hex_address'] as String));
  final publicKey =
      Uint8List.fromList(hex.decode(json['public_key'] as String));
  return Wallet(
    address: address,
    publicKey: publicKey,
    privateKey: privateKey,
    networkInfo: NetworkInfo.fromJson(json['network_info']),
  );
}