ethers.js/lib.commonjs/providers/contracts.d.ts

36 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-03-04 04:25:07 +03:00
import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js";
2023-06-02 00:52:58 +03:00
/**
* A **ContractRunner** is a generic interface which defines an object
* capable of interacting with a Contract on the network.
*
* The more operations supported, the more utility it is capable of.
*
* The most common ContractRunners are [Providers](Provider) which enable
* read-only access and [Signers](Signer) which enable write-access.
*/
2023-03-04 04:25:07 +03:00
export interface ContractRunner {
2023-06-02 00:52:58 +03:00
/**
* The provider used for necessary state querying operations.
*
* This can also point to the **ContractRunner** itself, in the
* case of an [[AbstractProvider]].
*/
2023-03-04 04:25:07 +03:00
provider: null | Provider;
2023-06-02 00:52:58 +03:00
/**
* Required to estimate gas.
*/
2023-03-04 04:25:07 +03:00
estimateGas?: (tx: TransactionRequest) => Promise<bigint>;
2023-06-02 00:52:58 +03:00
/**
* Required for pure, view or static calls to contracts.
*/
2023-03-04 04:25:07 +03:00
call?: (tx: TransactionRequest) => Promise<string>;
2023-06-02 00:52:58 +03:00
/**
* Required to support ENS names
*/
2023-03-04 04:25:07 +03:00
resolveName?: (name: string) => Promise<null | string>;
2023-06-02 00:52:58 +03:00
/**
* Required for state mutating calls
*/
2023-03-04 04:25:07 +03:00
sendTransaction?: (tx: TransactionRequest) => Promise<TransactionResponse>;
}
//# sourceMappingURL=contracts.d.ts.map