Roles · RBACuseQuery
useAirdropHasRole
Read AccessControl: is account a member of role on this airdrop clone? The role hashes are stable across deployments (DEFAULT_ADMIN_ROLE, FEE_COLLECTOR_ROLE, etc.).
Import
@tokenops/sdk/fhe-airdrop/reactReturn
{ data, isLoading, error, refetch }Lifecycle
Roles · RBACDescription
Read AccessControl: is account a member of role on this airdrop clone?
The role hashes are stable across deployments (DEFAULT_ADMIN_ROLE, FEE_COLLECTOR_ROLE, etc.).
Signature
@tokenops/sdk/fhe-airdrop/react
ts
function useAirdropHasRole(args: UseAirdropHasRoleArgs): UseQueryResult<boolean, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| role | Hex | |
| account | Address |
Example
components/useAirdropHasRoleExample.tsx
tsx
"use client";
import { useAirdropHasRole } from "@tokenops/sdk/fhe-airdrop/react";
export function Example() {
const { data, isLoading } = useAirdropHasRole(/* args */);
if (isLoading) return "loading…";
return <pre>{JSON.stringify(data, null, 2)}</pre>;
}Auto-generated from the hook's shape (the SDK doesn't carry a TSDoc @example here yet).
See also
Other Roles · RBAC hooks in airdrop: