import { AddressMap } from "../onchain/utils/AddressMap.js"; import { ParsedCallV2 } from "../onchain/base/types.js"; import { CallTrace } from "../onchain/utils/trace.js"; import { TokenTransfer } from "../onchain/market/adapters/transfers.js"; import { ChainContractsRegister } from "../onchain/base/ChainContractsRegister.js"; import "../onchain/index.js"; import { WithdrawCollateralEventInfo } from "./trace/extractTransfers.js"; import "./trace/index.js"; import { InnerOperation } from "./types.js"; import { Address } from "viem"; //#region src/history/classifyMulticallOperations.d.ts export interface ClassifyMulticallOperationsInput { innerCalls: ParsedCallV2[]; /** * ERC-20 transfers grouped per facade `Execute` event for this facade call, * one inner array per Execute event, in order. One inner array is consumed * per adapter/unknown inner call. */ executeTransfers: TokenTransfer[][]; /** * Adapter-level call traces (one per Execute event, in order) used to recover * the protocol-level call for adapter inner calls. See * `extractAdapterCallTraces`. */ adapterTraces: CallTrace[]; register: ChainContractsRegister; creditAccount: Address; underlying: Address; strict?: boolean; phantomTokens?: AddressMap
; withdrawCollateralEvents?: WithdrawCollateralEventInfo[]; } /** * Classifies each multicall inner call into a {@link InnerOperation}: * * - **Adapter calls** (target registered as an adapter): decodes the * protocol-level call via `adapter.parseProtocolCall()`, classifies the * legacy operation via `adapter.classifyLegacyOperation()`, and consumes the * next entry from `executeTransfers` (one Execute event per adapter call). * * - **Facade self-calls** (`increaseDebt`, `updateQuota`, etc.): mapped * directly from `functionName` / `rawArgs`. No transfer consumed. * * - **Unknown contracts** (address not in register): treated as adapter * calls with a fallback to generic `Swap` from transfers. * * Skips facade calls we're not interested in (`onDemandPriceUpdates`, `disableToken`, etc.). * * @throws {TransferAlignmentError} if the number of adapter calls does not * match the number of Execute transfers. * @throws {UnknownAdapterError} if strict is true and an inner call target * is not in the register. */ export declare function classifyMulticallOperations(input: ClassifyMulticallOperationsInput): InnerOperation[]; //#endregion