typescript-sdk

Home > @3rdweb/sdk > ModuleWithRoles > grantRole

ModuleWithRoles.grantRole() method

Call this to grant a role to a specific address.

Signature:

grantRole(role: Role, address: string): Promise<TransactionReceipt>;

Parameters

Parameter Type Description
role Role The role to grant to the address
address string The address to grant the role to

Returns:

Promise<TransactionReceipt>

The transaction receipt

Exceptions

If you are trying to grant does not exist on the module this will throw an InvariantError.

Remarks

Make sure you are sure you want to grant the role to the address.