ethers.js/packages/providers/src.ts/signer.ts

24 lines
999 B
TypeScript
Raw Permalink Normal View History

2022-04-11 17:09:17 -04:00
import type { Addressable, NameResolver } from "@ethersproject/address";
import type { TypedDataDomain, TypedDataField } from "@ethersproject/hash";
import type { ContractRunner } from "./contracts.js";
2022-04-11 17:09:17 -04:00
import type { CallRequest, Provider, TransactionRequest, TransactionResponse } from "./provider.js";
export interface Signer extends Addressable, ContractRunner, NameResolver {
2022-04-11 17:09:17 -04:00
provider: null | Provider;
connect(provider: null | Provider): Signer;
// Execution
estimateGas(tx: CallRequest): Promise<bigint>;
call(tx: CallRequest): Promise<string>;
resolveName(name: string | Addressable): Promise<null | string>;
// Signing
signTransaction(tx: TransactionRequest): Promise<string>;
sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
signMessage(message: string | Uint8Array): Promise<string>;
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
}