import { Interface } from '@ethersproject/abi'; import { BigNumber, BigNumberish } from 'ethers'; import { MethodParameters, Position as V3Position, RemoveLiquidityOptions as V3RemoveLiquidityOptions } from '@uniswap/v3-sdk'; import { Position as V4Position, AddLiquidityOptions as V4AddLiquidityOptions } from '@uniswap/v4-sdk'; import { Trade as RouterTrade } from '@uniswap/router-sdk'; import { Currency, TradeType } from '@uniswap/sdk-core'; import { SwapOptions } from './entities/actions/uniswap'; import { AcrossV4DepositV3Params } from './entities/actions/across'; import { TypedDataDomain, TypedDataField } from '@ethersproject/abstract-signer'; export type SwapRouterConfig = { sender?: string; deadline?: BigNumberish; }; export type SignedRouteOptions = { intent: string; data: string; sender: string; nonce?: string; }; export type EIP712Payload = { domain: TypedDataDomain; types: Record; value: { commands: string; inputs: string[]; intent: string; data: string; sender: string; nonce: string; deadline: string; }; }; export interface MigrateV3ToV4Options { inputPosition: V3Position; outputPosition: V4Position; v3RemoveLiquidityOptions: V3RemoveLiquidityOptions; v4AddLiquidityOptions: V4AddLiquidityOptions; } export declare abstract class SwapRouter { static INTERFACE: Interface; static PROXY_INTERFACE: Interface; static swapCallParameters(trades: RouterTrade, options: SwapOptions, bridgeOptions?: AcrossV4DepositV3Params[]): MethodParameters; /** * Generate EIP712 payload for signed execution (no signing performed) * Decodes existing execute() calldata and prepares it for signing * * @param calldata The calldata from swapCallParameters() or similar * @param signedOptions Options for signed execution (intent, data, sender, nonce) * @param deadline The deadline timestamp * @param chainId The chain ID * @param routerAddress The Universal Router contract address * @returns EIP712 payload ready to be signed externally */ static getExecuteSignedPayload(calldata: string, signedOptions: SignedRouteOptions, deadline: BigNumberish, chainId: number, routerAddress: string): EIP712Payload; /** * Encode executeSigned() call with signature * * @param calldata The original calldata from swapCallParameters() * @param signature The signature obtained from external signing * @param signedOptions The same options used in getExecuteSignedPayload() * @param deadline The deadline timestamp * @param nativeCurrencyValue The native currency value (ETH) to send * @returns Method parameters for executeSigned() */ static encodeExecuteSigned(calldata: string, signature: string, signedOptions: SignedRouteOptions, deadline: BigNumberish, nativeCurrencyValue?: BigNumber): MethodParameters; /** * Builds the call parameters for a migration from a V3 position to a V4 position. * Some requirements of the parameters: * - v3RemoveLiquidityOptions.collectOptions.recipient must equal v4PositionManager * - v3RemoveLiquidityOptions.liquidityPercentage must be 100% * - input pool and output pool must have the same tokens * - V3 NFT must be approved, or valid inputV3NFTPermit must be provided with UR as spender */ static migrateV3ToV4CallParameters(options: MigrateV3ToV4Options, positionManagerOverride?: string): MethodParameters; /** * Encodes a planned route into a method name and parameters for the Router contract. * @param planner the planned route * @param nativeCurrencyValue the native currency value of the planned route * @param config the router config */ private static encodePlan; /** * Encodes a planned route into calldata targeting the SwapProxy contract. * The proxy pulls ERC20 tokens from the user into the UR, then executes commands. */ private static encodeProxyPlan; }