import { Interface } from '@ethersproject/abi'; import { LogDescription } from 'ethers/lib/utils'; import { DeepReadonly } from 'ts-essentials'; import { Address, Log, Logger } from '../../types'; import { StatefulEventSubscriber } from '../../stateful-event-subscriber'; import { IDexHelper } from '../../dex-helper'; import { BmwState } from './types'; export declare class WombatBmw extends StatefulEventSubscriber { protected network: number; protected dexHelper: IDexHelper; protected bmwAddress: Address; protected onAssetAdded: (pool: Address, blockNumber: number) => Promise; static readonly bmwInterface: Interface; static readonly assetInterface: Interface; static readonly poolInterface: Interface; private readonly logDecoder; private bmwContract; private handlers; constructor(dexKey: string, name: string, network: number, dexHelper: IDexHelper, logger: Logger, bmwAddress: Address, onAssetAdded: (pool: Address, blockNumber: number) => Promise); /** * 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): 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. * should be generated * @returns state of the event subscriber at blocknumber */ generateState(blockNumber: number): Promise>; handleAdd(event: LogDescription, state: DeepReadonly, log: Readonly): Promise | null>; }