UNPKG

chaingate

Version:

A complete TypeScript library for connecting to and making transactions on different blockchains

25 lines (24 loc) 851 B
import { Encrypted } from './Encrypted'; export type Encrypt = { password: string; askForPassword: (attempts: number, reject: () => void) => Promise<string>; }; export declare class WalletIsNotEncrypted extends Error { constructor(); } export declare class WalletIncorrectPassword extends Error { constructor(); } export declare class EncodingError extends Error { constructor(message: string); } export declare class WalletEncryption { private askForPassword; private _secret; warnAboutUnencrypted: boolean; get isEncrypted(): boolean; constructor(secret: Uint8Array | Encrypted, askForPassword?: (attempts: number, reject: () => void) => Promise<string>); encrypt(password: string): Promise<void>; getSecret(): Uint8Array<ArrayBufferLike> | Encrypted; getSecretDecrypted(): Promise<Uint8Array>; }