@fuel-ts/account v0.94.9 • Docs
new Mnemonic(
wordlist
):Mnemonic
• wordlist: string
[] = english
Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.
Mnemonic instance
packages/account/src/mnemonic/mnemonic.ts:58
wordlist:
string
[]
packages/account/src/mnemonic/mnemonic.ts:51
entropyToMnemonic(
entropy
):string
• entropy: BytesLike
Entropy source to the mnemonic phrase.
string
Mnemonic phrase
packages/account/src/mnemonic/mnemonic.ts:78
mnemonicToEntropy(
phrase
):string
• phrase: MnemonicPhrase
Mnemonic phrase composed by words from the provided wordlist
string
Entropy hash
packages/account/src/mnemonic/mnemonic.ts:69
static
binarySearch(target
):boolean
• target: string
boolean
packages/account/src/mnemonic/mnemonic.ts:162
static
entropyToMnemonic(entropy
,wordlist
):string
• entropy: BytesLike
Entropy source to the mnemonic phrase.
• wordlist: string
[] = english
string
64-byte array contains privateKey and chainCode as described on BIP39
packages/account/src/mnemonic/mnemonic.ts:101
static
generate(size
,extraEntropy
):string
Create a new mnemonic using a randomly generated number as entropy.
As defined in BIP39, the entropy must be a multiple of 32 bits, and its size must be between 128 and 256 bits.
Therefore, the possible values for strength
are 128, 160, 192, 224, and 256.
If not provided, the default entropy length will be set to 256 bits.
The return is a list of words that encodes the generated entropy.
• size: number
= 32
Number of bytes used as an entropy
• extraEntropy: BytesLike
= ''
Optional extra entropy to increase randomness
string
A randomly generated mnemonic
packages/account/src/mnemonic/mnemonic.ts:243
static
isMnemonicValid(phrase
):boolean
Validates if given mnemonic is valid
• phrase: string
Mnemonic phrase composed by words from the provided wordlist
boolean
true if phrase is a valid mnemonic
packages/account/src/mnemonic/mnemonic.ts:141
static
masterKeysFromSeed(seed
):Uint8Array
• seed: string
BIP39 seed
Uint8Array
64-byte array contains privateKey and chainCode as described on BIP39
packages/account/src/mnemonic/mnemonic.ts:188
static
mnemonicToEntropy(phrase
,wordlist
):string
• phrase: MnemonicPhrase
Mnemonic phrase composed by words from the provided wordlist
• wordlist: string
[] = english
Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.
string
Mnemonic phrase
packages/account/src/mnemonic/mnemonic.ts:88
static
mnemonicToMasterKeys(phrase
,passphrase
):Uint8Array
• phrase: MnemonicPhrase
Mnemonic phrase composed by words from the provided wordlist
• passphrase: BytesLike
= ''
Add additional security to protect the generated seed with a memorized passphrase. Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.
Uint8Array
64-byte array contains privateKey and chainCode as described on BIP39
packages/account/src/mnemonic/mnemonic.ts:131
static
mnemonicToSeed(phrase
,passphrase
):string
• phrase: MnemonicPhrase
Mnemonic phrase composed by words from the provided wordlist
• passphrase: BytesLike
= ''
Add additional security to protect the generated seed with a memorized passphrase. Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.
string
64-byte array contains privateKey and chainCode as described on BIP39
packages/account/src/mnemonic/mnemonic.ts:117
static
seedToExtendedKey(seed
,testnet
):string
Get the extendKey as defined on BIP-32 from the provided seed
• seed: string
BIP39 seed
• testnet: boolean
= false
Inform if should use testnet or mainnet prefix, default value is true (mainnet
).
string
BIP-32 extended private key