Constructors

  • HDWallet is a implementation of the BIP-0044 and BIP-0032, Multi-Account Hierarchy for Deterministic Wallets

    Parameters

    • config: HDWalletConfig

      Wallet configurations

    Returns HDWallet

Properties

chainCode: BytesLike
depth: number = 0
fingerprint: string = ...
index: number = 0
parentFingerprint: string = ...
privateKey?: string
publicKey: string

Accessors

  • get extendedKey(): string
  • Returns string

Methods

  • Derive the current HDWallet instance navigating only on the index. Ex.: m/44'/0 -> Ex.: m/44'/1 -> m/44'/2. Learn more

    Parameters

    • index: number

      Index of the child HDWallet.

    Returns HDWallet

    A new instance of HDWallet on the derived index

  • Derive the current HDWallet instance to the path. Learn more

    Parameters

    • path: string

      The string representation of the child HDWallet. Ex.: m/44'/0'/0'/0/0

    Returns HDWallet

    A new instance of HDWallet on the derived path

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

    Parameters

    • isPublic: boolean = false

      enable to export public extendedKey, it not required when HDWallet didn't have the privateKey.

    • testnet: boolean = false

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

    Returns string

    BIP-32 extended private key

  • Parameters

    • extendedKey: string

    Returns HDWallet

  • Create HDWallet instance from seed

    Parameters

    • seed: string

      Seed

    Returns HDWallet

    A new instance of HDWallet