useIsAddressRole() function
This feature is currently in beta and may change based on feedback that we receive.
Use this to check if a WalletAddress is a member of a role on a
Example
const {
data: isMember,
isLoading,
error,
} = useIsAddressRole(SmartContract, "admin", "0x123");
Signature:
export declare function useIsAddressRole<TContract extends ContractWithRoles>(
contract: RequiredParam<TContract>,
role: RolesForContract<TContract>,
walletAddress: RequiredParam<WalletAddress>,
): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
contract | RequiredParam<TContract> | an instance of a |
role | RolesForContract<TContract> | the role to check the member against, see |
walletAddress | RequiredParam<WalletAddress> | the address to check |
Returns:
boolean
true if the address is a member of the role, or false if not