Classes

MnemonicUtils

Constructors

new MnemonicUtils()

new MnemonicUtils(): [MnemonicUtils](MnemonicUtils)

Properties

DEFAULT_WORDLIST

`static` DEFAULT\_WORDLIST: `string`[]

The default English wordlist.


ENGLISH_WORDLIST

`static` ENGLISH\_WORDLIST: `string`[]

The English wordlist.

Methods

entropyToMnemonic()

`static` entropyToMnemonic(`entropy`, `wordlist`?): `string`[]

Converts an Entropy to a mnemonic.

ParameterType
Firststring[]
[]

getMnemonicType()

`static` getMnemonicType(`mnemonic`, `wordlist`?): [MnemonicType](../namespaces/MnemonicUtils/enumerations/MnemonicType)

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.

ParameterType
Firststring[]

isCollidingChecksum()

`static` isCollidingChecksum(`entropy`): `boolean`

Tests if a mnemonic can be both for a legacy Nimiq wallet and a BIP39 wallet.

ParameterType
FirstEntropy

mnemonicToEntropy()

`static` mnemonicToEntropy(`mnemonic`, `wordlist`?): [Entropy](Entropy)

Converts a mnemonic to an Entropy.

ParameterType
Firststring[]
Returns
Entropy

mnemonicToExtendedPrivateKey()

`static` mnemonicToExtendedPrivateKey(`mnemonic`, `password`?): [ExtendedPrivateKey](ExtendedPrivateKey)

Converts a mnemonic to an extended private key.

Optionally takes a password to use for the seed derivation.

ParameterType
Firststring

mnemonicToSeed()

`static` mnemonicToSeed(`mnemonic`, `password`?): [SerialBuffer](SerialBuffer)

Converts a mnemonic to a seed.

Optionally takes a password to use for the seed derivation.

ParameterType
Firststring

On this page