/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, ContractFactory, ContractTransactionResponse, Interface } from 'ethers'
import type { Signer, BigNumberish, AddressLike, ContractDeployTransaction, ContractRunner } from 'ethers'
import type { NonPayableOverrides } from '../../../../common'
import type {
  GraphTallyCollector,
  GraphTallyCollectorInterface,
} from '../../../../contracts/payments/collectors/GraphTallyCollector'

const _abi = [
  {
    inputs: [
      {
        internalType: 'string',
        name: 'eip712Name',
        type: 'string',
      },
      {
        internalType: 'string',
        name: 'eip712Version',
        type: 'string',
      },
      {
        internalType: 'address',
        name: 'controller',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'revokeSignerThawingPeriod',
        type: 'uint256',
      },
    ],
    stateMutability: 'nonpayable',
    type: 'constructor',
  },
  {
    inputs: [],
    name: 'AuthorizableInvalidSignerProof',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'proofDeadline',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'currentTimestamp',
        type: 'uint256',
      },
    ],
    name: 'AuthorizableInvalidSignerProofDeadline',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
      {
        internalType: 'bool',
        name: 'revoked',
        type: 'bool',
      },
    ],
    name: 'AuthorizableSignerAlreadyAuthorized',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'AuthorizableSignerNotAuthorized',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'AuthorizableSignerNotThawing',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'currentTimestamp',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    name: 'AuthorizableSignerStillThawing',
    type: 'error',
  },
  {
    inputs: [],
    name: 'ECDSAInvalidSignature',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'length',
        type: 'uint256',
      },
    ],
    name: 'ECDSAInvalidSignatureLength',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'bytes32',
        name: 's',
        type: 'bytes32',
      },
    ],
    name: 'ECDSAInvalidSignatureS',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'bytes',
        name: 'contractName',
        type: 'bytes',
      },
    ],
    name: 'GraphDirectoryInvalidZeroAddress',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'caller',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'dataService',
        type: 'address',
      },
    ],
    name: 'GraphTallyCollectorCallerNotDataService',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'tokensCollected',
        type: 'uint256',
      },
    ],
    name: 'GraphTallyCollectorInconsistentRAVTokens',
    type: 'error',
  },
  {
    inputs: [],
    name: 'GraphTallyCollectorInvalidRAVSigner',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'tokensToCollect',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'maxTokensToCollect',
        type: 'uint256',
      },
    ],
    name: 'GraphTallyCollectorInvalidTokensToCollectAmount',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'dataService',
        type: 'address',
      },
    ],
    name: 'GraphTallyCollectorUnauthorizedDataService',
    type: 'error',
  },
  {
    inputs: [],
    name: 'InvalidShortString',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'string',
        name: 'str',
        type: 'string',
      },
    ],
    name: 'StringTooLong',
    type: 'error',
  },
  {
    anonymous: false,
    inputs: [],
    name: 'EIP712DomainChanged',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'graphToken',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'graphStaking',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphPayments',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphEscrow',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'graphController',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphEpochManager',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphRewardsManager',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphTokenGateway',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphProxyAdmin',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphCuration',
        type: 'address',
      },
    ],
    name: 'GraphDirectoryInitialized',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: 'enum IGraphPayments.PaymentTypes',
        name: 'paymentType',
        type: 'uint8',
      },
      {
        indexed: true,
        internalType: 'bytes32',
        name: 'collectionId',
        type: 'bytes32',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'dataService',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'PaymentCollected',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'bytes32',
        name: 'collectionId',
        type: 'bytes32',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'serviceProvider',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'dataService',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint64',
        name: 'timestampNs',
        type: 'uint64',
      },
      {
        indexed: false,
        internalType: 'uint128',
        name: 'valueAggregate',
        type: 'uint128',
      },
      {
        indexed: false,
        internalType: 'bytes',
        name: 'metadata',
        type: 'bytes',
      },
      {
        indexed: false,
        internalType: 'bytes',
        name: 'signature',
        type: 'bytes',
      },
    ],
    name: 'RAVCollected',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'SignerAuthorized',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'SignerRevoked',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    name: 'SignerThawCanceled',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    name: 'SignerThawing',
    type: 'event',
  },
  {
    inputs: [],
    name: 'REVOKE_AUTHORIZATION_THAWING_PERIOD',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'authorizations',
    outputs: [
      {
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
      {
        internalType: 'bool',
        name: 'revoked',
        type: 'bool',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'proofDeadline',
        type: 'uint256',
      },
      {
        internalType: 'bytes',
        name: 'proof',
        type: 'bytes',
      },
    ],
    name: 'authorizeSigner',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'cancelThawSigner',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'enum IGraphPayments.PaymentTypes',
        name: 'paymentType',
        type: 'uint8',
      },
      {
        internalType: 'bytes',
        name: 'data',
        type: 'bytes',
      },
      {
        internalType: 'uint256',
        name: 'tokensToCollect',
        type: 'uint256',
      },
    ],
    name: 'collect',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'enum IGraphPayments.PaymentTypes',
        name: 'paymentType',
        type: 'uint8',
      },
      {
        internalType: 'bytes',
        name: 'data',
        type: 'bytes',
      },
    ],
    name: 'collect',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [],
    name: 'eip712Domain',
    outputs: [
      {
        internalType: 'bytes1',
        name: 'fields',
        type: 'bytes1',
      },
      {
        internalType: 'string',
        name: 'name',
        type: 'string',
      },
      {
        internalType: 'string',
        name: 'version',
        type: 'string',
      },
      {
        internalType: 'uint256',
        name: 'chainId',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'verifyingContract',
        type: 'address',
      },
      {
        internalType: 'bytes32',
        name: 'salt',
        type: 'bytes32',
      },
      {
        internalType: 'uint256[]',
        name: 'extensions',
        type: 'uint256[]',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        components: [
          {
            internalType: 'bytes32',
            name: 'collectionId',
            type: 'bytes32',
          },
          {
            internalType: 'address',
            name: 'payer',
            type: 'address',
          },
          {
            internalType: 'address',
            name: 'serviceProvider',
            type: 'address',
          },
          {
            internalType: 'address',
            name: 'dataService',
            type: 'address',
          },
          {
            internalType: 'uint64',
            name: 'timestampNs',
            type: 'uint64',
          },
          {
            internalType: 'uint128',
            name: 'valueAggregate',
            type: 'uint128',
          },
          {
            internalType: 'bytes',
            name: 'metadata',
            type: 'bytes',
          },
        ],
        internalType: 'struct IGraphTallyCollector.ReceiptAggregateVoucher',
        name: 'rav',
        type: 'tuple',
      },
    ],
    name: 'encodeRAV',
    outputs: [
      {
        internalType: 'bytes32',
        name: '',
        type: 'bytes32',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'getThawEnd',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'authorizer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'isAuthorized',
    outputs: [
      {
        internalType: 'bool',
        name: '',
        type: 'bool',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        components: [
          {
            components: [
              {
                internalType: 'bytes32',
                name: 'collectionId',
                type: 'bytes32',
              },
              {
                internalType: 'address',
                name: 'payer',
                type: 'address',
              },
              {
                internalType: 'address',
                name: 'serviceProvider',
                type: 'address',
              },
              {
                internalType: 'address',
                name: 'dataService',
                type: 'address',
              },
              {
                internalType: 'uint64',
                name: 'timestampNs',
                type: 'uint64',
              },
              {
                internalType: 'uint128',
                name: 'valueAggregate',
                type: 'uint128',
              },
              {
                internalType: 'bytes',
                name: 'metadata',
                type: 'bytes',
              },
            ],
            internalType: 'struct IGraphTallyCollector.ReceiptAggregateVoucher',
            name: 'rav',
            type: 'tuple',
          },
          {
            internalType: 'bytes',
            name: 'signature',
            type: 'bytes',
          },
        ],
        internalType: 'struct IGraphTallyCollector.SignedRAV',
        name: 'signedRAV',
        type: 'tuple',
      },
    ],
    name: 'recoverRAVSigner',
    outputs: [
      {
        internalType: 'address',
        name: '',
        type: 'address',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'revokeAuthorizedSigner',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'signer',
        type: 'address',
      },
    ],
    name: 'thawSigner',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'dataService',
        type: 'address',
      },
      {
        internalType: 'bytes32',
        name: 'collectionId',
        type: 'bytes32',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
    ],
    name: 'tokensCollected',
    outputs: [
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
] as const

const _bytecode =
  ' '

type GraphTallyCollectorConstructorParams = [signer?: Signer] | ConstructorParameters<typeof ContractFactory>

const isSuperArgs = (xs: GraphTallyCollectorConstructorParams): xs is ConstructorParameters<typeof ContractFactory> =>
  xs.length > 1

export class GraphTallyCollector__factory extends ContractFactory {
  constructor(...args: GraphTallyCollectorConstructorParams) {
    if (isSuperArgs(args)) {
      super(...args)
    } else {
      super(_abi, _bytecode, args[0])
    }
  }

  override getDeployTransaction(
    eip712Name: string,
    eip712Version: string,
    controller: AddressLike,
    revokeSignerThawingPeriod: BigNumberish,
    overrides?: NonPayableOverrides & { from?: string },
  ): Promise<ContractDeployTransaction> {
    return super.getDeployTransaction(eip712Name, eip712Version, controller, revokeSignerThawingPeriod, overrides || {})
  }
  override deploy(
    eip712Name: string,
    eip712Version: string,
    controller: AddressLike,
    revokeSignerThawingPeriod: BigNumberish,
    overrides?: NonPayableOverrides & { from?: string },
  ) {
    return super.deploy(eip712Name, eip712Version, controller, revokeSignerThawingPeriod, overrides || {}) as Promise<
      GraphTallyCollector & {
        deploymentTransaction(): ContractTransactionResponse
      }
    >
  }
  override connect(runner: ContractRunner | null): GraphTallyCollector__factory {
    return super.connect(runner) as GraphTallyCollector__factory
  }

  static readonly bytecode = _bytecode
  static readonly abi = _abi
  static createInterface(): GraphTallyCollectorInterface {
    return new Interface(_abi) as GraphTallyCollectorInterface
  }
  static connect(address: string, runner?: ContractRunner | null): GraphTallyCollector {
    return new Contract(address, _abi, runner) as unknown as GraphTallyCollector
  }
}
