import { ethers } from 'ethers';
import { Mutex } from 'async-mutex';
import { EventProcessorFunction } from '../../../types/events.types';
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
export declare abstract class BlockchainEventEmitter {
    private readonly RETRY_MIN_PAGE_SIZE;
    private readonly MAX_RETRIES;
    private readonly _chainId;
    readonly contract: ethers.Contract;
    readonly depositOnChainUtxosContract?: ethers.Contract;
    private _latestBlockNumber;
    private _initialBlockNumber;
    onEventsProcessed?: (acceptedEventCount: number) => void;
    private eventProcessors;
    private readonly maxPageSize?;
    private _isReady;
    protected isServer: boolean;
    private inProgress;
    protected eventsFetchingMutex: Mutex;
    constructor(chainId: number, contract: ethers.Contract, initialBlockNumber: number, isServer: boolean, eventsFetchingMutex: Mutex, maxPageSize?: number, depositOnChainUtxosContract?: ethers.Contract);
    get latestBlockNumber(): number;
    get chainId(): number;
    get isReady(): boolean;
    syncFromAtMost(blockNumber: number): void;
    protected advanceLatestBlockNumber(blockNumber: number): void;
    intervalClear(): void;
    init(): Promise<void>;
    private requireReady;
    private getEventsForSingleContract;
    addEventProcessorFunction(eventProcessorFunction: EventProcessorFunction): void;
    getEventsInRange(fromBlockNumber: number, toBlockNumber: number): Promise<BlockchainEvent[]>;
    getLastBlockNumberForEventRequest(): Promise<number>;
    retrieveEvents(fromBlockNumber: number, useForce?: boolean): Promise<boolean>;
    protected processEvents(events: BlockchainEvent[]): Promise<void>;
    protected abstract clear(): void;
    protected abstract startUpdateListener(): void;
}
