Module: hd

Classes

Mnemonic
HDPrivateKey
HDPublicKey

Methods

(static) from(options, networknullable) → {HDPrivateKey|HDPublicKey}

Generate an hdkey from any number of options.

Parameters:
Name Type Attributes Description
options Object | Mnemonic | Buffer

mnemonic, mnemonic options, seed, or base58 key.

network Network | NetworkType <nullable>
Source:
Returns:
Type
HDPrivateKey | HDPublicKey

(static) fromBase58(xkey, networknullable) → {HDPrivateKey|HDPublicKey}

Instantiate an HD key (public or private) from an base58 string.

Parameters:
Name Type Attributes Description
xkey Base58String
network Network <nullable>
Source:
Returns:
Type
HDPrivateKey | HDPublicKey

(static) fromJSON(json, networknullable) → {HDPrivateKey|HDPublicKey}

Instantiate an HD key from a jsonified key object.

Parameters:
Name Type Attributes Description
json Object

The jsonified transaction object.

network Network <nullable>
Source:
Returns:
Type
HDPrivateKey | HDPublicKey

(static) fromMnemonic(mnemonic) → {HDPrivateKey}

Instantiate an hd private key from a mnemonic.

Parameters:
Name Type Description
mnemonic Mnemonic | Object
Source:
Returns:
Type
HDPrivateKey

(static) fromRaw(data, networknullable) → {HDPrivateKey|HDPublicKey}

Instantiate an HD key from serialized data.

Parameters:
Name Type Attributes Description
data Buffer
network Network <nullable>
Source:
Returns:
Type
HDPrivateKey | HDPublicKey

(static) fromSeed(options) → {HDPrivateKey}

Generate an HDPrivateKey from a seed.

Parameters:
Name Type Description
options Object | Mnemonic | Buffer

seed, mnemonic, mnemonic options.

Source:
Returns:
Type
HDPrivateKey

(static) generate(options) → {HDPrivateKey}

Generate an HDPrivateKey.

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Description
privateKey Buffer <nullable>
entropy Buffer <nullable>
Source:
Returns:
Type
HDPrivateKey

(static) isBase58(data, networknullable) → {Boolean}

Test whether an object is in the form of a base58 hd key.

Parameters:
Name Type Attributes Description
data String
network Network <nullable>
Source:
Returns:
Type
Boolean

(static) isHD(obj) → {Boolean}

Test whether an object is an HD key.

Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
Boolean

(static) isPrivate(obj) → {Boolean}

Test whether an object is an HD private key.

Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
Boolean

(static) isPublic(obj) → {Boolean}

Test whether an object is an HD public key.

Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
Boolean

(static) isRaw(data, networknullable) → {NetworkType}

Test whether an object is in the form of a serialized hd key.

Parameters:
Name Type Attributes Description
data Buffer
network Network <nullable>
Source:
Returns:
Type
NetworkType