@safeheron/crypto-bip32
Version:
HDKey in js(embrace bip32-secp256k1, bip32-ed25519)
44 lines (43 loc) • 1.44 kB
TypeScript
import * as BN from 'bn.js';
import { CryptoJSBytes } from "@safeheron/crypto-utils";
export declare class P256HDKey {
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): P256HDKey;
deriveChild(index: number): P256HDKey;
publicDerive(path: string): [P256HDKey, BN];
publicDeriveChild(index: number): [P256HDKey, BN];
sign(hash: number[]): number[];
verify(hash: number[], signature: []): boolean;
static fromMasterSeed(seedWordArray: CryptoJSBytes): P256HDKey;
static fromMasterSeedHex(seedHex: string): P256HDKey;
static fromPublicKeyAndChainCode(publicKey: any, chainCode: any): P256HDKey;
static fromPrivateKeyAndChainCode(privateKey: BN, chainCode: any): P256HDKey;
static fromExtendedKey(base58key: string): P256HDKey;
private static serialize;
private static hash160;
}