Closed anhdungle93 closed 4 years ago
You're passing a promise into hdkey.fromMasterSeed
; you need get the actual resolved Buffer
to pass in.
For how long should I wait until it resolves? I also tried
const seed = await bip39.mnemonicToSeed(mnemonic);
but it said that mnemonicToSeed is not an async
function, which is weird.
Use mnemonicToSeedSync
await
needs to be used INSIDE an async function foo() { ... }
type of function... the only time JS runtime error will say anything about "async" is when you try to await
outside of an async
function.
Hi I am trying to understand HD Wallet through this tutorial https://medium.com/@harshagoli/so-you-want-to-build-an-ethereum-hd-wallet-cb2b7d7e4998
first I generated the seed with
bip39
version3.0.2
seed
is an instance ofPromise
which resolves to aBuffer
the next step was to generate the
root
byhdkey.fromMasterSeed
(hdkey
version1.1.2
)this threw an error:
Thanks a lot.