newFromMnemonic method

  1. @override
Future<Map> newFromMnemonic({
  1. required String mnemonic,
})
override

Implementation

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

  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;
}