UX.SOL

Hook

useTokenList

Searches tokens through a replaceable server adapter and returns normalized metadata with explicit loading, error, and refresh states.

Installation

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

Usage

use-token-list.tsx
import { useTokenList } from "@/hooks/uxdotsol/use-token-list";
 
const tokens = useTokenList(search, { limit: 12 });

Options

NameTypeDefaultDescription
querystringrequiredName, symbol, or mint search text. Requests start at two characters.
options{ adapter?, endpoint?, enabled?, limit? }{}Provider override, route, request control, and result limit.

Returns

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