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/reactReturn
{ data, isLoading, error, refetch }Lifecycle
ReadDescription
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.
| Property | Type | Description |
|---|---|---|
| user | Address | Address whose registered subwallets to check. Hook disabled until set. |
| token | Address | ERC-7984 token address to check the operator approval against. Hook disabled until set. |
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:
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.