Vesting · Types · 29@tokenops/sdk/fhe-vesting

Vesting type surface.

The full type vocabulary the vesting clients export. Args that take encrypted amounts are unions: pass plaintext (the SDK encrypts) or a pre-built EncryptedInput, never both.

Id aliases (root export)· 2

  • VestingIdHex alias

    bytes32 vesting schedule id emitted in VestingCreated. Exported from the @tokenops/sdk root (core), not the fhe-vesting subpath. Plain Hex alias; asVestingId is a zero-cost marker at the validation boundary.

    Concept primer →
  • EncryptedHandleHex alias

    bytes32 pointer to an FHE ciphertext in the coprocessor's storage. Exported from the @tokenops/sdk root (core), not the fhe-vesting subpath.

    Concept primer →

Args· 10

  • VestingParams{ recipient, startTimestamp, endTimestamp, cliffSeconds, releaseIntervalSecs, timelockSeconds, initialUnlockBps, cliffAmountBps, isRevocable }

    Plaintext schedule struct - the params field of CreateVestingArgs. Mirrors the contract struct field-for-field.

  • CreateVestingArgs{ params, amount, encryptor? } | { params, encryptedInput }

    Input to useCreateVesting / manager.createVesting. Union: the SDK encrypts the plaintext amount, or you supply a pre-encrypted input. Passing both is a compile error.

  • BatchCreateVestingArgs{ items: { params, amount }[], encryptor? }

    Bulk variant - N vestings under one batch input proof. Respects maxBatchSize.

  • ClaimArgs{ vestingId, feeType: FeeType.Gas, value } | { vestingId, feeType: FeeType.DistributionToken }

    Discriminated by feeType: Gas managers need value (fee in wei); DistributionToken managers deduct the fee on-chain. useManagerFeeInfo resolves which variant to build.

  • PartialClaimArgs{ vestingId, amount, encryptor?, value? } | { vestingId, encryptedInput, value? }

    Claim less than the unlocked amount; the remainder stays encrypted. amount XOR encryptedInput; value covers the gas fee on FeeType.Gas managers.

  • SplitVestingArgs{ vestingId, numerator, denominator, newRecipient, encryptor?, preScaled? }

    Split one vesting into two. numerator/denominator are auto-scaled to FHE_SPLIT_DENOMINATOR unless preScaled: true.

    Concept primer →
  • InitiateTransferArgs{ vestingId, newRecipient, transferDurationSeconds }

    Recipient-side handoff; the counterparty has transferDurationSeconds to accept before the offer expires.

  • DiscloseArgs{ vestingId, party, disclosureType }

    Grant ACL on one encrypted view of a vesting to a third party (auditor, tax authority). disclosureType picks which view.

    Concept primer →
  • EncryptUint64Args{ encryptor, contractAddress, userAddress, value }

    Input to the standalone encryptUint64 helper - produces an EncryptedInput bound to the (contract, user) pair.

  • EncryptUint64BatchArgs{ encryptor, contractAddress, userAddress, values }

    Batch variant for encryptUint64Batch - one shared input proof for all values.

Result· 7

  • CreateManagerResult{ hash, manager }

    Output of factory.createManager(AndGetAddress). manager is parsed from the ManagerCreated event and always present.

  • EncryptedViewResult{ handle, hash }

    Returned by encrypted-view mutations like useGetVestedAmount.

    Concept primer →
  • SplitVestingResult{ hash, newVestingId }

    Output of splitVesting - newVestingId is parsed from the VestingSplit event for follow-up calls on the child position.

  • DiscloseToPartyResult{ hash, handle }

    Output of discloseToParty / adminDiscloseToParty - handle is the euint128 from the AmountDisclosed event.

  • BatchDiscloseToPartyResult{ hash, handles }

    Batch counterpart - handles[i] corresponds to vestingIds[i] from the input.

  • VestingInfo{ recipient, startTimestamp, endTimestamp, revokeTimestamp, cliffReleaseTimestamp, releaseIntervalSecs, timelock, initialUnlockBps, cliffAmountBps, isRevocable }

    Plaintext schedule snapshot from getVestingInfo. startTimestamp === 0 means the schedule does not exist.

  • PendingTransfer{ newRecipient, initiatedAt, expiresAt }

    What usePendingVestingTransfer returns - all zero when no transfer is pending.

Config· 5

  • FeeTypeenum { Gas = 0, DistributionToken = 1 }

    Numeric enum discriminant for claim fee variants. feeTypeName() stringifies it for logs.

  • DisclosureTypeenum { TotalAllocation = 0, SettledAmount = 1, VestedAmount = 2, ClaimableAmount = 3 }

    Selector for discloseToParty / adminDiscloseToParty - which encrypted view to disclose.

  • CustomFee{ enabled, preferredFeeType, gasFee, tokenFee }

    Per-creator fee override on the factory, read via getCustomFee.

  • ConfidentialVestingFactoryClientConfig{ publicClient, walletClient?, address?, chainId?, telemetry? }

    Constructor input for the factory client.

  • ConfidentialVestingManagerClientConfig{ publicClient, walletClient?, address, encryptor?, aclAddress?, telemetry? }

    Constructor input for the per-clone manager client. aclAddress overrides the chain-registry FHEVM ACL lookup.

Encryptor· 5

  • Encryptorinterface

    Zama relayer abstraction - any v3 RelayerWeb / RelayerNode / MockFhevmInstance satisfies it structurally.

    Concept primer →
  • EncryptorSourceEncryptor | () => Encryptor | undefined

    Lazy-factory union the SDK clients accept.

    Concept primer →
  • FheValueInput{ value, type: 'euint64' | 'ebool' | 'eaddress' | ... }

    Discriminated union mirroring Zama's EncryptInput - what Encryptor.encrypt accepts per value.

  • EncryptedInput{ handle, inputProof }

    A single externalEuint64 ciphertext: on-chain handle plus the KMS input proof, bound to the (contract, user) pair. Spreads directly into contract calldata.

  • EncryptedInputs{ handles, inputProof }

    N ciphertexts sharing one batch input proof - handles[i] corresponds to the i-th plaintext value.