/** * Decodes the four RAILGUN V2 logs the Action reconstruction consumes into the plain * values `deriveTransactionsFromActionLogs` expects. * * This decodes each log from its raw topics/data rather than reusing the already-decoded * `args` that `scanAllEvents` attaches, and that choice is load-bearing: * `recursivelyDecodeResult` (src/utils/ethers.ts) turns an EMPTY `tuple[]` into `{}` * rather than `[]`, because `Result.toObject()` on an empty Result returns an object with * no `'_'` key and so never trips its array-detection branch. Every `shield()` emits * `Action(caller, [])`, so a reducer fed that would see `length === undefined`, decide the * txconfigs count disagreed with the Nullified count, and abort segmentation for the whole * EVM transaction. `Interface.decodeEventLog` returns a `Result`, which extends `Array`, so * the empty case stays a real array here. * * The second normalization has to be done explicitly: ethers decodes every integer as * `bigint` regardless of declared width, so `uint32 nullifiersCount` arrives as `2n`. * `ActionTxConfig` declares `number`, and the reducer compares * `nullifiers.length !== cfg.nullifiersCount` - a cross-type `!==` that is *always* true * against a bigint and would reject every transaction. Convert at this boundary so the * reducer only ever sees its declared types. */ import { RailgunActionLog } from './action-frames'; /** The minimal shape of an ethers `Log` this decoder needs. */ export type RawRailgunLog = { topics: readonly string[]; data: string; index: number; }; export declare const ACTION_EVENT_TOPIC: string; export declare const NULLIFIED_EVENT_TOPIC: string; export declare const TRANSACT_EVENT_TOPIC: string; export declare const UNSHIELD_EVENT_TOPIC: string; /** Every topic the Action reconstruction reads. Logs with any other topic are ignored. */ export declare const RAILGUN_ACTION_LOG_TOPICS: readonly string[]; /** * Decode one log. Returns undefined for any topic the reconstruction does not read, so a * caller can pass a whole transaction's logs without pre-filtering. */ export declare const decodeRailgunActionLog: (log: RawRailgunLog) => Optional; /** * Decode every RAILGUN log in one EVM transaction, dropping topics the reconstruction does * not read. Order is preserved; the reducer sorts by logIndex regardless. */ export declare const decodeRailgunActionLogs: (logs: readonly RawRailgunLog[]) => RailgunActionLog[];