UX.SOL

Hook

usePaymentStatus

Verifies an existing Solana payment signature through a server RPC adapter with explicit not-found and terminal states.

Installation

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

Usage

use-payment-status.tsx
import { usePaymentStatus } from "@/hooks/uxdotsol/use-payment-status";
 
const payment = usePaymentStatus(signature, { cluster: "devnet" });

Options

NameTypeDefaultDescription
signaturestring | nullrequiredExisting Solana transaction signature to verify.
options{ cluster?, adapter?, endpoint?, enabled? }{}Cluster, 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.