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

usePreflightClaim

Report what would stop a claim right now - chain support, the pause flag, both ends of the claim window, whether claimant can cover the exact-equality gas fee, the Merkle argument-relation rules when account/entrypoint are given, and for an ECDSA campaign given signature, whether the authorisation is valid and unconsumed.

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

Description

Report what would stop a claim right now - chain support, the pause flag, both ends of the claim window, whether claimant can cover the exact-equality gas fee, the Merkle argument-relation rules when account/entrypoint are given, and for an ECDSA campaign given signature, whether the authorisation is valid and unconsumed.

`ready: true` does not mean the claimant has anything to claim. The allocation is encrypted, so an SDK-side "nothing to claim" would require decrypting it; this checks only what is decidable without the ciphertext. Use it to disable a button, not to promise a payout.

Does not run the factory-registry genuineness check (headless preflightClaim's factory option); pair it with useIsAirdrop for an instance address you did not create.

Every field below variant feeds the blockers and is therefore part of the cache key. The fee check reads claimant's live ETH balance, so keep staleTime short - the default 0 is right for a claim button.

Signature

@tokenops/sdk/fhe-airdrop/react
ts
function usePreflightClaim(args: UsePreflightClaimArgs): UseQueryResult<PreflightResult, Error>;

Parameters

Shape of the options object passed to the hook itself.

PropertyTypeDescription
variantrequiredAirdropVariantWhich variant this instance is - picks the client the preflight reads through.
claimantAddressThe account that will SEND the claim and therefore pays the exact-equality gas fee. On a relayed Merkle claim this is the relayer.
accountAddressMerkle campaigns only: the claim identity, when it is not the sender. Defaults to claimant. Any address may send a Merkle claim; only the account itself may redirect with to.
toAddressThe payout destination, if one will be passed.
entrypoint"claim" | "claimAndUnwrap"Set for claimAndUnwrap, which is always submitted for the caller.
signatureEcdsaClaimPreflightSignatureECDSA campaigns only: adds the authorisation check to the report.
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 usePreflightClaim; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-airdrop/react · @example
tsx
const { data } = usePreflightClaim({ address: airdropAddress, variant: "merkle", claimant });
<button disabled={!data?.ready}>Claim</button>

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

See also

Other Read hooks in airdrop v2: