usePreflightCreateVesting
Read-only preflight for useCreateVesting / useBatchCreateVesting — wraps ConfidentialVestingManagerClient.preflightCreateVesting as a TanStack query.
@tokenops/sdk/fhe-vesting/react{ data, isLoading, error, refetch }Description
Read-only preflight for useCreateVesting / useBatchCreateVesting —
wraps ConfidentialVestingManagerClient.preflightCreateVesting as a
TanStack query.
The report carries token, hasCreatorRole, isOperatorSet, ready and
blockerErrors (typed TokenOpsSdkErrors; branch on error.code).
Checks: structural params validation, VESTING_CREATOR_ROLE membership,
and ERC-7984 operator approval of the manager on the distribution token.
The creator's confidential token balance is NOT checked (encrypted; an
underfunded create silently zeroes amounts instead of reverting) — see the
headless method's TSDoc.
Hook is disabled until params and creator are both set. Refetch after
the user grants the role or calls setOperator (e.g. via
queryClient.invalidateQueries or query: { refetchInterval: 5_000 }).
Signature
function usePreflightCreateVesting(args: UsePreflightCreateVestingArgs): UseQueryResult<CreateVestingPreflightReport, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| params | VestingParams | The vesting schedule parameters to validate. |
| creator | Address | The address that will send the create transaction. |
Example
const { data: report } = usePreflightCreateVesting({
address: managerAddress, params, creator,
});
if (report?.ready) { /* enable submit *\/ }Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.
See also
Other Read hooks in vesting 2.0:
useFactoryDefaultGasFeeRead the factory-wide default gas fee (in wei) — applied to new FeeType.Gas manager clones at deployment.useFactoryDefaultTokenFeeRead the factory-wide default token fee in basis points — applied to new FeeType.DistributionToken manager clones at deployment.useFactoryDefaultFeeTypeRead the factory-wide default fee model (FeeType.Gas or FeeType.DistributionToken) applied to newly-created manager clones.useFactoryFeeCollectorRead the factory's current fee collector address.