UX.SOL

Hook

usePriorityFeeEstimate

Reads recent Solana prioritization-fee samples and exposes normalized low, medium, and high ranges.

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/use-priority-fee-estimate.json

Usage

use-priority-fee-estimate.tsx
import { usePriorityFeeEstimate } from "@/hooks/uxdotsol/use-priority-fee-estimate";
 
const fees = usePriorityFeeEstimate(writableAccounts, { cluster: "mainnet-beta" });

Options

NameTypeDefaultDescription
writableAccountsreadonly string[][]Writable accounts used by RPC to select relevant recent fee samples.
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.