/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
  BaseContract,
  BigNumberish,
  BytesLike,
  FunctionFragment,
  Result,
  Interface,
  AddressLike,
  ContractRunner,
  ContractMethod,
  Listener,
} from "ethers";
import type {
  TypedContractEvent,
  TypedDeferredTopicFilter,
  TypedEventLog,
  TypedListener,
  TypedContractMethod,
} from "./common";

export declare namespace IMulticall3 {
  export type CallStruct = { target: AddressLike; callData: BytesLike };

  export type CallStructOutput = [target: string, callData: string] & {
    target: string;
    callData: string;
  };

  export type Call3Struct = {
    target: AddressLike;
    allowFailure: boolean;
    callData: BytesLike;
  };

  export type Call3StructOutput = [
    target: string,
    allowFailure: boolean,
    callData: string
  ] & { target: string; allowFailure: boolean; callData: string };

  export type ResultStruct = { success: boolean; returnData: BytesLike };

  export type ResultStructOutput = [success: boolean, returnData: string] & {
    success: boolean;
    returnData: string;
  };

  export type Call3ValueStruct = {
    target: AddressLike;
    allowFailure: boolean;
    value: BigNumberish;
    callData: BytesLike;
  };

  export type Call3ValueStructOutput = [
    target: string,
    allowFailure: boolean,
    value: bigint,
    callData: string
  ] & {
    target: string;
    allowFailure: boolean;
    value: bigint;
    callData: string;
  };
}

export interface IMulticall3Interface extends Interface {
  getFunction(
    nameOrSignature:
      | "aggregate"
      | "aggregate3"
      | "aggregate3Value"
      | "blockAndAggregate"
      | "getBasefee"
      | "getBlockHash"
      | "getBlockNumber"
      | "getChainId"
      | "getCurrentBlockCoinbase"
      | "getCurrentBlockDifficulty"
      | "getCurrentBlockGasLimit"
      | "getCurrentBlockTimestamp"
      | "getEthBalance"
      | "getLastBlockHash"
      | "tryAggregate"
      | "tryBlockAndAggregate"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "aggregate",
    values: [IMulticall3.CallStruct[]]
  ): string;
  encodeFunctionData(
    functionFragment: "aggregate3",
    values: [IMulticall3.Call3Struct[]]
  ): string;
  encodeFunctionData(
    functionFragment: "aggregate3Value",
    values: [IMulticall3.Call3ValueStruct[]]
  ): string;
  encodeFunctionData(
    functionFragment: "blockAndAggregate",
    values: [IMulticall3.CallStruct[]]
  ): string;
  encodeFunctionData(
    functionFragment: "getBasefee",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getBlockHash",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getBlockNumber",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getChainId",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getCurrentBlockCoinbase",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getCurrentBlockDifficulty",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getCurrentBlockGasLimit",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getCurrentBlockTimestamp",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getEthBalance",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "getLastBlockHash",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "tryAggregate",
    values: [boolean, IMulticall3.CallStruct[]]
  ): string;
  encodeFunctionData(
    functionFragment: "tryBlockAndAggregate",
    values: [boolean, IMulticall3.CallStruct[]]
  ): string;

  decodeFunctionResult(functionFragment: "aggregate", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "aggregate3", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "aggregate3Value",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "blockAndAggregate",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "getBasefee", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getBlockHash",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getBlockNumber",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "getChainId", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getCurrentBlockCoinbase",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCurrentBlockDifficulty",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCurrentBlockGasLimit",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCurrentBlockTimestamp",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getEthBalance",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getLastBlockHash",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "tryAggregate",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "tryBlockAndAggregate",
    data: BytesLike
  ): Result;
}

export interface IMulticall3 extends BaseContract {
  connect(runner?: ContractRunner | null): IMulticall3;
  waitForDeployment(): Promise<this>;

  interface: IMulticall3Interface;

  queryFilter<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEventLog<TCEvent>>>;
  queryFilter<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEventLog<TCEvent>>>;

