@bancor/carbon-sdk
Version:
The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfi
37 lines • 1.31 kB
TypeScript
import { ChainCache } from './ChainCache';
import { Fetcher } from '../common/types';
export declare class ChainSync {
private _fetcher;
private _chainCache;
private _syncCalled;
private _slowPollPairs;
private _uncachedPairs;
private _lastFetch;
private _numOfPairsToBatch;
private _msToWaitBetweenSyncs;
private _chunkSize;
private _activeTimers;
private _isStopped;
private _reinitializeSelf;
private _resetSelf;
constructor(fetcher: Fetcher, chainCache: ChainCache, numOfPairsToBatch?: number, msToWaitBetweenSyncs?: number, chunkSize?: number);
/**
* Stops all running timers and cleans up resources
*/
stop(): void;
private _setTimeout;
startDataSync(): Promise<void>;
private _updateUncachedPairsFromChain;
private _populateFeesData;
private _populatePairsData;
private _syncPairDataBatch;
syncPairData(token0: string, token1: string): Promise<void>;
private _syncEvents;
/**
* Detects blockchain reorganization by comparing stored block metadata with current blockchain state
* @param currentBlock - The current block number to check against
* @returns True if a reorganization is detected, false otherwise
*/
private _detectReorg;
}
//# sourceMappingURL=ChainSync.d.ts.map