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

KK Hung
  • 3
  • 2

1 Answers1

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

Richard
  • 4,934
  • 2
  • 7
  • 25
  • ethers.Wallet.fromMnemonic() only returns the first account, not quite useful. I'm just gonna manully add accounts with PrivateKeys. – KK Hung Jan 16 '22 at 10:31