newFromPrivateKey method

  1. @override
Future<Map> newFromPrivateKey({
  1. required String privateKey,
})
override

Implementation

@override
Future<Map> newFromPrivateKey({
  required String privateKey,
}) async {
  final w = await WalletUnlocked.newFromPrivateKey(
    bridge: _bridge,
    privateKey: privateKey,
  );

  final address = await w.address();
  final bech32Address = await address.toBech32String();
  final b256Address = await address.toB256String();

  final data = {
    'address': {
      'bech32Address': bech32Address,
      'b256Address': b256Address,
    },
    'privateKey': w.privateKey,
    'mnemonicPhrase': w.mnemonicPhrase,
  };

  return data;
}