Wallet

The class for creating HD wallet (BIP32).

class Wallet(A)

The class for creating wallet object.

Arguments
  • from – (optional) should be mnemonic phrase, extended public key,extended private key, by default is null (generate new wallet).

  • passphrase – (optional) passphrase to get ability use 2FA approach forcreating seed, by default is empty string.

  • path – (optional) “BIP44”, “BIP49”, “BIP84”, by default is “BIP84”

  • testnet – (optional) flag for testnet network, by default is false.

  • strength – (optional) entropy bits strength, by default is 256 bit.

  • threshold – (optional) integer, by default is 1

  • shares – (optional) integer, by default is 1

  • wordList – (optional) word list, by default is BIP39_WORDLIST

  • addressType – (optional) “P2PKH”, “P2SH_P2WPKH”, “P2WPKH”

  • hardenedAddresses – (optional) boolean, by default is false.

  • account – (optional) integer

  • chain – (optional) integer

Wallet.accountXPrivateKey

account private xkey (string)

Wallet.accountXPublicKey

account public xkey (string)

Wallet.mnemonic

mnemonic (string)

Wallet.getAddress(i, external)

the class method for creating a wallet address.

Parameters
i

index

external

(optional) boolean, by default is true

Returns

object:

  • address

  • publicKey

  • privateKey (in case wallet is restored from private xkey or mnemonic)