2.0 RC docsView 1.x docs
v2.0.0-rc.1 release candidate
The API is frozen and later candidates carry fixes only, except the receipt-free and Safe create surface of /fhe-airdrop, which is @beta. Published on the next dist-tag; latest stays on 1.6.0 until 2.0.0.
ReaduseQuery

useTokenOf

Resolve the token the factory recorded for an airdrop instance at create - what fundAirdrop pulls, regardless of what the instance reports today.

Import
@tokenops/sdk/fhe-airdrop/react
Return
{ data, isLoading, error, refetch }
Lifecycle
Read

Description

Resolve the token the factory recorded for an airdrop instance at create - what fundAirdrop pulls, regardless of what the instance reports today.

A zero address means the instance did not come from this factory.

Cached indefinitely once non-zero: the mapping is written once, inside createX. A zero answer (not created yet, or not from this factory) is not cached forever: it stays stale and refetches on the next mount, focus or refetch, because the address can be created later by another tab, a server or the headless client, none of which reaches a hook invalidation. The create hooks in this subpath also invalidate this key for the address they deploy, so a zero already on screen updates immediately; the per-result staleTime covers every other create path, the same policy as useIsAirdrop. Override through query.staleTime.

Signature

@tokenops/sdk/fhe-airdrop/react
ts
function useTokenOf(args?: UseTokenOfArgs): UseQueryResult<Address, Error>;

Parameters

Shape of the options object passed to the hook itself.

PropertyTypeDescription
airdropAddressThe airdrop instance whose recorded token to resolve.
Want to run a similar shape interactively? The Playground ships 12 ready presets across vesting / airdrop / disperse / faucet — deploy a manager, create a vesting, claim, and run the product equivalents. The deep-link above auto-selects the closest preset to useTokenOf; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-airdrop/react · @example
tsx
const { data: token } = useTokenOf({ airdrop: airdropAddress });

Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.

See also

Other Read hooks in airdrop v2: