import { Counter, Gauge, Histogram } from 'prom-client'; import { Logger, Address, Metrics, Eventual } from '@graphprotocol/common-ts'; import { Allocation, QueryFeeModels, TransactionManager, specification as spec, SignedRAVv2, ReceiptAggregateVoucherV2 } from '..'; import { SubgraphClient } from '../subgraph-client'; import { GraphHorizonContracts, SubgraphServiceContracts } from '@graphprotocol/toolshed/deployments'; interface RavMetrics { ravRedeemsSuccess: Counter; ravRedeemsInvalid: Counter; ravRedeemsFailed: Counter; ravsRedeemDuration: Histogram; ravCollectedFees: Gauge; } interface TapCollectorOptions { logger: Logger; metrics: Metrics; transactionManager: TransactionManager; contracts: GraphHorizonContracts & SubgraphServiceContracts; allocations: Eventual; models: QueryFeeModels; networkSpecification: spec.NetworkSpecification; networkSubgraph: SubgraphClient; } export interface RavWithAllocation { rav: SignedRAVv2; allocation: Allocation; payer: string; } export interface SubgraphResponse { paymentsEscrowTransactions: GraphTallyTransaction[]; _meta: GraphTallyMeta; } interface GraphTallyMeta { block: { timestamp: number; hash: string; }; } export interface GraphTallyTransaction { id: string; allocationId: string; timestamp: number; payer: { id: string; }; } export interface AllocationsResponse { allocations: any[]; meta: { block: { hash: string; }; }; } export declare class GraphTallyCollector { logger: Logger; metrics: RavMetrics; models: QueryFeeModels; transactionManager: TransactionManager; contracts: GraphHorizonContracts & SubgraphServiceContracts; allocations: Eventual; ravRedemptionThreshold: bigint; protocolNetwork: string; networkSubgraph: SubgraphClient; finalityTime: number; indexerAddress: Address; private constructor(); static create({ logger, metrics, transactionManager, models, contracts, allocations, networkSpecification, networkSubgraph, }: TapCollectorOptions): GraphTallyCollector; startRAVProcessing(): void; private getPendingRAVs; private getAllocationsfromAllocationIds; private getSignedRAVsEventual; private pendingRAVs; private filterAndUpdateRavs; markRavsInTransactionsAsRedeemed(subgraphResponse: SubgraphResponse, ravsLastNotFinal: ReceiptAggregateVoucherV2[]): Promise; findTransactionsForRavs(ravs: ReceiptAggregateVoucherV2[]): Promise; private revertRavsRedeemed; private markRavsAsFinal; private submitRAVs; redeemRav(logger: Logger, signedRav: SignedRAVv2): Promise; private markRavAsRedeemed; } export {};