Class HDPath
Represents a path in the HD keys hierarchy (BIP-32)
Inheritance
Namespace: Netmavryk.Keys
Assembly: Netmavryk.dll
Syntax
public class HDPath : IEnumerable<uint>
Constructors
| Improve this Doc View SourceHDPath()
Creates an empty (root) HDPath object
Declaration
public HDPath()
HDPath(String)
Creates an HDPath object from a given string path.
Declaration
public HDPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | Path string, formatted like m/44'/1729'/0/0' |
Properties
| Improve this Doc View SourceHardened
True if the last index in the path is hardened
Declaration
public bool Hardened { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceDerive(Int32, Boolean)
Returns a new HDPath object with appended child index.
Declaration
public HDPath Derive(int index, bool hardened = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Child index |
| System.Boolean | hardened | If true, hardened derivation will be performed |
Returns
| Type | Description |
|---|---|
| HDPath | HDPath object |
GetEnumerator()
Returns an enumerator that iterates through an HDPath indexes collection.
Declaration
public IEnumerator<uint> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<System.UInt32> | An System.Collections.IEnumerator object that can be used to iterate through the HDPath indexes collection. |
Parse(String)
Converts the path string, formatted like m/44'/1729'/0/0', to the HDPath object
Declaration
public static HDPath Parse(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | HD key path string, formatted like m/44'/1729'/0/0' |
Returns
| Type | Description |
|---|---|
| HDPath | HDPath object |
ToString()
Converts the HDPath to a string, formatted like m/44'/1729'/0/0'
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | HDPath string, formatted like m/44'/1729'/0/0' |
TryParse(String, out HDPath)
Converts the path string, formatted like m/44'/1729'/0/0', to the HDPath object
Declaration
public static bool TryParse(string path, out HDPath res)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | HD key path string, formatted like m/44'/1729'/0/0' |
| HDPath | res | Successfully parsed HDPath |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the HDPath is parsed successfully, otherwise false |