useBuyWithFiatQuote
Hook to get a price quote for performing a "Buy with Fiat" transaction that allows users to buy a token with fiat currency.
The price quote is an object of type BuyWithFiatQuote
.
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 getBuyWithFiatQuote
function.
You can also use that function directly
Once you have the quote
, you can open a new window with quote.onRampLink
to allow the user to buy the token with fiat currency.
and useBuyWithFiatStatus
function to start polling for the status of this transaction.
Example
Parameters
Returns
A React Query object which contains the data of type BuyWithFiatQuote