import { Result } from "@ethersproject/abi"; import { Contract, Event, EventFilter } from "ethers"; import { Log, SortableEvent } from "../interfaces"; export declare function spreadEvent(args: Result | Record): { [key: string]: any; }; export interface EventSearchConfig { fromBlock: number; toBlock: number; maxBlockLookBack?: number; } export declare const eventToLog: (event: Event) => Log; export declare function paginatedEventQuery(contract: Contract, filter: EventFilter, searchConfig: EventSearchConfig, retryCount?: number): Promise; /** * @dev Warning: this is a specialized function!! Its functionality is not obvious. * This function attempts to return block ranges to repeat ranges as much as possible. To do so, it may include blocks that * are outside the provided range. The guarantee is that it will always include _at least_ the blocks requested. * @param eventSearchConfig contains fromBlock, toBlock, and maxBlockLookBack. * The range is inclusive, so the results will include events in the fromBlock and in the toBlock. * maxBlockLookback defined the maximum number of blocks to search. Because the range is inclusive, the maximum diff * in the returned pairs is maxBlockLookBack - 1. This is a bit non-intuitive here, but this is meant so that this * parameter more closely aligns with the more commonly understood definition of a max query range that node providers * use. * @returns an array of disjoint fromBlock, toBlock ranges that should be queried. These cover at least the entire * input range, but can include blocks outside of the desired range, so results should be filtered. Results * are ordered from smallest to largest. */ export declare function getPaginatedBlockRanges({ fromBlock, toBlock, maxBlockLookBack, }: EventSearchConfig): [number, number][]; export declare function spreadEventWithBlockNumber(event: Log): SortableEvent; export declare function sortEventsAscending(events: T[]): T[]; export declare function sortEventsAscendingInPlace(events: T[]): T[]; export declare function sortEventsDescending(events: T[]): T[]; export declare function sortEventsDescendingInPlace(events: T[]): T[]; export declare function isEventOlder(ex: T, ey: T): boolean; export declare function getTransactionHashes(events: SortableEvent[]): string[];