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

useAirdropConfig

Read an airdrop instance's immutable configuration in one round trip.

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

Description

Read an airdrop instance's immutable configuration in one round trip.

Bundles token / airdropType / unwrappable / complianceManager / gasFee / canExtendClaimWindow / deploymentBlockNumber - what a UI needs before it can render anything else about a campaign, and how airdropType and unwrappable get covered without shipping two more one-line hooks nobody would call separately. variant is derived from the ordinal so a consumer can branch to the ECDSA or Merkle hook set without decoding the enum itself.

Defaults to staleTime: Infinity - none of these values is mutable after create. Pass query: { staleTime: 0 } to override.

The existing useAirdropToken, useAirdropGasFee and useComplianceManager overlap this bundle and stay: they are one eth_call rather than seven, which is cheaper for a UI that needs exactly one value.

Signature

@tokenops/sdk/fhe-airdrop/react
ts
function useAirdropConfig(args: UseAirdropConfigArgs): UseQueryResult<AirdropConfig, Error>;
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 useAirdropConfig; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-airdrop/react · @example
tsx
const { data: config } = useAirdropConfig({ address: airdropAddress });
if (config?.variant === "merkle") { ... }

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

See also

Other Read hooks in airdrop v2: