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
(private) fromOptions(options) → {Path}
Instantiate path from options object.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
Returns:
- Type
- Path
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}
Clone the path object.
- Source:
Returns:
- Type
- Path
(private) read(data)
Inject properties from serialized data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
toAddress() → {Address}
Convert path object to an address (currently unused).
- Source:
Returns:
- Type
- Address
toPath(networknullable) → {String}
Convert path object to string derivation path.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
network |
String | Network |
<nullable> |
Network type. |
- Source:
Returns:
- Type
- String
write() → {Buffer}
Serialize path.
- Source:
Returns:
- Type
- Buffer