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

export declare namespace IAuthorizable {
  export type AuthorizationStruct = {
    authorizer: AddressLike;
    thawEndTimestamp: BigNumberish;
    revoked: boolean;
  };

  export type AuthorizationStructOutput = [
    authorizer: string,
    thawEndTimestamp: bigint,
    revoked: boolean,
  ] & { authorizer: string; thawEndTimestamp: bigint; revoked: boolean };
}

export declare namespace IGraphTallyCollector {
  export type ReceiptAggregateVoucherStruct = {
    collectionId: BytesLike;
    payer: AddressLike;
    serviceProvider: AddressLike;
    dataService: AddressLike;
    timestampNs: BigNumberish;
    valueAggregate: BigNumberish;
    metadata: BytesLike;
  };

  export type ReceiptAggregateVoucherStructOutput = [
    collectionId: string,
    payer: string,
    serviceProvider: string,
    dataService: string,
    timestampNs: bigint,
    valueAggregate: bigint,
    metadata: string,
  ] & {
    collectionId: string;
    payer: string;
    serviceProvider: string;
    dataService: string;
    timestampNs: bigint;
    valueAggregate: bigint;
    metadata: string;
  };

  export type SignedRAVStruct = {
    rav: IGraphTallyCollector.ReceiptAggregateVoucherStruct;
    signature: BytesLike;
  };

  export type SignedRAVStructOutput = [
    rav: IGraphTallyCollector.ReceiptAggregateVoucherStructOutput,
    signature: string,
  ] & {
    rav: IGraphTallyCollector.ReceiptAggregateVoucherStructOutput;
    signature: string;
  };
}

export interface IGraphTallyCollectorToolshedInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "REVOKE_AUTHORIZATION_THAWING_PERIOD"
      | "authorizations"
      | "authorizeSigner"
      | "cancelThawSigner"
      | "collect(uint8,bytes,uint256)"
      | "collect(uint8,bytes)"
      | "encodeRAV"
      | "getThawEnd"
      | "isAuthorized"
      | "recoverRAVSigner"
      | "revokeAuthorizedSigner"
      | "thawSigner"
      | "tokensCollected",
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic:
      | "PaymentCollected"
      | "RAVCollected"
      | "SignerAuthorized"
      | "SignerRevoked"
      | "SignerThawCanceled"
      | "SignerThawing",
  ): EventFragment;

  encodeFunctionData(
    functionFragment: "REVOKE_AUTHORIZATION_THAWING_PERIOD",
    values?: undefined,
  ): string;
  encodeFunctionData(
    functionFragment: "authorizations",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "authorizeSigner",
    values: [AddressLike, BigNumberish, BytesLike],
  ): string;
  encodeFunctionData(
    functionFragment: "cancelThawSigner",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "collect(uint8,bytes,uint256)",
    values: [BigNumberish, BytesLike, BigNumberish],
  ): string;
  encodeFunctionData(
    functionFragment: "collect(uint8,bytes)",
    values: [BigNumberish, BytesLike],
  ): string;
  encodeFunctionData(
    functionFragment: "encodeRAV",
    values: [IGraphTallyCollector.ReceiptAggregateVoucherStruct],
  ): string;
  encodeFunctionData(
    functionFragment: "getThawEnd",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "isAuthorized",
    values: [AddressLike, AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "recoverRAVSigner",
    values: [IGraphTallyCollector.SignedRAVStruct],
  ): string;
  encodeFunctionData(
    functionFragment: "revokeAuthorizedSigner",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "thawSigner",
    values: [AddressLike],
  ): string;
  encodeFunctionData(
    functionFragment: "tokensCollected",
    values: [AddressLike, BytesLike, AddressLike, AddressLike],
  ): string;

  decodeFunctionResult(
    functionFragment: "REVOKE_AUTHORIZATION_THAWING_PERIOD",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "authorizations",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "authorizeSigner",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "cancelThawSigner",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "collect(uint8,bytes,uint256)",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "collect(uint8,bytes)",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(functionFragment: "encodeRAV", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "getThawEnd", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "isAuthorized",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "recoverRAVSigner",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(
    functionFragment: "revokeAuthorizedSigner",
    data: BytesLike,
  ): Result;
  decodeFunctionResult(functionFragment: "thawSigner", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "tokensCollected",
    data: BytesLike,
  ): Result;
}

export namespace PaymentCollectedEvent {
  export type InputTuple = [
    paymentType: BigNumberish,
    collectionId: BytesLike,
    payer: AddressLike,
    receiver: AddressLike,
    dataService: AddressLike,
    tokens: BigNumberish,
  ];
  export type OutputTuple = [
    paymentType: bigint,
    collectionId: string,
    payer: string,
    receiver: string,
    dataService: string,
    tokens: bigint,
  ];
  export interface OutputObject {
    paymentType: bigint;
    collectionId: string;
    payer: string;
    receiver: string;
    dataService: string;
    tokens: bigint;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace RAVCollectedEvent {
  export type InputTuple = [
    collectionId: BytesLike,
    payer: AddressLike,
    serviceProvider: AddressLike,
    dataService: AddressLike,
    timestampNs: BigNumberish,
    valueAggregate: BigNumberish,
    metadata: BytesLike,
    signature: BytesLike,
  ];
  export type OutputTuple = [
    collectionId: string,
    payer: string,
    serviceProvider: string,
    dataService: string,
    timestampNs: bigint,
    valueAggregate: bigint,
    metadata: string,
    signature: string,
  ];
  export interface OutputObject {
    collectionId: string;
    payer: string;
    serviceProvider: string;
    dataService: string;
    timestampNs: bigint;
    valueAggregate: bigint;
    metadata: string;
    signature: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace SignerAuthorizedEvent {
  export type InputTuple = [authorizer: AddressLike, signer: AddressLike];
  export type OutputTuple = [authorizer: string, signer: string];
  export interface OutputObject {
    authorizer: string;
    signer: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace SignerRevokedEvent {
  export type InputTuple = [authorizer: AddressLike, signer: AddressLike];
  export type OutputTuple = [authorizer: string, signer: string];
  export interface OutputObject {
    authorizer: string;
    signer: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace SignerThawCanceledEvent {
  export type InputTuple = [
    authorizer: AddressLike,
    signer: AddressLike,
    thawEndTimestamp: BigNumberish,
  ];
  export type OutputTuple = [
    authorizer: string,
    signer: string,
    thawEndTimestamp: bigint,
  ];
  export interface OutputObject {
    authorizer: string;
    signer: string;
    thawEndTimestamp: bigint;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace SignerThawingEvent {
  export type InputTuple = [
    authorizer: AddressLike,
    signer: AddressLike,
    thawEndTimestamp: BigNumberish,
  ];
  export type OutputTuple = [
    authorizer: string,
    signer: string,
    thawEndTimestamp: bigint,
  ];
  export interface OutputObject {
    authorizer: string;
    signer: string;
    thawEndTimestamp: bigint;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

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

  interface: IGraphTallyCollectorToolshedInterface;

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

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

  authorizations: TypedContractMethod<
    [signer: AddressLike],
    [IAuthorizable.AuthorizationStructOutput],
    "view"
  >;

  authorizeSigner: TypedContractMethod<
    [signer: AddressLike, proofDeadline: BigNumberish, proof: BytesLike],
    [void],
    "nonpayable"
  >;

  cancelThawSigner: TypedContractMethod<
    [signer: AddressLike],
    [void],
    "nonpayable"
  >;

  "collect(uint8,bytes,uint256)": TypedContractMethod<
    [paymentType: BigNumberish, data: BytesLike, tokensToCollect: BigNumberish],
    [bigint],
    "nonpayable"
  >;

  "collect(uint8,bytes)": TypedContractMethod<
    [paymentType: BigNumberish, data: BytesLike],
    [bigint],
    "nonpayable"
  >;

  encodeRAV: TypedContractMethod<
    [rav: IGraphTallyCollector.ReceiptAggregateVoucherStruct],
    [string],
    "view"
  >;

  getThawEnd: TypedContractMethod<[signer: AddressLike], [bigint], "view">;

  isAuthorized: TypedContractMethod<
    [authorizer: AddressLike, signer: AddressLike],
    [boolean],
    "view"
  >;

  recoverRAVSigner: TypedContractMethod<
    [signedRAV: IGraphTallyCollector.SignedRAVStruct],
    [string],
    "view"
  >;

  revokeAuthorizedSigner: TypedContractMethod<
    [signer: AddressLike],
    [void],
    "nonpayable"
  >;

  thawSigner: TypedContractMethod<[signer: AddressLike], [void], "nonpayable">;

  tokensCollected: TypedContractMethod<
    [
      serviceProvider: AddressLike,
      collectionId: BytesLike,
      receiver: AddressLike,
      payer: AddressLike,
    ],
    [bigint],
    "view"
  >;

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

  getFunction(
    nameOrSignature: "REVOKE_AUTHORIZATION_THAWING_PERIOD",
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "authorizations",
  ): TypedContractMethod<
    [signer: AddressLike],
    [IAuthorizable.AuthorizationStructOutput],
    "view"
  >;
  getFunction(
    nameOrSignature: "authorizeSigner",
  ): TypedContractMethod<
    [signer: AddressLike, proofDeadline: BigNumberish, proof: BytesLike],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "cancelThawSigner",
  ): TypedContractMethod<[signer: AddressLike], [void], "nonpayable">;
  getFunction(
    nameOrSignature: "collect(uint8,bytes,uint256)",
  ): TypedContractMethod<
    [paymentType: BigNumberish, data: BytesLike, tokensToCollect: BigNumberish],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "collect(uint8,bytes)",
  ): TypedContractMethod<
    [paymentType: BigNumberish, data: BytesLike],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "encodeRAV",
  ): TypedContractMethod<
    [rav: IGraphTallyCollector.ReceiptAggregateVoucherStruct],
    [string],
    "view"
  >;
  getFunction(
    nameOrSignature: "getThawEnd",
  ): TypedContractMethod<[signer: AddressLike], [bigint], "view">;
  getFunction(
    nameOrSignature: "isAuthorized",
  ): TypedContractMethod<
    [authorizer: AddressLike, signer: AddressLike],
    [boolean],
    "view"
  >;
  getFunction(
    nameOrSignature: "recoverRAVSigner",
  ): TypedContractMethod<
    [signedRAV: IGraphTallyCollector.SignedRAVStruct],
    [string],
    "view"
  >;
  getFunction(
    nameOrSignature: "revokeAuthorizedSigner",
  ): TypedContractMethod<[signer: AddressLike], [void], "nonpayable">;
  getFunction(
    nameOrSignature: "thawSigner",
  ): TypedContractMethod<[signer: AddressLike], [void], "nonpayable">;
  getFunction(
    nameOrSignature: "tokensCollected",
  ): TypedContractMethod<
    [
      serviceProvider: AddressLike,
      collectionId: BytesLike,
      receiver: AddressLike,
      payer: AddressLike,
    ],
    [bigint],
    "view"
  >;

  getEvent(
    key: "PaymentCollected",
  ): TypedContractEvent<
    PaymentCollectedEvent.InputTuple,
    PaymentCollectedEvent.OutputTuple,
    PaymentCollectedEvent.OutputObject
  >;
  getEvent(
    key: "RAVCollected",
  ): TypedContractEvent<
    RAVCollectedEvent.InputTuple,
    RAVCollectedEvent.OutputTuple,
    RAVCollectedEvent.OutputObject
  >;
  getEvent(
    key: "SignerAuthorized",
  ): TypedContractEvent<
    SignerAuthorizedEvent.InputTuple,
    SignerAuthorizedEvent.OutputTuple,
    SignerAuthorizedEvent.OutputObject
  >;
  getEvent(
    key: "SignerRevoked",
  ): TypedContractEvent<
    SignerRevokedEvent.InputTuple,
    SignerRevokedEvent.OutputTuple,
    SignerRevokedEvent.OutputObject
  >;
  getEvent(
    key: "SignerThawCanceled",
  ): TypedContractEvent<
    SignerThawCanceledEvent.InputTuple,
    SignerThawCanceledEvent.OutputTuple,
    SignerThawCanceledEvent.OutputObject
  >;
  getEvent(
    key: "SignerThawing",
  ): TypedContractEvent<
    SignerThawingEvent.InputTuple,
    SignerThawingEvent.OutputTuple,
    SignerThawingEvent.OutputObject
  >;

  filters: {
    "PaymentCollected(uint8,bytes32,address,address,address,uint256)": TypedContractEvent<
      PaymentCollectedEvent.InputTuple,
      PaymentCollectedEvent.OutputTuple,
      PaymentCollectedEvent.OutputObject
    >;
    PaymentCollected: TypedContractEvent<
      PaymentCollectedEvent.InputTuple,
      PaymentCollectedEvent.OutputTuple,
      PaymentCollectedEvent.OutputObject
    >;

    "RAVCollected(bytes32,address,address,address,uint64,uint128,bytes,bytes)": TypedContractEvent<
      RAVCollectedEvent.InputTuple,
      RAVCollectedEvent.OutputTuple,
      RAVCollectedEvent.OutputObject
    >;
    RAVCollected: TypedContractEvent<
      RAVCollectedEvent.InputTuple,
      RAVCollectedEvent.OutputTuple,
      RAVCollectedEvent.OutputObject
    >;

    "SignerAuthorized(address,address)": TypedContractEvent<
      SignerAuthorizedEvent.InputTuple,
      SignerAuthorizedEvent.OutputTuple,
      SignerAuthorizedEvent.OutputObject
    >;
    SignerAuthorized: TypedContractEvent<
      SignerAuthorizedEvent.InputTuple,
      SignerAuthorizedEvent.OutputTuple,
      SignerAuthorizedEvent.OutputObject
    >;

    "SignerRevoked(address,address)": TypedContractEvent<
      SignerRevokedEvent.InputTuple,
      SignerRevokedEvent.OutputTuple,
      SignerRevokedEvent.OutputObject
    >;
    SignerRevoked: TypedContractEvent<
      SignerRevokedEvent.InputTuple,
      SignerRevokedEvent.OutputTuple,
      SignerRevokedEvent.OutputObject
    >;

    "SignerThawCanceled(address,address,uint256)": TypedContractEvent<
      SignerThawCanceledEvent.InputTuple,
      SignerThawCanceledEvent.OutputTuple,
      SignerThawCanceledEvent.OutputObject
    >;
    SignerThawCanceled: TypedContractEvent<
      SignerThawCanceledEvent.InputTuple,
      SignerThawCanceledEvent.OutputTuple,
      SignerThawCanceledEvent.OutputObject
    >;

    "SignerThawing(address,address,uint256)": TypedContractEvent<
      SignerThawingEvent.InputTuple,
      SignerThawingEvent.OutputTuple,
      SignerThawingEvent.OutputObject
    >;
    SignerThawing: TypedContractEvent<
      SignerThawingEvent.InputTuple,
      SignerThawingEvent.OutputTuple,
      SignerThawingEvent.OutputObject
    >;
  };
}
