Skip to main content

fhe-airdrop/react

Interfaces

PredictAirdropArgs

Defined in: fhe-airdrop/factory.ts:162

Properties

PropertyTypeDescriptionDefined in
paramsAirdropParams-fhe-airdrop/factory.ts:163
userSalt`0x${(...)}`-fhe-airdrop/factory.ts:164
deployer`0x${(...)}`-fhe-airdrop/factory.ts:165
gasFeebigintGas fee in wei to embed into the CREATE2 salt computation. Must match the fee that will be (or was) active for deployer at deploy time: custom fee if getCustomFee(deployer).enabled, otherwise defaultGasFee. Passing the wrong value produces a different address than the deployed clone.fhe-airdrop/factory.ts:173

BaseHookOptions

Defined in: fhe-airdrop/react/_shared.ts:29

Common per-hook overrides — every public hook accepts these alongside its own args.

Extended by

Properties

PropertyTypeDescriptionDefined in
address?... | ...Override the on-chain contract address. Defaults to getFheAirdropFactoryAddress keyed by chain id.fhe-airdrop/react/_shared.ts:31
chainId?... | ...Override the chain id used for default address resolution. Defaults to usePublicClient().chain?.id.fhe-airdrop/react/_shared.ts:33

FactoryHookOptions

Defined in: fhe-airdrop/react/_shared.ts:37

