1 | import { hasBigInt } from '@polkadot/util';
|
2 | import { bip39ToEntropy, isReady } from '@polkadot/wasm-crypto';
|
3 | import { mnemonicToEntropy as jsToEntropy } from './bip39.js';
|
4 | export function mnemonicToEntropy(mnemonic, wordlist, onlyJs) {
|
5 | return !hasBigInt || (!wordlist && !onlyJs && isReady())
|
6 | ? bip39ToEntropy(mnemonic)
|
7 | : jsToEntropy(mnemonic, wordlist);
|
8 | }
|