import { Interface } from '@ethersproject/abi'; import { DeepReadonly } from 'ts-essentials'; import { Log, Logger } from '../../types'; import { StatefulEventSubscriber } from '../../stateful-event-subscriber'; import { IDexHelper } from '../../dex-helper/idex-helper'; import { OSwapPool, OSwapPoolState } from './types'; export declare class OSwapEventPool extends StatefulEventSubscriber { readonly parentName: string; readonly pool: OSwapPool; protected network: number; protected dexHelper: IDexHelper; protected iOSwap: Interface; protected iERC20: Interface; protected iERC4626: Interface; handlers: { [event: string]: (event: any, state: DeepReadonly, log: Readonly) => DeepReadonly | null; }; logDecoder: (log: Log) => any; addressesSubscribed: string[]; constructor(parentName: string, pool: OSwapPool, network: number, dexHelper: IDexHelper, logger: Logger, iOSwap?: Interface, iERC20?: Interface, iERC4626?: Interface); protected parseLog(log: Log): import("@ethersproject/abi").LogDescription; /** * 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): Promise>; getStateOrGenerate(blockNumber: number): Promise; /** * Handle a trade rate change on the pool. */ handleTraderateChanged(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; /** * Process the transfer events for tokens in/out of the pool * to keep the state's token balances up to date. * Also handles ERC4626 asset transfers to vault for ERC4626 pools. */ handleTransfer(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; handleRedeemRequested(event: any, state: DeepReadonly, log: Readonly): { withdrawsQueued: any; traderate0: string; traderate1: string; balance0: string; balance1: string; withdrawsClaimed: string; totalAssets?: string; totalShares?: string; }; handleRedeemClaimed(event: any, state: DeepReadonly, log: Readonly): { withdrawsClaimed: string; traderate0: string; traderate1: string; balance0: string; balance1: string; withdrawsQueued: string; totalAssets?: string; totalShares?: string; }; /** * Handle ERC4626 Deposit event from vault. * Updates totalShares when assets are deposited. */ handleERC4626Deposit(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; /** * Handle ERC4626 Withdraw event from vault. * Updates both totalAssets and totalShares when assets are withdrawn. */ handleERC4626Withdraw(event: any, state: DeepReadonly, log: Readonly): DeepReadonly | null; }