  on<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    listener: TypedListener<TCEvent>
  ): Promise<this>;
  on<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    listener: TypedListener<TCEvent>
  ): Promise<this>;

  once<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    listener: TypedListener<TCEvent>
  ): Promise<this>;
  once<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    listener: TypedListener<TCEvent>
  ): Promise<this>;

  listeners<TCEvent extends TypedContractEvent>(
    event: TCEvent
  ): Promise<Array<TypedListener<TCEvent>>>;
  listeners(eventName?: string): Promise<Array<Listener>>;
  removeAllListeners<TCEvent extends TypedContractEvent>(
    event?: TCEvent
  ): Promise<this>;

  aggregate: TypedContractMethod<
    [calls: IMulticall3.CallStruct[]],
    [[bigint, string[]] & { blockNumber: bigint; returnData: string[] }],
    "payable"
  >;

  aggregate3: TypedContractMethod<
    [calls: IMulticall3.Call3Struct[]],
    [IMulticall3.ResultStructOutput[]],
    "payable"
  >;

  aggregate3Value: TypedContractMethod<
    [calls: IMulticall3.Call3ValueStruct[]],
    [IMulticall3.ResultStructOutput[]],
    "payable"
  >;

  blockAndAggregate: TypedContractMethod<
    [calls: IMulticall3.CallStruct[]],
    [
      [bigint, string, IMulticall3.ResultStructOutput[]] & {
        blockNumber: bigint;
        blockHash: string;
        returnData: IMulticall3.ResultStructOutput[];
      }
    ],
    "payable"
  >;

  getBasefee: TypedContractMethod<[], [bigint], "view">;

  getBlockHash: TypedContractMethod<
    [blockNumber: BigNumberish],
    [string],
    "view"
  >;

  getBlockNumber: TypedContractMethod<[], [bigint], "view">;

  getChainId: TypedContractMethod<[], [bigint], "view">;

  getCurrentBlockCoinbase: TypedContractMethod<[], [string], "view">;

  getCurrentBlockDifficulty: TypedContractMethod<[], [bigint], "view">;

  getCurrentBlockGasLimit: TypedContractMethod<[], [bigint], "view">;

  getCurrentBlockTimestamp: TypedContractMethod<[], [bigint], "view">;

  getEthBalance: TypedContractMethod<[addr: AddressLike], [bigint], "view">;

  getLastBlockHash: TypedContractMethod<[], [string], "view">;

  tryAggregate: TypedContractMethod<
    [requireSuccess: boolean, calls: IMulticall3.CallStruct[]],
    [IMulticall3.ResultStructOutput[]],
    "payable"
  >;

  tryBlockAndAggregate: TypedContractMethod<
    [requireSuccess: boolean, calls: IMulticall3.CallStruct[]],
    [
      [bigint, string, IMulticall3.ResultStructOutput[]] & {
        blockNumber: bigint;
        blockHash: string;
        returnData: IMulticall3.ResultStructOutput[];
      }
    ],
    "payable"
  >;

  getFunction<T extends ContractMethod = ContractMethod>(
    key: string | FunctionFragment
  ): T;

  getFunction(
    nameOrSignature: "aggregate"
  ): TypedContractMethod<
    [calls: IMulticall3.CallStruct[]],
    [[bigint, string[]] & { blockNumber: bigint; returnData: string[] }],
    "payable"
  >;
  getFunction(
    nameOrSignature: "aggregate3"
  ): TypedContractMethod<
    [calls: IMulticall3.Call3Struct[]],
    [IMulticall3.ResultStructOutput[]],
    "payable"
  >;
  getFunction(
    nameOrSignature: "aggregate3Value"
  ): TypedContractMethod<
    [calls: IMulticall3.Call3ValueStruct[]],
    [IMulticall3.ResultStructOutput[]],
    "payable"
  >;
  getFunction(
    nameOrSignature: "blockAndAggregate"
  ): TypedContractMethod<
    [calls: IMulticall3.CallStruct[]],
    [
      [bigint, string, IMulticall3.ResultStructOutput[]] & {
        blockNumber: bigint;
        blockHash: string;
        returnData: IMulticall3.ResultStructOutput[];
      }
    ],
    "payable"
  >;
  getFunction(
    nameOrSignature: "getBasefee"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "getBlockHash"
  ): TypedContractMethod<[blockNumber: BigNumberish], [string], "view">;
  getFunction(
    nameOrSignature: "getBlockNumber"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "getChainId"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "getCurrentBlockCoinbase"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "getCurrentBlockDifficulty"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "getCurrentBlockGasLimit"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "getCurrentBlockTimestamp"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "getEthBalance"
  ): TypedContractMethod<[addr: AddressLike], [bigint], "view">;
  getFunction(
    nameOrSignature: "getLastBlockHash"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "tryAggregate"
  ): TypedContractMethod<
    [requireSuccess: boolean, calls: IMulticall3.CallStruct[]],
    [IMulticall3.ResultStructOutput[]],
    "payable"
  >;
  getFunction(
    nameOrSignature: "tryBlockAndAggregate"
  ): TypedContractMethod<
    [requireSuccess: boolean, calls: IMulticall3.CallStruct[]],
    [
      [bigint, string, IMulticall3.ResultStructOutput[]] & {
        blockNumber: bigint;
        blockHash: string;
        returnData: IMulticall3.ResultStructOutput[];
      }
    ],
    "payable"
  >;

  filters: {};
}
