/* 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 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 IGraphTallyCollectorInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "collect(uint8,bytes,uint256)"
      | "collect(uint8,bytes)"
      | "encodeRAV"
      | "recoverRAVSigner"
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic: "PaymentCollected" | "RAVCollected"
  ): EventFragment;

  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: "recoverRAVSigner",
    values: [IGraphTallyCollector.SignedRAVStruct]
  ): string;

  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: "recoverRAVSigner",
    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 interface IGraphTallyCollector extends BaseContract {
  connect(runner?: ContractRunner | null): IGraphTallyCollector;
  waitForDeployment(): Promise<this>;

  interface: IGraphTallyCollectorInterface;

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

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

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

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

  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: "recoverRAVSigner"
  ): TypedContractMethod<
    [signedRAV: IGraphTallyCollector.SignedRAVStruct],
    [string],
    "view"
  >;

  getEvent(
    key: "PaymentCollected"
  ): TypedContractEvent<
    PaymentCollectedEvent.InputTuple,
    PaymentCollectedEvent.OutputTuple,
    PaymentCollectedEvent.OutputObject
  >;
  getEvent(
    key: "RAVCollected"
  ): TypedContractEvent<
    RAVCollectedEvent.InputTuple,
    RAVCollectedEvent.OutputTuple,
    RAVCollectedEvent.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
    >;
  };
}
