@nimiq/core / MnemonicUtils
Class: MnemonicUtils
Defined in: @nimiq/core/lib/index.d.ts:252
Constructors
Constructor
new MnemonicUtils():
MnemonicUtils
Returns
MnemonicUtils
Properties
DEFAULT_WORDLIST
staticDEFAULT_WORDLIST:string[]
Defined in: @nimiq/core/lib/index.d.ts:260
The default English wordlist.
ENGLISH_WORDLIST
staticENGLISH_WORDLIST:string[]
Defined in: @nimiq/core/lib/index.d.ts:256
The English wordlist.
Methods
entropyToMnemonic()
staticentropyToMnemonic(entropy,wordlist?):string[]
Defined in: @nimiq/core/lib/index.d.ts:264
Converts an Entropy to a mnemonic.
Parameters
entropy
string | ArrayBuffer | Uint8Array<ArrayBufferLike> | Entropy
wordlist?
string[]
Returns
string[]
getMnemonicType()
staticgetMnemonicType(mnemonic,wordlist?):MnemonicType
Defined in: @nimiq/core/lib/index.d.ts:295
Gets the type of a mnemonic.
Return values:
0 = MnemonicType.LEGACY: the mnemonic is for a legacy Nimiq wallet.1 = MnemonicType.BIP39: the mnemonic is for a BIP39 wallet.-1 = MnemonicType.UNKNOWN: the mnemonic can be for both.
Throws if the menmonic is invalid.
Parameters
mnemonic
string | string[]
wordlist?
string[]
Returns
isCollidingChecksum()
staticisCollidingChecksum(entropy):boolean
Defined in: @nimiq/core/lib/index.d.ts:284
Tests if a mnemonic can be both for a legacy Nimiq wallet and a BIP39 wallet.
Parameters
entropy
Returns
boolean
mnemonicToEntropy()
staticmnemonicToEntropy(mnemonic,wordlist?):Entropy
Defined in: @nimiq/core/lib/index.d.ts:268
Converts a mnemonic to an Entropy.
Parameters
mnemonic
string | string[]
wordlist?
string[]
Returns
mnemonicToExtendedPrivateKey()
staticmnemonicToExtendedPrivateKey(mnemonic,password?):ExtendedPrivateKey
Defined in: @nimiq/core/lib/index.d.ts:280
Converts a mnemonic to an extended private key.
Optionally takes a password to use for the seed derivation.
Parameters
mnemonic
string | string[]
password?
string
Returns
mnemonicToSeed()
staticmnemonicToSeed(mnemonic,password?):SerialBuffer
Defined in: @nimiq/core/lib/index.d.ts:274
Converts a mnemonic to a seed.
Optionally takes a password to use for the seed derivation.
Parameters
mnemonic
string | string[]
password?
string