cipher-ethereum
Version:
An Ethereum library used by Cipher Browser, a mobile Ethereum client
48 lines (47 loc) • 1.41 kB
TypeScript
/// <reference types="node" />
export interface VersionBytes {
bip32: {
public: number;
private: number;
};
public: number;
}
export declare const HDKEY_VERSIONS: {
[key: string]: VersionBytes;
};
export interface HDKeyConstructorOptions {
chainCode: Buffer;
privateKey?: Buffer | null;
publicKey?: Buffer | null;
index?: number;
depth?: number;
parentFingerprint?: Buffer;
version?: VersionBytes;
}
export declare class HDKey {
private _version;
private _privateKey?;
private _publicKey;
private _chainCode;
private _index;
private _depth;
private _parentFingerprint?;
private _keyIdentifier;
constructor({ privateKey, publicKey, chainCode, index, depth, parentFingerprint, version }: HDKeyConstructorOptions);
static parseMasterSeed(seed: Buffer, version?: VersionBytes): HDKey;
static parseExtendedKey(key: string, version?: VersionBytes): HDKey;
get privateKey(): Buffer | null;
get publicKey(): Buffer;
get chainCode(): Buffer;
get depth(): number;
get parentFingerprint(): Buffer | null;
get index(): number;
get keyIdentifier(): Buffer;
get fingerprint(): Buffer;
get version(): VersionBytes;
get extendedPrivateKey(): string | null;
get extendedPublicKey(): string;
derive(chain: string): HDKey;
private deriveChildKey;
private serialize;
}