UNPKG

@iacobus/hd

Version:

Hierarchical Deterministic Symmetric Keys.

29 lines 1.16 kB
/** * @fileoverview Provides functionality for parsing derivation paths and schemas. * @module * @author Jacob V. B. Haap <iacobus.xyz> * @license MIT */ import type { CHash } from "@noble/hashes/utils"; /** HDSchema is a derivation path schema. */ export type HDSchema = [string, string][]; /** HDPath is a derivation path. */ export type HDPath = number[]; /** defaultSchema is the default derivation path schema */ export declare const defaultSchema = "m / application: any / purpose: any / context: any / index: num"; /** defaultPath is the default derivation path. */ export declare const defaultPath = "m/42/0/1/0"; /** * newSchema parses a new derivation path schema from a given string. * @example * const str: string = "m / application: any / purpose: any / context: any / index: num"; * const schema = newSchema(str); */ export declare function newSchema(str: string): HDSchema; /** * newPath parses a new derivation path from a given hash, string, and schema. * @example * const path = newPath(h, "m/42/0/1/0", schema); */ export declare function newPath(h: CHash, str: string, schema: HDSchema): HDPath; //# sourceMappingURL=path.d.ts.map