Wallet

The class for creating HD wallet (BIP32).

class pybgl.Wallet(init_vector=None, passphrase='', path_type=None, init_account=None, address_type=None, testnet=False, hardened=False)[source]

The class for creating wallet object.

Parameters
  • init_vector – (optional) initialization vector should be mnemonic phrase, extended public key, extended private key, by default is None (generate new wallet).

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

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

  • init_account – (optional) integer

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

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

  • hardened – (optional) boolean, by default is False.

account_private_xkey

account private xkey (string)

account_public_xkey

account public xkey (string)

get_address(i, chain='external')[source]

the class method for creating a wallet address.

Parameters
  • i – index

  • chain – (optional) “external”, “internal”, by default is “external”

Returns

dictionary:

  • address

  • public_key

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

mnemonic

mnemonic (string)