Class: Path

wallet.Path(optionsopt)

Path

Constructor

new Path(optionsopt)

Create a path.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties:
Name Type Description
name String

Account name.

account Number

Account index.

branch Number

Branch index.

index Number

Address index.

Source:

Members

(static) types :Number

Path types.

Type:
  • Number
Properties:
Name Type Description
HD Number
KEY Number
ADDRESS Number
Default Value:
  • {"HD":0,"KEY":1,"ADDRESS":2}
Source:

(static) typesByVal :Number

Path types.

Type:
  • Number
Default Value:
  • ["HD","KEY","ADDRESS"]
Source:

Methods

(static) fromAddress(account, address) → {Path}

Instantiate path from address.

Parameters:
Name Type Description
account Account
address Address
Source:
Returns:
Type
Path

(static) fromJSON(json) → {Path}

Inject properties from a json object.

Parameters:
Name Type Description
json Object
Source:
Returns:
Type
Path

format() → {String}

Inspect the path.

Source:
Returns:
Type
String

(private) fromAddress(account, address)

Inject properties from address.

Parameters:
Name Type Description
account Account
address Address
Source:

fromJSON(json) → {Path}

Inject properties from a json object.

Parameters:
Name Type Description
json Object
Source:
Returns:
Type
Path

fromOptions(options) → {this}

Instantiate path from options object.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
this

getJSON(networknullable) → {Object}

Convert path to a json-friendly object.

Parameters:
Name Type Attributes Description
network String | Network <nullable>

Network type.

Source:
Returns:
Type
Object

getSize() → {Number}

Calculate serialization size.

Source:
Returns:
Type
Number

inject(path) → {this}

Clone the path object.

Parameters:
Name Type Description
path this
Source:
Returns:
Type
this

read(br) → {this}

Inject properties from serialized data.

Parameters:
Name Type Description
br bio.BufferReader
Source:
Returns:
Type
this

toAddress() → {Address}

Convert path object to an address (currently unused).

Source:
Returns:
Type
Address

toPath(networkopt, nullable) → {String}

Convert path object to string derivation path.

Parameters:
Name Type Attributes Description
network NetworkType | Network <optional>
<nullable>

Network type.

Source:
Returns:
Type
String

write(bw) → {bio.BufferWriter}

Serialize path.

Parameters:
Name Type Description
bw bio.BufferWriter
Source:
Returns:
Type
bio.BufferWriter