JsWallet.fromJsObject constructor

JsWallet.fromJsObject(
  1. Object o,
  2. String networkUrl
)

Implementation

factory JsWallet.fromJsObject(Object o, String networkUrl) {
  final dartObject = dartify(o) as Map;
  final data = dartObject.cast<String, dynamic>();
  return JsWallet(
      bech32Address: data['address']['bech32Address'],
      b256Address: addHexPrefix(data['address']['b256Address']),
      mnemonicPhrase: data['mnemonicPhrase'],
      privateKey: addHexPrefix(data['privateKey']),
      networkUrl: _enrichNetworkUrl(networkUrl));
}