v2.1.0 stable
SDK 2.1 is the stable release on the latest dist-tag. Install it with pnpm add @tokenops/sdk. The receipt-free and Safe create surface of /fhe-airdrop remains @beta.Vesting 2.x · Client@tokenops/sdk/fhe-vesting
ConfidentialVestingManagerClient
Mounts against one manager clone for chain reads and writes. SDK 2.1 also exports createVestingEngine('v1') for pure schedule, claim-state, token-fee, split and revoke previews; it does not replace this client's reads, encryption or transactions. Writes that submit an encrypted amount need an encryptor at call time and throw MissingEncryptorError naming the method otherwise. Every argument-object write takes a per-call gas; only splitVesting has a receipt-free overload.
Construct
Headless TS — non-React consumers (Node, Vite, server workers). React hosts use the per-hook surface; same method names, lazy encryptor.
@tokenops/sdk/fhe-vesting
ts
import { createConfidentialVestingManagerClient } from "@tokenops/sdk/fhe-vesting";
const client = createConfidentialVestingManagerClient({
publicClient,
walletClient,
address, // required: manager clone address
});Methods
Write · 9
- CreateVestingArgs: { params, amount } or { params, encryptedInput }, never both. Returns the tx hash; read the vestingId from VestingCreated.
client.createVesting()React:useCreateVesting - ClaimArgs, discriminated by feeType: Gas takes value (the fee in wei), DistributionToken takes none.
client.claim()React:useClaim - PartialClaimArgs: the same feeType discriminant as ClaimArgs, plus amount or encryptedInput. A mismatched value no longer compiles.
client.partialClaim()React:usePartialClaim - Admin revocation — clears the schedule (revocable variants only) and returns funds.
client.revokeVesting()React:useRevokeVesting - Encrypts the numerator and scales the ratio to FHE_SPLIT_DENOMINATOR unless preScaled. Overloaded on waitForReceipt: false returns PendingSplitVestingResult with newVestingId: undefined.
client.splitVesting()React:useSplitVesting - Recipient initiates a two-step transfer of a vesting position to another recipient.
client.initiateVestingTransfer()React:useInitiateVestingTransfer - Accept an inbound vesting transfer (counterparty side).
client.acceptVestingTransfer()React:useAcceptVestingTransfer - Cancel an outbound transfer before the counterparty accepts.
client.cancelVestingTransfer()React:useCancelVestingTransfer - Recipient-driven one-step transfer — moves a vesting to a new owner without waiting for counterparty acceptance.
client.directVestingTransfer()React:useDirectVestingTransfer
Batch write · 2
- At most MAX_EUINT64_PER_INPUT_PROOF (32) items, since every amount shares one input proof; a longer list throws InvalidArgumentError before encrypting. maxBatchSize also applies on chain.
client.batchCreateVesting()React:useBatchCreateVesting - Pass ids in any order: the SDK sorts a copy ascending, as the contract requires, and rejects an empty list or duplicates with InvalidArgumentError.
client.batchRevokeVesting()React:useBatchRevokeVesting
Admin · 2
Disclose · ACL · 6
- Grant ACL on a single encrypted field of a vesting (total allocation, settled, vested, or claimable) to a third party.
client.discloseToParty()React:useDiscloseToParty - Grant ACL on a single ciphertext handle to a third party (e.g. an auditor).
client.discloseHandleToParty()React:useDiscloseHandleToParty - handles[i] matches vestingIds[i]; events are paired by vestingId and disclosure type, so a repeated vestingId with different types gets the right handle.
client.batchDiscloseToParty()React:useBatchDiscloseToParty - Batch ACL grant across many handles in one tx.
client.batchDiscloseHandlesToParty()React:useBatchDiscloseHandlesToParty - Admin variant of useDiscloseToParty — caller must hold DISCLOSURE_ADMIN_ROLE.
client.adminDiscloseToParty()React:useAdminDiscloseToParty - Admin variant of useBatchDiscloseToParty — caller must hold DISCLOSURE_ADMIN_ROLE.
client.adminBatchDiscloseToParty()React:useAdminBatchDiscloseToParty
Encrypted read · 9
- Submits a transaction to read the vested amount at a given timestamp as an euint128 handle.
client.getVestedAmount()React:useAccessVestedAmount - Submits a transaction to read the currently-claimable amount as an euint128 handle.
client.getClaimableAmount()React:useAccessClaimableAmount - Submits a transaction to read the already-claimed (settled) amount of a vesting as an euint128 handle.
client.getSettledAmount()React:useAccessSettledAmount - Submits a transaction to read the total allocation of a vesting as an euint128 handle.
client.getTotalAllocation()React:useAccessTotalAllocation - Admin variant of useAccessVestedAmount — caller must hold DISCLOSURE_ADMIN_ROLE.
client.adminGetVestedAmount()React:useAdminGetVestedAmount - Admin variant of useAccessClaimableAmount — caller must hold DISCLOSURE_ADMIN_ROLE.
client.adminGetClaimableAmount()React:useAdminGetClaimableAmount - Admin variant of useAccessSettledAmount — caller must hold DISCLOSURE_ADMIN_ROLE.
client.adminGetSettledAmount()React:useAdminGetSettledAmount - Admin variant of useAccessTotalAllocation — caller must hold DISCLOSURE_ADMIN_ROLE.
client.adminGetTotalAllocation()React:useAdminGetTotalAllocation - Admin: read the manager clone's confidential ERC-7984 token balance as an euint64 handle.
client.adminGetTokenBalance()React:useAdminGetTokenBalance
Read · 21
- CreateVestingPreflightReport: { token, hasCreatorRole, isOperatorSet, ready, blockerErrors }. Cannot see an underfunded encrypted balance.
client.preflightCreateVesting()React:usePreflightCreateVesting client.preflightClaim()Headless only. PreflightResult { ready, blockers }: recipient match, schedule exists, timelock, pause, and ETH balance for the gas fee (InsufficientBalanceError, balanceKind "eth").- Plaintext schedule shape (start / end / cliff / interval) + encrypted-handle metadata.
client.getVestingInfo()React:useVestingInfo - The manager clone's immutable underlying token address.
client.token()React:useManagerToken - Read the manager clone's immutable FEE (in wei for FeeType.Gas, in basis points for FeeType.DistributionToken).
client.fee()React:useManagerFee - Read the manager clone's immutable FEE_TYPE (FeeType.Gas or FeeType.DistributionToken).
client.feeType()React:useManagerFeeType - Resolves { feeType, fee } — caller passes the right branch to useClaim.
client.getFeeInfo()React:useManagerFeeInfo - Read whether the manager clone has pause/unpause enabled (immutable).
client.isPausable()React:useManagerIsPausable - Read whether the manager clone has split-vesting enabled (immutable).
client.isSplitEnabled()React:useManagerIsSplitEnabled - Read whether the manager clone is currently paused.
client.paused()React:useManagerPaused - Read the manager clone's maxBatchSize — upper bound for batchCreateVesting.
client.maxBatchSize()React:useManagerMaxBatchSize - Read the manager clone's maxRevokeBatchSize — upper bound for batchRevokeVesting.
client.maxRevokeBatchSize()React:useManagerMaxRevokeBatchSize - Read the manager clone's immutable DEPLOYMENT_BLOCK_NUMBER slot.
client.deploymentBlockNumber()React:useManagerDeploymentBlockNumber - Every recipient currently registered on this manager.
client.getAllRecipients()React:useAllRecipients - Count of registered recipients (cheap pre-paging check).
client.getAllRecipientsLength()React:useAllRecipientsLength - Read a [start, end) slice of the recipients set.
client.getAllRecipientsSliced()React:useAllRecipientsSliced - Read whether account is currently a recipient on this manager clone.
client.isRecipient()React:useIsRecipient - Read all vesting IDs owned by recipient.
client.getAllRecipientVestings()React:useRecipientVestings - Read the number of vesting schedules owned by recipient.
client.getAllRecipientVestingsLength()React:useRecipientVestingsLength - Read a [start, end) slice of recipient's vesting IDs.
client.getAllRecipientVestingsSliced()React:useRecipientVestingsSliced - Read the pending transfer (if any) on a vesting — returns { newRecipient, initiatedAt, expiresAt }.
client.getPendingVestingTransfer()React:usePendingVestingTransfer
Configure · 2
Roles · RBAC · 6
- AccessControl: grant role to holder.
client.grantRole()React:useGrantRole - AccessControl: revoke role from holder.
client.revokeRole()React:useRevokeRole - AccessControl: renounce role from msg.sender.
client.renounceRole()React:useRenounceRole - Read AccessControl: is holder a member of role on this manager? The role hashes are stable across deployments — see useRoleConstants if you need to look them up dynamically.
client.hasRole()React:useHasRole - Read all eight AccessControl role hashes off the manager in one fan-out.
client.roleConstants()React:useRoleConstants - Transfer the FEE_COLLECTOR_ROLE to newCollector.
client.transferFeeCollectorRole()React:useTransferFeeCollectorRole
Recovery · 7
- Pauser: pause the manager clone — blocks claim, partialClaim, splitVesting, initiateVestingTransfer, acceptVestingTransfer, and directVestingTransfer.
client.pause()React:usePause - Pauser: unpause the manager clone.
client.unpause()React:useUnpause - WithdrawAdminArgs: { amount } or { encryptedInput }, exactly one, plus gas. WITHDRAWER_ROLE.
client.withdrawAdmin()React:useWithdrawAdmin - Fee collector: withdraw collected gas-fee ETH (FeeType.Gas managers).
client.withdrawGasFee()React:useWithdrawGasFee - WithdrawTokenFeeArgs: { to, amount } or { to, encryptedInput }, exactly one, plus gas.
client.withdrawTokenFee()React:useWithdrawTokenFee - Admin: rescue an ERC-20 (non-confidential) other than this manager's configured token.
client.withdrawOtherToken()React:useWithdrawOtherToken - Admin: rescue an ERC-7984 (confidential) token other than this manager's configured token.
client.withdrawOtherConfidentialToken()React:useWithdrawOtherConfidentialToken