We have upgraded the product to App Kit and recommend using it for all production deployments. USDCKit will remain available as a private beta product. Thank you.
@circle-fin/usdckit - v0.25.4
    Preparing search index...

    Function quoteExactInputSingle

    • Quotes the amount of output token that can be received for a given input token amount in a single swap.

      Parameters

      Returns Promise<
          {
              gasEstimate: bigint;
              initializedTicksCrossed: bigint;
              sqrtPriceX96After: bigint;
              tokenOutAmount: bigint;
          },
      >

      An object containing the amount of output token, the new sqrt price after the swap, the number of initialized ticks crossed, and the gas estimate for the operation.

      If the specified chain is not supported.

      const quote = await client.quoteExactInputSingle({
      tokenIn: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14', // WETH
      amountIn: '1', // 1 WETH
      tokenOut: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
      chain: ETH_SEPOLIA, // Ethereum Sepolia
      });
      // => {
      // tokenOutAmount: 1000000n, // 1 USDC
      // sqrtPriceX96After: 1234567890123456789n, // New sqrt price after the swap
      // initializedTicksCrossed: 1n, // Number of initialized ticks crossed
      // gasEstimate: 21000n, // Gas estimate for the operation
      // }