usePreflightCreateAirdrop
Read-only preflight for useCreateEcdsaAirdrop / useCreateMerkleAirdrop.
@tokenops/sdk/fhe-airdrop/react{ data, isLoading, error, refetch }Description
Read-only preflight for useCreateEcdsaAirdrop / useCreateMerkleAirdrop.
Runs every create-time guardrail the write path enforces - chain support,
the Merkle/UUPS refusal, params the new instance's initializer would revert
on (zero token, an endTime less than a minute past the latest block's
timestamp, a window that does not open before it closes, a zero immutable
Merkle root, a zero ECDSA signer),
the resolved fee against the factory's ceiling and the creator's bound,
the creator's effective upgradeability policy for
mode: "uups", the stock-wrapper probe when params.common.unwrappable is
set, a salt collision on the predicted address, a pinned expected
commitment that drifted from the fresh quote, and implementation drift
when expectedInitCodeHash (or a Merkle plan) is supplied.
The point is disabling the submit button, not catching after the fact.
blockers carries the same typed errors create* would have thrown, so a
UI branches on error.code here exactly as it does in onError.
commitments is what the create would be sent with, for showing the creator
before they sign.
Disabled until variant, params, mode, creator and userSalt are all
set. Factory writes made through this SDK's admin hooks invalidate it;
refetch after a factory change made anywhere else.
Signature
function usePreflightCreateAirdrop(args?: UsePreflightCreateAirdropArgs): UseQueryResult<PreflightCreateResult, Error>;Example
const { data: report } = usePreflightCreateAirdrop({
variant: "merkle", params, mode: "clone", creator, userSalt, plan,
});
const canSubmit = report?.ready === true;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.