ReaduseQuery Curated
usePreflightDisperse
Dry-run validator — checks operator + balance + paused state before broadcasting.
Import
@tokenops/sdk/fhe-disperse/reactReturn
{ data, isLoading, error, refetch }Lifecycle
ReadDescription
Comprehensive pre-flight report — one call gives a UI everything it needs
to render a "ready to disperse" checklist: registration state, wallet
approvals, fee preview, batch-limit check, per-recipient validation,
pre-computed wallet-mode subtotals, and a ready flag plus structured
blockers list.
Hook is disabled until user, token, recipients, amounts, and mode
are all set.
For live dashboards, set refetchInterval so the report stays current as
the user toggles approvals in a wallet UI:
const preflight = usePreflightDisperse({ user, token, recipients, amounts, mode });
// pass through TanStack Query options via queryClient.setQueryDefaults or a
// wrapping useQuery, e.g. refetchInterval: 5_000.Signature
@tokenops/sdk/fhe-disperse/react
ts
function usePreflightDisperse(args?: UsePreflightDisperseArgs): UseQueryResult<PreflightReport, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| user | Address | |
| token | Address | |
| recipients | Address[] | |
| amounts | bigint[] | |
| mode | DisperseMode |
Example
@tokenops/sdk/fhe-disperse/react · @example
tsx
const { data: report } = usePreflightDisperse({
user, token, recipients, amounts, mode: "direct",
});
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 disperse:
useIsRegisteredHas this deployer already called register?useGetWalletsRead the deployer's two registered subwallet addresses.useGetFeesRead consolidated fee information for user — combines per-user resolved fees (getFeeAmounts) with the global feeConfig toggles in one read.useGetFeeConfigRead the singleton's { gasFeeEnabled, tokenFeeEnabled, defaultGasFee, defaultTokenFee } fee config.