import type { Address, Hex } from 'viem'; interface IntentBase { chainId: number; to: Address; selector: Hex; } export interface Erc20ApproveIntent extends IntentBase { protocol: 'erc20'; action: 'approve'; args: { spender: Address; amount: bigint; }; } export interface Erc20TransferIntent extends IntentBase { protocol: 'erc20'; action: 'transfer'; args: { to: Address; amount: bigint; }; } export interface UniswapV3ExactInputSingleIntent extends IntentBase { protocol: 'uniswap_v3'; action: 'exactInputSingle'; args: { tokenIn: Address; tokenOut: Address; fee: number; recipient: Address; amountIn: bigint; amountOutMinimum: bigint; sqrtPriceLimitX96: bigint; }; } export interface AaveV3SupplyIntent extends IntentBase { protocol: 'aave_v3'; action: 'supply'; args: { asset: Address; amount: bigint; onBehalfOf: Address; referralCode: number; }; } export interface AaveV3BorrowIntent extends IntentBase { protocol: 'aave_v3'; action: 'borrow'; args: { asset: Address; amount: bigint; interestRateMode: bigint; referralCode: number; onBehalfOf: Address; }; } export interface AaveV3RepayIntent extends IntentBase { protocol: 'aave_v3'; action: 'repay'; args: { asset: Address; amount: bigint; interestRateMode: bigint; onBehalfOf: Address; }; } export interface AaveV3WithdrawIntent extends IntentBase { protocol: 'aave_v3'; action: 'withdraw'; args: { asset: Address; amount: bigint; to: Address; }; } export interface UnknownIntent { protocol: 'unknown'; chainId: number; to: Address; selector?: Hex; rawData: Hex; reason: string; } export type DecodedIntent = Erc20ApproveIntent | Erc20TransferIntent | UniswapV3ExactInputSingleIntent | AaveV3SupplyIntent | AaveV3BorrowIntent | AaveV3RepayIntent | AaveV3WithdrawIntent | UnknownIntent; export interface ProtocolDecoder { readonly protocol: string; readonly supportedSelectors: readonly Hex[]; decode(chainId: number, to: Address, data: Hex): DecodedIntent; } export {};