Skip to Content
Hydra@exodus/key-utils

@exodus/key-utils

Version: 0.0.0

Type Aliases

DerivationPath

class

Constructor

constructor
DerivationPath(derivationPath: number[], __namedParameters?: DerivationPathOptions): DerivationPath

Parameters:

derivationPath: number[]
__namedParameters (optional): DerivationPathOptions

Methods

at
at(index: number, __namedParameters?: any): number

Parameters:

index: number
__namedParameters (optional): any

Returns:

number
extend
extend(pathLike: PathLike): DerivationPath

Parameters:

pathLike: PathLike
replaceAtIndex
replaceAtIndex(index: number, value: string | number): DerivationPath

Parameters:

index: number
value: string | number
toJSON
toJSON(): string

Returns:

string
toPathArray
toPathArray(): number[]

Returns:

number[]
toString
toString(): string

Returns:

string
from
from(pathLike: PathLike, __namedParameters?: DerivationPathOptions): DerivationPath

Parameters:

pathLike: PathLike
__namedParameters (optional): DerivationPathOptions

Accessors

[toStringTag]

PathLike

type

assertValidDerivationPath

variable

Type

const assertValidDerivationPath: (path: unknown, requireAllHardened: boolean) => void

Signature

__type(path: unknown, requireAllHardened?: boolean): void

Parameters:

path: unknown
requireAllHardened (optional): boolean

Returns:

void

BIP32_PURPOSES

variable

Type

number[]

buildDerivationPath

variable

Type

const buildDerivationPath: ({ derivationAlgorithm, purpose, bip44, accountIndex, chainIndex, addressIndex, }: BuildDerivationPathParams) => string

Signature

__type({ derivationAlgorithm, purpose, bip44, accountIndex, chainIndex, addressIndex, }: BuildDerivationPathParams): string

Parameters:

{ derivationAlgorithm, purpose, bip44, accountIndex, chainIndex, addressIndex, }: BuildDerivationPathParams

Returns:

string

DEFAULT_ADDRESS_INDEX

variable

Type

0

DEFAULT_CHAIN_INDEX

variable

Type

0

DEFAULT_PURPOSE

variable

Type

44

isValidDerivationPath

variable

Type

const isValidDerivationPath: (path: unknown, requireAllHardened: boolean) => boolean

Signature

__type(path: unknown, requireAllHardened?: boolean): boolean

Parameters:

path: unknown
requireAllHardened (optional): boolean

Returns:

boolean

parseDerivationPath

variable

Type

const parseDerivationPath: (path: string) => { ... }

Signature

__type(path: string): any

Parameters:

path: string

Returns:

any

Properties

accountIndex
number
addressIndex
number | undefined
chainIndex
number | undefined
coinIndex
number
purpose
number

unhardenDerivationIndex

variable

Type

const unhardenDerivationIndex: (hardenedIndex: number) => number

Signature

__type(hardenedIndex: number): number

Parameters:

hardenedIndex: number

Returns:

number

createGetKeyIdentifier

function

Signature

createGetKeyIdentifier(__namedParameters: CreateGetKeyIdentifierOptions): any

Parameters:

Returns:

any

DerivationPath

class
Adapted bip32-path with stricter input validation and more flexible input parsing

Constructor

constructor
DerivationPath(derivationPath: number[], __namedParameters: DerivationPathOptions): DerivationPath

Parameters:

derivationPath: number[]
__namedParameters: DerivationPathOptions

Methods

at
at(index: number, __namedParameters: any): number

Parameters:

index: number
__namedParameters: any

Returns:

number
extend
extend(pathLike: PathLike): DerivationPath
Returns a new derivation path extended by the given indices

Parameters:

pathLike: PathLike
replaceAtIndex
replaceAtIndex(index: number, value: string | number): DerivationPath

Parameters:

index: number
value: string | number
toJSON
toJSON(): string

Returns:

string
toPathArray
toPathArray(): number[]

Returns:

number[]
toString
toString(): string

Returns:

string
from
from(pathLike: PathLike, __namedParameters: DerivationPathOptions): DerivationPath
Creates a DerivationPath instance from a string path or array of path indices

Parameters:

pathLike: PathLike
__namedParameters: DerivationPathOptions

Accessors

[toStringTag]

PathLike

type

BIP32_PURPOSES

variable

Type

number[]

DEFAULT_ADDRESS_INDEX

variable

Type

0

DEFAULT_CHAIN_INDEX

variable

Type

0

DEFAULT_PURPOSE

variable

Type

44

assertValidDerivationPath

function

Signature

assertValidDerivationPath(path: unknown, requireAllHardened: boolean): void

Parameters:

path: unknown
requireAllHardened: boolean

Returns:

void

buildDerivationPath

function

Signature

buildDerivationPath(__namedParameters: BuildDerivationPathParams): string

Parameters:

__namedParameters: BuildDerivationPathParams

Returns:

string

createGetKeyIdentifier

function

Signature

createGetKeyIdentifier(__namedParameters: CreateGetKeyIdentifierOptions): any
Factory to create a getKeyIdentifier function

Parameters:

Returns:

any

isValidDerivationPath

function

Signature

isValidDerivationPath(path: unknown, requireAllHardened: boolean): boolean

Parameters:

path: unknown
requireAllHardened: boolean

Returns:

boolean

parseDerivationPath

function

Signature

parseDerivationPath(path: string): any

Parameters:

path: string

Returns:

any

unhardenDerivationIndex

function

Signature

unhardenDerivationIndex(hardenedIndex: number): number

Parameters:

hardenedIndex: number

Returns:

number

Start building

XO

Request Demo

Schedule a call with our team

Select a product
Arrow right

Start building
Grateful

Contact Us

We're here to help