hasRole

Checks if the target account has the role.

Example

import { hasRole } from "thirdweb/extensions/permissions";
const result = await hasRole({
contract,
role: "admin",
targetAccountAddress: "0x1234567890123456789012345678901234567890",
});

Parameters

Returns

A boolean that is true if the target account has the role.