HDWallet.fromMnemonic constructor
HDWallet.fromMnemonic(
- String mnemonic
mnemonic is string
Implementation
factory HDWallet.fromMnemonic(String mnemonic) {
bool isValidate=validateMnemonic(mnemonic);
if(isValidate){
String seed=mnemonicToSeedHex(mnemonic);
BIP32 bip32 = BIP32.fromSeed(HEX.decode(seed) as Uint8List);
return HDWallet(bip32,pIsMaster: true);
}else{
throw ArgumentError("mnemonic is validated");
}
}