ethers.js/lib.esm/wallet/base-wallet.d.ts

48 lines
1.7 KiB
TypeScript
Raw Normal View History

2022-09-05 23:57:11 +03:00
import { AbstractSigner } from "../providers/index.js";
import type { SigningKey } from "../crypto/index.js";
import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
import type { Provider, TransactionRequest } from "../providers/index.js";
2022-11-30 23:44:23 +03:00
/**
* The **BaseWallet** is a stream-lined implementation of a
* [[Signer]] that operates with a private key.
*
* It is preferred to use the [[Wallet]] class, as it offers
* additional functionality and simplifies loading a variety
* of JSON formats, Mnemonic Phrases, etc.
*
* This class may be of use for those attempting to implement
* a minimal Signer.
*/
2022-09-05 23:57:11 +03:00
export declare class BaseWallet extends AbstractSigner {
#private;
2022-11-30 23:44:23 +03:00
/**
* The wallet address.
*/
2022-09-05 23:57:11 +03:00
readonly address: string;
2022-11-30 23:44:23 +03:00
/**
* Creates a new BaseWallet for %%privateKey%%, optionally
* connected to %%provider%%.
*
* If %%provider%% is not specified, only offline methods can
* be used.
*/
2022-09-05 23:57:11 +03:00
constructor(privateKey: SigningKey, provider?: null | Provider);
2022-11-30 23:44:23 +03:00
/**
* The [[SigningKey]] used for signing payloads.
*/
2022-09-05 23:57:11 +03:00
get signingKey(): SigningKey;
2022-11-30 23:44:23 +03:00
/**
* The private key for this wallet.
*/
2022-09-05 23:57:11 +03:00
get privateKey(): string;
getAddress(): Promise<string>;
connect(provider: null | Provider): BaseWallet;
2022-10-20 12:03:32 +03:00
signTransaction(tx: TransactionRequest): Promise<string>;
2022-09-05 23:57:11 +03:00
signMessage(message: string | Uint8Array): Promise<string>;
2022-11-30 23:44:23 +03:00
/**
* Returns the signature for %%message%% signed with this wallet.
*/
2022-10-20 12:03:32 +03:00
signMessageSync(message: string | Uint8Array): string;
2022-09-05 23:57:11 +03:00
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
}
//# sourceMappingURL=base-wallet.d.ts.map