contracts.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js";
  2. /**
  3. * A **ContractRunner** is a generic interface which defines an object
  4. * capable of interacting with a Contract on the network.
  5. *
  6. * The more operations supported, the more utility it is capable of.
  7. *
  8. * The most common ContractRunners are [Providers](Provider) which enable
  9. * read-only access and [Signers](Signer) which enable write-access.
  10. */
  11. export interface ContractRunner {
  12. /**
  13. * The provider used for necessary state querying operations.
  14. *
  15. * This can also point to the **ContractRunner** itself, in the
  16. * case of an [[AbstractProvider]].
  17. */
  18. provider: null | Provider;
  19. /**
  20. * Required to estimate gas.
  21. */
  22. estimateGas?: (tx: TransactionRequest) => Promise<bigint>;
  23. /**
  24. * Required for pure, view or static calls to contracts.
  25. */
  26. call?: (tx: TransactionRequest) => Promise<string>;
  27. /**
  28. * Required to support ENS names
  29. */
  30. resolveName?: (name: string) => Promise<null | string>;
  31. /**
  32. * Required for state mutating calls
  33. */
  34. sendTransaction?: (tx: TransactionRequest) => Promise<TransactionResponse>;
  35. }
  36. //# sourceMappingURL=contracts.d.ts.map