import { Interface } from '@ethersproject/abi'; import { DeepReadonly } from 'ts-essentials'; import { Address, Log, Logger } from '../../types'; import { StatefulEventSubscriber } from '../../stateful-event-subscriber'; import { IDexHelper } from '../../dex-helper/idex-helper'; import { AllVaultConfigs, VaultsStates } from './types'; export declare class CapPools extends StatefulEventSubscriber { readonly parentName: string; protected network: number; protected dexHelper: IDexHelper; protected configs: AllVaultConfigs; protected capIface: Interface; protected oracleIface: Interface; handlers: { [event: string]: (event: any, state: DeepReadonly, log: Readonly) => DeepReadonly | null; }; logDecoder: (log: Log) => any; addressesSubscribed: string[]; constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, configs: AllVaultConfigs, capIface?: Interface, oracleIface?: Interface); /** * 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 * @returns Updates state of the event subscriber after the log */ protected processLog(state: DeepReadonly, log: Readonly): DeepReadonly | 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, poolAddress?: Address): Promise>; handleSetFeeData(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; handleMint(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; handleBurn(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; getOrGenerateState(blockNumber: number): Promise; }