import { Counter, Gauge, Histogram } from 'prom-client'; import { Logger, Address, Metrics, Eventual } from '@graphprotocol/common-ts'; import { NetworkContracts as TapContracts } from '@semiotic-labs/tap-contracts-bindings'; import { Allocation, QueryFeeModels, ReceiptAggregateVoucher, TransactionManager, specification as spec, SignedRAV } from '..'; import { SubgraphClient } from '../subgraph-client'; interface RavMetrics { ravRedeemsSuccess: Counter; ravRedeemsInvalid: Counter; ravRedeemsFailed: Counter; ravsRedeemDuration: Histogram; ravCollectedFees: Gauge; } interface TapCollectorOptions { logger: Logger; metrics: Metrics; transactionManager: TransactionManager; tapContracts: TapContracts; allocations: Eventual; models: QueryFeeModels; networkSpecification: spec.NetworkSpecification; tapSubgraph: SubgraphClient; networkSubgraph: SubgraphClient; legacyMnemonics: string[]; } export interface RavWithAllocation { rav: SignedRAV; allocation: Allocation; sender: Address; } export interface TapSubgraphResponse { transactions: TapTransaction[]; _meta: TapMeta; } interface TapMeta { block: { timestamp: number; hash: string; }; } export interface TapTransaction { id: string; allocationID: string; timestamp: number; sender: { id: string; }; } export interface AllocationsResponse { allocations: any[]; meta: { block: { hash: string; }; }; } export declare class TapCollector { logger: Logger; metrics: RavMetrics; models: QueryFeeModels; transactionManager: TransactionManager; tapContracts: TapContracts; allocations: Eventual; ravRedemptionThreshold: bigint; protocolNetwork: string; tapSubgraph: SubgraphClient; networkSubgraph: SubgraphClient; finalityTime: number; indexerAddress: Address; legacyMnemonics: string[]; private constructor(); static create({ logger, metrics, transactionManager, models, tapContracts, allocations, networkSpecification, tapSubgraph, networkSubgraph, legacyMnemonics, }: TapCollectorOptions): TapCollector; startRAVProcessing(): void; private getPendingRAVs; private getAllocationsfromAllocationIds; private getSignedRAVsEventual; private pendingRAVs; private filterAndUpdateRavs; markRavsInTransactionsAsRedeemed(tapSubgraphResponse: TapSubgraphResponse, ravsLastNotFinal: ReceiptAggregateVoucher[]): Promise; findTransactionsForRavs(ravs: ReceiptAggregateVoucher[]): Promise; private revertRavsRedeemed; private markRavsAsFinal; private submitRAVs; private getAllocationSigner; redeemRav(logger: Logger, allocation: Allocation, sender: Address, signedRav: SignedRAV): Promise; private markRavAsRedeemed; } export {};