import { Interface } from '@ethersproject/abi'; import { AsyncOrSync, DeepReadonly } from 'ts-essentials'; import { Address, Log, Logger } from '../../types'; import { InitializeStateOptions, StatefulEventSubscriber } from '../../stateful-event-subscriber'; import { IDexHelper } from '../../dex-helper'; import { BlockHeader } from 'web3-eth'; import { PoolState } from './types'; export declare class WombatPool extends StatefulEventSubscriber { protected network: number; protected dexHelper: IDexHelper; protected poolAddress: Address; static readonly poolV2Interface: Interface; static readonly poolV3Interface: Interface; static readonly assetInterface: Interface; private rpcCallCount; private handlers; private poolInterface; private eventRefetched; blankState: PoolState; constructor(dexKey: string, name: string, network: number, dexHelper: IDexHelper, logger: Logger, poolAddress: Address); initialize(blockNumber: number, options?: InitializeStateOptions): Promise; protected processBlockLogs(state: DeepReadonly, logs: Readonly[], blockHeader: Readonly): Promise | null>; /** * The function is called every time any of the subscribed * addresses release log. The function accepts the current * state, updates the state according to the log, and returns * the updated state. * @param state - Current state of event subscriber * @param log - Log released by one of the subscribed addresses * @param blockHeader * @returns Updates state of the event subscriber after the log */ protected processLog(state: DeepReadonly, log: Readonly, blockHeader: Readonly): Promise | null>; /** * The function generates state using on-chain calls. This * function is called to regenerate state if the event based * system fails to fetch events and the local state is no * more correct. * @param blockNumber - Blocknumber for which the state should * should be generated * @returns state of the event subscriber at blocknumber */ generateState(blockNumber: number): Promise>; getOrGenerateState(blockNumber: number): Promise>; handleSwap(event: any, state: DeepReadonly, log: Readonly): AsyncOrSync | null>; handleSwapV2(event: any, state: DeepReadonly, log: Readonly): AsyncOrSync | null>; handleSetAmpFactor(event: any, state: DeepReadonly, _log: Readonly): AsyncOrSync | null>; handleSetHaircutRate(event: any, state: DeepReadonly, _log: Readonly): AsyncOrSync | null>; handleSetWithdrawalHaircutRate(event: any, state: DeepReadonly, _log: Readonly): AsyncOrSync | null>; handleAssetAdded(event: any, state: DeepReadonly, log: Readonly): Promise | null>; handleAssetRemoved(event: any, state: DeepReadonly, _log: Readonly): Promise | null>; handleFillPool(event: any, state: DeepReadonly, log: Readonly): Promise | null>; handlePaused(event: any, state: DeepReadonly, _log: Readonly): Promise | null>; handleUnpaused(event: any, state: DeepReadonly, _log: Readonly): Promise | null>; handlePausedAsset(event: any, state: DeepReadonly, _log: Readonly): Promise | null>; handleUnpausedAsset(event: any, state: DeepReadonly, _log: Readonly): Promise | null>; private refreshAssetStates; private fetchAssetBalances; private getAssetState; }