ethers.js/src.ts/providers/contracts.ts

22 lines
841 B
TypeScript
Raw Normal View History

2022-09-05 23:14:43 +03:00
import type {
Provider, TransactionRequest, TransactionResponse
2022-09-05 23:14:43 +03:00
} from "./provider.js";
// The object that will be used to run Contracts. The Signer and Provider
// both adhere to this, but other types of objects may wish to as well.
export interface ContractRunner {
provider: null | Provider;
// Required to estimate gas; usually a Signer or Provider
estimateGas?: (tx: TransactionRequest) => Promise<bigint>;
// Required for pure, view or static calls to contracts; usually a Signer or Provider
call?: (tx: TransactionRequest) => Promise<string>;
2022-09-05 23:14:43 +03:00
// Required to support ENS names; usually a Signer or Provider
resolveName?: (name: string) => Promise<null | string>;
// Required for mutating calls; usually a Signer
sendTransaction?: (tx: TransactionRequest) => Promise<TransactionResponse>;
}