Skip to main content

Import

Usage

Return Type: UseQueryResult<SwapQuote>

The hook returns all properties from React Query’s UseQueryResult with swap quote data. Here’s the detailed structure:

Properties

data

SwapQuote | undefined The swap quote object containing:
  • currencyAddress: Address of the currency to be swapped
  • currencyBalance: Balance of the currency in the user’s wallet
  • price: The current price for the swap
  • maxPrice: Maximum price allowed for the swap (includes slippage)
  • to: The target contract address for the swap
  • transactionData: Encoded transaction data for executing the swap
  • transactionValue: The value to be sent with the transaction
  • approveData: Encoded approval transaction data (if includeApprove is true)

isLoading

boolean Loading state for the data fetch.

isError

boolean Error state indicating if the query failed.

error

Error | null Any error that occurred during data fetching.

Parameters

The hook accepts two parameters:

args: UseGetSwapQuoteArgs

options: HooksOptions