UX.SOL

Hook

usePaymentQuote

Requests a normalized ExactIn or ExactOut token conversion quote through a replaceable payment provider adapter.

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/use-payment-quote.json

Usage

use-payment-quote.tsx
import { usePaymentQuote } from "@/hooks/uxdotsol/use-payment-quote";
 
const quote = usePaymentQuote({
inputMint,
outputMint,
amount: atomicAmount,
swapMode: "ExactOut",
});

Options

NameTypeDefaultDescription
inputPaymentQuoteInput | nullrequiredToken mints, atomic amount, slippage, and ExactIn or ExactOut mode.
options{ adapter?, endpoint?, enabled? }{}Provider override, route, and request control.

Returns

NameTypeDefaultDescription
resource{ status, data, error, updatedAt, refetch }Normalized resource state plus explicit status flags and a manual refresh action.