HDWalletSigner.recoverAccount constructor

HDWalletSigner.recoverAccount(
  1. String mnemonic
)

Recovers an account from a mnemonic phrase and stores it in the HD wallet as zeroth.

  • mnemonic: The mnemonic phrase.

Returns the HD signer instance.

Implementation

factory HDWalletSigner.recoverAccount(String mnemonic) {
  final seed = bip39.mnemonicToSeedHex(mnemonic);
  final signer = HDWalletSigner(seed: seed);
  signer.zerothAddress = signer._add(seed, 0);
  return signer;
}