Open JAtoms opened 1 year ago
Got the same issue, I use bip39 lib but after I get wrong address (not the same that I see in metamask for example). Do you have any information about that @xclud
Until we can do it with web3dart, this is how i do it:
I used 2 libs:
Code wise, i did:
import 'package:bip39/bip39.dart' as bip39;
import 'package:ethers/signers/wallet.dart' as EWallet;
String mnemonic = mnemonicController.text; //TextFormField controller
if (!bip39.validateMnemonic(mnemonic)) {
//error
}
final walletMnemonic = EWallet.Wallet.fromMnemonic(mnemonic);
final privateKey = walletMnemonic.privateKey;
final credentials = EthPrivateKey.fromHex(privateKey!);
Now you can use web3dart EthPrivateKey/Credentials object.
ethers now is outdated. Any other solutions?
I'd like to know if we can get a wallet using seed phrases from a different wallet.