Skip to main content

Class: Bip32Path

Class to help with bip32 paths.

Table of contents

Constructors

Methods

Constructors

constructor

new Bip32Path(initialPath?)

Create a new instance of Bip32Path.

Parameters

NameTypeDescription
initialPath?stringInitial path to create.

Methods

fromPath

Static fromPath(bip32Path): Bip32Path

Construct a new path by cloning an existing one.

Parameters

NameTypeDescription
bip32PathBip32PathThe path to clone.

Returns

Bip32Path

A new instance of Bip32Path.


toString

toString(): string

Converts the path to a string.

Returns

string

The path as a string.


push

push(index): void

Push a new index on to the path.

Parameters

NameTypeDescription
indexnumberThe index to add to the path.

Returns

void


pushHardened

pushHardened(index): void

Push a new hardened index on to the path.

Parameters

NameTypeDescription
indexnumberThe index to add to the path.

Returns

void


pop

pop(): void

Pop an index from the path.

Returns

void


numberSegments

numberSegments(): number[]

Get the segments.

Returns

number[]

The segments as numbers.