useTokenOf
Resolve the token the factory recorded for an airdrop instance at create - what fundAirdrop pulls, regardless of what the instance reports today.
@tokenops/sdk/fhe-airdrop/react{ data, isLoading, error, refetch }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
function useTokenOf(args?: UseTokenOfArgs): UseQueryResult<Address, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| airdrop | Address | The airdrop instance whose recorded token to resolve. |
Example
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:
useAirdropTokenRead the ERC-7984 token an airdrop instance distributes.useAirdropWindowRead an airdrop instance's claim-window snapshot in one round trip.useAirdropGasFeeRead the per-claim ETH fee (wei) an instance charges; 0n on a fee-free campaign.useMerkleRootRead a MerkleConfidentialAirdrop instance's currently published root.