React hooks

useToken

Load one token from its network, collection, and edition number.

Usage

tsx
import { useToken } from "@whitehash/react"
const result = useToken({ chain: "tezos:mainnet", contract: "KT1…", tokenId: "16333" })

Return value

ts
{
token: WhitehashToken | null
loading: boolean
error: string | null
refresh(): void
}

Identity is explicit

Pass the token’s chain, contract, and tokenId. Pass null while a route or selection is incomplete; the hook clears its result without issuing a request.

Live result

Loading token…