ReaduseQuery

useHasApprovedSubwallets

Check whether a user's registered subwallets have approved the singleton as an ERC-7984 operator for token.

Import
@tokenops/sdk/fhe-disperse/react
Return
{ data, isLoading, error, refetch }
Lifecycle
Read

Description

Check whether a user's registered subwallets have approved the singleton as an ERC-7984 operator for token. Both must return true before a wallet-mode disperse will succeed.

Returns { wallet0: false, wallet1: false, both: false } if the user is not yet registered — for pre-registration approvals, use usePredictWallets and call isOperator(predicted, singleton) on the token directly.

Signature

@tokenops/sdk/fhe-disperse/react
ts
function useHasApprovedSubwallets(args?: UseHasApprovedSubwalletsArgs): UseQueryResult<SubwalletApprovalState, Error>;

Parameters

Shape of the options object passed to the hook itself.

PropertyTypeDescription
userAddressAddress whose registered subwallets to check. Hook disabled until set.
tokenAddressERC-7984 token address to check the operator approval against. Hook disabled until set.
Want to run a similar shape interactively? The Playground ships 8 ready presets across vesting / airdrop / disperse — deploy a manager, create a vesting, claim, and the airdrop / disperse equivalents. The deep-link above auto-selects the closest preset to useHasApprovedSubwallets; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-disperse/react · @example
tsx
const { data: approvals } = useHasApprovedSubwallets({ user, token });
if (!approvals?.both) { /* prompt user to approve *\/ }

Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.

See also

Other Read hooks in disperse: