2
0
mirror of synced 2025-02-25 04:25:16 +00:00

35 lines
1.3 KiB
TypeScript
Raw Normal View History

2019-05-14 18:48:48 -04:00
import { ExternallyOwnedAccount } from "@ethersproject/abstract-signer";
import { Bytes, BytesLike } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
2020-01-07 19:58:04 -05:00
interface _KeystoreAccount {
address: string;
privateKey: string;
mnemonic?: string;
path?: string;
_isKeystoreAccount: boolean;
}
export declare class KeystoreAccount extends Description<_KeystoreAccount> implements ExternallyOwnedAccount {
2019-05-14 18:48:48 -04:00
readonly address: string;
readonly privateKey: string;
readonly mnemonic?: string;
readonly path?: string;
2019-06-11 17:57:04 -04:00
readonly _isKeystoreAccount: boolean;
isKeystoreAccount(value: any): value is KeystoreAccount;
2019-05-14 18:48:48 -04:00
}
export declare type ProgressCallback = (percent: number) => void;
export declare type EncryptOptions = {
iv?: BytesLike;
entropy?: BytesLike;
client?: string;
salt?: BytesLike;
uuid?: string;
scrypt?: {
N?: number;
r?: number;
p?: number;
};
};
export declare function decrypt(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise<KeystoreAccount>;
export declare function encrypt(account: ExternallyOwnedAccount, password: Bytes | string, options?: EncryptOptions, progressCallback?: ProgressCallback): Promise<string>;
2020-01-07 19:58:04 -05:00
export {};