Class: HDWallet
@fuel-ts/account.HDWallet
Constructors
constructor
• new HDWallet(config
): HDWallet
HDWallet is a implementation of the BIP-0044 and BIP-0032, Multi-Account Hierarchy for Deterministic Wallets
Parameters
Name | Type | Description |
---|---|---|
config | HDWalletConfig | Wallet configurations |
Returns
Defined in
packages/account/src/hdwallet/hdwallet.ts:80
Properties
chainCode
• chainCode: BytesLike
Defined in
packages/account/src/hdwallet/hdwallet.ts:73
depth
• depth: number
= 0
Defined in
packages/account/src/hdwallet/hdwallet.ts:67
fingerprint
• fingerprint: string
Defined in
packages/account/src/hdwallet/hdwallet.ts:69
index
• index: number
= 0
Defined in
packages/account/src/hdwallet/hdwallet.ts:68
parentFingerprint
• parentFingerprint: string
Defined in
packages/account/src/hdwallet/hdwallet.ts:70
privateKey
• Optional
privateKey: string
Defined in
packages/account/src/hdwallet/hdwallet.ts:71
publicKey
• publicKey: string
Defined in
packages/account/src/hdwallet/hdwallet.ts:72
Accessors
extendedKey
• get
extendedKey(): string
Returns
string
Defined in
packages/account/src/hdwallet/hdwallet.ts:104
Methods
deriveIndex
▸ deriveIndex(index
): HDWallet
Derive the current HDWallet instance navigating only on the index. Ex.: m/44'/0 -> Ex.: m/44'/1 -> m/44'/2
. Learn more
Parameters
Name | Type | Description |
---|---|---|
index | number | Index of the child HDWallet. |
Returns
A new instance of HDWallet on the derived index
Defined in
packages/account/src/hdwallet/hdwallet.ts:115
derivePath
▸ derivePath(path
): HDWallet
Derive the current HDWallet instance to the path. Learn more
Parameters
Name | Type | Description |
---|---|---|
path | string | The string representation of the child HDWallet. Ex.: m/44'/0'/0'/0/0 |
Returns
A new instance of HDWallet on the derived path
Defined in
packages/account/src/hdwallet/hdwallet.ts:174
toExtendedKey
▸ toExtendedKey(isPublic?
, testnet?
): string
Get the extendKey as defined on BIP-32 from the provided seed
Parameters
Name | Type | Default value | Description |
---|---|---|---|
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
Defined in
packages/account/src/hdwallet/hdwallet.ts:187
fromExtendedKey
▸ fromExtendedKey(extendedKey
): HDWallet
Parameters
Name | Type |
---|---|
extendedKey | string |
Returns
Defined in
packages/account/src/hdwallet/hdwallet.ts:223
fromSeed
▸ fromSeed(seed
): HDWallet
Create HDWallet instance from seed
Parameters
Name | Type | Description |
---|---|---|
seed | string | Seed |
Returns
A new instance of HDWallet