2023-03-03 18:25:07 -07:00
|
|
|
import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js";
|
2023-06-01 17:52:58 -04: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-03 18:25:07 -07:00
|
|
|
export interface ContractRunner {
|
2023-06-01 17:52:58 -04: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-03 18:25:07 -07:00
|
|
|
provider: null | Provider;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Required to estimate gas.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
estimateGas?: (tx: TransactionRequest) => Promise<bigint>;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Required for pure, view or static calls to contracts.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
call?: (tx: TransactionRequest) => Promise<string>;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Required to support ENS names
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
resolveName?: (name: string) => Promise<null | string>;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Required for state mutating calls
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
sendTransaction?: (tx: TransactionRequest) => Promise<TransactionResponse>;
|
|
|
|
}
|
2023-04-27 21:19:55 +09:00
|
|
|
//# sourceMappingURL=contracts.d.ts.map
|