ethers.js/packages/wallet/lib/index.d.ts

31 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
import { Provider, TransactionRequest } from "@ethersproject/abstract-provider";
import { ExternallyOwnedAccount, Signer } from "@ethersproject/abstract-signer";
import { Bytes, BytesLike, SignatureLike } from "@ethersproject/bytes";
2020-01-18 21:48:12 -05:00
import { Mnemonic } from "@ethersproject/hdnode";
2019-05-14 18:48:48 -04:00
import { SigningKey } from "@ethersproject/signing-key";
import { ProgressCallback } from "@ethersproject/json-wallets";
import { Wordlist } from "@ethersproject/wordlists";
2019-05-14 18:48:48 -04:00
export declare class Wallet extends Signer implements ExternallyOwnedAccount {
readonly address: string;
readonly provider: Provider;
readonly _signingKey: () => SigningKey;
2020-01-18 21:48:12 -05:00
readonly _mnemonic: () => Mnemonic;
2019-05-14 18:48:48 -04:00
constructor(privateKey: BytesLike | ExternallyOwnedAccount | SigningKey, provider?: Provider);
get mnemonic(): Mnemonic;
get privateKey(): string;
get publicKey(): string;
2019-05-14 18:48:48 -04:00
getAddress(): Promise<string>;
connect(provider: Provider): Wallet;
signTransaction(transaction: TransactionRequest): Promise<string>;
signMessage(message: Bytes | string): Promise<string>;
encrypt(password: Bytes | string, options?: any, progressCallback?: ProgressCallback): Promise<string>;
/**
* Static methods to create Wallet instances.
*/
static createRandom(options?: any): Wallet;
static fromEncryptedJson(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise<Wallet>;
2020-02-27 19:58:05 +00:00
static fromEncryptedJsonSync(json: string, password: Bytes | string): Wallet;
2019-05-14 18:48:48 -04:00
static fromMnemonic(mnemonic: string, path?: string, wordlist?: Wordlist): Wallet;
}
export declare function verifyMessage(message: Bytes | string, signature: SignatureLike): string;