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.jsonUsage
use-token-list.tsx
import { useTokenList } from "@/hooks/uxdotsol/use-token-list"; const tokens = useTokenList(search, { limit: 12 });Options
| Name | Type | Default | Description |
|---|---|---|---|
| query | string | required | Name, symbol, or mint search text. Requests start at two characters. |
| options | { adapter?, endpoint?, enabled?, limit? } | {} | Provider override, route, request control, and result limit. |
Returns
| Name | Type | Default | Description |
|---|---|---|---|
| resource | { status, data, error, updatedAt, refetch } | — | Normalized resource state plus explicit status flags and a manual refresh action. |

