React hooks
useWalletTokens
Find the tokens owned by a collector address across supported networks.
Usage
tsx
import { useWalletTokens } from "@whitehash/react"const result = useWalletTokens("tz1…")
Return value
ts
{state: {address: stringtokens: WhitehashToken[]chains: Record<ChainId, {status: "idle" | "loading" | "cached" | "done" | "error"message: stringtokens: WhitehashToken[]fromCache: boolean}>} | nullloading: booleanrefresh(): void}
Behavior
The address selects its Tezos or EVM family. Whitehash reads only known fxhash contracts, normalizes every generation into WhitehashToken, and can show cached results while each chain refreshes independently.
The address is always the owner. Passing an NFT contract asks for tokens owned by that contract; it does not filter a collection.
Limit the query
tsx
const wallet = useWalletTokens(address, {mode: "mainnet",chains: ["tezos:mainnet"], // skip address-based detectionclient, // optional custom WhitehashClientcache, // optional memory or IndexedDB cache})
Live result
Loading wallet…