useSetDefaultFeeType
Admin: set the factory's default fee model (FeeType.Gas or FeeType.DistributionToken) for new manager clones.
@tokenops/sdk/fhe-vesting/react{ mutate, mutateAsync, isPending, error, data }Description
Admin: set the factory's default fee model (FeeType.Gas or
FeeType.DistributionToken) for new manager clones. After success, invalidate
["tokenops-sdk", "fhe-vesting", "factory:defaultFeeType"].
Signature
function useSetDefaultFeeType(options?: BaseHookOptions): UseMutationResult<Hex, Error, UseSetDefaultFeeTypeArgs>;Parameters
Shape of the object you pass to .mutate(args).
| Property | Type | Description |
|---|---|---|
| feeTyperequired | FeeType | |
| account | Account | Address |
Example
"use client";
import { useSetDefaultFeeType } from "@tokenops/sdk/fhe-vesting/react";
export function Example() {
const { mutate, isPending } = useSetDefaultFeeType();
return (
<button disabled={isPending} onClick={() => mutate(/* args */)}>
{isPending ? "Sending…" : "SetDefaultFeeType"}
</button>
);
}Auto-generated from the hook's shape (the SDK doesn't carry a TSDoc @example here yet).
Errors
This mutation can reject with SDK-level, product-level, or viem-passthrough errors. Product classes carry the offending value as fields — render them inline instead of a generic "transaction failed." See Vesting › Errors for the per-class recovery table.
Invalidation recipe
After this mutation succeeds, invalidate the queries it affects so consumer UI re-fetches fresh state. The SDK never auto-invalidates — that's a consumer decision (different apps cache different shapes).
import { useQueryClient } from "@tanstack/react-query";
const queryClient = useQueryClient();
const setDefaultFeeType = useSetDefaultFeeType(/* options */);
setDefaultFeeType.mutate(args, {
onSuccess() {
// Coarse invalidation: refresh every cached read on this product surface.
queryClient.invalidateQueries({
queryKey: ["tokenops-sdk", "fhe-vesting"],
});
},
});See also
Other Configure hooks in vesting:
useSetDefaultGasFeeAdmin: set the factory-wide default gas fee (in wei).useSetDefaultTokenFeeAdmin: set the factory-wide default token fee (basis points).useResetGasFeeAdmin: reset the factory's default gas fee to its bytecode-encoded baseline.useResetTokenFeeAdmin: reset the factory's default token fee to its bytecode-encoded baseline.