UNPKG

@safeheron/crypto-bip32

Version:

HDKey in js(embrace bip32-secp256k1, bip32-ed25519)

44 lines (43 loc) 1.49 kB
import * as BN from 'bn.js'; import { CryptoJSBytes } from "@safeheron/crypto-utils"; export declare class Secp256k1HDKey { versions: { private: number; public: number; }; depth: number; index: number; private _privateKey; private _publicKey; chainCode: any; private _fingerprint; parentFingerprint: number; private _identifier; static HARDENED_OFFSET: number; constructor(versions: { private: number; public: number; }); get fingerprint(): number; get identifier(): number; get pubKeyHash(): number; get privateKey(): BN; set privateKey(value: string | BN); get publicKey(): any; set publicKey(value: any); get xprv(): string; get xpub(): string; derive(path: string): Secp256k1HDKey; deriveChild(index: number): Secp256k1HDKey; publicDerive(path: string): [Secp256k1HDKey, BN]; publicDeriveChild(index: number): [Secp256k1HDKey, BN]; sign(hash: number[]): number[]; verify(hash: number[], signature: []): boolean; static fromMasterSeed(seedWordArray: CryptoJSBytes): Secp256k1HDKey; static fromMasterSeedHex(seedHex: string): Secp256k1HDKey; static fromPublicKeyAndChainCode(publicKey: any, chainCode: any): Secp256k1HDKey; static fromPrivateKeyAndChainCode(privateKey: BN, chainCode: any): Secp256k1HDKey; static fromExtendedKey(base58key: string): Secp256k1HDKey; private static serialize; private static hash160; }