import { Interface, LogDescription } from '@ethersproject/abi'; type DecodableLog = { topics: string[]; data: string; }; /** * `Interface.parseLog` resolves `topics[0]` by formatting and keccak hashing * every event fragment of the ABI until one matches, then deep copies the * result into a `LogDescription`. Both costs are paid on every single log, and * the first one grows with the size of the ABI. * * This decoder builds the `topic0 -> fragment` map once and resolves a log with * a single map lookup, reusing the name/signature/topic computed at build time. * * `args` is deep copied exactly like `parseLog` does, so consumers see the same * values. The one deviation is `eventFragment`: `parseLog` hands out a deep * copy of the fragment, this decoder hands out the fragment itself. Copying it * per log is the most expensive part of that deep copy, and nothing reads * `eventFragment` off a decoded log. */ export declare class TopicLogDecoder { private readonly iface; private readonly byTopic; constructor(iface: Interface); decode(log: DecodableLog): LogDescription; private getEntry; } /** * Returns the shared `TopicLogDecoder` of an `Interface`, building it on first * use. Interfaces shared across pools (`erc20Iface`, ...) therefore share a * single topic map. */ export declare function getTopicLogDecoder(iface: Interface): TopicLogDecoder; export {};