typescript-sdk

Home > @3rdweb/sdk > ModuleWithRoles > getRoleMembers

ModuleWithRoles.getRoleMembers() method

Call this to get a list of addresses that are members of a specific role.

Signature:

getRoleMembers(role: Role): Promise<string[]>;

Parameters

Parameter Type Description
role Role The role to to get a memberlist for.

Returns:

Promise<string[]>

The list of addresses that are members of the specific role.

Exceptions

If you are requestiong a role that does not exist on the module this will throw an InvariantError.

Example

Say you want to get the list of addresses that are members of the minter role.

const minterAddresses: string[] = await module.getRoleMemberList("minter");