Per-hook overrides for factory hooks that submit encrypted inputs.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address?... | ...Override the on-chain contract address. Defaults to getFheAirdropFactoryAddress keyed by chain id.BaseHookOptions.addressfhe-airdrop/react/_shared.ts:31
chainId?... | ...Override the chain id used for default address resolution. Defaults to usePublicClient().chain?.id.BaseHookOptions.chainIdfhe-airdrop/react/_shared.ts:33
encryptor?... | ...Lazy or eager encryptor source. Optional at hook level; required at call time for factory methods that submit encrypted inputs (useCreateAndFundConfidentialAirdrop, useFundConfidentialAirdrop). Recommended in React: capture useZamaSDK() once at the top of your component and wire encryptor: () => sdk.relayer — the SDK calls this per-encryption so it picks up the live ZamaSDK instance rather than a stale capture (CLAUDE.md Pitfall #3).-fhe-airdrop/react/_shared.ts:48

AirdropHookOptions

Defined in: fhe-airdrop/react/_shared.ts:52

Per-hook overrides for FHE-airdrop clone hooks — address is required (per-airdrop).

Extended by

Properties

PropertyTypeDescriptionDefined in
address`0x${(...)}`Deployed airdrop clone address. Required — there is no chain-level default.fhe-airdrop/react/_shared.ts:54
aclAddress?... | ...Override the FHEVM ACL address (defaults to chain-id lookup).fhe-airdrop/react/_shared.ts:56
chainId?... | ...Override the chain id used for ACL/public-client lookup. Defaults to usePublicClient().chain?.id.fhe-airdrop/react/_shared.ts:58

UseAirdropClaimedSignaturesArgs

Defined in: fhe-airdrop/react/useAirdropClaimedSignatures.ts:6

Per-hook overrides for FHE-airdrop clone hooks — address is required (per-airdrop).

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address`0x${(...)}`Deployed airdrop clone address. Required — there is no chain-level default.AirdropHookOptions.addressfhe-airdrop/react/_shared.ts:54
aclAddress?... | ...Override the FHEVM ACL address (defaults to chain-id lookup).AirdropHookOptions.aclAddressfhe-airdrop/react/_shared.ts:56
chainId?... | ...Override the chain id used for ACL/public-client lookup. Defaults to usePublicClient().chain?.id.AirdropHookOptions.chainIdfhe-airdrop/react/_shared.ts:58
signatureHash?... | ...EIP-712 struct hash of a Claim. Hook is disabled until set.-fhe-airdrop/react/useAirdropClaimedSignatures.ts:8

UseAirdropGrantRoleArgs

Defined in: fhe-airdrop/react/useAirdropGrantRole.ts:7

Properties

PropertyTypeDefined in
role`0x${(...)}`fhe-airdrop/react/useAirdropGrantRole.ts:8
accountTarget`0x${(...)}`fhe-airdrop/react/useAirdropGrantRole.ts:9
account?... | ... | ...fhe-airdrop/react/useAirdropGrantRole.ts:10

UseAirdropHasRoleArgs

Defined in: fhe-airdrop/react/useAirdropHasRole.ts:6

Per-hook overrides for FHE-airdrop clone hooks — address is required (per-airdrop).

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address`0x${(...)}`Deployed airdrop clone address. Required — there is no chain-level default.AirdropHookOptions.addressfhe-airdrop/react/_shared.ts:54
aclAddress?... | ...Override the FHEVM ACL address (defaults to chain-id lookup).AirdropHookOptions.aclAddressfhe-airdrop/react/_shared.ts:56
chainId?... | ...Override the chain id used for ACL/public-client lookup. Defaults to usePublicClient().chain?.id.AirdropHookOptions.chainIdfhe-airdrop/react/_shared.ts:58
role?... | ...--fhe-airdrop/react/useAirdropHasRole.ts:7
account?... | ...--fhe-airdrop/react/useAirdropHasRole.ts:8

UseAirdropIsSignatureClaimedArgs

Defined in: fhe-airdrop/react/useAirdropIsSignatureClaimed.ts:6

Per-hook overrides for FHE-airdrop clone hooks — address is required (per-airdrop).

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address`0x${(...)}`Deployed airdrop clone address. Required — there is no chain-level default.AirdropHookOptions.addressfhe-airdrop/react/_shared.ts:54
aclAddress?... | ...Override the FHEVM ACL address (defaults to chain-id lookup).AirdropHookOptions.aclAddressfhe-airdrop/react/_shared.ts:56
chainId?... | ...Override the chain id used for ACL/public-client lookup. Defaults to usePublicClient().chain?.id.AirdropHookOptions.chainIdfhe-airdrop/react/_shared.ts:58
user?... | ...Recipient address from the claim authorization.-fhe-airdrop/react/useAirdropIsSignatureClaimed.ts:8
encryptedAmountHandle?... | ...externalEuint64 handle (as Hex) from the claim payload.-fhe-airdrop/react/useAirdropIsSignatureClaimed.ts:10

UseAirdropIsSignatureValidArgs

Defined in: fhe-airdrop/react/useAirdropIsSignatureValid.ts:7

Per-hook overrides for FHE-airdrop clone hooks — address is required (per-airdrop).

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address`0x${(...)}`Deployed airdrop clone address. Required — there is no chain-level default.AirdropHookOptions.addressfhe-airdrop/react/_shared.ts:54
aclAddress?... | ...Override the FHEVM ACL address (defaults to chain-id lookup).AirdropHookOptions.aclAddressfhe-airdrop/react/_shared.ts:56
chainId?... | ...Override the chain id used for ACL/public-client lookup. Defaults to usePublicClient().chain?.id.AirdropHookOptions.chainIdfhe-airdrop/react/_shared.ts:58
encryptedAmountHandle?... | ...externalEuint64 handle (as Hex) from the claim payload.-fhe-airdrop/react/useAirdropIsSignatureValid.ts:9
signature?... | ...EIP-712 admin signature over Claim(address recipient, bytes32 encryptedAmount).-fhe-airdrop/react/useAirdropIsSignatureValid.ts:11
caller?... | ...Caller address — the contract recomputes the struct hash over (msg.sender, encryptedAmount), so validity is caller-specific. Defaults to the connected wallet via wagmi's useAccount(); pass explicitly to check on behalf of another address.-fhe-airdrop/react/useAirdropIsSignatureValid.ts:18

UseAirdropRevokeRoleArgs

Defined in: fhe-airdrop/react/useAirdropRevokeRole.ts:7

Properties

PropertyTypeDefined in
role`0x${(...)}`fhe-airdrop/react/useAirdropRevokeRole.ts:8
accountTarget`0x${(...)}`fhe-airdrop/react/useAirdropRevokeRole.ts:9
account?... | ... | ...fhe-airdrop/react/useAirdropRevokeRole.ts:10

UseAirdropWithdrawGasFeeArgs

Defined in: fhe-airdrop/react/useAirdropWithdrawGasFee.ts:7

Properties

PropertyTypeDescriptionDefined in
recipient`0x${(...)}`-fhe-airdrop/react/useAirdropWithdrawGasFee.ts:8
amountbigintAmount of ETH to withdraw (in wei). Pass 0n to withdraw the entire balance.fhe-airdrop/react/useAirdropWithdrawGasFee.ts:10
account?... | ... | ...-fhe-airdrop/react/useAirdropWithdrawGasFee.ts:11

UseDisableCustomFeeArgs

Defined in: fhe-airdrop/react/useDisableCustomFee.ts:7

Properties

PropertyTypeDefined in
campaignCreator`0x${(...)}`fhe-airdrop/react/useDisableCustomFee.ts:8
account?... | ... | ...fhe-airdrop/react/useDisableCustomFee.ts:9

UseExtendClaimWindowArgs

Defined in: fhe-airdrop/react/useExtendClaimWindow.ts:7

Properties

PropertyTypeDefined in
newEndTimenumberfhe-airdrop/react/useExtendClaimWindow.ts:8
account?... | ... | ...fhe-airdrop/react/useExtendClaimWindow.ts:9

UseFactoryCustomFeeArgs

Defined in: fhe-airdrop/react/useFactoryCustomFee.ts:7

Common per-hook overrides — every public hook accepts these alongside its own args.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address?... | ...Override the on-chain contract address. Defaults to getFheAirdropFactoryAddress keyed by chain id.BaseHookOptions.addressfhe-airdrop/react/_shared.ts:31
chainId?... | ...Override the chain id used for default address resolution. Defaults to usePublicClient().chain?.id.BaseHookOptions.chainIdfhe-airdrop/react/_shared.ts:33
creator?... | ...Address whose per-creator fee override to read. Hook is disabled until set.-fhe-airdrop/react/useFactoryCustomFee.ts:9

UseFactoryInitCodeHashArgs

Defined in: fhe-airdrop/react/useFactoryInitCodeHash.ts:7

Common per-hook overrides — every public hook accepts these alongside its own args.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
address?... | ...Override the on-chain contract address. Defaults to getFheAirdropFactoryAddress keyed by chain id.BaseHookOptions.addressfhe-airdrop/react/_shared.ts:31
chainId?... | ...Override the chain id used for default address resolution. Defaults to usePublicClient().chain?.id.BaseHookOptions.chainIdfhe-airdrop/react/_shared.ts:33
params?... | ...--fhe-airdrop/react/useFactoryInitCodeHash.ts:8
gasFee?... | ...--fhe-airdrop/react/useFactoryInitCodeHash.ts:9

UseSetCustomFeeArgs

Defined in: fhe-airdrop/react/useSetCustomFee.ts:7

Properties

PropertyTypeDefined in
campaignCreator`0x${(...)}`fhe-airdrop/react/useSetCustomFee.ts:8
gasFeebigintfhe-airdrop/react/useSetCustomFee.ts:9
account?... | ... | ...fhe-airdrop/react/useSetCustomFee.ts:10

UseSetDefaultGasFeeArgs

Defined in: fhe-airdrop/react/useSetDefaultGasFee.ts:7

Properties

PropertyTypeDefined in
newGasFeebigintfhe-airdrop/react/useSetDefaultGasFee.ts:8
account?... | ... | ...fhe-airdrop/react/useSetDefaultGasFee.ts:9

UseSetFeeCollectorArgs

Defined in: fhe-airdrop/react/useSetFeeCollector.ts:7

Properties

PropertyTypeDefined in
newFeeCollector`0x${(...)}`fhe-airdrop/react/useSetFeeCollector.ts:8
account?... | ... | ...fhe-airdrop/react/useSetFeeCollector.ts:9

UseSetPausedArgs

Defined in: fhe-airdrop/react/useSetPaused.ts:7

Properties

PropertyTypeDefined in
pausedbooleanfhe-airdrop/react/useSetPaused.ts:8
account?... | ... | ...fhe-airdrop/react/useSetPaused.ts:9

UseSignClaimAuthorizationArgs

Defined in: fhe-airdrop/react/useSignClaimAuthorization.ts:8

Properties

PropertyTypeDescriptionDefined in
airdropAddress`0x${(...)}`The deployed airdrop clone address (EIP-712 verifying contract).fhe-airdrop/react/useSignClaimAuthorization.ts:10
recipient`0x${(...)}`Address authorised to claim.fhe-airdrop/react/useSignClaimAuthorization.ts:12
encryptedAmountHandle`0x${(...)}`externalEuint64 handle bytes32 — pass encrypted.handle from encryptUint64.fhe-airdrop/react/useSignClaimAuthorization.ts:14

UseSignClaimAuthorizationOptions

Defined in: fhe-airdrop/react/useSignClaimAuthorization.ts:17

Properties

PropertyTypeDescriptionDefined in
chainId?... | ...Override the chain id used for the wagmi useWalletClient lookup. Defaults to the connected chain.fhe-airdrop/react/useSignClaimAuthorization.ts:19

UseWithdrawArgs

Defined in: fhe-airdrop/react/useWithdraw.ts:7

Properties

PropertyTypeDefined in
recipient`0x${(...)}`fhe-airdrop/react/useWithdraw.ts:8
account?... | ... | ...fhe-airdrop/react/useWithdraw.ts:9

UseWithdrawOtherConfidentialTokenArgs

Defined in: fhe-airdrop/react/useWithdrawOtherConfidentialToken.ts:7

Properties

PropertyTypeDefined in
tokenAddress`0x${(...)}`fhe-airdrop/react/useWithdrawOtherConfidentialToken.ts:8
recipient`0x${(...)}`fhe-airdrop/react/useWithdrawOtherConfidentialToken.ts:9
account?... | ... | ...fhe-airdrop/react/useWithdrawOtherConfidentialToken.ts:10

UseWithdrawOtherTokenArgs

Defined in: fhe-airdrop/react/useWithdrawOtherToken.ts:7

Properties

PropertyTypeDefined in
tokenAddress`0x${(...)}`fhe-airdrop/react/useWithdrawOtherToken.ts:8
recipient`0x${(...)}`fhe-airdrop/react/useWithdrawOtherToken.ts:9
account?... | ... | ...fhe-airdrop/react/useWithdrawOtherToken.ts:10

Functions

useAirdropCanExtendClaimWindow()

function useAirdropCanExtendClaimWindow(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropCanExtendClaimWindow.ts:9

Read whether the admin can extend the claim window past endTime on this airdrop clone. Immutable arg — set at deployment, never changes.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropClaimTypehash()

function useAirdropClaimTypehash(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropClaimTypehash.ts:12

Read the EIP-712 type hash for Claim(address recipient, bytes32 encryptedAmount). Useful for off-chain signers that assemble the typed-data payload manually (custom HSM-backed signers, ledger flows) instead of calling signClaimAuthorization.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropClaimedSignatures()

function useAirdropClaimedSignatures(args): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropClaimedSignatures.ts:19

Check whether a pre-computed claim struct hash has been consumed on this airdrop clone.

Prefer useAirdropIsSignatureClaimed unless you already hold the pre-computed bytes32 struct hash — that hook takes the more common (user, encryptedAmountHandle) shape and computes the hash for you.

Parameters

ParameterType
argsUseAirdropClaimedSignaturesArgs

Returns

UseQueryResult<..., ...>


useAirdropDeploymentBlockNumber()

function useAirdropDeploymentBlockNumber(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropDeploymentBlockNumber.ts:8

Read the block number at which this airdrop clone was deployed.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropDomainSeparator()

function useAirdropDomainSeparator(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropDomainSeparator.ts:10

Read the EIP-712 domain separator for this airdrop clone. Useful for off-chain signing tools that build claim authorizations server-side.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropEndTime()

function useAirdropEndTime(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropEndTime.ts:12

Read the airdrop clone's endTime — the unix timestamp when claims close. Mutable: the admin can extend it via useExtendClaimWindow when canExtendClaimWindow() is true.

After a successful useExtendClaimWindow, invalidate this query.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropGasFee()

function useAirdropGasFee(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropGasFee.ts:13

Read the airdrop clone's immutable per-claim gas fee (in wei). Attached as msg.value by claim() automatically when the consumer doesn't pass value explicitly.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>

Example

const { data: gasFee } = useAirdropGasFee({ address: airdropAddress });

useAirdropGrantRole()

function useAirdropGrantRole(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useAirdropGrantRole.ts:20

AccessControl: grant role to accountTarget on this airdrop clone. Caller must be a member of the role's admin role (typically DEFAULT_ADMIN_ROLE).

After success, invalidate useAirdropHasRole({ role, account: accountTarget }).

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useAirdropHasClaimEnded()

function useAirdropHasClaimEnded(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropHasClaimEnded.ts:9

Read whether the current chain timestamp is past endTime on this airdrop clone. Free chain read — no gas, no tx.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropHasClaimStarted()

function useAirdropHasClaimStarted(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropHasClaimStarted.ts:9

Read whether the current chain timestamp is past START_TIME on this airdrop clone. Free chain read — no gas, no tx.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropHasRole()

function useAirdropHasRole(args): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropHasRole.ts:17

Read AccessControl: is account a member of role on this airdrop clone?

The role hashes are stable across deployments (DEFAULT_ADMIN_ROLE, FEE_COLLECTOR_ROLE, etc.).

Parameters

ParameterType
argsUseAirdropHasRoleArgs

Returns

UseQueryResult<..., ...>


useAirdropIsClaimWindowActive()

function useAirdropIsClaimWindowActive(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropIsClaimWindowActive.ts:11

Read whether the airdrop is currently within its claim window AND not paused. Free chain read — no gas, no tx.

Use this as a pre-claim UI gate.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropIsPaused()

function useAirdropIsPaused(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropIsPaused.ts:10

Read whether claims are currently paused by the admin on this airdrop clone.

After a successful useSetPaused, invalidate this query.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>


useAirdropIsSignatureClaimed()

function useAirdropIsSignatureClaimed(args): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropIsSignatureClaimed.ts:25

Check whether a claim has been consumed for a (user, encryptedAmountHandle) pair on this airdrop clone. The contract recomputes the struct hash internally and looks it up in storage.

Most frontends want this hook over useAirdropClaimedSignatures — pass the same user + encryptedAmountHandle that appear in the admin-issued claim payload.

After a successful useClaim, invalidate this query for the claimed (user, encryptedAmountHandle) pair.

Parameters

ParameterType
argsUseAirdropIsSignatureClaimedArgs

Returns

UseQueryResult<..., ...>


useAirdropIsSignatureValid()

function useAirdropIsSignatureValid(args): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropIsSignatureValid.ts:54

Check whether an admin-issued claim authorization is valid for a specific caller, without consuming it.

The query has two distinct failure shapes that must be handled separately:

  • data === false: the signature is structurally valid but fails the on-chain check — already claimed, claim window inactive, or signer lacks DEFAULT_ADMIN_ROLE.
  • error?.code === "TOKENOPS_INVALID_SIGNATURE": the signature bytes are structurally malformed (wrong length, invalid s-value range, unparseable). The on-chain ECDSA.recover reverts before the boolean logic runs, so this shows up on error, not on data.
const sig = useAirdropIsSignatureValid({ address, encryptedAmountHandle, signature, caller });
if (sig.error?.code === "TOKENOPS_INVALID_SIGNATURE") {
// malformed signature bytes
} else if (sig.data === false) {
// wrong signer, already claimed, or window closed
} else if (sig.data === true) {
// ready to claim
}

The result is caller-specific (the on-chain check binds to msg.sender). caller defaults to the connected wallet; the query stays disabled until a caller is available, and the caller is part of the query key so cached results don't bleed across account switches.

Use this to show a pre-claim validation state in the UI before asking the user to pay gas.

Parameters

ParameterType
argsUseAirdropIsSignatureValidArgs

Returns

UseQueryResult<..., ...>


useAirdropRevokeRole()

function useAirdropRevokeRole(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useAirdropRevokeRole.ts:19

AccessControl: revoke role from accountTarget on this airdrop clone. Caller must be a member of the role's admin role.

After success, invalidate useAirdropHasRole({ role, account: accountTarget }).

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useAirdropStartTime()

function useAirdropStartTime(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropStartTime.ts:12

Read the airdrop clone's immutable START_TIME — the unix timestamp when claims become available.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>

Example

const { data: startTime } = useAirdropStartTime({ address: airdropAddress });

useAirdropToken()

function useAirdropToken(options): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useAirdropToken.ts:13

Read the airdrop clone's immutable TOKEN. Result is cacheable for the clone's lifetime — the field is baked into the clone's bytecode.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseQueryResult<..., ...>

Example

const { data: token } = useAirdropToken({ address: airdropAddress });

useAirdropWithdrawGasFee()

function useAirdropWithdrawGasFee(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useAirdropWithdrawGasFee.ts:19

Fee collector: withdraw collected ETH gas fees from the airdrop clone. Requires FEE_COLLECTOR_ROLE. Pass amount = 0n to withdraw the entire balance.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useClaim()

function useClaim(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useClaim.ts:32

Claim tokens from an airdrop using an EIP-712 admin signature. Submits the admin-issued { encryptedInput, signature } pair verbatim — the SDK does NOT re-encrypt on the recipient side, because the signature commits to the exact bytes32 handle and any re-encryption would invalidate it.

Attaches GAS_FEE() ETH as msg.value automatically unless args.value is set.

The admin builds encryptedInput server-side via encryptUint64 with userAddress: recipient (Zama input proofs are bound to the recipient), then signs the resulting handle with signClaimAuthorization. Deliver (encryptedInput, signature) to the recipient via your channel of choice; the recipient passes the pair to this hook unchanged.

After a successful claim, invalidate useAirdropIsSignatureClaimed({ user, encryptedAmountHandle }) and any UI counts you computed off it.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>

Example

const claim = useClaim({ address: airdropAddress });
claim.mutate({ encryptedInput, signature });

useConfidentialAirdropFactoryImplementation()

function useConfidentialAirdropFactoryImplementation(options?): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.ts:13

Read the FHE-airdrop factory's current implementation() address — the LibClone target every new airdrop clone delegates to.

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseQueryResult<..., ...>

Example

const { data: implementation } = useConfidentialAirdropFactoryImplementation();

useCreateAndFundConfidentialAirdrop()

function useCreateAndFundConfidentialAirdrop(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.ts:36

Deploy AND fund a new airdrop clone in a single transaction. The SDK encrypts the plaintext amount into an externalEuint64 and submits it with an input proof — callers never handle ciphertext.

Encryptor resolution. The hook-level encryptor (from FactoryHookOptions) is forwarded lazily to the SDK client. You can also pass encryptor per-mutation via args.encryptor to override it. If neither is present, the SDK throws Missing encryptor — pass encryptor… verbatim.

Prerequisites: caller must have set the factory as an operator on the token: token.setOperator(factoryAddress, deadline).

After success, invalidate factory queries that depend on per-creator state:

function Component() {
const queryClient = useQueryClient();
const zamaSDK = useZamaSDK();
const create = useCreateAndFundConfidentialAirdrop({ encryptor: () => zamaSDK.relayer });
create.mutate(args, {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
},
});
}

Parameters

ParameterType
optionsFactoryHookOptions

Returns

UseMutationResult<..., ..., ...>


useCreateAndFundConfidentialAirdropAndGetAddress()

function useCreateAndFundConfidentialAirdropAndGetAddress(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.ts:43

Recommended fund-on-create entry point. Deploy AND fund a new airdrop clone in one tx, then resolve its address from the ConfidentialAirdropCreated event in the receipt.

Use this in place of useCreateAndFundConfidentialAirdrop when you need the deployed clone address — for example to navigate to a detail page immediately after the deploy.

Internally: createAndFundConfidentialAirdropwaitForTransactionReceiptparseEventLogs({ eventName: "ConfidentialAirdropCreated" }).

After a successful create, invalidate factory queries that depend on per-creator state:

function Component() {
const queryClient = useQueryClient();
const zamaSDK = useZamaSDK();
const create = useCreateAndFundConfidentialAirdropAndGetAddress({
encryptor: () => zamaSDK.relayer,
});
create.mutate(args, {
onSuccess: ({ airdrop }) => {
queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
navigate(`/airdrop/${airdrop}`);
},
});
}

Parameters

ParameterType
optionsFactoryHookOptions

Returns

UseMutationResult<..., ..., ...>

Example

const create = useCreateAndFundConfidentialAirdropAndGetAddress();
create.mutate({ params, userSalt, amount });
// create.data → { hash, airdrop }

useCreateConfidentialAirdrop()

function useCreateConfidentialAirdrop(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useCreateConfidentialAirdrop.ts:32

Deploy a new airdrop clone via the factory. Raw-hash-only variant — parse the ConfidentialAirdropCreated event yourself if you need the address.

For the common "deploy and learn the address" flow, prefer useCreateConfidentialAirdropAndGetAddress — it's a one-call wrapper that returns { hash, airdrop }.

After a successful create, invalidate factory queries that depend on per-creator state:

const queryClient = useQueryClient();
const create = useCreateConfidentialAirdrop();
create.mutate(args, {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
},
});

Parameters

ParameterType
optionsFactoryHookOptions

Returns

UseMutationResult<..., ..., ...>

Example

const create = useCreateConfidentialAirdrop();
create.mutate({ params, userSalt });

useCreateConfidentialAirdropAndGetAddress()

function useCreateConfidentialAirdropAndGetAddress(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.ts:34

Recommended factory entry point. Deploy a new ConfidentialAirdropCloneable clone and resolve its address from the ConfidentialAirdropCreated event in the tx receipt — in one call.

Internally: createConfidentialAirdropwaitForTransactionReceiptparseEventLogs({ eventName: "ConfidentialAirdropCreated" }).

After a successful create, invalidate factory queries that depend on per-creator state:

const queryClient = useQueryClient();
const create = useCreateConfidentialAirdropAndGetAddress();
create.mutate(args, {
onSuccess: ({ airdrop }) => {
queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] });
navigate(`/airdrop/${airdrop}`);
},
});

Parameters

ParameterType
optionsFactoryHookOptions

Returns

UseMutationResult<..., ..., ...>

Example

const create = useCreateConfidentialAirdropAndGetAddress();
create.mutate({ params, userSalt });
// create.data → { hash, airdrop }

useDisableCustomFee()

function useDisableCustomFee(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useDisableCustomFee.ts:18

Admin: remove a per-creator fee override, reverting to defaultGasFee. Requires FEE_MANAGER_ROLE.

After success, invalidate useFactoryCustomFee({ creator: campaignCreator }).

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseMutationResult<..., ..., ...>


useExtendClaimWindow()

function useExtendClaimWindow(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useExtendClaimWindow.ts:20

Admin: extend the claim window's endTime. Requires DEFAULT_ADMIN_ROLE AND CAN_EXTEND_CLAIM_WINDOW == true (immutable) — the contract reverts otherwise.

After success, invalidate useAirdropEndTime, useAirdropHasClaimEnded, and useAirdropIsClaimWindowActive.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useFactoryCustomFee()

function useFactoryCustomFee(args?): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useFactoryCustomFee.ts:20

Read the per-creator fee override set on the factory for creator. Returns { enabled: false, gasFee: 0n } when no override exists.

Parameters

ParameterType
argsUseFactoryCustomFeeArgs

Returns

UseQueryResult<..., ...>

Example

const { data: customFee } = useFactoryCustomFee({ creator });
if (customFee?.enabled) { ... use customFee.gasFee ... }

useFactoryDefaultGasFee()

function useFactoryDefaultGasFee(options?): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useFactoryDefaultGasFee.ts:12

Read the factory-wide default per-claim gas fee (in wei) — applied to new airdrop clones at deployment when the creator has no custom override.

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseQueryResult<..., ...>

Example

const { data: defaultGasFee } = useFactoryDefaultGasFee();

useFactoryFeeCollector()

function useFactoryFeeCollector(options?): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useFactoryFeeCollector.ts:13

Read the factory's current fee collector address — the account authorized to call withdrawGasFee on each deployed airdrop clone.

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseQueryResult<..., ...>

Example

const { data: feeCollector } = useFactoryFeeCollector();

useFactoryInitCodeHash()

function useFactoryInitCodeHash(args?): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/react/useFactoryInitCodeHash.ts:20

Read the init-code hash the factory would use to CREATE2 an airdrop clone with the given params + gasFee. Mirrors Solidity's getInitCodeHash selector.

Parameters

ParameterType
argsUseFactoryInitCodeHashArgs

Returns

UseQueryResult<..., ...>

Example

const { data: initCodeHash } = useFactoryInitCodeHash({ params, gasFee });

useFundConfidentialAirdrop()

function useFundConfidentialAirdrop(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useFundConfidentialAirdrop.ts:28

Fund an existing (or not-yet-deployed) airdrop clone with encrypted tokens via the factory. The SDK encrypts the plaintext amount into an externalEuint64 and submits it with an input proof — callers never handle ciphertext.

Encryptor resolution. The hook-level encryptor (from FactoryHookOptions) is forwarded lazily to the SDK client. You can also pass encryptor per-mutation via args.encryptor to override it. If neither is present, the SDK throws Missing encryptor — pass encryptor… verbatim.

Prerequisites: caller must have set the factory as an operator on the token: token.setOperator(factoryAddress, deadline).

args.gasFee MUST match the fee active for deployer at airdrop creation time — custom fee if getCustomFee(deployer).enabled, otherwise defaultGasFee. The factory derives the target clone address from this value via CREATE2; a mismatch funds the wrong (predicted) address.

Parameters

ParameterType
optionsFactoryHookOptions

Returns

UseMutationResult<..., ..., ...>


useGetClaimAmount()

function useGetClaimAmount(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useGetClaimAmount.ts:33

Submits a transaction (costs gas) to grant the caller decrypt access to the claim amount as an euint64 handle. The handle is granted persistent ACL on-chain via FHE.allow(handle, msg.sender); the SDK extracts it from the receipt's ACL.Allowed event (NOT from simulation — that returns a divergent, ACL-less handle; see CLAUDE.md Pitfall #1).

Pass data.handle to the Zama relayer's userDecrypt to obtain the plaintext amount. The handle is only valid after the tx lands.

Does not consume the claim (the claimedSignatures bit is not set). Call useClaim when the user is ready to transfer tokens.

Submits the admin-issued { encryptedInput, signature } pair verbatim. The SDK does NOT re-encrypt — the signature commits to the exact handle.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>

Example

// `encryptedInput` + `signature` are the admin-issued payload delivered to
// the recipient (same pair the recipient passes to `useClaim`). Sourced
// from your server API or, for admin-dashboard flows, by combining
// `encryptUint64({ userAddress: recipient, ... })` with
// `useSignClaimAuthorization`.
const view = useGetClaimAmount({ address: airdropAddress });
view.mutate({ encryptedInput, signature });
// view.data → { handle: "0x...", hash: "0x..." }

useSetCustomFee()

function useSetCustomFee(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useSetCustomFee.ts:20

Admin: install a per-creator gas-fee override on the factory. Takes precedence over defaultGasFee for all airdrops campaignCreator deploys after the override. Requires FEE_MANAGER_ROLE.

After success, invalidate useFactoryCustomFee({ creator: campaignCreator }).

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseMutationResult<..., ..., ...>


useSetDefaultGasFee()

function useSetDefaultGasFee(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useSetDefaultGasFee.ts:19

Admin: change the factory-wide default per-claim gas fee. Requires FEE_MANAGER_ROLE. Only affects airdrops deployed AFTER this call — already deployed clones carry the gas fee as an immutable arg.

After success, invalidate useFactoryDefaultGasFee().

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseMutationResult<..., ..., ...>


useSetFeeCollector()

function useSetFeeCollector(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useSetFeeCollector.ts:18

Admin: change the factory's fee collector address. Requires FEE_MANAGER_ROLE.

After success, invalidate useFactoryFeeCollector().

Parameters

ParameterType
optionsBaseHookOptions

Returns

UseMutationResult<..., ..., ...>


useSetPaused()

function useSetPaused(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useSetPaused.ts:18

Admin: pause or unpause claims on this airdrop clone. Requires DEFAULT_ADMIN_ROLE.

After success, invalidate useAirdropIsPaused and useAirdropIsClaimWindowActive.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useSignClaimAuthorization()

function useSignClaimAuthorization(options?): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useSignClaimAuthorization.ts:38

Sign a Claim(address recipient, bytes32 encryptedAmount) EIP-712 authorization. The signer (pulled from wagmi's useWalletClient()) must hold DEFAULT_ADMIN_ROLE on the airdrop clone for the produced signature to be accepted by useClaim / useGetClaimAmount.

Mutation throws TokenOpsSdkError if no wallet is connected.

Parameters

ParameterType
optionsUseSignClaimAuthorizationOptions

Returns

UseMutationResult<..., ..., ...>

Example

const sign = useSignClaimAuthorization();
const signature = await sign.mutateAsync({
airdropAddress,
recipient,
encryptedAmountHandle: encrypted.handle,
});

useWithdraw()

function useWithdraw(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useWithdraw.ts:16

Admin: withdraw all confidential tokens from the airdrop to recipient. Requires DEFAULT_ADMIN_ROLE.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useWithdrawOtherConfidentialToken()

function useWithdrawOtherConfidentialToken(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useWithdrawOtherConfidentialToken.ts:17

Admin: rescue accidentally sent ERC-7984 confidential tokens (other than this airdrop's configured TOKEN). Requires DEFAULT_ADMIN_ROLE.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>


useWithdrawOtherToken()

function useWithdrawOtherToken(options): UseMutationResult<..., ..., ...>;

Defined in: fhe-airdrop/react/useWithdrawOtherToken.ts:17

Admin: rescue accidentally sent ERC-20 (non-confidential) tokens. Requires DEFAULT_ADMIN_ROLE.

Parameters

ParameterType
optionsAirdropHookOptions

Returns

UseMutationResult<..., ..., ...>