@zondax/ledger-js
Version:
TS / Node API for apps running on Ledger devices
25 lines (24 loc) • 1.22 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { BIP32Path } from './types';
/**
* Serializes a derivation path into a buffer.
* @param path - The derivation path in string format.
* @returns A buffer representing the serialized path.
* @throws {ResponseError} If the path format is incorrect or invalid.
*/
export declare function serializePath(path: BIP32Path, requiredPathLengths?: number[]): Buffer;
/**
* Converts an array of numbers representing a serialized path back into a derivation path string.
* @param items - The array of numbers representing the serialized path.
* @returns The derivation path in string format.
* @throws {Error} If the array length is not a multiple of 4 or if the array contains invalid values.
*/
export declare function numbersToBip32Path(items: number[]): BIP32Path;
/**
* Converts a buffer representing a serialized path back into a derivation path string.
* @param buffer - The buffer representing the serialized path.
* @returns The derivation path in string format.
* @throws {Error} If the buffer length is not a multiple of 4 or if the buffer contains invalid values.
*/
export declare function bufferToBip32Path(buffer: Buffer): BIP32Path;