Constructors

  • Parameters

    • wordlist: string[] = english

      Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.

    Returns Mnemonic

    Mnemonic instance

Properties

wordlist: string[]

Methods

  • Parameters

    • entropy: BytesLike

      Entropy source to the mnemonic phrase.

    Returns string

    Mnemonic phrase

  • Parameters

    • phrase: MnemonicPhrase

      Mnemonic phrase composed by words from the provided wordlist

    Returns string

    Entropy hash

  • Parameters

    • target: string

    Returns boolean

  • Parameters

    • entropy: BytesLike

      Entropy source to the mnemonic phrase.

    • wordlist: string[] = english

    Returns string

    64-byte array contains privateKey and chainCode as described on BIP39

  • 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.

    Parameters

    • size: number = 32

      Number of bytes used as an entropy

    • extraEntropy: BytesLike = ''

      Optional extra entropy to increase randomness

    Returns string

    A randomly generated mnemonic

  • Validates if given mnemonic is valid

    Parameters

    • phrase: string

      Mnemonic phrase composed by words from the provided wordlist

    Returns boolean

    true if phrase is a valid mnemonic

  • Parameters

    • seed: string

      BIP39 seed

    Returns Uint8Array

    64-byte array contains privateKey and chainCode as described on BIP39

  • Parameters

    • 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.

    Returns string

    Mnemonic phrase

  • Parameters

    • 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.

    Returns Uint8Array

    64-byte array contains privateKey and chainCode as described on BIP39

  • Parameters

    • 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.

    Returns string

    64-byte array contains privateKey and chainCode as described on BIP39

  • Get the extendKey as defined on BIP-32 from the provided seed

    Parameters

    • seed: string

      BIP39 seed

    • testnet: boolean = false

      Inform if should use testnet or mainnet prefix, default value is true (mainnet).

    Returns string

    BIP-32 extended private key