UNPKG

dimension-js-sdk

Version:
47 lines (46 loc) 1.29 kB
/// <reference types="node" /> import { HDKeyT } from 'ethereum-cryptography/pure/hdkey'; import { Secp256K1 } from './Keys'; export declare class DimensionHDKey { private hdKey; private readonly bip44Index; constructor(hdKey: HDKeyT); private bip44Path; /** * Generate HDKey from master seed * @param seed */ static fromMasterSeed(seed: Uint8Array): DimensionHDKey; publicKey(): Buffer | null; privateKey(): Buffer | null; privateExtendedKey(): string; publicExtendedKey(): string; /** * Derive the child key basing the path * @param path */ derive(path: string): Secp256K1; /** * Derive child key basing the bip44 protocol * @param index the index of child key */ deriveIndex(index: number): Secp256K1; /** * Generate the signature for the message by using the key * @param msg The message to sign */ sign(msg: Uint8Array): Buffer; /** * Verify the signature * @param signature the signature generated for the msg * @param msg the raw message */ verify(signature: Uint8Array, msg: Uint8Array): boolean; /** * Get the JSON representation of the wallet */ toJSON(): { xpriv: string; xpub: string; }; }