generateMnemonic method

Future<AddressIconDataWithMnemonic> generateMnemonic({
  1. String derivePath = '',
  2. String key = '',
})

Generate a set of new mnemonic.

Implementation

Future<AddressIconDataWithMnemonic> generateMnemonic(
    {String derivePath = '', String key = ''}) async {
  final mnemonic = bip39.generateMnemonic();
  final wallet = ethers.Wallet.fromMnemonic(mnemonic);
  return AddressIconDataWithMnemonic.fromJson({
    'mnemonic': mnemonic,
    'address': wallet.address,
    'svg': 'xxx',
  });
}