import { type Address, type Hex } from "viem"; import type { AddressMap, ChainContractsRegister, ParsedCallV2 } from "../sdk/index.js"; import type { WithdrawCollateralEventInfo } from "./extractTransfers.js"; import type { InnerOperation } from "./inner-operations.js"; import type { ExecuteResult } from "./internal-types.js"; export interface ClassifyMulticallOperationsInput { innerCalls: ParsedCallV2[]; executeResults: ExecuteResult[]; protocolCalldatas: Hex[]; 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): delegates to * `adapter.parseAdapterOperation()` 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[];