useAirdropRoleConstants
Read an airdrop instance's role identifiers in one fan-out.
@tokenops/sdk/fhe-airdrop/react{ data, isLoading, error, refetch }Description
Read an airdrop instance's role identifiers in one fan-out.
Every value is a bytecode constant, so this is cacheable indefinitely
(staleTime: Infinity by default, overridable through query). Feed the
results into useAirdropHasRole, useAirdropRoleMembers,
useAirdropRoleAdmin and the role mutations - hand-hashing
keccak256("PAUSER_ROLE") client-side would turn a constant renamed in a
future contract version into a grantRole that silently grants a role
nothing checks.
One bundled hook rather than ten one-liners nobody would call separately: a UI needs the whole palette to render a role panel at all.
Signature
function useAirdropRoleConstants(args: UseAirdropRoleConstantsArgs): UseQueryResult<AirdropRoleConstants, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| variant | "ecdsa" | "merkle" | Also read the variant-only role: MERKLE_ADMIN_ROLE or SIGNER_ROLE. Omit it for the eight shared constants and neither extra read fires. |
Example
const { data: roles } = useAirdropRoleConstants({ address, variant: "merkle" });
const { data: isPauser } = useAirdropHasRole({ address, role: roles?.PAUSER_ROLE, holder });Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.
See also
Other Introspection hooks in airdrop v2: