@circle-fin/usdckit - v0.18.0
    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
      // }