useAllRoleMembers
Hook for getting all wallet addresses that have a role in a smart contract.
Available to use on contracts that implement Permission Controls.
import { useAllRoleMembers } from "@thirdweb-dev/react";
const { data, isLoading, error } = useAllRoleMembers(contract);
Usage
Provide your contract instance as the argument.
import { useAllRoleMembers, useContract } from "@thirdweb-dev/react";
// Your smart contract address (must implement permission controls)
const contractAddress = "{{contract_address}}";
function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useAllRoleMembers(contract);
}