ConfidentialVestingFactoryClient
Resolves the Sepolia factory from DEPLOYED_ADDRESSES by chain id; on mainnet the registry entry is null, so construction reports DeploymentAddressUnavailableError with reason registry-not-deployed. Both create methods are overloaded on waitForReceipt: omitted or true returns the mined CreateManagerResult, false returns PendingCreateManagerResult with manager: undefined. Fee setters are positional and need FEE_MANAGER_ROLE; they use the client's gasHeadroomPercent. Address prediction lives on ConfidentialVestingFactoryAdvancedClient from @tokenops/sdk/fhe-vesting/advanced, whose predictManagerAddress takes PredictManagerArgs.
Construct
Headless TS — non-React consumers (Node, Vite, server workers). React hosts use the per-hook surface; same method names, lazy encryptor.
import { createConfidentialVestingFactoryClient } from "@tokenops/sdk/fhe-vesting";
const client = createConfidentialVestingFactoryClient({
publicClient,
walletClient,
// address optional: resolved from publicClient.chain.id
});Methods
Setup · 2
- Deploy a clone; createManagerWithOptions when splitEnabled or pausableEnabled is set. Takes gas and waitForReceipt. Throws ReceiptEventNotFoundError / ReceiptEventAmbiguousError on a missing or repeated ManagerCreated event.
client.createManager()React:useCreateManager - Same deploy and result; the recommended entry point for deploy-and-use. With waitForReceipt: false, read the address from the executed transaction's ManagerCreated log.
client.createManagerAndGetAddress()React:useCreateManagerAndGetAddress
Introspection · 1
client.predictManagerAddress()Advanced client only. Block-dependent: the factory packs the deployment block into the clone args, so it is for historical lookups at a known blockNumber, not pre-deploy prediction.
Configure · 8
- Admin: set the factory-wide default gas fee (in wei).
client.setDefaultGasFee()React:useSetDefaultGasFee - Admin: set the factory-wide default token fee (basis points).
client.setDefaultTokenFee()React:useSetDefaultTokenFee - Admin: set the factory's default fee model (FeeType.Gas or FeeType.DistributionToken) for new manager clones.
client.setDefaultFeeType()React:useSetDefaultFeeType - Admin: install a per-creator fee override on the factory.
client.setCustomFee()React:useSetCustomFee - Admin: set the factory's fee collector address.
client.setFeeCollector()React:useSetFeeCollector - Admin: reset the factory's default gas fee to zero.
client.resetGasFee()React:useResetGasFee - Admin: reset the factory's default token fee to zero.
client.resetTokenFee()React:useResetTokenFee - Admin: disable the per-creator fee override for creator.
client.disableCustomFee()React:useDisableCustomFee
Read · 8
- Read the factory-wide default gas fee (in wei) — applied to new FeeType.Gas manager clones at deployment.
client.defaultGasFee()React:useFactoryDefaultGasFee - Read the factory-wide default token fee in basis points — applied to new FeeType.DistributionToken manager clones at deployment.
client.defaultTokenFee()React:useFactoryDefaultTokenFee - Read the factory-wide default fee model (FeeType.Gas or FeeType.DistributionToken) applied to newly-created manager clones.
client.defaultFeeType()React:useFactoryDefaultFeeType - Read the per-creator fee override set on the factory for creator.
client.getCustomFee()React:useFactoryCustomFee - Read the factory's current fee collector address.
client.feeCollector()React:useFactoryFeeCollector - Read the init-code hash the factory would use to CREATE2 a manager clone with the given token + deployer (+ optional immutable flags).
client.getInitCodeHash()React:useFactoryInitCodeHash - Read the FHE-vesting factory's current implementation() address — the LibClone target every new manager clone delegates to.
client.implementation()React:useConfidentialVestingFactoryImplementation client.managerImplementation()Alias for implementation(). Client method only; the hook covers the canonical read.