Skip to main content

useRoleMembers() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to get the members of a role on a

Example

const {
data: members,
isLoading,
error,
} = useRoleMembers(SmartContract, "admin");

Signature:

export declare function useRoleMembers<TContract extends ContractWithRoles>(
contract: RequiredParam<TContract>,
role: RolesForContract<TContract>,
): import("@tanstack/react-query").UseQueryResult<string[], unknown>;

Parameters

ParameterTypeDescription
contractRequiredParam<TContract>an instance of a
roleRolesForContract<TContract>the role to get the members of, see

Returns:

import("@tanstack/react-query").UseQueryResult<string[], unknown>

a list of addresses that are members of the role