useBuyWithCryptoQuote
Hook to get a price quote for performing a "Buy with crypto" transaction that allows users to buy a token with another token - aka a swap.
The price quote is an object of type BuyWithCryptoQuote
.
This quote contains the information about the purchase such as token amounts, processing fees, estimated time etc.
This hook is a React Query wrapper of the getBuyWithCryptoQuote
function.
You can also use that function directly
Once you have the quote, you can use the useSendTransaction
function to send the purchase
and useBuyWithCryptoStatus
function to get the status of the swap transaction.
Example
Parameters
Returns
A React Query object which contains the data of type BuyWithCryptoQuote