ethers.js/packages/wallet/lib/json-keystore.d.ts

37 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2022-04-11 17:14:19 -04:00
import type { ProgressCallback } from "@ethersproject/crypto";
import type { BytesLike } from "@ethersproject/logger";
export declare type KeystoreAccountParams = {
privateKey: string;
address?: string;
mnemonic?: {
entropy: string;
path: string;
locale: string;
};
};
export declare type KeystoreAccount = {
address: string;
privateKey: string;
mnemonic?: {
entropy: string;
path: string;
locale: string;
};
};
export declare type EncryptOptions = {
iv?: BytesLike;
entropy?: BytesLike;
client?: string;
salt?: BytesLike;
uuid?: string;
scrypt?: {
N?: number;
r?: number;
p?: number;
};
};
export declare function isKeystoreJson(json: string): boolean;
export declare function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount;
export declare function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise<KeystoreAccount>;
export declare function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions, progressCallback?: ProgressCallback): Promise<string>;
//# sourceMappingURL=json-keystore.d.ts.map