import { HDPublicNode } from './hd-public-node.js'; import { PrivateKey } from './private-key.js'; import type { HdKeyNetwork, HdPrivateNodeValid } from '@bitauth/libauth'; /** * Hierarchically Deterministic Private Node Entity. */ export declare class HDPrivateNode { readonly node: HdPrivateNodeValid; /** * Construct a new HD Private Node. * * @param node The HD Private Node. */ constructor(node: HdPrivateNodeValid); /** * Creates a HD Private Node from a raw seed. * * @param seed The raw seed bytes. * * @throws {Error} If HD Private Node cannot be created. * * @returns The created HD Private Node. */ static fromBytes(seed: Uint8Array): HDPrivateNode; /** * Creates a HD Private Node from a raw seed. * * @param seed The raw seed bytes. * * @throws {Error} If HD Private Node cannot be created. * * @returns The created HD Private Node. */ static fromSeed(seed: Uint8Array): HDPrivateNode; /** * Creates a HD Private Node from the given mnemonic. * * @param mnemonic The mnemonic. * * @throws {Error} If HD Private Node cannot be created. * * @returns The created HD Private Node. */ static fromMnemonic(mnemonic: string): HDPrivateNode; /** * Creates a HD Private Node from the given XPriv Key. * * @param xpriv The XPriv Key. * * @throws {Error} If HD Private Node cannot be created. * * @returns The created HD Private Node. */ static fromXPriv(xpriv: string): HDPrivateNode; /** * Creates a HD Private Node from raw node data. * * @param node The raw node data. * * @returns The created HD Private Node. */ static fromRaw(node: HdPrivateNodeValid): HDPrivateNode; /** * Generates a random HD Private Node. * * @throws {Error} If HD Private Node cannot be created. * * @returns The created HD Private Node. */ static generateRandom(): HDPrivateNode; /** * Checks if the given XPriv string is a valid HD Private Key. * * @param xpriv The XPriv string to check. * * @returns True if the XPriv string is valid, false otherwise. */ static isXPriv(xpriv: string): boolean; /** * Gets the Private Key entity for this node. * * @returns The Private Key Entity for this node. */ privateKey(): PrivateKey; /** * Derives a HD Private Node from the given BIP32 path. * * @param path {string} The BIP32 Path (e.g. m/44'/145'/0'/0/1). * * @throws {Error} If HD Private Node cannot be derived. * * @returns The derived HD Private Node */ derivePath(path: string): HDPrivateNode; /** * Derives a HD Private Node from the given relative BIP32 path. * * @param path {string} The BIP32 Path (e.g. 0/0). * * @throws {Error} If HD Private Node cannot be derived. * * @returns The derived HD Private Node */ deriveRelativePath(path: string): HDPrivateNode; /** * Derives a HD Public Node from this Private Node. * * @returns The derived HD Public Node */ deriveHDPublicNode(): HDPublicNode; /** * Returns the Private Key of this node (as a Uint8Array). * * @returns The Node's Private Key (as a Uint8Array). */ toBytes(): Uint8Array; /** * Converts this node to an XPriv Key for export. * * @param network {HdKeyNetwork} The network to encode for. * * @returns The XPriv Key. */ toXPriv(network?: HdKeyNetwork): string; /** * Returns the XPriv string for this node. * * @returns The XPriv string for this node. */ toString(): string; /** * Returns the raw node data. * * @returns The raw node data. */ toRaw(): HdPrivateNodeValid; }