hoodkit
    Preparing search index...

    Interface UseSwapResult

    State + actions returned by useSwap.

    interface UseSwapResult {
        error: Error | null;
        getQuote: (
            args: {
                amountIn: bigint;
                tokenIn: `0x${string}`;
                tokenOut: `0x${string}`;
            },
        ) => Promise<SwapQuote | null>;
        isQuoting: boolean;
        isSwapping: boolean;
        quote: SwapQuote | null;
        reset: () => void;
        swap: (
            args: {
                amountIn: bigint;
                tokenIn: `0x${string}`;
                tokenOut: `0x${string}`;
            },
            swapOptions?: { slippageBps?: number },
        ) => Promise<`0x${string}` | null>;
        txHash: `0x${string}` | null;
    }
    Index
    error: Error | null
    getQuote: (
        args: {
            amountIn: bigint;
            tokenIn: `0x${string}`;
            tokenOut: `0x${string}`;
        },
    ) => Promise<SwapQuote | null>

    Fetch a quote for the given swap.

    isQuoting: boolean
    isSwapping: boolean
    quote: SwapQuote | null
    reset: () => void

    Reset quote/error/tx state.

    swap: (
        args: {
            amountIn: bigint;
            tokenIn: `0x${string}`;
            tokenOut: `0x${string}`;
        },
        swapOptions?: { slippageBps?: number },
    ) => Promise<`0x${string}` | null>

    Execute the swap (requires a wallet-backed client).

    txHash: `0x${string}` | null