0

pls someone save me from getting list of accounts(private keys) with MNEMONIC in web3.js, just like how it perfromed with metamask, just enter your MNEMONIC, then you could just add your way up to multiple account

i know how to do it with web3.py, or brownie, just simply

Accounts.from_mnemonic()

but when i try this with web3.js, the closest function i could find is

web3.eth.accounts.wallet.create(numberOfAccounts [, entropy]);,

and I had trouble converting MNEMONIC to this entropy

1 Answer 1

0

Seems like this is not supported by web3js: https://github.com/ChainSafe/web3.js/issues/1594

If you are open to other js libs you can work around it with ethers: Web3 create account from mnemonic + passphrase

1
  • ethers.Wallet.fromMnemonic() only returns the first account, not quite useful. I'm just gonna manully add accounts with PrivateKeys.
    – KK Hung
    Jan 16, 2022 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.