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

export declare namespace IServiceRegistry {
  export type IndexerServiceStruct = { url: string; geohash: string };

  export type IndexerServiceStructOutput = [url: string, geohash: string] & {
    url: string;
    geohash: string;
  };
}

export interface IServiceRegistryToolshedInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "isRegistered"
      | "register"
      | "registerFor"
      | "services"
      | "unregister"
      | "unregisterFor"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "isRegistered",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "register",
    values: [string, string]
  ): string;
  encodeFunctionData(
    functionFragment: "registerFor",
    values: [AddressLike, string, string]
  ): string;
  encodeFunctionData(
    functionFragment: "services",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "unregister",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "unregisterFor",
    values: [AddressLike]
  ): string;

  decodeFunctionResult(
    functionFragment: "isRegistered",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "register", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "registerFor",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "services", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "unregister", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "unregisterFor",
    data: BytesLike
  ): Result;
}

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

  interface: IServiceRegistryToolshedInterface;

  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>;

  isRegistered: TypedContractMethod<[_indexer: AddressLike], [boolean], "view">;

  register: TypedContractMethod<
    [_url: string, _geohash: string],
    [void],
    "nonpayable"
  >;

  registerFor: TypedContractMethod<
    [_indexer: AddressLike, _url: string, _geohash: string],
    [void],
    "nonpayable"
  >;

  services: TypedContractMethod<
    [_indexer: AddressLike],
    [IServiceRegistry.IndexerServiceStructOutput],
    "view"
  >;

  unregister: TypedContractMethod<[], [void], "nonpayable">;

  unregisterFor: TypedContractMethod<
    [_indexer: AddressLike],
    [void],
    "nonpayable"
  >;

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

  getFunction(
    nameOrSignature: "isRegistered"
  ): TypedContractMethod<[_indexer: AddressLike], [boolean], "view">;
  getFunction(
    nameOrSignature: "register"
  ): TypedContractMethod<
    [_url: string, _geohash: string],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "registerFor"
  ): TypedContractMethod<
    [_indexer: AddressLike, _url: string, _geohash: string],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "services"
  ): TypedContractMethod<
    [_indexer: AddressLike],
    [IServiceRegistry.IndexerServiceStructOutput],
    "view"
  >;
  getFunction(
    nameOrSignature: "unregister"
  ): TypedContractMethod<[], [void], "nonpayable">;
  getFunction(
    nameOrSignature: "unregisterFor"
  ): TypedContractMethod<[_indexer: AddressLike], [void], "nonpayable">;

  filters: {};
}
