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: string
tokens: WhitehashToken[]
chains: Record<ChainId, {
status: "idle" | "loading" | "cached" | "done" | "error"
message: string
tokens: WhitehashToken[]
fromCache: boolean
}>
} | null
loading: boolean
refresh(): 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 detection
client, // optional custom WhitehashClient
cache, // optional memory or IndexedDB cache
})

Live result

Loading wallet…