UniDevKit - v2.1.1
    Preparing search index...

    Interface SwapExactInSingle

    Extended SwapExactInSingle type that ensures alignment with Uniswap V4 SDK while providing additional flexibility for our use case.

    const swapParams: SwapExactInSingle = {
    poolKey: {
    currency0: "0x...",
    currency1: "0x...",
    fee: 500,
    tickSpacing: 10,
    hooks: "0x0000000000000000000000000000000000000000"
    },
    zeroForOne: true,
    amountIn: "1000000"
    };
    interface SwapExactInSingle {
        amountIn: string;
        amountOutMinimum?: string;
        hookData?: string;
        poolKey: PoolKey;
        zeroForOne: boolean;
    }

    Hierarchy

    • Partial<UniswapSwapExactInSingle>
      • SwapExactInSingle
    Index

    Properties

    amountIn: string

    The amount of tokens being swapped, as string (numberish). Accepts bigint.toString(), number, etc.

    Must match Uniswap V4 structure exactly

    amountOutMinimum?: string

    Optional minimum amount out for slippage protection.

    Made optional for flexibility, defaults to "0" if not provided

    hookData?: string

    Optional additional data for the hooks.

    Made optional for flexibility, defaults to "0x" if not provided

    poolKey: PoolKey

    Pool key with currency addresses, fee, tick spacing, and hooks.

    Must match Uniswap V4 structure exactly

    zeroForOne: boolean

    Direction of the swap. True if swapping from currency0 to currency1.

    Must match Uniswap V4 structure exactly