grantRoles

Prepares a transaction to call the "grantRoles" function on the contract.

Example

import { sendTransaction } from "thirdweb";
import { grantRoles } from "thirdweb/extensions/modules";
const transaction = grantRoles({
contract,
user: ...,
roles: ...,
overrides: {
...
}
});
// Send the transaction
await sendTransaction({ transaction, account });
function grantRoles(
| { asyncParams: () => Promise<GrantRolesParams> }
>,

Parameters

The options for the "grantRoles" function.

Type

GrantRolesParams | { asyncParams: () => Promise<GrantRolesParams> }
>;

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.