UNPKG

@okxweb3/crypto-lib

Version:

A base package for @okxweb3/coin-*

47 lines (46 loc) 1.7 kB
/// <reference types="node" /> export declare const tinySecp256k1Interface: { isPoint: (p: Uint8Array) => boolean; pointCompress: (p: Uint8Array, compressed?: boolean) => Uint8Array; isPrivate: (d: Uint8Array) => boolean; pointFromScalar: (d: Uint8Array, compressed?: boolean) => Uint8Array | null; sign: (h: Uint8Array, d: Uint8Array, e?: Uint8Array) => Uint8Array; verify: (h: Uint8Array, Q: Uint8Array, signature: Uint8Array, strict?: boolean) => boolean; }; interface Network { wif: number; bip32: { public: number; private: number; }; messagePrefix?: string; bech32?: string; pubKeyHash?: number; scriptHash?: number; } export interface BIP32Interface { chainCode: Buffer; network: Network; lowR: boolean; depth: number; index: number; parentFingerprint: number; publicKey: Buffer; privateKey?: Buffer; identifier: Buffer; fingerprint: Buffer; isNeutered(): boolean; neutered(): BIP32Interface; toBase58(): string; toWIF(): string; derive(index: number): BIP32Interface; deriveHardened(index: number): BIP32Interface; derivePath(path: string): BIP32Interface; sign(hash: Buffer): Buffer; verify(hash: Buffer, signature: Buffer): boolean; } export declare function fromBase58(inString: string, network?: Network): BIP32Interface; export declare function fromPrivateKey(privateKey: Buffer, chainCode: Buffer, network?: Network): BIP32Interface; export declare function fromPublicKey(publicKey: Buffer, chainCode: Buffer, network?: Network): BIP32Interface; export declare function fromSeed(seed: Buffer, network?: Network): BIP32Interface; export {};