@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
30 lines • 1.16 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;
constructor(fetcher: Fetcher, chainCache: ChainCache, numOfPairsToBatch?: number, msToWaitBetweenSyncs?: number, chunkSize?: number);
startDataSync(): Promise<void>;
private _updateUncachedPairsFromChain;
private _populateFeesData;
private _populatePairsData;
private _syncPairDataBatch;
syncPairData(token0: string, token1: string): Promise<void>;
private _getBlockChunks;
private _syncEvents;
private _resetPairsFetching;
/**
* 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