# @tokenops/sdk, Developer Documentation

Typed viem-first SDK for confidential vesting, airdrops, and disperse on FHEVM (Zama Protocol).
Source of truth: @tokenops/sdk v1.0.0. Live runner in stories executes real Sepolia transactions.

## Start here

Getting-started + narrative product demos.

- [Home](https://docs.tokenops.xyz/): Three confidential flows on FHEVM, story-driven.
- [Quickstart](https://docs.tokenops.xyz/quickstart): Install, providers, encryptor, first call.
- [Stories](https://docs.tokenops.xyz/stories): Aria runs vesting / airdrop / disperse on Sepolia.
- [Story · Vesting](https://docs.tokenops.xyz/stories/vesting): Aria vests her CTO Mira — 4 chapters, real Sepolia tx.
- [Story · Airdrop](https://docs.tokenops.xyz/stories/airdrop): Aria runs ARI Labs' community airdrop with EIP-712 claims.
- [Story · Disperse](https://docs.tokenops.xyz/stories/disperse): Aria pays three investors under NDA in one tx.

## Concepts

Mental models the SDK assumes, FHEVM, encryptor source pattern, encrypted handles, ACL, errors, telemetry.

- [Concepts](https://docs.tokenops.xyz/concepts): Mental models for FHEVM, encryptor, handles, errors, ACL, chains, telemetry.
- [Concepts · What is FHEVM?](https://docs.tokenops.xyz/concepts/fhevm): Fully-homomorphic encryption on chain. Handles, ACL, why @zama-fhe is optional.
- [Concepts · The encryptor source pattern](https://docs.tokenops.xyz/concepts/encryptor): Eager vs lazy injection. Pitfall #3 spelled out.
- [Concepts · Encrypted inputs + handles](https://docs.tokenops.xyz/concepts/encrypted-handles): EncryptedInput / EncryptedHandle / EncryptedViewResult.
- [Concepts · Typed errors + recovery](https://docs.tokenops.xyz/concepts/errors): Three error tiers: SDK / product / viem. The catch ladder.
- [Concepts · Scale-ratio math](https://docs.tokenops.xyz/concepts/scale-ratio): FHE_SPLIT_DENOMINATOR, scaleRatio() — bigint arithmetic for encrypted splits.
- [Concepts · Branded primitives](https://docs.tokenops.xyz/concepts/branded-types): asVestingId, asAirdropId, asDisperseId — typed wrappers around Hex.
- [Concepts · Preflight checks](https://docs.tokenops.xyz/concepts/preflight): PreflightResult, when to run, how to surface hints.
- [Concepts · ACL grants + disclosure](https://docs.tokenops.xyz/concepts/acl): FHE ACL is append-only. Operators + disclose hooks + FHE.allow.
- [Concepts · Supported chains + addresses](https://docs.tokenops.xyz/concepts/chains): DEPLOYED_ADDRESSES, chain overrides, Sepolia / Anvil / mainnet matrix.
- [Concepts · SDK telemetry](https://docs.tokenops.xyz/concepts/telemetry): SdkTelemetry interface, event tags, plug-your-own adapter pattern.

## Products

Per-product hubs. Each product has /flows, /hooks (faceted catalog), /clients, /types, /errors planned.

- [Vesting](https://docs.tokenops.xyz/vesting): Confidential vesting product hub — flows, hooks, concepts.
- [Vesting · Hooks](https://docs.tokenops.xyz/vesting/hooks): Faceted catalog of every public vesting method.
- [Vesting · Flows](https://docs.tokenops.xyz/vesting/flows): Five canonical operator flows — deploy, open, claim, disclose, transfer/recover.
- [Vesting · Clients](https://docs.tokenops.xyz/vesting/clients): Vanilla TS clients (factory + manager) for non-React consumers.
- [Vesting · ConfidentialVestingFactoryClient](https://docs.tokenops.xyz/vesting/clients/factory): Deploy manager clones, configure default fees, manage factory roles.
- [Vesting · ConfidentialVestingManagerClient](https://docs.tokenops.xyz/vesting/clients/manager): Per-clone client — open vestings, claim, disclose, encrypted reads, admin.
- [Vesting · Types](https://docs.tokenops.xyz/vesting/types): Vesting type aliases — branded ids, args, encrypted shapes, fee discriminants.
- [Vesting · Errors](https://docs.tokenops.xyz/vesting/errors): Typed vesting error classes — VestingNotFoundError, ClaimLockedError, AccessDeniedError, etc.
- [Vesting · Roles](https://docs.tokenops.xyz/vesting/roles): RBAC reference for vesting factory + manager clones.
- [Vesting · Events](https://docs.tokenops.xyz/vesting/events): Events emitted by the vesting factory + manager — full lifecycle, disclosure, roles.
- [Vesting · ABIs](https://docs.tokenops.xyz/vesting/abis): Raw ABI exports for the vesting factory + manager contracts.
- [Airdrop](https://docs.tokenops.xyz/airdrop): Confidential cohort airdrop product hub.
- [Airdrop · Hooks](https://docs.tokenops.xyz/airdrop/hooks): Faceted catalog of every public airdrop method.
- [Airdrop · Flows](https://docs.tokenops.xyz/airdrop/flows): Five canonical operator flows — deploy clone, fund pot, sign claims, recipient claims, admin recovery.
- [Airdrop · Clients](https://docs.tokenops.xyz/airdrop/clients): Vanilla TS clients (factory + airdrop clone) for non-React consumers.
- [Airdrop · ConfidentialAirdropFactoryClient](https://docs.tokenops.xyz/airdrop/clients/factory): Deploy per-campaign clones, manage default fees, roles.
- [Airdrop · ConfidentialAirdropClient](https://docs.tokenops.xyz/airdrop/clients/airdrop): Per-clone client — fund, sign claim, claim, extend window.
- [Airdrop · Types](https://docs.tokenops.xyz/airdrop/types): Airdrop type aliases — EIP-712 signature shape, claim args, config.
- [Airdrop · Errors](https://docs.tokenops.xyz/airdrop/errors): Typed airdrop error classes — AlreadyClaimedError, ClaimWindowClosedError, etc.
- [Airdrop · Roles](https://docs.tokenops.xyz/airdrop/roles): RBAC reference — CLAIM_AUTHORIZER, PAUSER, WINDOW_MANAGER.
- [Airdrop · Events](https://docs.tokenops.xyz/airdrop/events): Events emitted by the airdrop factory + clones.
- [Airdrop · ABIs](https://docs.tokenops.xyz/airdrop/abis): Raw ABI exports for the airdrop factory + clone contracts.
- [Disperse](https://docs.tokenops.xyz/disperse): One-tx confidential payouts to many product hub.
- [Disperse · Hooks](https://docs.tokenops.xyz/disperse/hooks): Faceted catalog of every public disperse method.
- [Disperse · Flows](https://docs.tokenops.xyz/disperse/flows): Four canonical operator flows — register, fund operator wallet, disperse to N recipients, recover + fees.
- [Disperse · Clients](https://docs.tokenops.xyz/disperse/clients): Vanilla TS client for the disperse singleton (non-React consumers).
- [Disperse · ConfidentialDisperseClient](https://docs.tokenops.xyz/disperse/clients/singleton): Singleton client — register, fund, preflight, disperse, disclose, recover.
- [Disperse · Types](https://docs.tokenops.xyz/disperse/types): Disperse type aliases — preflight result + reason, batch args.
- [Disperse · Errors](https://docs.tokenops.xyz/disperse/errors): Typed disperse error classes — NotRegisteredError, DisperseSubwalletNotFoundError, BatchTooLargeError, PausedError.
- [Disperse · Roles](https://docs.tokenops.xyz/disperse/roles): RBAC reference for the disperse singleton.
- [Disperse · Events](https://docs.tokenops.xyz/disperse/events): Events emitted by the disperse singleton — registration, dispersal, ACL grants.
- [Disperse · ABIs](https://docs.tokenops.xyz/disperse/abis): Raw ABI exports for the disperse singleton + subwallet contracts.

## Recipes

Copy-paste-ready solutions to common integration questions.

- [Recipes](https://docs.tokenops.xyz/recipes): Goal-driven cookbook — first tx, server-side, Next App Router, testing, telemetry.
- [Recipe · Your first encrypted tx](https://docs.tokenops.xyz/recipes/first-encrypted-tx): Connect a wallet, encrypt a uint64, create a vesting on Sepolia.
- [Recipe · Server-side encryptor](https://docs.tokenops.xyz/recipes/server-side-encryptor): Node + private key + RPC. Eager encryptor injection.
- [Recipe · Next.js App Router integration](https://docs.tokenops.xyz/recipes/next-app-router): Provider tree, lazy encryptor, server actions vs client mutations.
- [Recipe · Vite SPA integration](https://docs.tokenops.xyz/recipes/vite-spa): Vite + React + wagmi setup. No Next-specific machinery.
- [Recipe · Custom RPC + chain overrides](https://docs.tokenops.xyz/recipes/custom-rpc-and-chains): Use Alchemy / Infura / your own RPC behind viem.
- [Recipe · Testing with mock encryptor](https://docs.tokenops.xyz/recipes/testing-with-mock-encryptor): Anvil + forge-fhevm + deterministic FHE tests, no relayer.
- [Recipe · Reading encrypted state](https://docs.tokenops.xyz/recipes/reading-encrypted-state): useGetVestedAmount and useDecryptedHandle two-phase pattern.
- [Recipe · Off-chain admin signer](https://docs.tokenops.xyz/recipes/signing-claim-authorization): Sign EIP-712 Claim authorizations from a server or cold wallet.
- [Recipe · Indexing events](https://docs.tokenops.xyz/recipes/indexing-events): Backfill plus watch with viem; per-product event reference.
- [Recipe · Error recovery patterns](https://docs.tokenops.xyz/recipes/error-recovery-patterns): Per-error-class recovery snippets — invalidate, countdown, fresh sig, render reasons.
- [Recipe · Mainnet readiness checklist](https://docs.tokenops.xyz/recipes/mainnet-readiness-checklist): Six gates before flipping a confidential product to Ethereum mainnet.
- [Recipe · Chain switching](https://docs.tokenops.xyz/recipes/chain-switching): Sepolia ↔ mainnet ↔ custom chain — provider tree + viem chain swap patterns.
- [Recipe · Gas + fees](https://docs.tokenops.xyz/recipes/gas-and-fees): What an FHE write actually costs — gas vs token fees, claim-side branching, batch cost shape.
- [Recipe · Handling wallet rejection](https://docs.tokenops.xyz/recipes/handling-wallet-rejection): User-rejection is a UX state, not an error. How to recover, retry, and not log noise.
- [Recipe · React Native](https://docs.tokenops.xyz/recipes/react-native): WalletConnect + private-key signer flavours; the encryptor source pattern with no `window`.

## Reference

Flat machine-readable indices and operational facts, addresses, audits, mainnet-readiness, telemetry policy, security, changelog.

- [API Reference](https://docs.tokenops.xyz/api-reference): Flat machine-readable index of every export.
- [Resources](https://docs.tokenops.xyz/resources): Deployed addresses, audit posture, bounty timeline, security.
- [Resources · Mainnet readiness](https://docs.tokenops.xyz/resources/mainnet-readiness): Per-product status, the relayer + KMS dependency model, gas + HCU envelope, the four gates before Phase 2.
- [Resources · Changelog](https://docs.tokenops.xyz/resources/changelog): @tokenops/sdk release notes — per-version highlights with date + tone.
- [Resources · Security](https://docs.tokenops.xyz/resources/security): Threat model, audit posture, responsible disclosure for @tokenops/sdk.
- [Resources · Contributing](https://docs.tokenops.xyz/resources/contributing): Feedback inbox + PR workflow + contribution bar for @tokenops/sdk.
- [Resources · Support](https://docs.tokenops.xyz/resources/support): Four support channels (inbox, security email, Discord, GitHub) with SLAs.
- [Resources · Telemetry policy](https://docs.tokenops.xyz/resources/telemetry-policy): What the SDK + docs site collect via SdkTelemetry and DocsTelemetry. Privacy posture, scrubbing rules.

## Hooks reference (160 total)

Every public method on the headless clients ships as a React hook. Each hook page documents signature, return shape, lifecycle, encryptor dependency, example.

### Vesting (80 hooks)

- [useConfidentialVestingFactoryImplementation](https://docs.tokenops.xyz/vesting/hooks/useConfidentialVestingFactoryImplementation): Read the FHE-vesting factory's current implementation() address — the LibClone target every new manager clone delegates to.
- [useFactoryDefaultGasFee](https://docs.tokenops.xyz/vesting/hooks/useFactoryDefaultGasFee): Read the factory-wide default gas fee (in wei) — applied to new FeeType.Gas manager clones at deployment.
- [useFactoryDefaultTokenFee](https://docs.tokenops.xyz/vesting/hooks/useFactoryDefaultTokenFee): Read the factory-wide default token fee in basis points — applied to new FeeType.DistributionToken manager clones at deployment.
- [useFactoryDefaultFeeType](https://docs.tokenops.xyz/vesting/hooks/useFactoryDefaultFeeType): Read the factory-wide default fee model (FeeType.Gas or FeeType.DistributionToken) applied to newly-created manager clones.
- [useFactoryFeeCollector](https://docs.tokenops.xyz/vesting/hooks/useFactoryFeeCollector): Read the factory's current fee collector address.
- [useFactoryCustomFee](https://docs.tokenops.xyz/vesting/hooks/useFactoryCustomFee): Read the per-creator fee override set on the factory for creator.
- [useFactoryInitCodeHash](https://docs.tokenops.xyz/vesting/hooks/useFactoryInitCodeHash): Read the init-code hash the factory would use to CREATE2 a manager clone with the given token + deployer (+ optional immutable flags).
- [useCreateManagerAndGetAddress](https://docs.tokenops.xyz/vesting/hooks/useCreateManagerAndGetAddress): Deploy a manager and wait for the receipt — returns the deterministic clone address.
- [useCreateManager](https://docs.tokenops.xyz/vesting/hooks/useCreateManager): Deploy a per-user vesting manager clone via the factory.
- [useSetDefaultGasFee](https://docs.tokenops.xyz/vesting/hooks/useSetDefaultGasFee): Admin: set the factory-wide default gas fee (in wei).
- [useSetDefaultTokenFee](https://docs.tokenops.xyz/vesting/hooks/useSetDefaultTokenFee): Admin: set the factory-wide default token fee (basis points).
- [useSetDefaultFeeType](https://docs.tokenops.xyz/vesting/hooks/useSetDefaultFeeType): Admin: set the factory's default fee model (FeeType.Gas or FeeType.DistributionToken) for new manager clones.
- [useResetGasFee](https://docs.tokenops.xyz/vesting/hooks/useResetGasFee): Admin: reset the factory's default gas fee to its bytecode-encoded baseline.
- [useResetTokenFee](https://docs.tokenops.xyz/vesting/hooks/useResetTokenFee): Admin: reset the factory's default token fee to its bytecode-encoded baseline.
- [useSetCustomFee](https://docs.tokenops.xyz/vesting/hooks/useSetCustomFee): Admin: install a per-creator fee override on the factory.
- [useDisableCustomFee](https://docs.tokenops.xyz/vesting/hooks/useDisableCustomFee): Admin: disable the per-creator fee override for creator.
- [useSetFeeCollector](https://docs.tokenops.xyz/vesting/hooks/useSetFeeCollector): Admin: set the factory's fee collector address.
- [useManagerToken](https://docs.tokenops.xyz/vesting/hooks/useManagerToken): The manager clone's immutable underlying token address.
- [useManagerFeeType](https://docs.tokenops.xyz/vesting/hooks/useManagerFeeType): Read the manager clone's immutable FEE_TYPE (FeeType.Gas or FeeType.DistributionToken).
- [useManagerFee](https://docs.tokenops.xyz/vesting/hooks/useManagerFee): Read the manager clone's immutable FEE (in wei for FeeType.Gas, in basis points for FeeType.DistributionToken).
- [useManagerFeeInfo](https://docs.tokenops.xyz/vesting/hooks/useManagerFeeInfo): Resolves { feeType, fee } — caller passes the right branch to useClaim.
- [useManagerDeploymentBlockNumber](https://docs.tokenops.xyz/vesting/hooks/useManagerDeploymentBlockNumber): Read the manager clone's immutable DEPLOYMENT_BLOCK_NUMBER — the block at which the factory deployed this clone via LibClone.
- [useManagerIsSplitEnabled](https://docs.tokenops.xyz/vesting/hooks/useManagerIsSplitEnabled): Read whether the manager clone has split-vesting enabled (immutable).
- [useManagerIsPausable](https://docs.tokenops.xyz/vesting/hooks/useManagerIsPausable): Read whether the manager clone has pause/unpause enabled (immutable).
- [useManagerPaused](https://docs.tokenops.xyz/vesting/hooks/useManagerPaused): Read whether the manager clone is currently paused.
- [useManagerMaxBatchSize](https://docs.tokenops.xyz/vesting/hooks/useManagerMaxBatchSize): Read the manager clone's maxBatchSize — upper bound for batchCreateVesting.
- [useManagerMaxRevokeBatchSize](https://docs.tokenops.xyz/vesting/hooks/useManagerMaxRevokeBatchSize): Read the manager clone's maxRevokeBatchSize — upper bound for batchRevokeVesting.
- [useVestingInfo](https://docs.tokenops.xyz/vesting/hooks/useVestingInfo): Plaintext schedule shape (start / end / cliff / interval) + encrypted-handle metadata.
- [useAllRecipients](https://docs.tokenops.xyz/vesting/hooks/useAllRecipients): Every recipient currently registered on this manager.
- [useAllRecipientsLength](https://docs.tokenops.xyz/vesting/hooks/useAllRecipientsLength): Count of registered recipients (cheap pre-paging check).
- [useAllRecipientsSliced](https://docs.tokenops.xyz/vesting/hooks/useAllRecipientsSliced): Read a [start, end) slice of the recipients set.
- [useIsRecipient](https://docs.tokenops.xyz/vesting/hooks/useIsRecipient): Read whether account is currently a recipient on this manager clone.
- [useRecipientVestings](https://docs.tokenops.xyz/vesting/hooks/useRecipientVestings): Read all vesting IDs owned by recipient.
- [useRecipientVestingsLength](https://docs.tokenops.xyz/vesting/hooks/useRecipientVestingsLength): Read the number of vesting schedules owned by recipient.
- [useRecipientVestingsSliced](https://docs.tokenops.xyz/vesting/hooks/useRecipientVestingsSliced): Read a [start, end) slice of recipient's vesting IDs.
- [usePendingVestingTransfer](https://docs.tokenops.xyz/vesting/hooks/usePendingVestingTransfer): Read the pending transfer (if any) on a vesting — returns { newRecipient, initiatedAt, expiresAt }.
- [useHasRole](https://docs.tokenops.xyz/vesting/hooks/useHasRole): Read AccessControl: is account a member of role on this manager? The role hashes are stable across deployments — see useRoleConstants if you need to look them up dynamically.
- [useRoleConstants](https://docs.tokenops.xyz/vesting/hooks/useRoleConstants): Read all eight AccessControl role hashes off the manager in one fan-out.
- [useGetVestedAmount](https://docs.tokenops.xyz/vesting/hooks/useGetVestedAmount): Encrypted-view read: time-unlocked total. Pair with useDecryptedHandle.
- [useGetClaimableAmount](https://docs.tokenops.xyz/vesting/hooks/useGetClaimableAmount): Encrypted-view read: min(vested, balance) - settled. Pair with useDecryptedHandle.
- [useGetTotalAllocation](https://docs.tokenops.xyz/vesting/hooks/useGetTotalAllocation): Encrypted-view read: original allocation. Pair with useDecryptedHandle.
- [useGetSettledAmount](https://docs.tokenops.xyz/vesting/hooks/useGetSettledAmount): Encrypted-view read: running settled total. Pair with useDecryptedHandle.
- [useAdminGetVestedAmount](https://docs.tokenops.xyz/vesting/hooks/useAdminGetVestedAmount): Admin variant of useGetVestedAmount — caller must hold DISCLOSURE_ADMIN_ROLE.
- [useAdminGetClaimableAmount](https://docs.tokenops.xyz/vesting/hooks/useAdminGetClaimableAmount): Admin variant of useGetClaimableAmount — caller must hold DISCLOSURE_ADMIN_ROLE.
- [useAdminGetTotalAllocation](https://docs.tokenops.xyz/vesting/hooks/useAdminGetTotalAllocation): Admin variant of useGetTotalAllocation — caller must hold DISCLOSURE_ADMIN_ROLE.
- [useAdminGetSettledAmount](https://docs.tokenops.xyz/vesting/hooks/useAdminGetSettledAmount): Admin variant of useGetSettledAmount — caller must hold DISCLOSURE_ADMIN_ROLE.
- [useAdminGetTokenBalance](https://docs.tokenops.xyz/vesting/hooks/useAdminGetTokenBalance): Admin: read the manager clone's confidential ERC-7984 token balance as an euint64 handle.
- [useCreateVesting](https://docs.tokenops.xyz/vesting/hooks/useCreateVesting): Open a new vesting schedule on a manager — encrypts the amount client-side, submits the tx.
- [useBatchCreateVesting](https://docs.tokenops.xyz/vesting/hooks/useBatchCreateVesting): Batch variant of useCreateVesting — open N vestings in one tx with one batch input proof.
- [useClaim](https://docs.tokenops.xyz/vesting/hooks/useClaim): Recipient-side claim. For FeeType.Gas managers pass value (read it with useManagerFeeInfo); omit value for FeeType.DistributionToken.
- [useAdminClaim](https://docs.tokenops.xyz/vesting/hooks/useAdminClaim): Admin variant of useClaim — caller must hold CLAIMER_ROLE.
- [usePartialClaim](https://docs.tokenops.xyz/vesting/hooks/usePartialClaim): Claim less than the unlocked amount — leaves the remainder encrypted on the clone.
- [useAdminPartialClaim](https://docs.tokenops.xyz/vesting/hooks/useAdminPartialClaim): Admin variant of usePartialClaim — caller must hold CLAIMER_ROLE.
- [useRevokeVesting](https://docs.tokenops.xyz/vesting/hooks/useRevokeVesting): Admin revocation — clears the schedule (revocable variants only) and returns funds.
- [useBatchRevokeVesting](https://docs.tokenops.xyz/vesting/hooks/useBatchRevokeVesting): Batch variant of useRevokeVesting.
- [useSplitVesting](https://docs.tokenops.xyz/vesting/hooks/useSplitVesting): Split one vesting into two with custom proportions; both stay encrypted.
- [useInitiateVestingTransfer](https://docs.tokenops.xyz/vesting/hooks/useInitiateVestingTransfer): Recipient initiates a two-step transfer of a vesting position to another recipient.
- [useAcceptVestingTransfer](https://docs.tokenops.xyz/vesting/hooks/useAcceptVestingTransfer): Accept an inbound vesting transfer (counterparty side).
- [useCancelVestingTransfer](https://docs.tokenops.xyz/vesting/hooks/useCancelVestingTransfer): Cancel an outbound transfer before the counterparty accepts.
- [useDirectVestingTransfer](https://docs.tokenops.xyz/vesting/hooks/useDirectVestingTransfer): Admin-driven transfer — moves a vesting without the recipient's signature.
- [useDiscloseToParty](https://docs.tokenops.xyz/vesting/hooks/useDiscloseToParty): Grant ACL on a full vesting (allocation + settled + claimable) to a third party.
- [useBatchDiscloseToParty](https://docs.tokenops.xyz/vesting/hooks/useBatchDiscloseToParty): Batch variant of useDiscloseToParty.
- [useAdminDiscloseToParty](https://docs.tokenops.xyz/vesting/hooks/useAdminDiscloseToParty): Admin variant of useDiscloseToParty — caller must hold DISCLOSURE_ADMIN_ROLE.
- [useAdminBatchDiscloseToParty](https://docs.tokenops.xyz/vesting/hooks/useAdminBatchDiscloseToParty): Admin variant of useBatchDiscloseToParty — caller must hold DISCLOSURE_ADMIN_ROLE.
- [useDiscloseHandleToParty](https://docs.tokenops.xyz/vesting/hooks/useDiscloseHandleToParty): Grant ACL on a single ciphertext handle to a third party (e.g. an auditor).
- [useBatchDiscloseHandlesToParty](https://docs.tokenops.xyz/vesting/hooks/useBatchDiscloseHandlesToParty): Batch ACL grant across many handles in one tx.
- [useWithdrawAdmin](https://docs.tokenops.xyz/vesting/hooks/useWithdrawAdmin): Admin: withdraw an encrypted amount of the manager's distribution token to msg.sender.
- [useWithdrawOtherToken](https://docs.tokenops.xyz/vesting/hooks/useWithdrawOtherToken): Admin: rescue an ERC-20 (non-confidential) other than this manager's configured token.
- [useWithdrawOtherConfidentialToken](https://docs.tokenops.xyz/vesting/hooks/useWithdrawOtherConfidentialToken): Admin: rescue an ERC-7984 (confidential) token other than this manager's configured token.
- [useWithdrawGasFee](https://docs.tokenops.xyz/vesting/hooks/useWithdrawGasFee): Fee collector: withdraw collected gas-fee ETH (FeeType.Gas managers).
- [useWithdrawTokenFee](https://docs.tokenops.xyz/vesting/hooks/useWithdrawTokenFee): Fee collector: withdraw collected distribution-token fees (FeeType.DistributionToken managers).
- [useSetMaxBatchSize](https://docs.tokenops.xyz/vesting/hooks/useSetMaxBatchSize): Admin: bump or lower maxBatchSize (cap for useBatchCreateVesting).
- [useSetMaxRevokeBatchSize](https://docs.tokenops.xyz/vesting/hooks/useSetMaxRevokeBatchSize): Admin: bump or lower maxRevokeBatchSize (cap for useBatchRevokeVesting).
- [useTransferFeeCollectorRole](https://docs.tokenops.xyz/vesting/hooks/useTransferFeeCollectorRole): Transfer the FEE_COLLECTOR_ROLE to newCollector.
- [usePause](https://docs.tokenops.xyz/vesting/hooks/usePause): Pauser: pause the manager clone — blocks claim, partialClaim, createVesting, etc.
- [useUnpause](https://docs.tokenops.xyz/vesting/hooks/useUnpause): Pauser: unpause the manager clone.
- [useGrantRole](https://docs.tokenops.xyz/vesting/hooks/useGrantRole): AccessControl: grant role to accountTarget.
- [useRevokeRole](https://docs.tokenops.xyz/vesting/hooks/useRevokeRole): AccessControl: revoke role from accountTarget.
- [useRenounceRole](https://docs.tokenops.xyz/vesting/hooks/useRenounceRole): AccessControl: renounce role from msg.sender.
- [usePredictManagerAddress](https://docs.tokenops.xyz/vesting/hooks/usePredictManagerAddress): CREATE2 the manager clone address before deploying — pre-flight UI flows.

### Airdrop (42 hooks)

- [useConfidentialAirdropFactoryImplementation](https://docs.tokenops.xyz/airdrop/hooks/useConfidentialAirdropFactoryImplementation): Read the FHE-airdrop factory's current implementation() address — the LibClone target every new airdrop clone delegates to.
- [useFactoryDefaultGasFee](https://docs.tokenops.xyz/airdrop/hooks/useFactoryDefaultGasFee): 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.
- [useFactoryFeeCollector](https://docs.tokenops.xyz/airdrop/hooks/useFactoryFeeCollector): Read the factory's current fee collector address — the account authorized to call withdrawGasFee on each deployed airdrop clone.
- [useFactoryCustomFee](https://docs.tokenops.xyz/airdrop/hooks/useFactoryCustomFee): Read the per-creator fee override set on the factory for creator.
- [useFactoryInitCodeHash](https://docs.tokenops.xyz/airdrop/hooks/useFactoryInitCodeHash): Read the init-code hash the factory would use to CREATE2 an airdrop clone with the given params + gasFee.
- [useCreateConfidentialAirdropAndGetAddress](https://docs.tokenops.xyz/airdrop/hooks/useCreateConfidentialAirdropAndGetAddress): Deploy an airdrop + wait for receipt + return the clone address.
- [useCreateConfidentialAirdrop](https://docs.tokenops.xyz/airdrop/hooks/useCreateConfidentialAirdrop): Deploy an airdrop clone for a token + admin + claim window.
- [useCreateAndFundConfidentialAirdrop](https://docs.tokenops.xyz/airdrop/hooks/useCreateAndFundConfidentialAirdrop): Single-flow helper: deploy + fund in one bundle.
- [useCreateAndFundConfidentialAirdropAndGetAddress](https://docs.tokenops.xyz/airdrop/hooks/useCreateAndFundConfidentialAirdropAndGetAddress): Same as useCreateAndFundConfidentialAirdrop but returns the clone address.
- [useFundConfidentialAirdrop](https://docs.tokenops.xyz/airdrop/hooks/useFundConfidentialAirdrop): Encrypt the funding amount and transferFromConfidential into the clone.
- [useSetFeeCollector](https://docs.tokenops.xyz/airdrop/hooks/useSetFeeCollector): Admin: change the factory's fee collector address.
- [useSetDefaultGasFee](https://docs.tokenops.xyz/airdrop/hooks/useSetDefaultGasFee): Admin: change the factory-wide default per-claim gas fee.
- [useSetCustomFee](https://docs.tokenops.xyz/airdrop/hooks/useSetCustomFee): Admin: install a per-creator gas-fee override on the factory.
- [useDisableCustomFee](https://docs.tokenops.xyz/airdrop/hooks/useDisableCustomFee): Admin: remove a per-creator fee override, reverting to defaultGasFee.
- [useAirdropToken](https://docs.tokenops.xyz/airdrop/hooks/useAirdropToken): Read the airdrop clone's immutable TOKEN.
- [useAirdropGasFee](https://docs.tokenops.xyz/airdrop/hooks/useAirdropGasFee): Read the airdrop clone's immutable per-claim gas fee (in wei).
- [useAirdropStartTime](https://docs.tokenops.xyz/airdrop/hooks/useAirdropStartTime): Read the airdrop clone's immutable START_TIME — the unix timestamp when claims become available.
- [useAirdropCanExtendClaimWindow](https://docs.tokenops.xyz/airdrop/hooks/useAirdropCanExtendClaimWindow): Read whether the admin can extend the claim window past endTime on this airdrop clone.
- [useAirdropEndTime](https://docs.tokenops.xyz/airdrop/hooks/useAirdropEndTime): Read the airdrop clone's endTime — the unix timestamp when claims close.
- [useAirdropIsPaused](https://docs.tokenops.xyz/airdrop/hooks/useAirdropIsPaused): Read whether claims are currently paused by the admin on this airdrop clone.
- [useAirdropDeploymentBlockNumber](https://docs.tokenops.xyz/airdrop/hooks/useAirdropDeploymentBlockNumber): Read the block number at which this airdrop clone was deployed.
- [useAirdropDomainSeparator](https://docs.tokenops.xyz/airdrop/hooks/useAirdropDomainSeparator): Read the EIP-712 domain separator for this airdrop clone.
- [useAirdropClaimTypehash](https://docs.tokenops.xyz/airdrop/hooks/useAirdropClaimTypehash): Read the EIP-712 type hash for Claim(address recipient, bytes32 encryptedAmount).
- [useAirdropIsClaimWindowActive](https://docs.tokenops.xyz/airdrop/hooks/useAirdropIsClaimWindowActive): Returns true between startTime and endTime per the on-chain config.
- [useAirdropHasClaimStarted](https://docs.tokenops.xyz/airdrop/hooks/useAirdropHasClaimStarted): Read whether the current chain timestamp is past START_TIME on this airdrop clone.
- [useAirdropHasClaimEnded](https://docs.tokenops.xyz/airdrop/hooks/useAirdropHasClaimEnded): Read whether the current chain timestamp is past endTime on this airdrop clone.
- [useAirdropClaimedSignatures](https://docs.tokenops.xyz/airdrop/hooks/useAirdropClaimedSignatures): Check whether a pre-computed claim struct hash has been consumed on this airdrop clone.
- [useAirdropIsSignatureClaimed](https://docs.tokenops.xyz/airdrop/hooks/useAirdropIsSignatureClaimed): Has this admin signature already been redeemed?
- [useAirdropIsSignatureValid](https://docs.tokenops.xyz/airdrop/hooks/useAirdropIsSignatureValid): Off-chain check of the signature shape before paying gas to submit it.
- [useAirdropHasRole](https://docs.tokenops.xyz/airdrop/hooks/useAirdropHasRole): 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.).
- [useClaim](https://docs.tokenops.xyz/airdrop/hooks/useClaim): Claim tokens from an airdrop using an EIP-712 admin signature.
- [useGetClaimAmount](https://docs.tokenops.xyz/airdrop/hooks/useGetClaimAmount): 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).
- [useWithdraw](https://docs.tokenops.xyz/airdrop/hooks/useWithdraw): Admin: withdraw all confidential tokens from the airdrop to recipient.
- [useSetPaused](https://docs.tokenops.xyz/airdrop/hooks/useSetPaused): Admin: pause or unpause claims on this airdrop clone.
- [useExtendClaimWindow](https://docs.tokenops.xyz/airdrop/hooks/useExtendClaimWindow): Admin extends the claim deadline.
- [useWithdrawOtherToken](https://docs.tokenops.xyz/airdrop/hooks/useWithdrawOtherToken): Admin: rescue accidentally sent ERC-20 (non-confidential) tokens.
- [useWithdrawOtherConfidentialToken](https://docs.tokenops.xyz/airdrop/hooks/useWithdrawOtherConfidentialToken): Admin: rescue accidentally sent ERC-7984 confidential tokens (other than this airdrop's configured TOKEN).
- [useAirdropWithdrawGasFee](https://docs.tokenops.xyz/airdrop/hooks/useAirdropWithdrawGasFee): Fee collector: withdraw collected ETH gas fees from the airdrop clone.
- [useAirdropGrantRole](https://docs.tokenops.xyz/airdrop/hooks/useAirdropGrantRole): AccessControl: grant role to accountTarget on this airdrop clone.
- [useAirdropRevokeRole](https://docs.tokenops.xyz/airdrop/hooks/useAirdropRevokeRole): AccessControl: revoke role from accountTarget on this airdrop clone.
- [useSignClaimAuthorization](https://docs.tokenops.xyz/airdrop/hooks/useSignClaimAuthorization): Admin signs the off-chain EIP-712 Claim(recipient, encryptedAmountHandle) message.
- [usePredictAirdropAddress](https://docs.tokenops.xyz/airdrop/hooks/usePredictAirdropAddress): CREATE2 the airdrop clone address before deploying.

### Disperse (37 hooks)

- [useIsRegistered](https://docs.tokenops.xyz/disperse/hooks/useIsRegistered): Has this deployer already called register?
- [useGetWallets](https://docs.tokenops.xyz/disperse/hooks/useGetWallets): Read the deployer's two registered subwallet addresses.
- [usePredictWallets](https://docs.tokenops.xyz/disperse/hooks/usePredictWallets): Compute the deterministic subwallet addresses for a deployer without registering.
- [useGetFees](https://docs.tokenops.xyz/disperse/hooks/useGetFees): Read consolidated fee information for user — combines per-user resolved fees (getFeeAmounts) with the global feeConfig toggles in one read.
- [useGetFeeConfig](https://docs.tokenops.xyz/disperse/hooks/useGetFeeConfig): Read the singleton's { gasFeeEnabled, tokenFeeEnabled, defaultGasFee, defaultTokenFee } fee config.
- [useGetBatchLimits](https://docs.tokenops.xyz/disperse/hooks/useGetBatchLimits): Read the maximum batch size for each of the three disperse modes ("wallet", "direct", "wallet-token-fee").
- [useCalculateFee](https://docs.tokenops.xyz/disperse/hooks/useCalculateFee): Quote the on-chain fee config for a given disperse batch shape (count + mode).
- [useHasApprovedSubwallets](https://docs.tokenops.xyz/disperse/hooks/useHasApprovedSubwallets): Check whether a user's registered subwallets have approved the singleton as an ERC-7984 operator for token.
- [useHasRole](https://docs.tokenops.xyz/disperse/hooks/useHasRole): Read AccessControl: is account a member of role on the singleton? All five role constants (DEFAULT_ADMIN_ROLE, FEE_MANAGER_ROLE, FEE_COLLECTOR_ROLE, PAUSER_ROLE, WITHDRAWER_ROLE) are exported from @tokenops/sdk/fhe-disperse/react.
- [useIsPaused](https://docs.tokenops.xyz/disperse/hooks/useIsPaused): Read the singleton's paused flag.
- [useDeploymentBlockNumber](https://docs.tokenops.xyz/disperse/hooks/useDeploymentBlockNumber): Read the block number at which the singleton was deployed — useful as the fromBlock argument to getLogs when subscribing to events.
- [useWalletImplementation](https://docs.tokenops.xyz/disperse/hooks/useWalletImplementation): Read the WALLET_IMPLEMENTATION address — the singleton clones this deterministically (Clones.cloneDeterministic) for each registered user to derive their wallet pair.
- [usePreflightDisperse](https://docs.tokenops.xyz/disperse/hooks/usePreflightDisperse): Dry-run validator — checks operator + balance + paused state before broadcasting.
- [useRegister](https://docs.tokenops.xyz/disperse/hooks/useRegister): First-time setup for a deployer — singleton creates the two ERC-1167 subwallets.
- [useApproveTokenOnWallets](https://docs.tokenops.xyz/disperse/hooks/useApproveTokenOnWallets): Approve the subwallets to transferFromConfidential for the listed tokens.
- [useRevokeTokenOnWallets](https://docs.tokenops.xyz/disperse/hooks/useRevokeTokenOnWallets): Revoke operator approval on the subwallets (rollback).
- [useRecoverFromWallets](https://docs.tokenops.xyz/disperse/hooks/useRecoverFromWallets): Recover residual confidential ERC-7984 tokens from the caller's registered wallets to to.
- [useRecoverERC20FromWallets](https://docs.tokenops.xyz/disperse/hooks/useRecoverERC20FromWallets): Recover ERC-20 tokens accidentally sent to the caller's registered wallets.
- [useDisperse](https://docs.tokenops.xyz/disperse/hooks/useDisperse): Multi-recipient confidential transfer in one tx — batch-encrypts amounts + per-recipient ACL.
- [useAccessEncryptedFeeReserve](https://docs.tokenops.xyz/disperse/hooks/useAccessEncryptedFeeReserve): MUTATION — submits a transaction (costs gas). Mirrors the on-chain accessEncryptedFeeReserve(token) function: grants the caller persistent decrypt access to the encrypted token fee reserve as an euint64 handle.
- [useGetEncryptedFeeReserve](https://docs.tokenops.xyz/disperse/hooks/useGetEncryptedFeeReserve): MUTATION — submits a transaction (costs gas). Mirrors the on-chain accessEncryptedFeeReserve(token) function: grants the caller persistent decrypt access to the encrypted token fee reserve as an euint64 handle.
- [useDiscloseHandleToParty](https://docs.tokenops.xyz/disperse/hooks/useDiscloseHandleToParty): Grant ACL on a single ciphertext handle to a third party (e.g. an auditor).
- [useBatchDiscloseHandlesToParty](https://docs.tokenops.xyz/disperse/hooks/useBatchDiscloseHandlesToParty): Batch ACL grant across many handles in one tx.
- [usePause](https://docs.tokenops.xyz/disperse/hooks/usePause): Admin: pause all disperse operations on the singleton.
- [useUnpause](https://docs.tokenops.xyz/disperse/hooks/useUnpause): Admin: unpause the singleton.
- [useSetFeeConfig](https://docs.tokenops.xyz/disperse/hooks/useSetFeeConfig): Admin: update the global fee configuration — enable/disable gas and token fees, set the defaults.
- [useSetCustomFee](https://docs.tokenops.xyz/disperse/hooks/useSetCustomFee): Admin: install a per-user fee override (gas fee in wei, token fee in BPS).
- [useDisableCustomFee](https://docs.tokenops.xyz/disperse/hooks/useDisableCustomFee): Admin: remove a per-user fee override, falling back to the global defaults.
- [useSetMaxBatchSizeHolding](https://docs.tokenops.xyz/disperse/hooks/useSetMaxBatchSizeHolding): Admin: set the maximum batch size for "wallet" mode disperses.
- [useSetMaxBatchSizeDirect](https://docs.tokenops.xyz/disperse/hooks/useSetMaxBatchSizeDirect): Admin: set the maximum batch size for "direct" mode disperses.
- [useSetMaxBatchSizeTokenFee](https://docs.tokenops.xyz/disperse/hooks/useSetMaxBatchSizeTokenFee): Admin: set the maximum batch size for "wallet-token-fee" mode disperses.
- [useWithdrawGasFee](https://docs.tokenops.xyz/disperse/hooks/useWithdrawGasFee): Fee-collector: withdraw amount wei of accumulated ETH gas fees from the singleton to to.
- [useWithdrawTokenFee](https://docs.tokenops.xyz/disperse/hooks/useWithdrawTokenFee): Fee-collector: withdraw accumulated encrypted token fees.
- [useRescueConfidentialTokens](https://docs.tokenops.xyz/disperse/hooks/useRescueConfidentialTokens): Sweep stranded confidential tokens out of a subwallet (admin-only).
- [useRescueERC20](https://docs.tokenops.xyz/disperse/hooks/useRescueERC20): Sweep stranded plain ERC-20 tokens (e.g. someone sent the wrong token).
- [useGrantRole](https://docs.tokenops.xyz/disperse/hooks/useGrantRole): AccessControl: grant role to accountTarget on the singleton.
- [useRevokeRole](https://docs.tokenops.xyz/disperse/hooks/useRevokeRole): AccessControl: revoke role from accountTarget on the singleton.

## License

MIT. SDK version 1.0.0. Audit status per product on /resources.
