import { Keypath } from './Keypath'; import { CoinInfo } from './CoinInfo'; interface HDKeyArgs { isMaster?: boolean; keyData: Buffer; chainCode?: Buffer; isPrivateKey?: boolean; useInfo?: CoinInfo; origin?: Keypath; children?: Keypath; parentFingerprint?: number; name?: string; note?: string; } declare const HDKey_base: import("@ngraveio/bc-ur").RegistryItemClass; export declare class HDKey extends HDKey_base { data: HDKeyArgs; constructor(input: HDKeyArgs); /** * @returns {boolean} True if the key is a master key, otherwise false. */ getIsMaster: () => boolean; /** * @returns {boolean} True if the key is a private key, otherwise false. */ getIsPrivateKey: () => boolean; /** * @returns {Buffer} The key data. */ getKeyData: () => Buffer; /** * @returns {Buffer | undefined} The chain code. */ getChainCode: () => Buffer | undefined; /** * @returns {CoinInfo | undefined} The coin information. */ getUseInfo: () => CoinInfo | undefined; /** * @returns {Keypath | undefined} The origin keypath. */ getOrigin: () => Keypath | undefined; /** * @returns {Keypath | undefined} The children keypath. */ getChildren: () => Keypath | undefined; /** * @returns {number | undefined} The parent fingerprint. */ getParentFingerprint: () => number | undefined; /** * @returns {string | undefined} The name of the key. */ getName: () => string | undefined; /** * @returns {string | undefined} The note associated with the key. */ getNote: () => string | undefined; /** * Prepares the data for CBOR encoding. * @returns {any} The data prepared for CBOR encoding. * @throws {Error} If the input data is invalid. */ preCBOR(): any; /** * Verifies the input data. * @param {HDKeyArgs} input - The input data to verify. * @returns {{ valid: boolean; reasons?: Error[] }} The verification result. */ verifyInput(input: HDKeyArgs): { valid: boolean; reasons?: Error[]; }; /** * Creates an HDKey instance from an extended public key (xpub). * @param {string} xpub - The extended public key. * @param {{ xpubPath?: string; isPrivate?: boolean; sourceFingerprint?: number }} [params] - Optional parameters. * @returns {HDKey} The HDKey instance. * @throws {Error} If the xpub is invalid or inconsistent with the provided path. */ static fromXpub(xpub: string, params?: { xpubPath?: string; isPrivate?: boolean; sourceFingerprint?: number; }): HDKey; /** * Converts the HDKey instance to an extended public key (xpub). * @param {{ versionBytes?: Buffer }} [params] - Optional parameters. * @returns {string} The extended public key. * @throws {Error} If the chain code or origin is missing. * * https://github.com/bitcoinjs/bip32/blob/master/ts-src/bip32.ts#L238 */ toXpub(params?: { versionBytes?: Buffer; }): string; /** * Converts the HDKey instance to an extended public key (xpub). * @param {{ versionBytes?: Buffer }} [params] - Optional parameters. * @returns {string} The extended public key. * @throws {Error} If the chain code or origin is missing. */ getBip32Key(params?: { versionBytes?: Buffer; }): ReturnType; /** * Extracts the parent fingerprint from an extended public key (xpub). * @param {string} xpub - The extended public key. * @returns {number} The parent fingerprint. */ static extractParentFingerprint(xpub: string): number; /** * Parses an extended public key (xpub). * @param {string} xpub - The extended public key. * @returns {{ version: Buffer; depth: number; parentFingerprint: number; childNumber: number; chainCode: Buffer; keyData: Buffer; checksum: Buffer; isMaster: boolean }} The parsed xpub components. * @throws {Error} If the checksum is invalid. */ static parseXpub(xpub: string): { version: Buffer; depth: number; parentFingerprint: number; childNumber: number; chainCode: Buffer; keyData: Buffer; checksum: Buffer; }; /** * Encodes the components into an extended public key (xpub). * @param {{ version: Buffer; depth: number; parentFingerprint: number; childNumber: number; chainCode: Buffer; keyData: Buffer }} params - The components to encode. * @returns {string} The encoded extended public key. */ static encodeXpub({ version, depth, parentFingerprint, childNumber, chainCode, keyData, }: { version: Buffer; depth: number | Buffer; parentFingerprint: number | Buffer; childNumber: number | Buffer; chainCode: Buffer; keyData: Buffer; }): string; } export {};