fhe-vesting
Enumerations
FeeType
Defined in: fhe-vesting/types.ts:36
Factory fee model.
Enumeration Members
| Enumeration Member | Value | Defined in |
|---|---|---|
Gas | 0 | fhe-vesting/types.ts:37 |
DistributionToken | 1 | fhe-vesting/types.ts:38 |
DisclosureType
Defined in: fhe-vesting/types.ts:67
Selector for discloseToParty / adminDiscloseToParty.
Enumeration Members
| Enumeration Member | Value | Defined in |
|---|---|---|
TotalAllocation | 0 | fhe-vesting/types.ts:68 |
SettledAmount | 1 | fhe-vesting/types.ts:69 |
VestedAmount | 2 | fhe-vesting/types.ts:70 |
ClaimableAmount | 3 | fhe-vesting/types.ts:71 |
Classes
VestingNotFoundError
Defined in: fhe-vesting/errors.ts:16
Vesting schedule with this ID does not exist.
Extends
Constructors
Constructor
new VestingNotFoundError(args): VestingNotFoundError;
Defined in: fhe-vesting/errors.ts:24
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "VestingNotFoundError" | "VestingNotFoundError" | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:17 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; } | undefined | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:18 |
context.method | public | ... | undefined | - | - | fhe-vesting/errors.ts:19 |
context.contractAddress | public | ... | undefined | - | - | fhe-vesting/errors.ts:20 |
context.vestingId | public | ... | undefined | - | - | fhe-vesting/errors.ts:21 |
NotVestingRecipientError
Defined in: fhe-vesting/errors.ts:38
Caller is not the recipient of this vesting schedule.
Extends
Constructors
Constructor
new NotVestingRecipientError(args): NotVestingRecipientError;
Defined in: fhe-vesting/errors.ts:48
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; caller?: ...; expectedRecipient?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.caller? | ... |
args.expectedRecipient? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "NotVestingRecipientError" | "NotVestingRecipientError" | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:39 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; caller?: ...; expectedRecipient?: ...; } | undefined | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:40 |
context.method | public | ... | undefined | - | - | fhe-vesting/errors.ts:41 |
context.contractAddress | public | ... | undefined | - | - | fhe-vesting/errors.ts:42 |
context.vestingId | public | ... | undefined | - | - | fhe-vesting/errors.ts:43 |
context.caller? | public | ... | undefined | - | - | fhe-vesting/errors.ts:44 |
context.expectedRecipient? | public | ... | undefined | - | - | fhe-vesting/errors.ts:45 |
ClaimLockedError
Defined in: fhe-vesting/errors.ts:75
Vesting has a timelock and the current block timestamp has not yet reached
it. unlocksAt is populated when the SDK has read the vesting info; UIs can
render a countdown.
Extends
Constructors
Constructor
new ClaimLockedError(args): ClaimLockedError;
Defined in: fhe-vesting/errors.ts:85
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; unlocksAt?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.unlocksAt? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "ClaimLockedError" | "ClaimLockedError" | - | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:76 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; unlocksAt?: ...; } | undefined | - | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:77 |
context.method | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:78 |
context.contractAddress | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:79 |
context.vestingId | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:80 |
context.unlocksAt? | public | ... | undefined | Unix seconds. Multiply by 1000 for new Date(...). | - | - | fhe-vesting/errors.ts:82 |
VestingRevokedError
Defined in: fhe-vesting/errors.ts:108
Vesting has already been revoked. revokedAt is in unix seconds.
Extends
Constructors
Constructor
new VestingRevokedError(args): VestingRevokedError;
Defined in: fhe-vesting/errors.ts:118
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; revokedAt?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.revokedAt? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "VestingRevokedError" | "VestingRevokedError" | - | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:109 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; revokedAt?: ...; } | undefined | - | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:110 |
context.method | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:111 |
context.contractAddress | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:112 |
context.vestingId | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:113 |
context.revokedAt? | public | ... | undefined | Unix seconds. Multiply by 1000 for new Date(...). | - | - | fhe-vesting/errors.ts:115 |
VestingNotRevocableError
Defined in: fhe-vesting/errors.ts:140
Vesting was created with isRevocable: false and cannot be revoked.
Extends
Constructors
Constructor
new VestingNotRevocableError(args): VestingNotRevocableError;
Defined in: fhe-vesting/errors.ts:148
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "VestingNotRevocableError" | "VestingNotRevocableError" | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:141 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; } | undefined | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:142 |
context.method | public | ... | undefined | - | - | fhe-vesting/errors.ts:143 |
context.contractAddress | public | ... | undefined | - | - | fhe-vesting/errors.ts:144 |
context.vestingId | public | ... | undefined | - | - | fhe-vesting/errors.ts:145 |
VestingExpiredError
Defined in: fhe-vesting/errors.ts:162
Vesting has ended (block.timestamp > endTimestamp); admin actions like revoke are no longer valid.
Extends
Constructors
Constructor
new VestingExpiredError(args): VestingExpiredError;
Defined in: fhe-vesting/errors.ts:172
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; endedAt?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.endedAt? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "VestingExpiredError" | "VestingExpiredError" | - | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:163 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; endedAt?: ...; } | undefined | - | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:164 |
context.method | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:165 |
context.contractAddress | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:166 |
context.vestingId | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:167 |
context.endedAt? | public | ... | undefined | Unix seconds. Multiply by 1000 for new Date(...). | - | - | fhe-vesting/errors.ts:169 |
TransferAlreadyPendingError
Defined in: fhe-vesting/errors.ts:193
A vesting transfer is already pending — initiate fails until accepted/cancelled/expired.
Extends
Constructors
Constructor
new TransferAlreadyPendingError(args): TransferAlreadyPendingError;
Defined in: fhe-vesting/errors.ts:204
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; pendingRecipient?: ...; expiresAt?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.pendingRecipient? | ... |
args.expiresAt? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "TransferAlreadyPendingError" | "TransferAlreadyPendingError" | - | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:194 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; pendingRecipient?: ...; expiresAt?: ...; } | undefined | - | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:195 |
context.method | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:196 |
context.contractAddress | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:197 |
context.vestingId | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:198 |
context.pendingRecipient? | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:199 |
context.expiresAt? | public | ... | undefined | Unix seconds. Multiply by 1000 for new Date(...). | - | - | fhe-vesting/errors.ts:201 |
NoPendingTransferError
Defined in: fhe-vesting/errors.ts:227
No pending transfer exists — cancel/accept fails until one is initiated.
Extends
Constructors
Constructor
new NoPendingTransferError(args): NoPendingTransferError;
Defined in: fhe-vesting/errors.ts:235
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "NoPendingTransferError" | "NoPendingTransferError" | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:228 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; } | undefined | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:229 |
context.method | public | ... | undefined | - | - | fhe-vesting/errors.ts:230 |
context.contractAddress | public | ... | undefined | - | - | fhe-vesting/errors.ts:231 |
context.vestingId | public | ... | undefined | - | - | fhe-vesting/errors.ts:232 |
NotPendingRecipientError
Defined in: fhe-vesting/errors.ts:249
Caller is not the pending recipient of this transfer.
Extends
Constructors
Constructor
new NotPendingRecipientError(args): NotPendingRecipientError;
Defined in: fhe-vesting/errors.ts:259
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; caller?: ...; expectedRecipient?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.caller? | ... |
args.expectedRecipient? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "NotPendingRecipientError" | "NotPendingRecipientError" | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:250 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; caller?: ...; expectedRecipient?: ...; } | undefined | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:251 |
context.method | public | ... | undefined | - | - | fhe-vesting/errors.ts:252 |
context.contractAddress | public | ... | undefined | - | - | fhe-vesting/errors.ts:253 |
context.vestingId | public | ... | undefined | - | - | fhe-vesting/errors.ts:254 |
context.caller? | public | ... | undefined | - | - | fhe-vesting/errors.ts:255 |
context.expectedRecipient? | public | ... | undefined | - | - | fhe-vesting/errors.ts:256 |
TransferExpiredError
Defined in: fhe-vesting/errors.ts:282
Pending transfer has expired and can no longer be accepted.
Extends
Constructors
Constructor
new TransferExpiredError(args): TransferExpiredError;
Defined in: fhe-vesting/errors.ts:292
Parameters
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; vestingId: ...; expiredAt?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.vestingId | ... |
args.expiredAt? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "TransferExpiredError" | "TransferExpiredError" | - | TokenOpsSdkError.name | - | fhe-vesting/errors.ts:283 |
context | readonly | { method: ...; contractAddress: ...; vestingId: ...; expiredAt?: ...; } | undefined | - | TokenOpsSdkError.context | - | fhe-vesting/errors.ts:284 |
context.method | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:285 |
context.contractAddress | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:286 |
context.vestingId | public | ... | undefined | - | - | - | fhe-vesting/errors.ts:287 |
context.expiredAt? | public | ... | undefined | Unix seconds. Multiply by 1000 for new Date(...). | - | - | fhe-vesting/errors.ts:289 |
ConfidentialVestingFactoryClient
Defined in: fhe-vesting/factory.ts:121
Typed wrapper around the deployed ConfidentialVestingFactory. Mirrors the
Solidity interface 1:1 — the only "abstraction" is plumbing viem clients and
resolving the deployed factory address per chain.
Example
const factory = createConfidentialVestingFactoryClient({ publicClient, walletClient });
const hash = await factory.createManager({ token, userSalt });
Extended by
Constructors
Constructor
new ConfidentialVestingFactoryClient(config): ConfidentialVestingFactoryClient;
Defined in: fhe-vesting/factory.ts:127
Parameters
| Parameter | Type |
|---|---|
config | ConfidentialVestingFactoryClientConfig |
Returns
ConfidentialVestingFactoryClient
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
publicClient | readonly | { } | fhe-vesting/factory.ts:122 |
walletClient? | readonly | ... | ... | fhe-vesting/factory.ts:123 |
address | readonly | `0x${(...)}` | fhe-vesting/factory.ts:124 |
Methods
createManager()
createManager(args): Promise<...>;
Defined in: fhe-vesting/factory.ts:185
Deploy a new ConfidentialVestingManager clone via the factory and return
its address, parsed from the ManagerCreated event in the tx receipt.
This is the headline factory entry point. It returns one rich-return
shape: the address is only knowable after the tx mines (the factory packs
block.number into the clone's immutable args), so a hash-only variant
would force consumers to re-derive what the SDK already had to compute.
Calls createManagerWithOptions when splitEnabled or pausableEnabled
is provided; otherwise calls the simpler createManager entry point.
Internally: writeContract → PublicClient.waitForTransactionReceipt →
parseEventLogs({ eventName: "ManagerCreated" }).
Pre-mine prediction is exposed only on
ConfidentialVestingFactoryAdvancedClient from
@tokenops/sdk/fhe-vesting/advanced — predict at block N, mine at N+1,
the addresses differ.
Parameters
| Parameter | Type |
|---|---|
args | CreateManagerArgs |
Returns
Promise<...>
Example
const { hash, manager } = await factory.createManager({
token: "0xYourToken",
userSalt: "0x0000000000000000000000000000000000000000000000000000000000000001",
});
createManagerAndGetAddress()
createManagerAndGetAddress(args): Promise<...>;
Defined in: fhe-vesting/factory.ts:218
Deploy a new manager clone and return its address, parsed from the
ManagerCreated event in the tx receipt.
This is the recommended entry point for the common "deploy a clone and use its address" flow. ConfidentialVestingFactoryClient.predictManagerAddress is unreliable on a live chain because the factory packs the deployment block number into the clone's immutable args — predict at block N, mine at N+1, and the addresses differ.
Internally: ConfidentialVestingFactoryClient.createManager →
PublicClient.waitForTransactionReceipt →
parseEventLogs({ eventName: "ManagerCreated" }).
Parameters
| Parameter | Type |
|---|---|
args | CreateManagerArgs |
Returns
Promise<...>
Example
const { hash, manager } = await factory.createManagerAndGetAddress({
token, userSalt,
});
setDefaultGasFee()
setDefaultGasFee(fee, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:227
Set the factory-wide default gas fee (in wei). Factory admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
fee | bigint | Fee in wei charged per claim on FeeType.Gas managers. |
account? | ... | ... | ... | - |
Returns
Promise<...>
setDefaultTokenFee()
setDefaultTokenFee(feeBps, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:239
Set the factory-wide default token fee in basis points. Factory admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
feeBps | bigint | Basis points (1 bps = 0.01 %). Deducted from the claimed token amount on FeeType.DistributionToken managers. |
account? | ... | ... | ... | - |
Returns
Promise<...>
setDefaultFeeType()
setDefaultFeeType(feeType, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:246
Set the default fee model (FeeType.Gas or FeeType.DistributionToken) for new clones. Factory admin only.
Parameters
| Parameter | Type |
|---|---|
feeType | FeeType |
account? | ... | ... | ... |
Returns
Promise<...>
resetGasFee()
resetGasFee(account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:252
Parameters
| Parameter | Type |
|---|---|
account? | ... | ... | ... |
Returns
Promise<...>
resetTokenFee()
resetTokenFee(account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:258
Parameters
| Parameter | Type |
|---|---|
account? | ... | ... | ... |
Returns
Promise<...>
setCustomFee()
setCustomFee(args, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:268
Set a per-creator fee override. The override takes precedence over the factory
defaults for all managers created by args.creator.
Parameters
| Parameter | Type |
|---|---|
args | { creator: ...; feeType: ...; gasFee: ...; tokenFee: ...; } |
args.creator | ... |
args.feeType? | ... |
args.gasFee? | ... |
args.tokenFee? | ... |
account? | ... | ... | ... |
Returns
Promise<...>
disableCustomFee()
disableCustomFee(creator, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:281
Parameters
| Parameter | Type |
|---|---|
creator | `0x${(...)}` |
account? | ... | ... | ... |
Returns
Promise<...>
setFeeCollector()
setFeeCollector(newCollector, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:287
Parameters
| Parameter | Type |
|---|---|
newCollector | `0x${(...)}` |
account? | ... | ... | ... |
Returns
Promise<...>
implementation()
implementation(): Promise<...>;
Defined in: fhe-vesting/factory.ts:296
Current LibClone implementation address.
Returns
Promise<...>
managerImplementation()
managerImplementation(): Promise<...>;
Defined in: fhe-vesting/factory.ts:310
Alias for ConfidentialVestingFactoryClient.implementation that matches
the contract's storage field name (_managerImplementation).
Named for clarity: server devs reading the Solidity reach for
factory.managerImplementation()
via autocomplete (the contract storage slot name) and hit a TS2551. The
canonical implementation() method is retained for backwards-compat and
cross-factory uniformity (fhe-airdrop exposes the same shape).
Returns
Promise<...>
defaultGasFee()
defaultGasFee(): Promise<...>;
Defined in: fhe-vesting/factory.ts:314
Returns
Promise<...>
defaultTokenFee()
defaultTokenFee(): Promise<...>;
Defined in: fhe-vesting/factory.ts:318
Returns
Promise<...>
defaultFeeType()
defaultFeeType(): Promise<...>;
Defined in: fhe-vesting/factory.ts:322
Returns
Promise<...>
feeCollector()
feeCollector(): Promise<...>;
Defined in: fhe-vesting/factory.ts:327
Returns
Promise<...>
getCustomFee()
getCustomFee(creator): Promise<...>;
Defined in: fhe-vesting/factory.ts:331
Parameters
| Parameter | Type |
|---|---|
creator | `0x${(...)}` |
Returns
Promise<...>
getInitCodeHash()
getInitCodeHash(args): Promise<...>;
Defined in: fhe-vesting/factory.ts:346
Parameters
| Parameter | Type |
|---|---|
args | { token: ...; deployer: ...; splitEnabled?: ...; pausableEnabled?: ...; } |
args.token | ... |
args.deployer | ... |
args.splitEnabled? | ... |
args.pausableEnabled? | ... |
Returns
Promise<...>
ConfidentialVestingManagerClient
Defined in: fhe-vesting/manager.ts:330
Typed wrapper around a deployed ConfidentialVestingManager clone. The
underlying contract delegates calls to its extension via fallback(); we
merge both ABIs so the consumer sees one logical surface.
Pass encryptor to enable methods that take plaintext amount inputs. The SDK
encrypts them internally — callers never handle raw ciphertext.
Example
const manager = createConfidentialVestingManagerClient({
publicClient, walletClient,
address: managerAddress,
encryptor, // RelayerNode / RelayerWeb / MockFhevmInstance
});
Constructors
Constructor
new ConfidentialVestingManagerClient(config): ConfidentialVestingManagerClient;
Defined in: fhe-vesting/manager.ts:339
Parameters
| Parameter | Type |
|---|---|
config | ConfidentialVestingManagerClientConfig |
Returns
ConfidentialVestingManagerClient
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
publicClient | readonly | { } | fhe-vesting/manager.ts:331 |
walletClient? | readonly | ... | ... | fhe-vesting/manager.ts:332 |
address | readonly | `0x${(...)}` | fhe-vesting/manager.ts:333 |
encryptor? | readonly | ... | ... | fhe-vesting/manager.ts:334 |
Accessors
aclAddress
Get Signature
get aclAddress(): `0x${(...)}`;
Defined in: fhe-vesting/manager.ts:374
The FHEVM ACL contract address used by encrypted-view methods to parse
ACL.Allowed events. Resolved lazily on first access; throws
DeploymentAddressUnavailableError if no override was passed and the
SDK does not have an ACL deployed for the connected chain.
Returns
`0x${(...)}`
Methods
token()
token(): Promise<...>;
Defined in: fhe-vesting/manager.ts:390
Return the ERC-7984 token address this manager clone is bound to.
Returns
Promise<...>
Checksummed token address.
feeType()
feeType(): Promise<...>;
Defined in: fhe-vesting/manager.ts:398
Return the fee model baked into this clone's immutable args.
Returns
Promise<...>
FeeType.Gas (0) or FeeType.DistributionToken (1).
fee()
fee(): Promise<...>;
Defined in: fhe-vesting/manager.ts:408
Return the raw fee value baked into this clone's immutable args.
Interpretation depends on feeType: wei for Gas, basis points for DistributionToken.
Returns
Promise<...>
Fee amount in the unit appropriate for feeType.
getFeeInfo()
getFeeInfo(): Promise<...>;
Defined in: fhe-vesting/manager.ts:428
Read the manager's fee configuration in one call.
Both fields are immutable (baked into the clone's bytecode at deploy time), so consumers should memoize the result for the manager's lifetime.
Returns
Promise<...>
{ feeType, fee } — feed both into the discriminated
ClaimArgs union to construct the correct claim shape.
Example
const { feeType, fee } = await manager.getFeeInfo();
await manager.claim(
feeType === FeeType.Gas
? { feeType, vestingId, value: fee }
: { feeType, vestingId },
);
deploymentBlockNumber()
deploymentBlockNumber(): Promise<...>;
Defined in: fhe-vesting/manager.ts:438
Return the block number at which this clone was deployed. Used for event log scanning — start from this block to avoid scanning from genesis.
Returns
Promise<...>
Block number as bigint.
isSplitEnabled()
isSplitEnabled(): Promise<...>;
Defined in: fhe-vesting/manager.ts:446
Return whether splitVesting is enabled on this clone.
Returns
Promise<...>
true if the split feature is enabled.
isPausable()
isPausable(): Promise<...>;
Defined in: fhe-vesting/manager.ts:454
Return whether this clone supports pause/unpause.
Returns
Promise<...>
true if the clone is pausable.
paused()
paused(): Promise<...>;
Defined in: fhe-vesting/manager.ts:462
Return the current pause state. Always false for non-pausable clones.
Returns
Promise<...>
true if the manager is paused and claims are blocked.
maxBatchSize()
maxBatchSize(): Promise<...>;
Defined in: fhe-vesting/manager.ts:470
Return the maximum number of vesting schedules allowed in a single batchCreateVesting call.
Returns
Promise<...>
Batch size limit as bigint.
maxRevokeBatchSize()
maxRevokeBatchSize(): Promise<...>;
Defined in: fhe-vesting/manager.ts:478
Return the maximum number of vesting ids allowed in a single batchRevokeVesting call.
Returns
Promise<...>
Revoke batch size limit as bigint.
getVestingInfo()
getVestingInfo(vestingId): Promise<...>;
Defined in: fhe-vesting/manager.ts:494
Return metadata for a vesting schedule. Returns a zero-struct when vestingId does not exist.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingId | `0x${(...)}` | The bytes32 vesting schedule ID from the VestingCreated event. |
Returns
Promise<...>
VestingInfo struct; startTimestamp === 0 means the schedule does not exist.
Example
const info = await manager.getVestingInfo(vestingId);
if (info.startTimestamp === 0) throw new Error("vesting not found");
getAllRecipients()
getAllRecipients(): Promise<...>;
Defined in: fhe-vesting/manager.ts:503
Return all recipient addresses that have at least one vesting schedule on this manager.
Returns
Promise<...>
Array of checksummed addresses; may be large — use getAllRecipientsSliced for pagination.
getAllRecipientsLength()
getAllRecipientsLength(): Promise<...>;
Defined in: fhe-vesting/manager.ts:511
Return the total number of unique recipients on this manager.
Returns
Promise<...>
Count as bigint.
getAllRecipientsSliced()
getAllRecipientsSliced(start, end): Promise<...>;
Defined in: fhe-vesting/manager.ts:523
Slice of getAllRecipients, half-open [start, end).
Accepts bigint | number for start / end for ergonomics on read paths
— CI scripts typically derive these from Number(process.env.X) and
forcing bigint coercion at the call site is a pure paper cut. The
underlying contract reads through unchanged (viem coerces).
Parameters
| Parameter | Type |
|---|---|
start | ... | ... |
end | ... | ... |
Returns
Promise<...>
isRecipient()
isRecipient(account): Promise<...>;
Defined in: fhe-vesting/manager.ts:535
Return whether account has at least one vesting schedule on this manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
account | `0x${(...)}` | Address to check. |
Returns
Promise<...>
true if the account is a known recipient.
getAllRecipientVestings()
getAllRecipientVestings(recipient): Promise<...>;
Defined in: fhe-vesting/manager.ts:544
Return all vesting schedule IDs for recipient.
Parameters
| Parameter | Type | Description |
|---|---|---|
recipient | `0x${(...)}` | Address of the vesting recipient. |
Returns
Promise<...>
Array of bytes32 vesting IDs; may be large — use getAllRecipientVestingsSliced for pagination.
getAllRecipientVestingsLength()
getAllRecipientVestingsLength(recipient): Promise<...>;
Defined in: fhe-vesting/manager.ts:553
Return the number of vesting schedules for recipient.
Parameters
| Parameter | Type | Description |
|---|---|---|
recipient | `0x${(...)}` | Address of the vesting recipient. |
Returns
Promise<...>
Count as bigint.
getAllRecipientVestingsSliced()
getAllRecipientVestingsSliced(
recipient,
start,
end): Promise<...>;
Defined in: fhe-vesting/manager.ts:561
Slice of getAllRecipientVestings(recipient), half-open [start, end).
See getAllRecipientsSliced for the bigint-permissiveness rationale.
Parameters
| Parameter | Type |
|---|---|
recipient | `0x${(...)}` |
start | ... | ... |
end | ... | ... |
Returns
Promise<...>
getPendingVestingTransfer()
getPendingVestingTransfer(vestingId): Promise<...>;
Defined in: fhe-vesting/manager.ts:574
Return the pending transfer details for a vesting schedule.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingId | `0x${(...)}` | The bytes32 vesting schedule ID. |
Returns
Promise<...>
{ newRecipient, initiatedAt, expiresAt } — all zero if no transfer is pending.
preflightClaim()
preflightClaim(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:608
Read-only preflight for claim. Runs the deterministic-from-off-chain
checks in parallel and reports any blockers as typed TokenOpsSdkErrors.
Returns { ready: true, blockers: [] } when the claim is safe to submit.
Preflight is opt-in. Consumers who have already validated state can
skip this call and invoke claim directly — they'll receive the same
typed errors at write time via the revert mapper.
Checks performed (all read-only, no gas):
- Recipient match:
vestingInfo.recipient === caller. - Schedule exists:
getVestingInforeturns a non-zero startTimestamp. - Timelock elapsed:
block.timestamp ≥ startTimestamp + timelock. - Manager is not paused (only when the clone has pause enabled).
- ETH balance covers the gas fee (only when
feeType === FeeType.Gas).
Stochastic failures (FHE handle invalidation between read and write, ACL race conditions) cannot be detected off-chain and still surface as typed errors via the revert mapper.
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; caller: ...; } |
args.vestingId | ... |
args.caller | ... |
Returns
Promise<...>
{ ready, blockers } — same code shape as the write would throw.
getVestedAmount()
getVestedAmount(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:703
Get the vested amount at a given timestamp as an encrypted handle.
Submits a transaction that calls FHE.allow(handle, msg.sender) — the handle
is extracted from the receipt's ACL Allowed event, not from simulation. Pass
handle to the Zama relayer's userDecrypt to obtain the plaintext.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { vestingId: ...; timestamp: ...; account?: ...; } | - |
args.vestingId | ... | - |
args.timestamp | ... | Unix timestamp to evaluate vesting at (use Date.now() / 1000 for current). |
args.account? | ... | - |
Returns
Promise<...>
{ handle, hash } — handle is a euint128 granted to the caller.
getClaimableAmount()
getClaimableAmount(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:719
Get the currently claimable token amount as an encrypted handle.
Like all encrypted view methods, this submits a transaction. Pass handle
to the Zama relayer's userDecrypt to obtain the plaintext.
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; account?: ...; } |
args.vestingId | ... |
args.account? | ... |
Returns
Promise<...>
{ handle, hash } — handle is a euint128 granted to the caller.
getTotalAllocation()
getTotalAllocation(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:726
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; account?: ...; } |
args.vestingId | ... |
args.account? | ... |
Returns
Promise<...>
getSettledAmount()
getSettledAmount(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:733
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; account?: ...; } |
args.vestingId | ... |
args.account? | ... |
Returns
Promise<...>
adminGetVestedAmount()
adminGetVestedAmount(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:740
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; timestamp: ...; account?: ...; } |
args.vestingId | ... |
args.timestamp | ... |
args.account? | ... |
Returns
Promise<...>
adminGetClaimableAmount()
adminGetClaimableAmount(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:752
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; account?: ...; } |
args.vestingId | ... |
args.account? | ... |
Returns
Promise<...>
adminGetTotalAllocation()
adminGetTotalAllocation(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:759
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; account?: ...; } |
args.vestingId | ... |
args.account? | ... |
Returns
Promise<...>
adminGetSettledAmount()
adminGetSettledAmount(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:766
Parameters
| Parameter | Type |
|---|---|
args | { vestingId: ...; account?: ...; } |
args.vestingId | ... |
args.account? | ... |
Returns
Promise<...>
adminGetTokenBalance()
adminGetTokenBalance(args?): Promise<...>;
Defined in: fhe-vesting/manager.ts:773
Parameters
| Parameter | Type |
|---|---|
args? | ... | ... |
Returns
Promise<...>
createVesting()
createVesting(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:796
Create a single vesting schedule. The SDK encrypts amount into an
externalEuint64 and submits it as the input proof — callers pass plaintext.
Pass encryptedInput to bypass the encryptor when you manage encryption yourself.
Parameters
| Parameter | Type |
|---|---|
args | CreateVestingArgs |
Returns
Promise<...>
Transaction hash. Parse the VestingCreated event to extract the vestingId.
Example
const hash = await manager.createVesting({
params: { recipient, startTimestamp, endTimestamp, cliffSeconds: 0,
releaseIntervalSecs: 86400, timelockSeconds: 0,
initialUnlockBps: 0, cliffAmountBps: 0, isRevocable: false },
amount: 1_000_000n,
});
batchCreateVesting()
batchCreateVesting(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:831
Batch-create vesting schedules. All amounts are encrypted together under a
single input proof, saving gas vs. multiple createVesting calls.
Respects maxBatchSize — check before calling on large lists.
Parameters
| Parameter | Type |
|---|---|
args | BatchCreateVestingArgs |
Returns
Promise<...>
Transaction hash.
claim()
claim(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:888
Claim all currently vested tokens for vestingId.
For FeeType.Gas managers, pass value (gas fee in wei from getFeeInfo()).
Parameters
| Parameter | Type | Description |
|---|---|---|
args | ClaimArgs | Discriminated by feeType: pass { feeType, vestingId, value } for Gas, { feeType, vestingId } for DistributionToken. |
Returns
Promise<...>
Transaction hash.
Example
const { feeType, fee } = await manager.getFeeInfo();
const hash = await manager.claim(
feeType === FeeType.Gas ? { feeType, vestingId, value: fee } : { feeType, vestingId },
);
adminClaim()
adminClaim(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:912
Admin variant of claim — callable by the manager admin on behalf of any recipient.
Useful for gas-sponsored claim flows. Same fee rules as claim.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | ClaimArgs | Same discriminated union as claim. |
Returns
Promise<...>
Transaction hash.
partialClaim()
partialClaim(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:941
Claim a specific encrypted amount from a vesting schedule rather than the full claimable balance.
The SDK encrypts amount — pass plaintext. Alternatively pass encryptedInput to bypass encryption.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | PartialClaimArgs | Includes vestingId, amount or encryptedInput, and optional value for Gas-fee managers. |
Returns
Promise<...>
Transaction hash.
adminPartialClaim()
adminPartialClaim(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:976
Admin variant of partialClaim — callable by the manager admin on behalf of any recipient.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | PartialClaimArgs | Same as partialClaim. |
Returns
Promise<...>
Transaction hash.
revokeVesting()
revokeVesting(vestingId, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1012
Revoke a vesting schedule. Callable only when the schedule was created with isRevocable: true.
The unvested remainder is returned to the manager admin.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingId | `0x${(...)}` | The bytes32 vesting schedule ID to revoke. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
batchRevokeVesting()
batchRevokeVesting(vestingIds, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1023
Revoke multiple vesting schedules in one transaction. Respects maxRevokeBatchSize.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingIds | readonly ...[] | Array of bytes32 vesting schedule IDs to revoke. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
splitVesting()
splitVesting(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1079
Split a vesting into two positions.
The numerator/denominator ratio is auto-scaled via scaleRatio to the
universal split constant FHE_SPLIT_DENOMINATOR (90_090_000 =
LCM(1..16, 10_000)) unless args.preScaled is set. Every confidential
split lands on the same plaintext denominator so the constant itself
leaks no information about the split's shape; only the encrypted
numerator carries the share. 90_090_000 is well above the contract's
MIN_SPLIT_DENOMINATOR (10_000) floor. The SDK encrypts numerator —
pass plaintext.
Two natural input shapes both produce exact integer numerators against the universal denominator:
n/mwithm ∈ 1..16(halves, thirds, …, sixteenths)bps/10_000(basis points)
Use the share builder to construct them without manual math:
share.fraction(1, 7) or share.basisPoints(250) → pass the returned
{ numerator, denominator } with preScaled: true.
Parameters
| Parameter | Type |
|---|---|
args | SplitVestingArgs |
Returns
Promise<...>
{ hash, newVestingId } — the receipt-derived id of the
newly-created vesting position, required for any follow-up call
(claim, transfer, disclose) on the split-off position.
Examples
const { newVestingId } = await manager.splitVesting({
vestingId,
numerator: 1n, denominator: 2n, // 50% split; SDK scales to 45_045_000 / 90_090_000
newRecipient: "0xNewRecipient",
});
// Basis-point style via the guided builder:
const ratio = share.basisPoints(250); // 2.5%
const { newVestingId } = await manager.splitVesting({
vestingId,
numerator: ratio.numerator,
denominator: ratio.denominator,
preScaled: true,
newRecipient: "0xNewRecipient",
});
initiateVestingTransfer()
initiateVestingTransfer(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1179
Initiate a vesting schedule transfer to a new recipient.
The new recipient has transferDurationSeconds to accept before the offer expires.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | InitiateTransferArgs | { vestingId, newRecipient, transferDurationSeconds }. |
Returns
Promise<...>
Transaction hash.
acceptVestingTransfer()
acceptVestingTransfer(vestingId, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1216
Accept a pending vesting transfer. Called by the newRecipient named in initiateVestingTransfer.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingId | `0x${(...)}` | The bytes32 vesting schedule ID being transferred. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
cancelVestingTransfer()
cancelVestingTransfer(vestingId, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1225
Cancel a pending vesting transfer. Callable by either the original or new recipient.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingId | `0x${(...)}` | The bytes32 vesting schedule ID with a pending transfer. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
directVestingTransfer()
directVestingTransfer(
vestingId,
newOwner,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1236
Transfer ownership of a vesting schedule directly to newOwner without a time-locked acceptance window.
Callable only by the manager admin.
Parameters
| Parameter | Type | Description |
|---|---|---|
vestingId | `0x${(...)}` | The bytes32 vesting schedule ID to transfer. |
newOwner | `0x${(...)}` | Address that will become the new recipient. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
discloseToParty()
discloseToParty(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1274
Disclose a single vesting amount to party, granting them persistent FHE
ACL on the corresponding euint128 handle. The handle is parsed from the
AmountDisclosed event filtered by the indexed
(vestingId, discloser=caller, party) tuple — exactly one match expected.
Parameters
| Parameter | Type |
|---|---|
args | DiscloseArgs |
Returns
Promise<...>
{ hash, handle } — pass handle to the Zama relayer's
userDecrypt (from the party side) to obtain the plaintext.
batchDiscloseToParty()
batchDiscloseToParty(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1291
Disclose multiple vesting amounts to one party in a single tx. Handles
are parsed from the matching AmountDisclosed events and returned in the
same order as args.vestingIds (one handle per input id).
Parameters
| Parameter | Type |
|---|---|
args | { vestingIds: ...; disclosureTypes: ...; party: ...; account?: ...; } |
args.vestingIds | ... |
args.disclosureTypes | ... |
args.party | ... |
args.account? | ... |
Returns
Promise<...>
{ hash, handles } — handles[i] corresponds to vestingIds[i].
adminDiscloseToParty()
adminDiscloseToParty(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1325
Admin-only counterpart to discloseToParty. Same receipt-parsing
semantics — returns the granted euint128 handle from the
AmountDisclosed event.
Parameters
| Parameter | Type |
|---|---|
args | DiscloseArgs |
Returns
Promise<...>
adminBatchDiscloseToParty()
adminBatchDiscloseToParty(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1338
Admin-only counterpart to batchDiscloseToParty. Same return shape.
Parameters
| Parameter | Type |
|---|---|
args | { vestingIds: ...; disclosureTypes: ...; party: ...; account?: ...; } |
args.vestingIds | ... |
args.disclosureTypes | ... |
args.party | ... |
args.account? | ... |
Returns
Promise<...>
discloseHandleToParty()
discloseHandleToParty(
handle,
party,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1374
Grant party persistent FHE ACL on an already-obtained encrypted handle.
Use this when you hold a handle from a previous call and want to share it with another address.
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | `0x${(...)}` | The euint128 encrypted handle to disclose. |
party | `0x${(...)}` | Address to grant ACL on the handle. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
batchDiscloseHandlesToParty()
batchDiscloseHandlesToParty(
handles,
party,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1388
Grant party persistent FHE ACL on multiple encrypted handles in one transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
handles | readonly ...[] | Array of euint128 handles to disclose. |
party | `0x${(...)}` | Address to grant ACL on all handles. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
withdrawAdmin()
withdrawAdmin(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1413
Withdraw a confidential token amount from the manager's balance back to the admin.
The SDK encrypts amount — pass plaintext. Alternatively pass encryptedInput.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { amount?: ...; encryptor?: ...; encryptedInput?: ...; account?: ...; } | { amount } (plaintext, SDK encrypts) or { encryptedInput } (pre-encrypted). |
args.amount? | ... | Plaintext amount. Mutually exclusive with encryptedInput. |
args.encryptor? | ... | - |
args.encryptedInput? | ... | Pre-encrypted input. Mutually exclusive with amount. |
args.account? | ... | - |
Returns
Promise<...>
Transaction hash.
withdrawOtherToken()
withdrawOtherToken(
token,
to,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1450
Recover a plain ERC-20 token accidentally sent to this manager. Admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | `0x${(...)}` | ERC-20 token address to recover. |
to | `0x${(...)}` | Recipient address for the recovered tokens. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
withdrawOtherConfidentialToken()
withdrawOtherConfidentialToken(
token,
to,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1464
Recover a confidential ERC-7984 token accidentally sent to this manager. Admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | `0x${(...)}` | ERC-7984 token address to recover. |
to | `0x${(...)}` | Recipient address for the recovered tokens. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
withdrawGasFee()
withdrawGasFee(
to,
amount,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1478
Withdraw accumulated ETH gas fees from the manager to to. Admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
to | `0x${(...)}` | Recipient address. |
amount | bigint | Amount in wei. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
withdrawTokenFee()
withdrawTokenFee(args): Promise<...>;
Defined in: fhe-vesting/manager.ts:1488
Withdraw accumulated token fees from a FeeType.DistributionToken manager. Admin only.
The SDK encrypts amount — pass plaintext. Alternatively pass encryptedInput.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { to: ...; amount?: ...; encryptor?: ...; encryptedInput?: ...; account?: ...; } | { to, amount } (plaintext, SDK encrypts) or { to, encryptedInput } (pre-encrypted). |
args.to | ... | - |
args.amount? | ... | Plaintext amount. Mutually exclusive with encryptedInput. |
args.encryptor? | ... | - |
args.encryptedInput? | ... | Pre-encrypted input. Mutually exclusive with amount. |
args.account? | ... | - |
Returns
Promise<...>
Transaction hash.
setMaxBatchSize()
setMaxBatchSize(newMax, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1532
Update the maximum number of vestings allowed in a single batchCreateVesting call. Admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
newMax | bigint | New batch size limit. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
setMaxRevokeBatchSize()
setMaxRevokeBatchSize(newMax, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1543
Update the maximum number of vestings allowed in a single batchRevokeVesting call. Admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
newMax | ... | ... | New revoke batch size limit. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
transferFeeCollectorRole()
transferFeeCollectorRole(newCollector, account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1557
Transfer the fee-collector role to a new address. Callable by the current fee collector.
Parameters
| Parameter | Type | Description |
|---|---|---|
newCollector | `0x${(...)}` | Address to assign the fee-collector role. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
pause()
pause(account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1572
Pause the manager, blocking all claim operations. Requires isPausable() === true. PAUSER_ROLE only.
Parameters
| Parameter | Type |
|---|---|
account? | ... | ... | ... |
Returns
Promise<...>
Transaction hash.
unpause()
unpause(account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1582
Resume a paused manager, re-enabling claim operations. PAUSER_ROLE only.
Parameters
| Parameter | Type |
|---|---|
account? | ... | ... | ... |
Returns
Promise<...>
Transaction hash.
hasRole()
hasRole(role, account): Promise<...>;
Defined in: fhe-vesting/manager.ts:1598
Check whether account holds role on this manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
role | `0x${(...)}` | bytes32 role identifier — use the roleConstants() helper or the SDK's exported role constants. |
account | `0x${(...)}` | Address to check. |
Returns
Promise<...>
true if the account holds the role.
grantRole()
grantRole(
role,
accountTarget,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1608
Grant role to accountTarget. Requires DEFAULT_ADMIN_ROLE.
Parameters
| Parameter | Type | Description |
|---|---|---|
role | `0x${(...)}` | bytes32 role identifier. |
accountTarget | `0x${(...)}` | Address to grant the role to. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
revokeRole()
revokeRole(
role,
accountTarget,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1624
Revoke role from accountTarget. Requires DEFAULT_ADMIN_ROLE.
Parameters
| Parameter | Type | Description |
|---|---|---|
role | `0x${(...)}` | bytes32 role identifier. |
accountTarget | `0x${(...)}` | Address to revoke the role from. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
renounceRole()
renounceRole(
role,
callerConfirm,
account?): Promise<...>;
Defined in: fhe-vesting/manager.ts:1640
Renounce a role held by the caller. callerConfirm must equal msg.sender (OpenZeppelin guard).
Parameters
| Parameter | Type | Description |
|---|---|---|
role | `0x${(...)}` | bytes32 role identifier to renounce. |
callerConfirm | `0x${(...)}` | Must equal the calling account address. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Transaction hash.
roleConstants()
roleConstants(): Promise<...>;
Defined in: fhe-vesting/manager.ts:1657
Read all role identifiers from the contract in one multicall.
Returns
Promise<...>
Object mapping role name to its bytes32 identifier.
Example
const { VESTING_CREATOR_ROLE } = await manager.roleConstants();
await manager.grantRole(VESTING_CREATOR_ROLE, creatorAddress);
Interfaces
Encryptor
Defined in: fhe-vesting/encryption.ts:41
Subset of @zama-fhe/sdk RelayerSDK we depend on. Declared structurally so
consumers can pass any v3 RelayerSDK (RelayerWeb, RelayerNode, or a mock
like MockFhevmInstance) without us importing the optional peer dep.
The values shape matches Zama's EncryptInput discriminated union, so
relayer instances satisfy this interface directly — no cast needed.
Extended by
Methods
encrypt()
encrypt(params): Promise<...>;
Defined in: fhe-vesting/encryption.ts:42
Parameters
| Parameter | Type |
|---|---|
params | { values: ...; contractAddress: ...; userAddress: ...; } |
params.values | ... |
params.contractAddress | ... |
params.userAddress | ... |
Returns
Promise<...>
EncryptUint64Args
Defined in: fhe-vesting/encryption.ts:80
Properties
| Property | Type | Defined in |
|---|---|---|
encryptor | Encryptor | fhe-vesting/encryption.ts:81 |
contractAddress | `0x${(...)}` | fhe-vesting/encryption.ts:82 |
userAddress | `0x${(...)}` | fhe-vesting/encryption.ts:83 |
value | bigint | fhe-vesting/encryption.ts:84 |
EncryptUint64BatchArgs
Defined in: fhe-vesting/encryption.ts:87
Properties
| Property | Type | Defined in |
|---|---|---|
encryptor | Encryptor | fhe-vesting/encryption.ts:88 |
contractAddress | `0x${(...)}` | fhe-vesting/encryption.ts:89 |
userAddress | `0x${(...)}` | fhe-vesting/encryption.ts:90 |
values | ...[] | fhe-vesting/encryption.ts:91 |
ConfidentialVestingFactoryClientConfig
Defined in: fhe-vesting/factory.ts:31
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
publicClient | { } | - | fhe-vesting/factory.ts:32 |
walletClient? | ... | ... | - | fhe-vesting/factory.ts:33 |
address? | ... | ... | Override the on-chain factory address. Falls back to getFheVestingFactoryAddress keyed by chain id. | fhe-vesting/factory.ts:35 |
chainId? | ... | ... | Explicit chain id used to look up the default factory address. Defaults to publicClient.chain?.id. | fhe-vesting/factory.ts:37 |
telemetry? | ... | ... | Optional telemetry sink. When provided, the SDK emits a fhe-vesting.client.init event on construction and brackets public write methods with named spans (fhe-vesting.factory.createManager, …). Defaults to a no-op — zero overhead, zero leakage of consumer-side identifiers. The shape is structurally compatible with NoopTelemetry / ConsoleTelemetry / TokenOpsTelemetry exported from @tokenops/sdk/telemetry. | fhe-vesting/factory.ts:47 |
CreateManagerArgs
Defined in: fhe-vesting/factory.ts:50
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
token | `0x${(...)}` | - | fhe-vesting/factory.ts:51 |
userSalt | `0x${(...)}` | Any unique 32-byte value chosen by the caller. Combined with token and the deployer address to deterministically derive the clone address via CREATE3. Example keccak256(toBytes("user-" + userId)) // keccak256 / toBytes from viem "0x0000000000000000000000000000000000000000000000000000000000000001" | fhe-vesting/factory.ts:62 |
splitEnabled? | ... | ... | ... | Override splitVesting immutable flag. Defaults to true. Forces createManagerWithOptions. | fhe-vesting/factory.ts:64 |
pausableEnabled? | ... | ... | ... | Override pause/unpause immutable flag. Defaults to true. Forces createManagerWithOptions. | fhe-vesting/factory.ts:66 |
account? | ... | ... | ... | - | fhe-vesting/factory.ts:67 |
CreateManagerResult
Defined in: fhe-vesting/factory.ts:105
Rich-return shape from ConfidentialVestingFactoryClient.createManager.
Branded hash: TxHash and manager: Address so consumers can't accidentally
swap them at the destructure site.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
hash | `0x${(...)}` | Transaction hash of the deploy. | fhe-vesting/factory.ts:107 |
manager | `0x${(...)}` | Address of the deployed clone, parsed from the ManagerCreated event. | fhe-vesting/factory.ts:109 |
ConfidentialVestingManagerClientConfig
Defined in: fhe-vesting/manager.ts:61
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
publicClient | { } | - | fhe-vesting/manager.ts:62 |
walletClient? | ... | ... | - | fhe-vesting/manager.ts:63 |
address | `0x${(...)}` | Manager clone address (per-user; use the factory's predictManagerAddress or ManagerCreated event). | fhe-vesting/manager.ts:65 |
encryptor? | ... | ... | Default encryptor used by methods that take plaintext inputs. Optional at construction time, but REQUIRED at call time for any method that submits encrypted inputs: createVesting, batchCreateVesting, partialClaim, splitVesting, withdrawAdmin, withdrawTokenFee. These methods throw if no encryptor is resolvable when they run — TypeScript cannot catch this at construction time. Pass an eager Encryptor instance (server, vitest) or a `() => Encryptor | undefined` factory (React contexts, Vue refs, signals) whose result is resolved per-encryption so the live instance is always picked up. |
aclAddress? | ... | ... | FHEVM ACL contract address override. When omitted, resolved from publicClient.chain?.id via the SDK's chain registry; the constructor throws DeploymentAddressUnavailableError if neither is available. Required because #encryptedView filters the receipt for ACL grants to extract the returned handle. | fhe-vesting/manager.ts:86 |
telemetry? | ... | ... | Optional telemetry sink. When provided, the SDK brackets public write methods with named spans (fhe-vesting.manager.pause, etc.). Defaults to a no-op — zero overhead, zero leakage of consumer-side identifiers. Structurally compatible with NoopTelemetry / ConsoleTelemetry / TokenOpsTelemetry exported from @tokenops/sdk/telemetry. | fhe-vesting/manager.ts:95 |
BatchCreateVestingArgs
Defined in: fhe-vesting/manager.ts:144
Properties
| Property | Type | Defined in |
|---|---|---|
items | ...[] | fhe-vesting/manager.ts:145 |
encryptor? | ... | ... | fhe-vesting/manager.ts:146 |
account? | ... | ... | ... | fhe-vesting/manager.ts:147 |
SplitVestingArgs
Defined in: fhe-vesting/manager.ts:234
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
vestingId | `0x${(...)}` | bytes32 vesting schedule ID emitted in the VestingCreated event. | fhe-vesting/manager.ts:236 |
numerator | bigint | Plaintext share numerator (kept confidential on-chain — SDK encrypts it). Note: after auto-scaling, large numerators (close to uint64 max after multiplication by the scale factor) will cause assertUint64 to throw. Call scaleRatio({ numerator, denominator }) manually first to preview the scaled values, then pass preScaled: true to skip double-scaling. | fhe-vesting/manager.ts:245 |
denominator | bigint | Plaintext denominator. Auto-scaled to the universal privacy-preserving constant FHE_SPLIT_DENOMINATOR (90_090_000 = LCM(1..16, 10_000)), which is well above the contract's MIN_SPLIT_DENOMINATOR (10_000) floor. Use the share builder (share.fraction / share.basisPoints) for exact-integer ratios without manual scaling. | fhe-vesting/manager.ts:253 |
newRecipient | `0x${(...)}` | - | fhe-vesting/manager.ts:254 |
encryptor? | ... | ... | - | fhe-vesting/manager.ts:255 |
preScaled? | ... | ... | ... | Set to true if you have already called scaleRatio on the numerator/denominator pair. By default the SDK calls scaleRatio automatically; pass preScaled: true to skip it and use your values as-is. | fhe-vesting/manager.ts:261 |
account? | ... | ... | ... | - | fhe-vesting/manager.ts:262 |
InitiateTransferArgs
Defined in: fhe-vesting/manager.ts:265
Properties
| Property | Type | Defined in |
|---|---|---|
vestingId | `0x${(...)}` | fhe-vesting/manager.ts:266 |
newRecipient | `0x${(...)}` | fhe-vesting/manager.ts:267 |
transferDurationSeconds | number | fhe-vesting/manager.ts:268 |
account? | ... | ... | ... | fhe-vesting/manager.ts:269 |
DiscloseArgs
Defined in: fhe-vesting/manager.ts:272
Properties
| Property | Type | Defined in |
|---|---|---|
vestingId | `0x${(...)}` | fhe-vesting/manager.ts:273 |
party | `0x${(...)}` | fhe-vesting/manager.ts:274 |
disclosureType | DisclosureType | fhe-vesting/manager.ts:275 |
account? | ... | ... | ... | fhe-vesting/manager.ts:276 |
SplitVestingResult
Defined in: fhe-vesting/manager.ts:286
Result of ConfidentialVestingManagerClient.splitVesting.
The newVestingId is parsed from the VestingSplit event filtered by the
(originalVestingId, newRecipient) indexed args — both supplied at call
time, so the filter is exact.
Properties
| Property | Type | Defined in |
|---|---|---|
hash | `0x${(...)}` | fhe-vesting/manager.ts:287 |
newVestingId | `0x${(...)}` | fhe-vesting/manager.ts:288 |
DiscloseToPartyResult
Defined in: fhe-vesting/manager.ts:299
Result of ConfidentialVestingManagerClient.discloseToParty / ConfidentialVestingManagerClient.adminDiscloseToParty.
The handle is the euint128 ciphertext parsed from the AmountDisclosed
event — (vestingId, discloser=msg.sender, party) are indexed and the
filter pins all three.
Properties
| Property | Type | Defined in |
|---|---|---|
hash | `0x${(...)}` | fhe-vesting/manager.ts:300 |
handle | `0x${(...)}` | fhe-vesting/manager.ts:301 |
BatchDiscloseToPartyResult
Defined in: fhe-vesting/manager.ts:310
Result of ConfidentialVestingManagerClient.batchDiscloseToParty / ConfidentialVestingManagerClient.adminBatchDiscloseToParty.
handles[i] corresponds to vestingIds[i] from the input. Each handle
comes from the AmountDisclosed event keyed on that vestingId.
Properties
| Property | Type | Defined in |
|---|---|---|
hash | `0x${(...)}` | fhe-vesting/manager.ts:311 |
handles | readonly ...[] | fhe-vesting/manager.ts:312 |
VestingParams
Defined in: fhe-vesting/types.ts:9
Plaintext mirror of IConfidentialVestingManagerTypes.VestingParams. Field
names and order match the contract struct so viem can encode it as a tuple.
Properties
| Property | Type | Defined in |
|---|---|---|
recipient | `0x${(...)}` | fhe-vesting/types.ts:10 |
startTimestamp | number | fhe-vesting/types.ts:11 |
endTimestamp | number | fhe-vesting/types.ts:12 |
cliffSeconds | number | fhe-vesting/types.ts:13 |
releaseIntervalSecs | number | fhe-vesting/types.ts:14 |
timelockSeconds | number | fhe-vesting/types.ts:15 |
initialUnlockBps | number | fhe-vesting/types.ts:16 |
cliffAmountBps | number | fhe-vesting/types.ts:17 |
isRevocable | boolean | fhe-vesting/types.ts:18 |
VestingInfo
Defined in: fhe-vesting/types.ts:22
Read-only snapshot returned by getVestingInfo.
Properties
| Property | Type | Defined in |
|---|---|---|
recipient | `0x${(...)}` | fhe-vesting/types.ts:23 |
startTimestamp | number | fhe-vesting/types.ts:24 |
endTimestamp | number | fhe-vesting/types.ts:25 |
revokeTimestamp | number | fhe-vesting/types.ts:26 |
cliffReleaseTimestamp | number | fhe-vesting/types.ts:27 |
releaseIntervalSecs | number | fhe-vesting/types.ts:28 |
timelock | number | fhe-vesting/types.ts:29 |
initialUnlockBps | number | fhe-vesting/types.ts:30 |
cliffAmountBps | number | fhe-vesting/types.ts:31 |
isRevocable | boolean | fhe-vesting/types.ts:32 |
CustomFee
Defined in: fhe-vesting/types.ts:74
Properties
| Property | Type | Defined in |
|---|---|---|
enabled | boolean | fhe-vesting/types.ts:75 |
preferredFeeType | FeeType | fhe-vesting/types.ts:76 |
gasFee | bigint | fhe-vesting/types.ts:77 |
tokenFee | bigint | fhe-vesting/types.ts:78 |
PendingTransfer
Defined in: fhe-vesting/types.ts:81
Properties
| Property | Type | Defined in |
|---|---|---|
newRecipient | `0x${(...)}` | fhe-vesting/types.ts:82 |
initiatedAt | number | fhe-vesting/types.ts:83 |
expiresAt | number | fhe-vesting/types.ts:84 |
Type Aliases
FheValueInput
type FheValueInput = ... | ... | ...;
Defined in: fhe-vesting/encryption.ts:15
FHE input values, discriminated by ciphertext type. Mirrors the shape of
EncryptInput from @zama-fhe/sdk so that a RelayerWeb / RelayerNode
/ MockFhevmInstance instance is structurally assignable to Encryptor
without casting. We restate it here instead of importing from the optional
@zama-fhe/sdk peer dep.
EncryptorSource
type EncryptorSource = ... | ...;
Defined in: fhe-vesting/encryption.ts:59
Eager or lazy Encryptor reference. The lazy form (() => Encryptor | undefined)
is for hosts where the encryptor instance lives in a context whose lifetime
doesn't match the SDK client's — React contexts, Vue refs, signals, etc. The
factory is invoked per-encryption, so the client always picks up the live
instance without needing to be reconstructed when the host swaps it.
Server-side and test code where the encryptor is built once at startup can keep passing an Encryptor directly; the union accepts both shapes.
CreateVestingArgs
type CreateVestingArgs = ... | ...;
Defined in: fhe-vesting/manager.ts:129
Discriminated union: provide EITHER an encryptor (the SDK encrypts the
plaintext amount) OR a pre-built encryptedInput. Passing both is a TS
error — the JSDoc previously documented this as a runtime contract; now
it's enforced by the compiler.
ClaimArgs
type ClaimArgs = ... | ...;
Defined in: fhe-vesting/manager.ts:165
Arguments for ConfidentialVestingManagerClient.claim and
ConfidentialVestingManagerClient.adminClaim, discriminated by
feeType (read via getFeeInfo()).
For FeeType.Gas, pass value (gas fee in wei).
For FeeType.DistributionToken, omit value (token fee deducted on-chain).
PartialClaimArgs
type PartialClaimArgs = ... | ...;
Defined in: fhe-vesting/manager.ts:179
Discriminated union: provide EITHER an encryptor (the SDK encrypts amount)
OR a pre-built encryptedInput. Passing both is a compile error.
Variables
confidentialVestingFactoryAbi
const confidentialVestingFactoryAbi: readonly [..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...];
Defined in: fhe-vesting/abis/factory.ts:2
confidentialVestingManagerAbi
const confidentialVestingManagerAbi: readonly [..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...];
Defined in: fhe-vesting/abis/manager.ts:2
Functions
resolveEncryptor()
function resolveEncryptor(source): ... | ...;
Defined in: fhe-vesting/encryption.ts:75
Normalize an EncryptorSource to the underlying Encryptor, invoking the factory if lazy.
Parameters
| Parameter | Type | Description |
|---|---|---|
source | ... | ... | Eager encryptor instance or a lazy factory that returns one. |
Returns
... | ...
The resolved Encryptor, or undefined if source is undefined or the factory returned undefined.
Example
// Server / test — eager instance
const encryptor = new RelayerNode({ transports: { ... }, getChainId: async () => sepolia.id });
const resolved = resolveEncryptor(encryptor); // returns encryptor directly
// React — lazy factory picks up the live ZamaSDK context
const zamaSDK = useZamaSDK();
const resolved = resolveEncryptor(() => zamaSDK.relayer);
encryptUint64()
function encryptUint64(args): Promise<...>;
Defined in: fhe-vesting/encryption.ts:121
Encrypt a single uint64 value into an externalEuint64 handle + KMS input proof.
The handle and proof are bound to contractAddress and userAddress — they
cannot be replayed against a different contract or sender.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | EncryptUint64Args | Encryption request; value must fit in uint64 (0 to 2^64-1). |
Returns
Promise<...>
{ handle: Hex, inputProof: Hex } — pass both to the contract.
Example
const encrypted = await encryptUint64({
encryptor, contractAddress: managerAddress,
userAddress: account.address, value: 1_000_000n,
});
encryptUint64Batch()
function encryptUint64Batch(__namedParameters): Promise<...>;
Defined in: fhe-vesting/encryption.ts:160
Encrypt N uint64 values into N handles bound by a single input proof.
Using a batch is more gas-efficient than N separate encryptUint64 calls because
the prover generates one proof for the entire set.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | EncryptUint64BatchArgs |
Returns
Promise<...>
{ handles: Hex[], inputProof: Hex } — handles[i] corresponds to values[i].
Example
const { handles, inputProof } = await encryptUint64Batch({
encryptor, contractAddress, userAddress,
values: [100_000n, 200_000n],
});
createConfidentialVestingFactoryClient()
function createConfidentialVestingFactoryClient(config): ConfidentialVestingFactoryClient;
Defined in: fhe-vesting/factory.ts:494
Create a ConfidentialVestingFactoryClient. Mirrors viem's create* convention.
Parameters
| Parameter | Type |
|---|---|
config | ConfidentialVestingFactoryClientConfig |
Returns
ConfidentialVestingFactoryClient
Example
const factory = createConfidentialVestingFactoryClient({ publicClient, walletClient });
createConfidentialVestingManagerClient()
function createConfidentialVestingManagerClient(config): ConfidentialVestingManagerClient;
Defined in: fhe-vesting/manager.ts:2169
Create a ConfidentialVestingManagerClient. Mirrors viem's create* convention.
Parameters
| Parameter | Type |
|---|---|
config | ConfidentialVestingManagerClientConfig |
Returns
ConfidentialVestingManagerClient
Example
const manager = createConfidentialVestingManagerClient({
publicClient, walletClient,
address: "0xYourManagerClone",
encryptor,
});
feeTypeName()
function feeTypeName(feeType): ... | ...;
Defined in: fhe-vesting/types.ts:57
Stringify a FeeType for human-readable / JSON-output contexts.
FeeType is a numeric enum so it serialises to 0 / 1 in JSON payloads,
which is ergonomic on the wire but confusing in SIEM/Slack/Datadog scrapes
of a CI script's summary.json. This helper returns "Gas" /
"DistributionToken" for inclusion in human-readable envelopes without
forcing the consumer to write FeeType[value] reverse-lookup boilerplate
(which is also less type-safe — the reverse lookup returns
string | undefined).
Parameters
| Parameter | Type |
|---|---|
feeType | FeeType |
Returns
... | ...
Example
const { feeType, fee } = await manager.getFeeInfo();
const summary = { fee: fee.toString(), feeType, feeTypeName: feeTypeName(feeType) };
// summary.feeType === 0, summary.feeTypeName === "Gas"