Hierarchical Deterministic’s¶
- class index.HDS()¶
Manages and retrieves supported HD wallet classes for multiple blockchain protocols.
exported from
hds.indexName
Class
AlgorandHD
BIP32HD
BIP44HD
BIP49HD
BIP84HD
BIP86HD
BIP141HD
CardanoHD
ElectrumV1HD
ElectrumV2HD
MoneroHD
- static index.HDS.getClasses()¶
Returns all registered HD wallet classes.
- Returns:
typeof HD[] – An array of HD wallet class constructors.
- static index.HDS.getHDClass(name)¶
Retrieves a specific HD wallet class by name.
- Arguments:
name (string) – The HD wallet name to look up.
- Returns:
typeof HD – The corresponding HD wallet class.
- static index.HDS.getNames()¶
Returns all registered HD wallet names.
- Returns:
string[] – An array of HD wallet names.
- static index.HDS.isHD(name)¶
Checks whether the provided name corresponds to a valid HD wallet class.
- Arguments:
name (string) – The HD wallet name to validate.
- Returns:
boolean – True if the name exists in the dictionary, otherwise false.
- class hd.HD(options={})¶
Base class for Hierarchical Deterministic (HD) wallets. Provides a common interface for key and address derivation across multiple blockchain protocols.
exported from
hds.hdCreates an instance of an HD wallet.
- Arguments:
options (HDOptionsInterface) – Configuration options including ECC implementation.
- hd.HD.derivation¶
type: any
- hd.HD.ecc¶
type: typeof EllipticCurveCryptography
- hd.HD.cleanDerivation()¶
Resets the current derivation state.
- Returns:
this – The HD instance with cleared derivation.
- hd.HD.fromDerivation(derivation)¶
Initializes HD wallet from a derivation object.
- Arguments:
derivation (Derivation) – Derivation path or object.
- Returns:
this – The initialized HD instance.
- hd.HD.fromPrivateKey(privateKey)¶
Initializes HD wallet from a private key.
- Arguments:
privateKey (string) – Private key string.
- Returns:
this – The initialized HD instance.
- hd.HD.fromPublicKey(publicKey)¶
Initializes HD wallet from a public key.
- Arguments:
publicKey (string) – Public key string.
- Returns:
this – The initialized HD instance.
- hd.HD.fromSeed(...args)¶
Initializes the HD wallet from a seed.
- Arguments:
args (any[])
- Returns:
this – The initialized HD instance.
- hd.HD.fromSpendPrivateKey(spendPrivateKey)¶
Initializes HD wallet from a spend private key.
- Arguments:
spendPrivateKey (string) – Spend private key string.
- Returns:
this – The initialized HD instance.
- hd.HD.fromWIF(wif)¶
Loads HD wallet from a Wallet Import Format (WIF) string.
- Arguments:
wif (string) – WIF string.
- Returns:
this – The initialized HD instance.
- hd.HD.fromWatchOnly(viewPrivateKey, spendPublicKey)¶
Initializes HD wallet from a view private key and spend public key.
- Arguments:
viewPrivateKey (string) – View private key string.
spendPublicKey (string) – Spend public key string.
- Returns:
this – The initialized HD instance.
- hd.HD.fromXPrivateKey(...args)¶
Initializes the HD wallet from an extended private key.
- Arguments:
args (any[])
- Returns:
this – The initialized HD instance.
- hd.HD.fromXPublicKey(...args)¶
Initializes the HD wallet from an extended public key.
- Arguments:
args (any[])
- Returns:
this – The initialized HD instance.
- hd.HD.getAddress(...args)¶
Returns the general address derived from the current state.
- Arguments:
args (any[])
- Returns:
string | null – The address string or null.
- hd.HD.getChainCode()¶
Returns the chain code for key derivation.
- Returns:
any – The chain code object or value.
- hd.HD.getCompressed()¶
Returns the compressed public key representation.
- Returns:
string – The compressed public key.
- hd.HD.getDepth()¶
Returns the depth of the current derivation in the HD tree.
- Returns:
number – The derivation depth.
- hd.HD.getDerivation()¶
Returns the current derivation object.
- Returns:
Derivation – The derivation instance.
- hd.HD.getFingerprint()¶
Returns the fingerprint of the key or node.
- Returns:
string – The fingerprint string.
- hd.HD.getHash()¶
Returns the hash of the derived public key or address.
- Returns:
string – The hash string.
- hd.HD.getIndex()¶
Returns the index of the current derivation level.
- Returns:
number – The derivation index.
- hd.HD.getIndexes()¶
Returns the list of indexes used in the current derivation path.
- Returns:
number[] – An array of index values.
- hd.HD.getIntegratedAddress(...args)¶
Returns the integrated address (used in Monero for payment IDs).
- Arguments:
args (any[])
- Returns:
string | null – The integrated address or null.
- hd.HD.getMasterChainCode(...args)¶
Returns the master chain code.
- Arguments:
args (any[])
- Returns:
string | null – The chain code or null.
- hd.HD.getMasterPrivateKey(...args)¶
Returns the master private key.
- Arguments:
args (any[])
- Returns:
string | null – The private key or null.
- hd.HD.getMasterPublicKey(...args)¶
Returns the master public key.
- Arguments:
args (any[])
- Returns:
string | null – The public key or null.
- hd.HD.getMasterWIF(...args)¶
Returns the master WIF.
- Arguments:
args (any[])
- Returns:
string | null – The WIF string or null.
- hd.HD.getMasterXPrivateKey(...args)¶
Returns the master extended private key (alias of root).
- Arguments:
args (any[])
- Returns:
string | null – The master xprv.
- hd.HD.getMasterXPublicKey(...args)¶
Returns the master extended public key (alias of root).
- Arguments:
args (any[])
- Returns:
string | null – The master xpub.
- hd.HD.getMode()¶
Returns the derivation or address mode (e.g., legacy, segwit).
- Returns:
string – The mode string.
- hd.HD.getName()¶
Gets the name of the current HD wallet instance.
- Returns:
string – The name of the HD wallet.
- hd.HD.getParentFingerprint()¶
Returns the parent node’s fingerprint.
- Returns:
any – The parent fingerprint value.
- hd.HD.getPath()¶
Returns the full derivation path string.
- Returns:
string – The derivation path (e.g., “m/44’/0’/0’/0”).
- hd.HD.getPathKey()¶
Returns a key representation of the current derivation path.
- Returns:
string | null – The path key or null.
- hd.HD.getPrimaryAddress(...args)¶
Returns the primary wallet address.
- Arguments:
args (any[])
- Returns:
string – The main wallet address string.
- hd.HD.getPrivateKey(...args)¶
Returns the derived private key.
- Arguments:
args (any[])
- Returns:
string | null – The private key string or null.
- hd.HD.getPublicKey(...args)¶
Returns the derived public key.
- Arguments:
args (any[])
- Returns:
any – The public key instance or object.
- hd.HD.getPublicKeyType()¶
Returns the public key type or encoding.
- Returns:
string – The public key type (e.g., ‘compressed’, ‘uncompressed’).
- hd.HD.getRootChainCode()¶
Returns the root chain code.
- Returns:
string | null – The chain code or null.
- hd.HD.getRootPrivateKey(...args)¶
Returns the root private key.
- Arguments:
args (any[])
- Returns:
string | null – The private key or null.
- hd.HD.getRootPublicKey(...args)¶
Returns the root public key.
- Arguments:
args (any[])
- Returns:
string | null – The public key or null.
- hd.HD.getRootWIF(...args)¶
Returns the root WIF key.
- Arguments:
args (any[])
- Returns:
string | null – The WIF string or null.
- hd.HD.getRootXPrivateKey(...args)¶
Returns the root extended private key.
- Arguments:
args (any[])
- Returns:
string | null – The root xprv.
- hd.HD.getRootXPublicKey(...args)¶
Returns the root extended public key.
- Arguments:
args (any[])
- Returns:
string | null – The root xpub.
- hd.HD.getSeed()¶
Returns the wallet seed.
- Returns:
string | null – The seed as a string or null if not available.
- hd.HD.getSemantic()¶
Returns the wallet semantic identifier (if applicable).
- Returns:
string | null – The semantic or null.
- hd.HD.getSpendPrivateKey()¶
Returns the spend private key (used in Monero-like systems).
- Returns:
string | null – The spend private key or null.
- hd.HD.getSpendPublicKey()¶
Returns the spend public key (used in Monero-like systems).
- Returns:
string – The spend public key string.
- hd.HD.getStrict()¶
Indicates if strict derivation mode is enabled.
- Returns:
boolean | null – True if strict mode is on, otherwise null.
- hd.HD.getSubAddress(...args)¶
Returns the sub-address for a given index or derivation.
- Arguments:
args (any[])
- Returns:
string – The generated sub-address.
- hd.HD.getUncompressed()¶
Returns the uncompressed public key representation.
- Returns:
string – The uncompressed public key.
- hd.HD.getViewPrivateKey()¶
Returns the view private key (used in Monero-like systems).
- Returns:
string – The view private key string.
- hd.HD.getViewPublicKey()¶
Returns the view public key (used in Monero-like systems).
- Returns:
string – The view public key string.
- hd.HD.getWIF(..._args)¶
Returns the Wallet Import Format (WIF) string.
- Arguments:
_args (any[])
- Returns:
string | null – The WIF key string or null.
- hd.HD.getWIFType()¶
Returns the WIF encoding type used.
- Returns:
any – The WIF type identifier.
- hd.HD.getXPrivateKey(...args)¶
Returns the derived extended private key.
- Arguments:
args (any[])
- Returns:
string | null – The xprv key or null if unavailable.
- hd.HD.getXPublicKey(...args)¶
Returns the derived extended public key.
- Arguments:
args (any[])
- Returns:
string | null – The xpub key or null if unavailable.
- hd.HD.updateDerivation(derivation)¶
Updates the wallet derivation.
- Arguments:
derivation (Derivation) – New derivation object.
- Returns:
this – The updated HD instance.
- static hd.HD.getName()¶
Returns the name of the HD wallet implementation.
- Returns:
string – The HD wallet name.
- class algorand.AlgorandHD()¶
Hierarchical Deterministic (HD) wallet implementation for the Algorand blockchain.
Extends the base class but uses the KholawEd25519ECC curve and Algorand-specific key derivation logic. Implements a variant of SLIP-0010 style derivation with additional clamping and key validation for the Ed25519 curve used by Algorand.
exported from
hds.algorand- Extends:
BIP32HD
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/algorand.ts
- algorand.AlgorandHD.drive(index)¶
Derives a child key at the given index according to Algorand’s modified SLIP-0010 algorithm.
Supports both hardened and non-hardened derivation.
- Arguments:
index (number) – The index of the child key to derive.
- Returns:
this – The derived child HD instance.
- algorand.AlgorandHD.fromSeed(seed)¶
Initializes this HD wallet instance from a given seed.
- Arguments:
seed (string | Uint8Array<ArrayBufferLike> | Seed) – The input seed (hex string, byte array, or Seed instance).
- Returns:
this – The initialized AlgorandHD instance.
- algorand.AlgorandHD.getAddress()¶
Derives and returns the Algorand address associated with the current public key.
- Returns:
string – The encoded Algorand address.
- algorand.AlgorandHD.getRootXPrivateKey(version=Algorand.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the root extended private key (xprv) encoded using Algorand’s version bytes.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – The version prefix to use for encoding.
encoded (boolean) – Whether to return the base58-encoded key string.
- Returns:
string | null – The root xprv or
nullif unavailable.
- algorand.AlgorandHD.getXPrivateKey(version=Algorand.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the current extended private key (xprv) of the HD node.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – The version prefix to use for encoding.
encoded (boolean) – Whether to return the base58-encoded key string.
- Returns:
string | null – The xprv string or
nullif not set.
- static algorand.AlgorandHD.getName()¶
Returns the human-readable name of this HD scheme.
- Returns:
string – The name
"Algorand".
- class bip32.BIP32HD(options=...)¶
Implements the BIP32 hierarchical deterministic (HD) wallet standard. Provides methods for key derivation, serialization, address generation, and working with extended keys (xprv/xpub) and WIF format.
exported from
hds.bip32- Extends:
HD
Create a new BIP32HD instance with optional configuration.
- Arguments:
options (HDOptionsInterface) – Configuration options for HD wallet
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/bip32.ts
- bip32.BIP32HD.chainCode?¶
type: Uint8Array<ArrayBufferLike>
- bip32.BIP32HD.depth¶
type: number
- bip32.BIP32HD.fingerprint?¶
type: Uint8Array<ArrayBufferLike>
- bip32.BIP32HD.index¶
type: number
- bip32.BIP32HD.parentFingerprint?¶
type: Uint8Array<ArrayBufferLike>
- bip32.BIP32HD.privateKey?¶
type: PrivateKey
- bip32.BIP32HD.publicKey?¶
type: PublicKey
- bip32.BIP32HD.publicKeyType¶
type: string
- bip32.BIP32HD.rootChainCode?¶
type: Uint8Array<ArrayBufferLike>
- bip32.BIP32HD.rootDepth¶
type: number
- bip32.BIP32HD.rootIndex¶
type: number
- bip32.BIP32HD.rootPrivateKey?¶
type: PrivateKey
- bip32.BIP32HD.rootPublicKey?¶
type: PublicKey
- bip32.BIP32HD.seed?¶
type: Uint8Array<ArrayBufferLike>
- bip32.BIP32HD.strict?¶
type: boolean | null
- bip32.BIP32HD.wifPrefix?¶
type: number
- bip32.BIP32HD.wifType¶
type: string
- bip32.BIP32HD.cleanDerivation()¶
Reset derivation to the root keys.
- Returns:
this – The current HD instance
- bip32.BIP32HD.drive(index)¶
Derive a child key at a specific index.
- Arguments:
index (number) – Child index
- Returns:
BIP32HD | null | undefined – The current HD instance
- bip32.BIP32HD.fromDerivation(derivation)¶
Apply a derivation path to the HD instance.
- Arguments:
derivation (Derivation) – Derivation object
- Returns:
this – The current HD instance
- bip32.BIP32HD.fromPrivateKey(privateKey)¶
Initialize from a raw private key.
- Arguments:
privateKey (string) – Private key as string
- Returns:
this – The current HD instance
- bip32.BIP32HD.fromPublicKey(publicKey)¶
Initialize from a raw public key.
- Arguments:
publicKey (string) – Public key as string
- Returns:
this – The current HD instance
- bip32.BIP32HD.fromSeed(seed)¶
Initialize HD wallet from a seed.
- Arguments:
seed (string | Uint8Array<ArrayBufferLike> | Seed) – Seed as Uint8Array, string, or Seed object
- Returns:
this – The current HD instance
- bip32.BIP32HD.fromWIF(wif)¶
Initialize from WIF private key.
- Arguments:
wif (string) – WIF string
- Returns:
this – The current HD instance
- bip32.BIP32HD.fromXPrivateKey(xprv, encoded=true, strict=false)¶
Initialize from extended private key (xprv).
- Arguments:
xprv (string) – Extended private key
encoded (boolean) – Whether the key is encoded in Base58
strict (boolean) – Whether to enforce root key validation
- Returns:
this – The current HD instance
- bip32.BIP32HD.fromXPublicKey(xpub, encoded=true, strict=false)¶
Initialize from extended public key (xpub).
- Arguments:
xpub (string) – Extended public key
encoded (boolean) – Whether the key is encoded in Base58
strict (boolean) – Whether to enforce root key validation
- Returns:
this – The current HD instance
- bip32.BIP32HD.getAddress(options=...)¶
Generate a cryptocurrency address using current public key. Supports multiple address formats like P2PKH, P2SH, P2TR, P2WPKH, etc.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded address
- bip32.BIP32HD.getChainCode()¶
Returns the chain code for key derivation.
- Returns:
string | null – The chain code object or value.
- bip32.BIP32HD.getCompressed()¶
Returns the compressed public key representation.
- Returns:
string – The compressed public key.
- bip32.BIP32HD.getDepth()¶
Returns the depth of the current derivation in the HD tree.
- Returns:
number – The derivation depth.
- bip32.BIP32HD.getFingerprint()¶
Returns the fingerprint of the key or node.
- Returns:
string – The fingerprint string.
- bip32.BIP32HD.getHash()¶
Returns the hash of the derived public key or address.
- Returns:
string – The hash string.
- bip32.BIP32HD.getIndex()¶
Returns the index of the current derivation level.
- Returns:
number – The derivation index.
- bip32.BIP32HD.getIndexes()¶
Returns the list of indexes used in the current derivation path.
- Returns:
number[] – An array of index values.
- bip32.BIP32HD.getParentFingerprint()¶
Returns the parent node’s fingerprint.
- Returns:
string | null – The parent fingerprint value.
- bip32.BIP32HD.getPath()¶
Returns the full derivation path string.
- Returns:
string – The derivation path (e.g., “m/44’/0’/0’/0”).
- bip32.BIP32HD.getPrivateKey()¶
Returns the derived private key.
- Returns:
string | null – The private key string or null.
- bip32.BIP32HD.getPublicKey(publicKeyType=...)¶
Returns the derived public key.
- Arguments:
publicKeyType (string)
- Returns:
string – The public key instance or object.
- bip32.BIP32HD.getPublicKeyType()¶
Returns the public key type or encoding.
- Returns:
string – The public key type (e.g., ‘compressed’, ‘uncompressed’).
- bip32.BIP32HD.getRootChainCode()¶
Returns the root chain code.
- Returns:
string | null – The chain code or null.
- bip32.BIP32HD.getRootPrivateKey()¶
Returns the root private key.
- Returns:
string | null – The private key or null.
- bip32.BIP32HD.getRootPublicKey(publicKeyType=...)¶
Returns the root public key.
- Arguments:
publicKeyType (string)
- Returns:
string | null – The public key or null.
- bip32.BIP32HD.getRootWIF(wifType)¶
Returns the root WIF key.
- Arguments:
wifType (string)
- Returns:
string | null – The WIF string or null.
- bip32.BIP32HD.getRootXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the root extended private key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>)
encoded (boolean)
- Returns:
string | null – The root xprv.
- bip32.BIP32HD.getRootXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the root extended public key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>)
encoded (boolean)
- Returns:
string | null – The root xpub.
- bip32.BIP32HD.getSeed()¶
Returns the seed as a string.
- Returns:
string | null – Seed or null if not set
- bip32.BIP32HD.getStrict()¶
Indicates if strict derivation mode is enabled.
- Returns:
boolean | null – True if strict mode is on, otherwise null.
- bip32.BIP32HD.getUncompressed()¶
Returns the uncompressed public key representation.
- Returns:
string – The uncompressed public key.
- bip32.BIP32HD.getWIF(wifType)¶
Returns the Wallet Import Format (WIF) string.
- Arguments:
wifType (string)
- Returns:
string | null – The WIF key string or null.
- bip32.BIP32HD.getWIFType()¶
Returns the WIF encoding type used.
- Returns:
string | null – The WIF type identifier.
- bip32.BIP32HD.getXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the derived extended private key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>)
encoded (boolean)
- Returns:
string | null – The xprv key or null if unavailable.
- bip32.BIP32HD.getXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the derived extended public key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>)
encoded (boolean)
- Returns:
string | null – The xpub key or null if unavailable.
- bip32.BIP32HD.updateDerivation(derivation)¶
Update derivation path after clearing previous derivation.
- Arguments:
derivation (Derivation) – Derivation object
- Returns:
this – The current HD instance
- static bip32.BIP32HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘BIP32’
- class bip44.BIP44HD(options=...)¶
Implements the BIP44 hierarchical deterministic (HD) wallet standard. Extends BIP32HD to provide multi-account, multi-coin, and change/address-level derivations. Provides methods to derive keys and generate P2PKH addresses according to BIP44.
exported from
hds.bip44- Extends:
BIP32HD
Create a new BIP44HD instance with optional configuration.
- Arguments:
options (HDOptionsInterface) – Configuration options for HD wallet
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/bip44.ts
- bip44.BIP44HD.coinType¶
type: number
- bip44.BIP44HD.fromAccount(account)¶
Set derivation to a specific account or account range.
- Arguments:
account (number | [number, number]) – Single account index or a tuple [start, end]
- Returns:
this – Current BIP44HD instance
- bip44.BIP44HD.fromAddress(address)¶
Set derivation to a specific address index or range.
- Arguments:
address (number | [number, number]) – Single address index or a tuple [start, end]
- Returns:
this – Current BIP44HD instance
- bip44.BIP44HD.fromChange(change)¶
Set derivation to a specific change chain.
- Arguments:
change (string | number) – Change index or string (0: external, 1: internal)
- Returns:
this – Current BIP44HD instance
- bip44.BIP44HD.fromCoinType(coinType)¶
Set derivation to a specific coin type.
- Arguments:
coinType (number) – Coin type index
- Returns:
this – Current BIP44HD instance
- bip44.BIP44HD.fromDerivation(derivation)¶
Apply a full BIP44 derivation path to the HD instance.
- Arguments:
derivation (BIP44Derivation) – BIP44Derivation instance
- Returns:
this – Current BIP44HD instance
- bip44.BIP44HD.getAddress(options=...)¶
Generate a P2PKH cryptocurrency address from the current public key.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded P2PKH address
- static bip44.BIP44HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘BIP44’
- class bip49.BIP49HD(options=...)¶
Implements the BIP49 hierarchical deterministic (HD) wallet standard. Extends BIP44HD to support P2WPKH-in-P2SH addresses (SegWit wrapped in P2SH). Provides methods to derive keys, generate extended keys, and encode addresses according to BIP49.
exported from
hds.bip49- Extends:
BIP44HD
Create a new BIP49HD instance with optional configuration.
- Arguments:
options (HDOptionsInterface) – Configuration options for HD wallet
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/bip49.ts
- bip49.BIP49HD.fromDerivation(derivation)¶
Apply a full BIP49 derivation path to the HD instance.
- Arguments:
derivation (BIP49Derivation) – BIP49Derivation instance
- Returns:
this – Current BIP49HD instance
- bip49.BIP49HD.getAddress(options=...)¶
Generate a P2WPKH-in-P2SH address from the current public key.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded P2WPKH-in-P2SH address
- bip49.BIP49HD.getRootXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2WPKH_IN_P2SH, encoded=true)¶
Get the root extended private key (xprv) for BIP49 with optional version and encoding.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH-in-P2SH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended private key or null if unavailable
- bip49.BIP49HD.getRootXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2WPKH_IN_P2SH, encoded=true)¶
Get the root extended public key (xpub) for BIP49 with optional version and encoding.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH-in-P2SH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended public key or null if unavailable
- bip49.BIP49HD.getXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2WPKH_IN_P2SH, encoded=true)¶
Get the extended private key (xprv) for the current derivation path.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH-in-P2SH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended private key or null if unavailable
- bip49.BIP49HD.getXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2WPKH_IN_P2SH, encoded=true)¶
Get the extended public key (xpub) for the current derivation path.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH-in-P2SH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended public key or null if unavailable
- static bip49.BIP49HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘BIP49’
- class bip84.BIP84HD(options=...)¶
Implements the BIP84 hierarchical deterministic (HD) wallet standard. Extends BIP44HD to support native SegWit P2WPKH addresses. Provides methods to derive keys, generate extended keys, and encode addresses according to BIP84.
exported from
hds.bip84- Extends:
BIP44HD
Create a new BIP84HD instance with optional configuration.
- Arguments:
options (HDOptionsInterface) – Configuration options for HD wallet
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/bip84.ts
- bip84.BIP84HD.fromDerivation(derivation)¶
Apply a full BIP84 derivation path to the HD instance.
- Arguments:
derivation (BIP84Derivation) – BIP84Derivation instance
- Returns:
this – Current BIP84HD instance
- bip84.BIP84HD.getAddress(options=...)¶
Generate a native SegWit P2WPKH address from the current public key.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded P2WPKH address
- bip84.BIP84HD.getRootXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2WPKH, encoded=true)¶
Get the root extended private key (xprv) for BIP84 with optional version and encoding.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended private key or null if unavailable
- bip84.BIP84HD.getRootXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2WPKH, encoded=true)¶
Get the root extended public key (xpub) for BIP84 with optional version and encoding.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended public key or null if unavailable
- bip84.BIP84HD.getXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2WPKH, encoded=true)¶
Get the extended private key (xprv) for the current derivation path.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended private key or null if unavailable
- bip84.BIP84HD.getXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2WPKH, encoded=true)¶
Get the extended public key (xpub) for the current derivation path.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2WPKH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended public key or null if unavailable
- static bip84.BIP84HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘BIP84’
- class bip86.BIP86HD(options=...)¶
Implements the BIP86 hierarchical deterministic (HD) wallet standard. Extends BIP44HD to support Taproot (P2TR) addresses. Provides methods for key derivation, extended key generation, and Taproot address encoding.
exported from
hds.bip86- Extends:
BIP44HD
Create a new BIP86HD instance with optional configuration.
- Arguments:
options (HDOptionsInterface) – Configuration options for HD wallet
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/bip86.ts
- bip86.BIP86HD.fromDerivation(derivation)¶
Apply a full BIP86 derivation path to the HD instance.
- Arguments:
derivation (BIP86Derivation) – BIP86Derivation instance
- Returns:
this – Current BIP86HD instance
- bip86.BIP86HD.getAddress(options=...)¶
Generate a Taproot (P2TR) address from the current public key.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded P2TR address
- bip86.BIP86HD.getRootXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2TR, encoded=true)¶
Get the root extended private key (xprv) for BIP86 with optional version and encoding.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2TR)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended private key or null if unavailable
- bip86.BIP86HD.getRootXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2TR, encoded=true)¶
Get the root extended public key (xpub) for BIP86 with optional version and encoding.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2TR)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended public key or null if unavailable
- bip86.BIP86HD.getXPrivateKey(version=Bitcoin.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2TR, encoded=true)¶
Get the extended private key (xprv) for the current derivation path.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2TR)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended private key or null if unavailable
- bip86.BIP86HD.getXPublicKey(version=Bitcoin.NETWORKS.MAINNET.XPUBLIC_KEY_VERSIONS.P2TR, encoded=true)¶
Get the extended public key (xpub) for the current derivation path.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Version bytes or number (default: Bitcoin mainnet P2TR)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended public key or null if unavailable
- static bip86.BIP86HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘BIP86’
- class bip141.BIP141HD(options=...)¶
Implements BIP141 hierarchical deterministic wallet functionality.
exported from
hds.bip141- Extends:
BIP32HD
Creates a new BIP141HD instance with semantic validation.
- Arguments:
options (HDOptionsInterface) – The HD wallet configuration options.
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/bip141.ts
- bip141.BIP141HD.address¶
type: string
- bip141.BIP141HD.semantic¶
type: string
- bip141.BIP141HD.xprivateKeyVersion¶
type: number | Uint8Array<ArrayBufferLike>
- bip141.BIP141HD.xpublicKeyVersion¶
type: number | Uint8Array<ArrayBufferLike>
- bip141.BIP141HD.fromSemantic(semantic, options={})¶
Initializes the HD wallet based on semantic type.
- Arguments:
semantic (string) – The semantic standard type (e.g., P2WPKH, P2WSH).
options (BIP141HDSemanticOptionsInterface) – Optional BIP141-specific configuration.
- Returns:
this – The initialized BIP141HD instance.
- bip141.BIP141HD.getAddress(options=...)¶
Encodes and returns the wallet address based on the selected semantic type.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options such as prefix, HRP, and witness version.
- Returns:
string – The encoded Bitcoin SegWit address.
- bip141.BIP141HD.getRootXPrivateKey(version, encoded=true)¶
Returns the root extended private key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – The key version or prefix.
encoded (boolean) – Whether to return the encoded key string.
- Returns:
string | null – The root extended private key or null.
- bip141.BIP141HD.getRootXPublicKey(version, encoded=true)¶
Returns the root extended public key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – The key version or prefix.
encoded (boolean) – Whether to return the encoded key string.
- Returns:
string | null – The root extended public key or null.
- bip141.BIP141HD.getSemantic()¶
Retrieves the semantic type of the HD wallet.
- Returns:
string – The semantic type.
- bip141.BIP141HD.getXPrivateKey(version, encoded=true)¶
Returns the derived extended private key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – The key version or prefix.
encoded (boolean) – Whether to return the encoded key string.
- Returns:
string | null – The derived extended private key or null.
- bip141.BIP141HD.getXPublicKey(version, encoded=true)¶
Returns the derived extended public key.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – The key version or prefix.
encoded (boolean) – Whether to return the encoded key string.
- Returns:
string | null – The derived extended public key or null.
- static bip141.BIP141HD.getName()¶
Returns the BIP standard name.
- Returns:
string – The name “BIP141”.
- class cardano.CardanoHD(options=...)¶
Implements hierarchical deterministic (HD) wallet logic for Cardano. Supports multiple Cardano derivation types including Byron Legacy, Icarus, Shelley, and Ledger. Provides methods to derive keys, addresses, and extended keys according to Cardano standards.
exported from
hds.cardano- Extends:
BIP32HD
Creates a new CardanoHD instance.
- Arguments:
options (HDOptionsInterface) – Configuration options for Cardano HD wallet
Example: https://github.com/hdwallet-io/hdwallet.js/tree/master/examples/hds/cardano
- cardano.CardanoHD.cardanoType¶
type: string
- cardano.CardanoHD.drive(index)¶
Derives a child key at the given index according to Cardano derivation rules. Supports hardened and non-hardened derivation.
- Arguments:
index (number) – Child index to derive
- Returns:
this – Current CardanoHD instance with updated keys
- cardano.CardanoHD.fromPrivateKey(privateKey)¶
Sets the HD wallet from a private key (only supported for Shelley types).
- Arguments:
privateKey (string) – Private key as string
- Returns:
this – Current CardanoHD instance
- cardano.CardanoHD.fromPublicKey(publicKey)¶
Sets the HD wallet from a public key (only supported for Shelley types).
- Arguments:
publicKey (string) – Public key as string
- Returns:
this – Current CardanoHD instance
- cardano.CardanoHD.fromSeed(seed, passphrase)¶
Initializes the HD wallet from a seed. Handles different derivation types and Cardano-specific tweaks.
- Arguments:
seed (string | Seed) – Seed value as string or Seed instance
passphrase (string) – Optional passphrase for certain derivation types
- Returns:
this – Current CardanoHD instance
- cardano.CardanoHD.getAddress(options=...)¶
Generates a Cardano address for the current public key and derivation path. Handles Byron Legacy, Icarus, Ledger, and Shelley address types.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded Cardano address
- cardano.CardanoHD.getPathKey()¶
Computes the Byron Legacy path key used for address generation.
- Returns:
string | null – Computed path key or null for non-Legacy types
- cardano.CardanoHD.getRootXPrivateKey(version=Cardano.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the root extended private key (xprv) for the current derivation. Delegates to BIP32HD serialization logic.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Optional version bytes or number (default: Cardano mainnet P2PKH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized root extended private key
- cardano.CardanoHD.getXPrivateKey(version=Cardano.NETWORKS.MAINNET.XPRIVATE_KEY_VERSIONS.P2PKH, encoded=true)¶
Returns the extended private key (xprv) for the current path. Delegates to BIP32HD serialization logic.
- Arguments:
version (number | Uint8Array<ArrayBufferLike>) – Optional version bytes or number (default: Cardano mainnet P2PKH)
encoded (boolean) – Whether to return a base58-encoded string (default: true)
- Returns:
string | null – Serialized extended private key
- static cardano.CardanoHD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘Cardano’
- class electrum.v1.ElectrumV1HD(options=...)¶
Implements Electrum V1 hierarchical deterministic (HD) wallet. Provides methods to derive private/public keys, WIF, and P2PKH addresses according to Electrum V1 derivation rules.
exported from
hds.electrum.v1- Extends:
HD
Constructs a new ElectrumV1HD instance.
- Arguments:
options (HDOptionsInterface) – Configuration options
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/electrum/v1.ts
- electrum.v1.ElectrumV1HD.masterPrivateKey?¶
type: PrivateKey
- electrum.v1.ElectrumV1HD.masterPublicKey¶
type: PublicKey
- electrum.v1.ElectrumV1HD.privateKey?¶
type: PrivateKey
- electrum.v1.ElectrumV1HD.publicKey¶
type: PublicKey
- electrum.v1.ElectrumV1HD.publicKeyType¶
type: string
- electrum.v1.ElectrumV1HD.seed?¶
type: Uint8Array<ArrayBufferLike>
- electrum.v1.ElectrumV1HD.wifPrefix?¶
type: number
- electrum.v1.ElectrumV1HD.wifType¶
type: string
- electrum.v1.ElectrumV1HD.cleanDerivation()¶
Resets derivation path to initial state.
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.drive(changeIndex, addressIndex)¶
Derives child private/public key for the specified change and address index.
- Arguments:
changeIndex (number) – Change index
addressIndex (number) – Address index
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.fromDerivation(derivation)¶
Sets the derivation path.
- Arguments:
derivation (ElectrumDerivation) – ElectrumDerivation instance
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.fromPrivateKey(key)¶
Initializes the wallet from a raw private key.
- Arguments:
key (string | Uint8Array<ArrayBufferLike>) – Private key as Uint8Array or string
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.fromPublicKey(key)¶
Initializes the wallet from a public key.
- Arguments:
key (string | Uint8Array<ArrayBufferLike>) – Public key as Uint8Array or string
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.fromSeed(seed)¶
Initializes the wallet from a seed.
- Arguments:
seed (string | Uint8Array<ArrayBufferLike> | Seed) – Seed as Uint8Array, string, or Seed instance
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.fromWIF(wif)¶
Initializes the wallet from a WIF string.
- Arguments:
wif (string) – Wallet Import Format string
- Returns:
this – Current ElectrumV1HD instance
- electrum.v1.ElectrumV1HD.getAddress(options=...)¶
Generates P2PKH address from the derived public key.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded P2PKH address
- electrum.v1.ElectrumV1HD.getCompressed()¶
Returns the derived public key in compressed format.
- Returns:
string – Compressed public key
- electrum.v1.ElectrumV1HD.getMasterPrivateKey()¶
Returns master private key as string.
- Returns:
string | null – Master private key
- electrum.v1.ElectrumV1HD.getMasterPublicKey(publicKeyType=...)¶
Returns master public key as string.
- Arguments:
publicKeyType (string) – Optional type (‘compressed’ or ‘uncompressed’)
- Returns:
string – Master public key string
- electrum.v1.ElectrumV1HD.getMasterWIF(wifType)¶
Returns master private key in WIF format.
- Arguments:
wifType (string) – Optional WIF type override
- Returns:
string | null – WIF string
- electrum.v1.ElectrumV1HD.getPrivateKey()¶
Returns derived private key as string.
- Returns:
string | null – Derived private key
- electrum.v1.ElectrumV1HD.getPublicKey(publicKeyType=...)¶
Returns derived public key as string.
- Arguments:
publicKeyType (string) – Optional type (‘compressed’ or ‘uncompressed’)
- Returns:
string – Public key string
- electrum.v1.ElectrumV1HD.getPublicKeyType()¶
Returns public key type used by this instance.
- Returns:
string – Public key type string
- electrum.v1.ElectrumV1HD.getSeed()¶
Returns raw seed as string.
- Returns:
string | null – Seed or null if not set
- electrum.v1.ElectrumV1HD.getUncompressed()¶
Returns the derived public key in uncompressed format.
- Returns:
string – Uncompressed public key
- electrum.v1.ElectrumV1HD.getWIF(wifType)¶
Returns derived private key in WIF format.
- Arguments:
wifType (string) – Optional WIF type override
- Returns:
string | null – WIF string
- electrum.v1.ElectrumV1HD.getWIFType()¶
Returns the WIF type used by this instance.
- Returns:
string – WIF type string
- electrum.v1.ElectrumV1HD.updateDerivation(derivation)¶
Updates derivation path by cleaning previous derivation state.
- Arguments:
derivation (ElectrumDerivation) – ElectrumDerivation instance
- Returns:
this – Current ElectrumV1HD instance
- static electrum.v1.ElectrumV1HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘Electrum-V1’
- class electrum.v2.ElectrumV2HD(options=...)¶
Electrum V2 hierarchical deterministic (HD) wallet. Supports standard (P2PKH) and SegWit (P2WPKH) modes. Wraps a BIP32HD instance and provides Electrum-specific derivation logic.
exported from
hds.electrum.v2- Extends:
HD
Constructs a new ElectrumV2HD instance.
- Arguments:
options (HDOptionsInterface) – Configuration options
Example: https://github.com/hdwallet-io/hdwallet.js/tree/master/examples/hds/electrum/v2
- electrum.v2.ElectrumV2HD.bip32HD¶
type: BIP32HD
- electrum.v2.ElectrumV2HD.mode¶
type: string
- electrum.v2.ElectrumV2HD.publicKeyType¶
type: string
- electrum.v2.ElectrumV2HD.wifPrefix?¶
type: number
- electrum.v2.ElectrumV2HD.wifType¶
type: string
- electrum.v2.ElectrumV2HD.cleanDerivation()¶
Resets derivation path to initial state.
- Returns:
this – Current ElectrumV2HD instance
- electrum.v2.ElectrumV2HD.drive(changeIndex, addressIndex)¶
Derives child keys for given change and address indices. Uses custom Electrum V2 derivation logic.
- Arguments:
changeIndex (number) – Change index
addressIndex (number) – Address index
- Returns:
this – Current ElectrumV2HD instance
- electrum.v2.ElectrumV2HD.fromDerivation(derivation)¶
Sets the derivation path.
- Arguments:
derivation (ElectrumDerivation) – ElectrumDerivation instance
- Returns:
this – Current ElectrumV2HD instance
- electrum.v2.ElectrumV2HD.fromSeed(seed)¶
Initializes wallet from a seed.
- Arguments:
seed (string | Uint8Array<ArrayBufferLike> | Seed) – Seed as Uint8Array, string, or Seed instance
- Returns:
this – Current ElectrumV2HD instance
- electrum.v2.ElectrumV2HD.getAddress(options=...)¶
Generates an address based on the current mode. - Standard mode → P2PKH - SegWit mode → P2WPKH
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string – Encoded Bitcoin address
- electrum.v2.ElectrumV2HD.getCompressed()¶
Returns derived public key in compressed format.
- Returns:
string – Compressed public key
- electrum.v2.ElectrumV2HD.getMasterPrivateKey()¶
Returns master private key as string.
- Returns:
string | null – Master private key
- electrum.v2.ElectrumV2HD.getMasterPublicKey(publicKeyType)¶
Returns master public key as string.
- Arguments:
publicKeyType (string) – Optional type (‘compressed’ or ‘uncompressed’)
- Returns:
string – Master public key
- electrum.v2.ElectrumV2HD.getMasterWIF(wifType)¶
Returns master private key in WIF format.
- Arguments:
wifType (string) – Optional WIF type override
- Returns:
string | null – WIF string
- electrum.v2.ElectrumV2HD.getMode()¶
Returns the current wallet mode (‘standard’ or ‘segwit’).
- Returns:
string – Mode string
- electrum.v2.ElectrumV2HD.getPrivateKey()¶
Returns derived private key as string.
- Returns:
string | null – Derived private key
- electrum.v2.ElectrumV2HD.getPublicKey(publicKeyType)¶
Returns derived public key as string.
- Arguments:
publicKeyType (string) – Optional type (‘compressed’ or ‘uncompressed’)
- Returns:
string – Public key string
- electrum.v2.ElectrumV2HD.getPublicKeyType()¶
Returns public key type used by this instance.
- Returns:
string – Public key type string
- electrum.v2.ElectrumV2HD.getSeed()¶
Returns the raw seed as string.
- Returns:
string | null – Seed or null if not set
- electrum.v2.ElectrumV2HD.getUncompressed()¶
Returns derived public key in uncompressed format.
- Returns:
string – Uncompressed public key
- electrum.v2.ElectrumV2HD.getWIF(wifType)¶
Returns derived private key in WIF format.
- Arguments:
wifType (string) – Optional WIF type override
- Returns:
string | null – WIF string
- electrum.v2.ElectrumV2HD.getWIFType()¶
Returns the WIF type used by this instance.
- Returns:
string – WIF type
- electrum.v2.ElectrumV2HD.updateDerivation(derivation)¶
Updates derivation path by cleaning previous derivation state.
- Arguments:
derivation (ElectrumDerivation) – ElectrumDerivation instance
- Returns:
this – Current ElectrumV2HD instance
- static electrum.v2.ElectrumV2HD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘Electrum-V2’
- class monero.MoneroHD(options=...)¶
Implements hierarchical deterministic (HD) wallet logic for Monero. Supports primary, integrated, and subaddresses according to Monero’s key derivation rules. Provides methods to initialize from seed, private key, derivation, or watch-only mode.
exported from
hds.monero- Extends:
HD
Creates a new MoneroHD instance.
- Arguments:
options (HDOptionsInterface) – HD wallet configuration options
Example: https://github.com/hdwallet-io/hdwallet.js/blob/master/examples/hds/monero.ts
- monero.MoneroHD.network¶
type: Network
- monero.MoneroHD.paymentID?¶
type: string
- monero.MoneroHD.privateKeyRaw?¶
type: Uint8Array<ArrayBufferLike>
- monero.MoneroHD.seed?¶
type: Uint8Array<ArrayBufferLike>
- monero.MoneroHD.spendPrivateKey?¶
type: PrivateKey | null
- monero.MoneroHD.spendPublicKey¶
type: PublicKey
- monero.MoneroHD.viewPrivateKey¶
type: PrivateKey
- monero.MoneroHD.viewPublicKey¶
type: PublicKey
- monero.MoneroHD.cleanDerivation()¶
Resets derivation state to initial.
- Returns:
this – Current MoneroHD instance
- monero.MoneroHD.drive(minorIndex, majorIndex)¶
Derives subaddress public keys at given minor and major indices.
- Arguments:
minorIndex (number) – Minor index
majorIndex (number) – Major index
- Returns:
[PublicKey, PublicKey] – Tuple of [subaddress spend key, subaddress view key]
- monero.MoneroHD.fromDerivation(derivation)¶
Sets the derivation path.
- Arguments:
derivation (MoneroDerivation) – MoneroDerivation instance
- Returns:
this – Current MoneroHD instance
- monero.MoneroHD.fromPrivateKey(privateKey)¶
Initializes wallet from a raw private key.
- Arguments:
privateKey (string) – Private key string
- Returns:
this – Current MoneroHD instance
- monero.MoneroHD.fromSeed(seed)¶
Initializes wallet from a seed. Automatically derives spend and view keys.
- Arguments:
seed (string | Uint8Array<ArrayBufferLike> | Seed) – Seed as Uint8Array, string, or Seed instance
- Returns:
this – Current MoneroHD instance
- monero.MoneroHD.fromSpendPrivateKey(spendPrivateKey)¶
Initializes HD wallet from a spend private key. Automatically derives the corresponding view key.
- Arguments:
spendPrivateKey (string | Uint8Array<ArrayBufferLike>) – Spend private key as string or Uint8Array
- Returns:
this – Current MoneroHD instance
- monero.MoneroHD.fromWatchOnly(viewPrivateKey, spendPublicKey)¶
Initializes wallet in watch-only mode. Only view private key and spend public key are required.
- Arguments:
viewPrivateKey (string) – View private key string
spendPublicKey (string) – Spend public key string
- Returns:
this – Current MoneroHD instance
- monero.MoneroHD.getAddress(options=...)¶
Generates a Monero address of the specified type. Supports standard, integrated, and subaddress types.
- Arguments:
options (HDAddressOptionsInterface) – Address generation options
- Returns:
string | null – Encoded Monero address
- monero.MoneroHD.getIntegratedAddress(paymentID)¶
Generates an integrated Monero address with optional payment ID.
- Arguments:
paymentID (string) – Optional payment ID
- Returns:
string | null – Encoded integrated address or null if no payment ID
- monero.MoneroHD.getPrimaryAddress()¶
Generates the primary Monero address.
- Returns:
string – Encoded primary address
- monero.MoneroHD.getPrivateKey()¶
Returns the raw private key as string.
- Returns:
string | null – Private key string or null if not set
- monero.MoneroHD.getSeed()¶
Returns the raw seed as string.
- Returns:
string | null – Seed string or null if not set
- monero.MoneroHD.getSpendPrivateKey()¶
Returns spend private key as string.
- Returns:
string | null – Spend private key string
- monero.MoneroHD.getSpendPublicKey()¶
Returns spend public key as string.
- Returns:
string – Spend public key string
- monero.MoneroHD.getSubAddress(minor=..., major=...)¶
Generates a subaddress for given minor and major indices. Defaults to current derivation indices.
- Arguments:
minor (number) – Minor index
major (number) – Major index
- Returns:
string – Encoded subaddress
- monero.MoneroHD.getViewPrivateKey()¶
Returns view private key as string.
- Returns:
string – View private key string
- monero.MoneroHD.getViewPublicKey()¶
Returns view public key as string.
- Returns:
string – View public key string
- monero.MoneroHD.updateDerivation(derivation)¶
Updates derivation path, cleaning previous derivation state.
- Arguments:
derivation (MoneroDerivation) – MoneroDerivation instance
- Returns:
this – Current MoneroHD instance
- static monero.MoneroHD.getName()¶
Returns the name of this HD implementation.
- Returns:
string – ‘Monero’