import { OnApplicationShutdown } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; import { SchedulerRegistry } from '@nestjs/schedule'; import { BaseDataSource } from '@subql/types-core'; import { IBlockchainService } from '../blockchain.service'; import { NodeConfig } from '../configure'; import { IBlockDispatcher } from './blockDispatcher'; import { DictionaryService } from './dictionary/dictionary.service'; import { MultiChainRewindService } from './multiChainRewind.service'; import { IStoreModelProvider } from './storeModelProvider'; import { IProjectService } from './types'; import { IUnfinalizedBlocksServiceUtil } from './unfinalizedBlocks.service'; export declare class FetchService, FB> implements OnApplicationShutdown { private nodeConfig; protected projectService: IProjectService; protected blockDispatcher: B; protected dictionaryService: DictionaryService; private eventEmitter; private schedulerRegistry; private unfinalizedBlocksService; private storeModelProvider; private blockchainSevice; private multiChainRewindService; private _latestBestHeight?; private _latestFinalizedHeight?; private isShutdown; constructor(nodeConfig: NodeConfig, projectService: IProjectService, blockDispatcher: B, dictionaryService: DictionaryService, eventEmitter: EventEmitter2, schedulerRegistry: SchedulerRegistry, unfinalizedBlocksService: IUnfinalizedBlocksServiceUtil, storeModelProvider: IStoreModelProvider, blockchainSevice: IBlockchainService, multiChainRewindService: MultiChainRewindService); private get latestBestHeight(); private get latestFinalizedHeight(); protected getModulos(dataSources: DS[]): number[]; onApplicationShutdown(): void; init(startHeight: number): Promise; private updateDictionary; getFinalizedBlockHead(): Promise; getBestBlockHead(): Promise; private startLoop; private latestHeight; fillNextBlockBuffer(initBlockHeight: number): Promise; private getModuloBlocks; /** * * @param startBlockHeight * @param endBlockHeight is either FinalizedHeight or BestHeight, ensure ModuloBlocks not greater than this number */ private getEnqueuedModuloBlocks; private useModuloHandlersOnly; private getRelevantDsDetails; private enqueueSequential; private enqueueBlocks; /** * * @param rawBatchBlocks * @param latestHeight * @private */ private getLatestBufferHeight; /** * If a projects datasources are not continuious we can add add them to the bypass blocks * */ private getDatasourceBypassBlocks; private nextEndBlockHeight; resetForNewDs(blockHeight: number): void; getLatestFinalizedHeight(): number; }