@circle-fin/usdckit - v0.18.0
    Preparing search index...

    Function getContract

    • Retrieves a contract instance using the provided address, ABI, and client.

      Parameters

      Returns
          | {
              abi: Abi;
              address: `0x${string}`;
              createEventFilter: {
                  [key: string]: <strict extends undefined | boolean = undefined>(
                      ...parameters:
                          | [
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  strict?: undefined;
                                  toBlock?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ],
                  ) => Promise<CreateContractEventFilterReturnType>;
              };
              estimateGas: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              } & {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              };
              getEvents: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ]
                          | [
                              args?: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ],
                  ) => Promise<GetContractEventsReturnType<Abi, string>>;
              };
              read: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<unknown>;
              };
              simulate: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain = undefined,
                      accountOverride extends undefined | `0x${string}` | Account = undefined,
                  >(
                      ...parameters:
                          | [
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      undefined
                                      | Chain,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      undefined
                                      | Chain,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ],
                  ) => Promise<SimulateContractReturnType>;
              };
              watchEvent: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ],
                  ) => WatchContractEventReturnType;
              };
              write: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain,
                      options extends
                          {
                              [K in string | number | symbol]: UnionOmit<
                                  WriteContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      undefined
                                      | Chain,
                                      undefined | Account,
                                      chainOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >[K]
                          },
                      Rest extends unknown[] = [options: options],
                  >(
                      ...parameters:
                          | Rest
                          | [args: readonly unknown[], ...parameters: Rest[]],
                  ) => Promise<`0x${string}`>;
              };
          }
          | {
              abi: Abi;
              address: `0x${string}`;
              createEventFilter: {
                  [key: string]: <strict extends undefined | boolean = undefined>(
                      ...parameters:
                          | [
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  strict?: undefined;
                                  toBlock?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ],
                  ) => Promise<CreateContractEventFilterReturnType>;
              };
              estimateGas: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              } & {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              };
              getEvents: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ]
                          | [
                              args?: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ],
                  ) => Promise<GetContractEventsReturnType<Abi, string>>;
              };
              read: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<unknown>;
              };
              simulate: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain = undefined,
                      accountOverride extends undefined | `0x${string}` | Account = undefined,
                  >(
                      ...parameters:
                          | [
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      undefined
                                      | Chain,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      undefined
                                      | Chain,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ],
                  ) => Promise<SimulateContractReturnType>;
              };
              watchEvent: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ],
                  ) => WatchContractEventReturnType;
              };
              write: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain,
                      options extends
                          {
                              [K in string | number | symbol]: UnionOmit<
                                  WriteContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      {
                                          blockExplorers?: (...)
                                          | (...);
                                          blockTime?: (...) | (...);
                                          contracts?: (...) | (...);
                                          ensTlds?: (...) | (...);
                                          id: number;
                                          name: string;
                                          nativeCurrency: ChainNativeCurrency;
                                          rpcUrls: { default: ...; [key: ...]: ... };
                                          sourceId?: (...) | (...);
                                          testnet?: (...) | (...) | (...);
                                      } & ChainConfig<(...) | (...), (...) | (...)>,
                                      undefined | Account,
                                      chainOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >[K]
                          },
                      Rest extends unknown[] = [options: options],
                  >(
                      ...parameters:
                          | Rest
                          | [args: readonly unknown[], ...parameters: Rest[]],
                  ) => Promise<`0x${string}`>;
              };
          }
          | {
              abi: Abi;
              address: `0x${string}`;
              createEventFilter: {
                  [key: string]: <strict extends undefined | boolean = undefined>(
                      ...parameters:
                          | [
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  strict?: undefined;
                                  toBlock?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ],
                  ) => Promise<CreateContractEventFilterReturnType>;
              };
              estimateGas: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              } & {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) | (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              };
              getEvents: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ]
                          | [
                              args?: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ],
                  ) => Promise<GetContractEventsReturnType<Abi, string>>;
              };
              read: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<unknown>;
              };
              simulate: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain = undefined,
                      accountOverride extends undefined | `0x${string}` | Account = undefined,
                  >(
                      ...parameters:
                          | [
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      {
                                          blockExplorers?: ...;
                                          blockTime?: ...;
                                          contracts?: ...;
                                          ensTlds?: ...;
                                          id: ...;
                                          name: ...;
                                          nativeCurrency: ...;
                                          rpcUrls: ...;
                                          sourceId?: ...;
                                          testnet?: ...;
                                      } & ChainConfig<(...), (...)>,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      {
                                          blockExplorers?: ...;
                                          blockTime?: ...;
                                          contracts?: ...;
                                          ensTlds?: ...;
                                          id: ...;
                                          name: ...;
                                          nativeCurrency: ...;
                                          rpcUrls: ...;
                                          sourceId?: ...;
                                          testnet?: ...;
                                      } & ChainConfig<(...), (...)>,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ],
                  ) => Promise<SimulateContractReturnType>;
              };
              watchEvent: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ],
                  ) => WatchContractEventReturnType;
              };
              write: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain,
                      options extends
                          {
                              [K in string | number | symbol]: UnionOmit<
                                  WriteContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      undefined
                                      | Chain,
                                      undefined | Account,
                                      chainOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >[K]
                          },
                      Rest extends unknown[] = [options: options],
                  >(
                      ...parameters:
                          | Rest
                          | [args: readonly unknown[], ...parameters: Rest[]],
                  ) => Promise<`0x${string}`>;
              };
          }
          | {
              abi: Abi;
              address: `0x${string}`;
              createEventFilter: {
                  [key: string]: <strict extends undefined | boolean = undefined>(
                      ...parameters:
                          | [
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  strict?: undefined;
                                  toBlock?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  fromBlock?: bigint
                                  | BlockTag;
                                  toBlock?: bigint | BlockTag;
                              } & { strict?: strict },
                          ],
                  ) => Promise<CreateContractEventFilterReturnType>;
              };
              estimateGas: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              } & {
                  [key: string]: (
                      ...parameters:
                          | [
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options: Prettify<
                                  UnionOmit<
                                      EstimateContractGasParameters<
                                          Abi,
                                          string,
                                          readonly (...)[],
                                          (...) & (...),
                                      >,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<bigint>;
              };
              getEvents: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ]
                          | [
                              args?: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  blockHash?: `0x${string}`;
                                  fromBlock?: bigint
                                  | BlockTag;
                                  strict?: boolean;
                                  toBlock?: bigint | BlockTag;
                              },
                          ],
                  ) => Promise<GetContractEventsReturnType<Abi, string>>;
              };
              read: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Prettify<
                                  UnionOmit<
                                      ReadContractParameters<Abi, string, readonly (...)[]>,
                                      "address" | "abi" | "functionName" | "args",
                                  >,
                              >,
                          ],
                  ) => Promise<unknown>;
              };
              simulate: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain = undefined,
                      accountOverride extends undefined | `0x${string}` | Account = undefined,
                  >(
                      ...parameters:
                          | [
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      {
                                          blockExplorers?: ...;
                                          blockTime?: ...;
                                          contracts?: ...;
                                          ensTlds?: ...;
                                          id: ...;
                                          name: ...;
                                          nativeCurrency: ...;
                                          rpcUrls: ...;
                                          sourceId?: ...;
                                          testnet?: ...;
                                      } & ChainConfig<(...), (...)>,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ]
                          | [
                              args: readonly unknown[],
                              options?: Omit<
                                  SimulateContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      {
                                          blockExplorers?: ...;
                                          blockTime?: ...;
                                          contracts?: ...;
                                          ensTlds?: ...;
                                          id: ...;
                                          name: ...;
                                          nativeCurrency: ...;
                                          rpcUrls: ...;
                                          sourceId?: ...;
                                          testnet?: ...;
                                      } & ChainConfig<(...), (...)>,
                                      chainOverride,
                                      accountOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          ],
                  ) => Promise<SimulateContractReturnType>;
              };
              watchEvent: {
                  [key: string]: (
                      ...parameters:
                          | [
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ]
                          | [
                              args: | readonly unknown[]
                              | {
                                  abi?: undefined;
                                  address?: undefined;
                                  args?: undefined;
                                  batch?: undefined;
                                  eventName?: undefined;
                                  fromBlock?: undefined;
                                  onError?: undefined;
                                  onLogs?: undefined;
                                  poll?: undefined;
                                  pollingInterval?: undefined;
                                  strict?: undefined;
                                  [key: string]: unknown;
                              },
                              options?: {
                                  batch?: boolean;
                                  fromBlock?: bigint;
                                  onError?: (error: Error) => void;
                                  onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                  poll?: true;
                                  pollingInterval?: number;
                                  strict?: boolean;
                              },
                          ],
                  ) => WatchContractEventReturnType;
              };
              write: {
                  [key: string]: <
                      chainOverride extends undefined
                      | Chain,
                      options extends
                          {
                              [K in string | number | symbol]: UnionOmit<
                                  WriteContractParameters<
                                      Abi,
                                      string,
                                      readonly unknown[],
                                      {
                                          blockExplorers?: (...)
                                          | (...);
                                          blockTime?: (...) | (...);
                                          contracts?: (...) | (...);
                                          ensTlds?: (...) | (...);
                                          id: number;
                                          name: string;
                                          nativeCurrency: ChainNativeCurrency;
                                          rpcUrls: { default: ...; [key: ...]: ... };
                                          sourceId?: (...) | (...);
                                          testnet?: (...) | (...) | (...);
                                      } & ChainConfig<(...) | (...), (...) | (...)>,
                                      undefined | Account,
                                      chainOverride,
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >[K]
                          },
                      Rest extends unknown[] = [options: options],
                  >(
                      ...parameters:
                          | Rest
                          | [args: readonly unknown[], ...parameters: Rest[]],
                  ) => Promise<`0x${string}`>;
              };
          }

      The contract instance.

      • {
            abi: Abi;
            address: `0x${string}`;
            createEventFilter: {
                [key: string]: <strict extends undefined | boolean = undefined>(
                    ...parameters:
                        | [
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                strict?: undefined;
                                toBlock?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ],
                ) => Promise<CreateContractEventFilterReturnType>;
            };
            estimateGas: {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            } & {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            };
            getEvents: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ]
                        | [
                            args?: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ],
                ) => Promise<GetContractEventsReturnType<Abi, string>>;
            };
            read: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<unknown>;
            };
            simulate: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain = undefined,
                    accountOverride extends undefined | `0x${string}` | Account = undefined,
                >(
                    ...parameters:
                        | [
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    undefined
                                    | Chain,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    undefined
                                    | Chain,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ],
                ) => Promise<SimulateContractReturnType>;
            };
            watchEvent: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ],
                ) => WatchContractEventReturnType;
            };
            write: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain,
                    options extends
                        {
                            [K in string | number | symbol]: UnionOmit<
                                WriteContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    undefined
                                    | Chain,
                                    undefined | Account,
                                    chainOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >[K]
                        },
                    Rest extends unknown[] = [options: options],
                >(
                    ...parameters:
                        | Rest
                        | [args: readonly unknown[], ...parameters: Rest[]],
                ) => Promise<`0x${string}`>;
            };
        }
        • abi: Abi
        • address: `0x${string}`
        • createEventFilter: {
              [key: string]: <strict extends undefined | boolean = undefined>(
                  ...parameters:
                      | [
                          options?: {
                              fromBlock?: bigint
                              | BlockTag;
                              toBlock?: bigint | BlockTag;
                          } & { strict?: strict },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              strict?: undefined;
                              toBlock?: undefined;
                              [key: string]: unknown;
                          },
                          options?: { fromBlock?: bigint
                          | BlockTag; toBlock?: bigint | BlockTag } & { strict?: strict },
                      ],
              ) => Promise<CreateContractEventFilterReturnType>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • estimateGas: {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          } & {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          }

          Estimates the gas necessary to complete a transaction without submitting it to the network.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const gas = await contract.estimateGas.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • getEvents: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ]
                      | [
                          args?: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ],
              ) => Promise<GetContractEventsReturnType<Abi, string>>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • read: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<unknown>;
          }

          Calls a read-only function on a contract, and returns the response.

          A "read-only" function (constant function) on a Solidity contract is denoted by a view or pure keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.

          Internally, read uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi([
          'function balanceOf(address owner) view returns (uint256)',
          ]),
          client: publicClient,
          })
          const result = await contract.read.balanceOf(['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'])
          // 424122n
        • simulate: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain = undefined,
                  accountOverride extends undefined | `0x${string}` | Account = undefined,
              >(
                  ...parameters:
                      | [
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  undefined
                                  | Chain,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  undefined
                                  | Chain,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ],
              ) => Promise<SimulateContractReturnType>;
          }

          Simulates/validates a contract interaction. This is useful for retrieving return data and revert reasons of contract write functions.

          This function does not require gas to execute and does not change the state of the blockchain. It is almost identical to readContract, but also supports contract write functions.

          Internally, simulate uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const result = await contract.simulate.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • watchEvent: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ],
              ) => WatchContractEventReturnType;
          }

          Watches and returns emitted contract event logs.

          This Action will batch up all the event logs found within the pollingInterval, and invoke them via onLogs.

          watchEvent will attempt to create an Event Filter and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. eth_newFilter), then watchEvent will fall back to using getLogs instead.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
          const unwatch = contract.watchEvent.Transfer(
          { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },
          { onLogs: (logs) => console.log(logs) },
          )
        • write: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain,
                  options extends
                      {
                          [K in string | number | symbol]: UnionOmit<
                              WriteContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  undefined
                                  | Chain,
                                  undefined | Account,
                                  chainOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >[K]
                      },
                  Rest extends unknown[] = [options: options],
              >(
                  ...parameters: Rest | [args: readonly unknown[], ...parameters: Rest[]],
              ) => Promise<`0x${string}`>;
          }

          Executes a write function on a contract.

          A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a Transaction is needed to be broadcast in order to change the state.

          Internally, write uses a Wallet Client to call the sendTransaction action with ABI-encoded data.

          Warning: The write internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to simulate the contract write with contract.simulate before you execute it.

          import { createWalletClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const walletClient = createWalletClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
          client: walletClient,
          })
          const hash = await contract.write.min([69420], {
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          })
      • {
            abi: Abi;
            address: `0x${string}`;
            createEventFilter: {
                [key: string]: <strict extends undefined | boolean = undefined>(
                    ...parameters:
                        | [
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                strict?: undefined;
                                toBlock?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ],
                ) => Promise<CreateContractEventFilterReturnType>;
            };
            estimateGas: {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            } & {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            };
            getEvents: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ]
                        | [
                            args?: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ],
                ) => Promise<GetContractEventsReturnType<Abi, string>>;
            };
            read: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<unknown>;
            };
            simulate: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain = undefined,
                    accountOverride extends undefined | `0x${string}` | Account = undefined,
                >(
                    ...parameters:
                        | [
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    undefined
                                    | Chain,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    undefined
                                    | Chain,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ],
                ) => Promise<SimulateContractReturnType>;
            };
            watchEvent: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ],
                ) => WatchContractEventReturnType;
            };
            write: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain,
                    options extends
                        {
                            [K in string | number | symbol]: UnionOmit<
                                WriteContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    {
                                        blockExplorers?: (...)
                                        | (...);
                                        blockTime?: (...) | (...);
                                        contracts?: (...) | (...);
                                        ensTlds?: (...) | (...);
                                        id: number;
                                        name: string;
                                        nativeCurrency: ChainNativeCurrency;
                                        rpcUrls: { default: ...; [key: ...]: ... };
                                        sourceId?: (...) | (...);
                                        testnet?: (...) | (...) | (...);
                                    } & ChainConfig<(...) | (...), (...) | (...)>,
                                    undefined | Account,
                                    chainOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >[K]
                        },
                    Rest extends unknown[] = [options: options],
                >(
                    ...parameters:
                        | Rest
                        | [args: readonly unknown[], ...parameters: Rest[]],
                ) => Promise<`0x${string}`>;
            };
        }
        • abi: Abi
        • address: `0x${string}`
        • createEventFilter: {
              [key: string]: <strict extends undefined | boolean = undefined>(
                  ...parameters:
                      | [
                          options?: {
                              fromBlock?: bigint
                              | BlockTag;
                              toBlock?: bigint | BlockTag;
                          } & { strict?: strict },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              strict?: undefined;
                              toBlock?: undefined;
                              [key: string]: unknown;
                          },
                          options?: { fromBlock?: bigint
                          | BlockTag; toBlock?: bigint | BlockTag } & { strict?: strict },
                      ],
              ) => Promise<CreateContractEventFilterReturnType>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • estimateGas: {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          } & {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          }

          Estimates the gas necessary to complete a transaction without submitting it to the network.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const gas = await contract.estimateGas.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • getEvents: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ]
                      | [
                          args?: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ],
              ) => Promise<GetContractEventsReturnType<Abi, string>>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • read: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<unknown>;
          }

          Calls a read-only function on a contract, and returns the response.

          A "read-only" function (constant function) on a Solidity contract is denoted by a view or pure keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.

          Internally, read uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi([
          'function balanceOf(address owner) view returns (uint256)',
          ]),
          client: publicClient,
          })
          const result = await contract.read.balanceOf(['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'])
          // 424122n
        • simulate: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain = undefined,
                  accountOverride extends undefined | `0x${string}` | Account = undefined,
              >(
                  ...parameters:
                      | [
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  undefined
                                  | Chain,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  undefined
                                  | Chain,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ],
              ) => Promise<SimulateContractReturnType>;
          }

          Simulates/validates a contract interaction. This is useful for retrieving return data and revert reasons of contract write functions.

          This function does not require gas to execute and does not change the state of the blockchain. It is almost identical to readContract, but also supports contract write functions.

          Internally, simulate uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const result = await contract.simulate.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • watchEvent: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ],
              ) => WatchContractEventReturnType;
          }

          Watches and returns emitted contract event logs.

          This Action will batch up all the event logs found within the pollingInterval, and invoke them via onLogs.

          watchEvent will attempt to create an Event Filter and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. eth_newFilter), then watchEvent will fall back to using getLogs instead.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
          const unwatch = contract.watchEvent.Transfer(
          { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },
          { onLogs: (logs) => console.log(logs) },
          )
        • write: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain,
                  options extends
                      {
                          [K in string | number | symbol]: UnionOmit<
                              WriteContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  {
                                      blockExplorers?: (...)
                                      | (...);
                                      blockTime?: (...) | (...);
                                      contracts?: (...) | (...);
                                      ensTlds?: (...) | (...);
                                      id: number;
                                      name: string;
                                      nativeCurrency: ChainNativeCurrency;
                                      rpcUrls: { default: ...; [key: ...]: ... };
                                      sourceId?: (...) | (...);
                                      testnet?: (...) | (...) | (...);
                                  } & ChainConfig<(...) | (...), (...) | (...)>,
                                  undefined | Account,
                                  chainOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >[K]
                      },
                  Rest extends unknown[] = [options: options],
              >(
                  ...parameters: Rest | [args: readonly unknown[], ...parameters: Rest[]],
              ) => Promise<`0x${string}`>;
          }

          Executes a write function on a contract.

          A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a Transaction is needed to be broadcast in order to change the state.

          Internally, write uses a Wallet Client to call the sendTransaction action with ABI-encoded data.

          Warning: The write internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to simulate the contract write with contract.simulate before you execute it.

          import { createWalletClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const walletClient = createWalletClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
          client: walletClient,
          })
          const hash = await contract.write.min([69420], {
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          })
      • {
            abi: Abi;
            address: `0x${string}`;
            createEventFilter: {
                [key: string]: <strict extends undefined | boolean = undefined>(
                    ...parameters:
                        | [
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                strict?: undefined;
                                toBlock?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ],
                ) => Promise<CreateContractEventFilterReturnType>;
            };
            estimateGas: {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            } & {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) | (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            };
            getEvents: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ]
                        | [
                            args?: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ],
                ) => Promise<GetContractEventsReturnType<Abi, string>>;
            };
            read: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<unknown>;
            };
            simulate: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain = undefined,
                    accountOverride extends undefined | `0x${string}` | Account = undefined,
                >(
                    ...parameters:
                        | [
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    {
                                        blockExplorers?: ...;
                                        blockTime?: ...;
                                        contracts?: ...;
                                        ensTlds?: ...;
                                        id: ...;
                                        name: ...;
                                        nativeCurrency: ...;
                                        rpcUrls: ...;
                                        sourceId?: ...;
                                        testnet?: ...;
                                    } & ChainConfig<(...), (...)>,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    {
                                        blockExplorers?: ...;
                                        blockTime?: ...;
                                        contracts?: ...;
                                        ensTlds?: ...;
                                        id: ...;
                                        name: ...;
                                        nativeCurrency: ...;
                                        rpcUrls: ...;
                                        sourceId?: ...;
                                        testnet?: ...;
                                    } & ChainConfig<(...), (...)>,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ],
                ) => Promise<SimulateContractReturnType>;
            };
            watchEvent: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ],
                ) => WatchContractEventReturnType;
            };
            write: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain,
                    options extends
                        {
                            [K in string | number | symbol]: UnionOmit<
                                WriteContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    undefined
                                    | Chain,
                                    undefined | Account,
                                    chainOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >[K]
                        },
                    Rest extends unknown[] = [options: options],
                >(
                    ...parameters:
                        | Rest
                        | [args: readonly unknown[], ...parameters: Rest[]],
                ) => Promise<`0x${string}`>;
            };
        }
        • abi: Abi
        • address: `0x${string}`
        • createEventFilter: {
              [key: string]: <strict extends undefined | boolean = undefined>(
                  ...parameters:
                      | [
                          options?: {
                              fromBlock?: bigint
                              | BlockTag;
                              toBlock?: bigint | BlockTag;
                          } & { strict?: strict },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              strict?: undefined;
                              toBlock?: undefined;
                              [key: string]: unknown;
                          },
                          options?: { fromBlock?: bigint
                          | BlockTag; toBlock?: bigint | BlockTag } & { strict?: strict },
                      ],
              ) => Promise<CreateContractEventFilterReturnType>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • estimateGas: {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          } & {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) | (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          }

          Estimates the gas necessary to complete a transaction without submitting it to the network.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const gas = await contract.estimateGas.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • getEvents: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ]
                      | [
                          args?: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ],
              ) => Promise<GetContractEventsReturnType<Abi, string>>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • read: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<unknown>;
          }

          Calls a read-only function on a contract, and returns the response.

          A "read-only" function (constant function) on a Solidity contract is denoted by a view or pure keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.

          Internally, read uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi([
          'function balanceOf(address owner) view returns (uint256)',
          ]),
          client: publicClient,
          })
          const result = await contract.read.balanceOf(['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'])
          // 424122n
        • simulate: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain = undefined,
                  accountOverride extends undefined | `0x${string}` | Account = undefined,
              >(
                  ...parameters:
                      | [
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  {
                                      blockExplorers?: ...;
                                      blockTime?: ...;
                                      contracts?: ...;
                                      ensTlds?: ...;
                                      id: ...;
                                      name: ...;
                                      nativeCurrency: ...;
                                      rpcUrls: ...;
                                      sourceId?: ...;
                                      testnet?: ...;
                                  } & ChainConfig<(...), (...)>,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  {
                                      blockExplorers?: ...;
                                      blockTime?: ...;
                                      contracts?: ...;
                                      ensTlds?: ...;
                                      id: ...;
                                      name: ...;
                                      nativeCurrency: ...;
                                      rpcUrls: ...;
                                      sourceId?: ...;
                                      testnet?: ...;
                                  } & ChainConfig<(...), (...)>,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ],
              ) => Promise<SimulateContractReturnType>;
          }

          Simulates/validates a contract interaction. This is useful for retrieving return data and revert reasons of contract write functions.

          This function does not require gas to execute and does not change the state of the blockchain. It is almost identical to readContract, but also supports contract write functions.

          Internally, simulate uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const result = await contract.simulate.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • watchEvent: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ],
              ) => WatchContractEventReturnType;
          }

          Watches and returns emitted contract event logs.

          This Action will batch up all the event logs found within the pollingInterval, and invoke them via onLogs.

          watchEvent will attempt to create an Event Filter and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. eth_newFilter), then watchEvent will fall back to using getLogs instead.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
          const unwatch = contract.watchEvent.Transfer(
          { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },
          { onLogs: (logs) => console.log(logs) },
          )
        • write: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain,
                  options extends
                      {
                          [K in string | number | symbol]: UnionOmit<
                              WriteContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  undefined
                                  | Chain,
                                  undefined | Account,
                                  chainOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >[K]
                      },
                  Rest extends unknown[] = [options: options],
              >(
                  ...parameters: Rest | [args: readonly unknown[], ...parameters: Rest[]],
              ) => Promise<`0x${string}`>;
          }

          Executes a write function on a contract.

          A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a Transaction is needed to be broadcast in order to change the state.

          Internally, write uses a Wallet Client to call the sendTransaction action with ABI-encoded data.

          Warning: The write internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to simulate the contract write with contract.simulate before you execute it.

          import { createWalletClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const walletClient = createWalletClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
          client: walletClient,
          })
          const hash = await contract.write.min([69420], {
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          })
      • {
            abi: Abi;
            address: `0x${string}`;
            createEventFilter: {
                [key: string]: <strict extends undefined | boolean = undefined>(
                    ...parameters:
                        | [
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                strict?: undefined;
                                toBlock?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                fromBlock?: bigint
                                | BlockTag;
                                toBlock?: bigint | BlockTag;
                            } & { strict?: strict },
                        ],
                ) => Promise<CreateContractEventFilterReturnType>;
            };
            estimateGas: {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            } & {
                [key: string]: (
                    ...parameters:
                        | [
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options: Prettify<
                                UnionOmit<
                                    EstimateContractGasParameters<
                                        Abi,
                                        string,
                                        readonly (...)[],
                                        (...) & (...),
                                    >,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<bigint>;
            };
            getEvents: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ]
                        | [
                            args?: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                blockHash?: `0x${string}`;
                                fromBlock?: bigint
                                | BlockTag;
                                strict?: boolean;
                                toBlock?: bigint | BlockTag;
                            },
                        ],
                ) => Promise<GetContractEventsReturnType<Abi, string>>;
            };
            read: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Prettify<
                                UnionOmit<
                                    ReadContractParameters<Abi, string, readonly (...)[]>,
                                    "address" | "abi" | "functionName" | "args",
                                >,
                            >,
                        ],
                ) => Promise<unknown>;
            };
            simulate: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain = undefined,
                    accountOverride extends undefined | `0x${string}` | Account = undefined,
                >(
                    ...parameters:
                        | [
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    {
                                        blockExplorers?: ...;
                                        blockTime?: ...;
                                        contracts?: ...;
                                        ensTlds?: ...;
                                        id: ...;
                                        name: ...;
                                        nativeCurrency: ...;
                                        rpcUrls: ...;
                                        sourceId?: ...;
                                        testnet?: ...;
                                    } & ChainConfig<(...), (...)>,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ]
                        | [
                            args: readonly unknown[],
                            options?: Omit<
                                SimulateContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    {
                                        blockExplorers?: ...;
                                        blockTime?: ...;
                                        contracts?: ...;
                                        ensTlds?: ...;
                                        id: ...;
                                        name: ...;
                                        nativeCurrency: ...;
                                        rpcUrls: ...;
                                        sourceId?: ...;
                                        testnet?: ...;
                                    } & ChainConfig<(...), (...)>,
                                    chainOverride,
                                    accountOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >,
                        ],
                ) => Promise<SimulateContractReturnType>;
            };
            watchEvent: {
                [key: string]: (
                    ...parameters:
                        | [
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ]
                        | [
                            args: | readonly unknown[]
                            | {
                                abi?: undefined;
                                address?: undefined;
                                args?: undefined;
                                batch?: undefined;
                                eventName?: undefined;
                                fromBlock?: undefined;
                                onError?: undefined;
                                onLogs?: undefined;
                                poll?: undefined;
                                pollingInterval?: undefined;
                                strict?: undefined;
                                [key: string]: unknown;
                            },
                            options?: {
                                batch?: boolean;
                                fromBlock?: bigint;
                                onError?: (error: Error) => void;
                                onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                                poll?: true;
                                pollingInterval?: number;
                                strict?: boolean;
                            },
                        ],
                ) => WatchContractEventReturnType;
            };
            write: {
                [key: string]: <
                    chainOverride extends undefined
                    | Chain,
                    options extends
                        {
                            [K in string | number | symbol]: UnionOmit<
                                WriteContractParameters<
                                    Abi,
                                    string,
                                    readonly unknown[],
                                    {
                                        blockExplorers?: (...)
                                        | (...);
                                        blockTime?: (...) | (...);
                                        contracts?: (...) | (...);
                                        ensTlds?: (...) | (...);
                                        id: number;
                                        name: string;
                                        nativeCurrency: ChainNativeCurrency;
                                        rpcUrls: { default: ...; [key: ...]: ... };
                                        sourceId?: (...) | (...);
                                        testnet?: (...) | (...) | (...);
                                    } & ChainConfig<(...) | (...), (...) | (...)>,
                                    undefined | Account,
                                    chainOverride,
                                >,
                                "address" | "abi" | "functionName" | "args",
                            >[K]
                        },
                    Rest extends unknown[] = [options: options],
                >(
                    ...parameters:
                        | Rest
                        | [args: readonly unknown[], ...parameters: Rest[]],
                ) => Promise<`0x${string}`>;
            };
        }
        • abi: Abi
        • address: `0x${string}`
        • createEventFilter: {
              [key: string]: <strict extends undefined | boolean = undefined>(
                  ...parameters:
                      | [
                          options?: {
                              fromBlock?: bigint
                              | BlockTag;
                              toBlock?: bigint | BlockTag;
                          } & { strict?: strict },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              strict?: undefined;
                              toBlock?: undefined;
                              [key: string]: unknown;
                          },
                          options?: { fromBlock?: bigint
                          | BlockTag; toBlock?: bigint | BlockTag } & { strict?: strict },
                      ],
              ) => Promise<CreateContractEventFilterReturnType>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • estimateGas: {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          } & {
              [key: string]: (
                  ...parameters:
                      | [
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options: Prettify<
                              UnionOmit<
                                  EstimateContractGasParameters<
                                      Abi,
                                      string,
                                      readonly (...)[],
                                      (...) & (...),
                                  >,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<bigint>;
          }

          Estimates the gas necessary to complete a transaction without submitting it to the network.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const gas = await contract.estimateGas.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • getEvents: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ]
                      | [
                          args?: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              blockHash?: `0x${string}`;
                              fromBlock?: bigint
                              | BlockTag;
                              strict?: boolean;
                              toBlock?: bigint | BlockTag;
                          },
                      ],
              ) => Promise<GetContractEventsReturnType<Abi, string>>;
          }

          Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
        • read: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Prettify<
                              UnionOmit<
                                  ReadContractParameters<Abi, string, readonly (...)[]>,
                                  "address" | "abi" | "functionName" | "args",
                              >,
                          >,
                      ],
              ) => Promise<unknown>;
          }

          Calls a read-only function on a contract, and returns the response.

          A "read-only" function (constant function) on a Solidity contract is denoted by a view or pure keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.

          Internally, read uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi([
          'function balanceOf(address owner) view returns (uint256)',
          ]),
          client: publicClient,
          })
          const result = await contract.read.balanceOf(['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'])
          // 424122n
        • simulate: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain = undefined,
                  accountOverride extends undefined | `0x${string}` | Account = undefined,
              >(
                  ...parameters:
                      | [
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  {
                                      blockExplorers?: ...;
                                      blockTime?: ...;
                                      contracts?: ...;
                                      ensTlds?: ...;
                                      id: ...;
                                      name: ...;
                                      nativeCurrency: ...;
                                      rpcUrls: ...;
                                      sourceId?: ...;
                                      testnet?: ...;
                                  } & ChainConfig<(...), (...)>,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ]
                      | [
                          args: readonly unknown[],
                          options?: Omit<
                              SimulateContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  {
                                      blockExplorers?: ...;
                                      blockTime?: ...;
                                      contracts?: ...;
                                      ensTlds?: ...;
                                      id: ...;
                                      name: ...;
                                      nativeCurrency: ...;
                                      rpcUrls: ...;
                                      sourceId?: ...;
                                      testnet?: ...;
                                  } & ChainConfig<(...), (...)>,
                                  chainOverride,
                                  accountOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >,
                      ],
              ) => Promise<SimulateContractReturnType>;
          }

          Simulates/validates a contract interaction. This is useful for retrieving return data and revert reasons of contract write functions.

          This function does not require gas to execute and does not change the state of the blockchain. It is almost identical to readContract, but also supports contract write functions.

          Internally, simulate uses a Public Client to call the call action with ABI-encoded data.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint() public']),
          client: publicClient,
          })
          const result = await contract.simulate.mint({
          account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
          })
        • watchEvent: {
              [key: string]: (
                  ...parameters:
                      | [
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ]
                      | [
                          args: | readonly unknown[]
                          | {
                              abi?: undefined;
                              address?: undefined;
                              args?: undefined;
                              batch?: undefined;
                              eventName?: undefined;
                              fromBlock?: undefined;
                              onError?: undefined;
                              onLogs?: undefined;
                              poll?: undefined;
                              pollingInterval?: undefined;
                              strict?: undefined;
                              [key: string]: unknown;
                          },
                          options?: {
                              batch?: boolean;
                              fromBlock?: bigint;
                              onError?: (error: Error) => void;
                              onLogs: WatchContractEventOnLogsFn<Abi, string, undefined>;
                              poll?: true;
                              pollingInterval?: number;
                              strict?: boolean;
                          },
                      ],
              ) => WatchContractEventReturnType;
          }

          Watches and returns emitted contract event logs.

          This Action will batch up all the event logs found within the pollingInterval, and invoke them via onLogs.

          watchEvent will attempt to create an Event Filter and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. eth_newFilter), then watchEvent will fall back to using getLogs instead.

          import { createPublicClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const publicClient = createPublicClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
          client: publicClient,
          })
          const filter = await contract.createEventFilter.Transfer()
          const unwatch = contract.watchEvent.Transfer(
          { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },
          { onLogs: (logs) => console.log(logs) },
          )
        • write: {
              [key: string]: <
                  chainOverride extends undefined
                  | Chain,
                  options extends
                      {
                          [K in string | number | symbol]: UnionOmit<
                              WriteContractParameters<
                                  Abi,
                                  string,
                                  readonly unknown[],
                                  {
                                      blockExplorers?: (...)
                                      | (...);
                                      blockTime?: (...) | (...);
                                      contracts?: (...) | (...);
                                      ensTlds?: (...) | (...);
                                      id: number;
                                      name: string;
                                      nativeCurrency: ChainNativeCurrency;
                                      rpcUrls: { default: ...; [key: ...]: ... };
                                      sourceId?: (...) | (...);
                                      testnet?: (...) | (...) | (...);
                                  } & ChainConfig<(...) | (...), (...) | (...)>,
                                  undefined | Account,
                                  chainOverride,
                              >,
                              "address" | "abi" | "functionName" | "args",
                          >[K]
                      },
                  Rest extends unknown[] = [options: options],
              >(
                  ...parameters: Rest | [args: readonly unknown[], ...parameters: Rest[]],
              ) => Promise<`0x${string}`>;
          }

          Executes a write function on a contract.

          A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a Transaction is needed to be broadcast in order to change the state.

          Internally, write uses a Wallet Client to call the sendTransaction action with ABI-encoded data.

          Warning: The write internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to simulate the contract write with contract.simulate before you execute it.

          import { createWalletClient, getContract, http, parseAbi } from 'viem'
          import { mainnet } from 'viem/chains'

          const walletClient = createWalletClient({
          chain: mainnet,
          transport: http(),
          })
          const contract = getContract({
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
          client: walletClient,
          })
          const hash = await contract.write.min([69420], {
          address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
          })

      Throws an error if the ABI is not provided and cannot be found in the chain's contracts.