You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For these treat the wordlist the same as onlyJs, i.e. when passed in we want to take the JS (non-WASM) route, i.e. it ties into the changes we made in bip39.ts. This looks something like !hasBigInt || (!wordlist && !onlyJs && isReady()) and the param passed on the JS-only path
For all the above add tests...
part 3
Now we also need keyring support -
Make the required wordlist-in changes to addFromMnemonic, addFromUri & createFromUri in
We are pulling in the extra wordlists via #1803
This has been PR-ed previously in #1689 and there has been some discussion. However after giving it some thought, we could actually make this work.
part 1
wordlist
option passed to the bip39 functions, e.g. last param ofwordlist: string[] = DEFAULT_WORDLIST
-common/packages/util-crypto/src/mnemonic/bip39.ts
Line 53 in 91a2eac
common/packages/util-crypto/src/mnemonic/bip39.ts
Line 95 in 91a2eac
DEAFULT_WORDLIST
usage in these functions so bewordlist
instead.bip39.spec.ts
to ensure we are actually ok.part 2
Now the base generation is ok, but we may still use the wasm versions which doesn't have support for this. To get around it -
wordlist?: string[], onlyJs?: boolean
common/packages/util-crypto/src/mnemonic/validate.ts
Lines 22 to 23 in 91a2eac
common/packages/util-crypto/src/mnemonic/toMiniSecret.ts
Line 11 in 91a2eac
common/packages/util-crypto/src/mnemonic/toLegacySeed.ts
Line 27 in 91a2eac
common/packages/util-crypto/src/mnemonic/toEntropy.ts
Line 9 in 91a2eac
common/packages/util-crypto/src/mnemonic/generate.ts
Line 21 in 91a2eac
wordlist
the same asonlyJs
, i.e. when passed in we want to take the JS (non-WASM) route, i.e. it ties into the changes we made inbip39.ts
. This looks something like!hasBigInt || (!wordlist && !onlyJs && isReady())
and the param passed on the JS-only pathpart 3
Now we also need keyring support -
addFromMnemonic
,addFromUri
&createFromUri
incommon/packages/keyring/src/keyring.ts
Lines 201 to 223 in 8920045
The text was updated successfully, but these errors were encountered: