Class Mnemonic

Multi-word mnemonic phrase (BIP-39).

Compatible with the official Hedera mobile wallets (24-words or 22-words) and BRD (12-words).

Hierarchy

  • Mnemonic

Properties

_mnemonic: default

Methods

  • Parameters

    • Optional passphrase: string = ""
    • Optional path: number[]

    Returns Promise<PrivateKey>

    Deprecated

    • Use toStandardEd25519PrivateKey() or toStandardECDSAsecp256k1PrivateKey() instead Recover an ECDSA private key from this mnemonic phrase, with an optional passphrase.
  • Parameters

    • Optional passphrase: string = ""
    • Optional path: number[]

    Returns Promise<PrivateKey>

    Deprecated

    • Use toStandardEd25519PrivateKey() or toStandardECDSAsecp256k1PrivateKey() instead Recover an Ed25519 private key from this mnemonic phrase, with an optional passphrase.
  • Parameters

    • Optional passphrase: string = ""

    Returns Promise<PrivateKey>

    Deprecated

    • Use toStandardEd25519PrivateKey() or toStandardECDSAsecp256k1PrivateKey() instead Recover a private key from this mnemonic phrase, with an optional passphrase.
  • Parameters

    • passphrase: string

    Returns Promise<Uint8Array>

  • Recover an ECDSA private key from this mnemonic phrase, with an optional passphrase.

    Parameters

    • Optional passphrase: string = ""
    • Optional index: number

    Returns Promise<PrivateKey>

  • Recover an Ed25519 private key from this mnemonic phrase, with an optional passphrase.

    Parameters

    • Optional passphrase: string = ""
    • Optional index: number

    Returns Promise<PrivateKey>

  • Recover a mnemonic phrase from a string, splitting on spaces. Handles 12, 22 (legacy), and 24 words.

    Parameters

    • mnemonic: string

    Returns Promise<Mnemonic>

  • Construct a mnemonic from a list of words. Handles 12, 22 (legacy), and 24 words.

    An exception of BadMnemonicError will be thrown if the mnemonic contains unknown words or fails the checksum. An invalid mnemonic can still be used to create private keys, the exception will contain the failing mnemonic in case you wish to ignore the validation error and continue.

    Parameters

    • words: string[]

    Returns Promise<Mnemonic>

    Throws

  • Returns a new random 12-word mnemonic from the BIP-39 standard English word list.

    Returns Promise<Mnemonic>

Generated using TypeDoc