UNPKG

@wasserstoff/tribes-sdk

Version:

SDK for integrating with Tribes by Astrix platform on any EVM compatible chain

62 lines (61 loc) 1.75 kB
import { BaseModule } from '../core/BaseModule'; /** * Module for managing roles */ export declare class RolesModule extends BaseModule { /** * Get the RoleManager contract * @param useSigner Whether to use the signer */ private getRoleManagerContract; /** * Get the DEFAULT_ADMIN_ROLE bytes */ getDefaultAdminRole(): Promise<string>; /** * Get the ORGANIZER_ROLE bytes */ getOrganizerRole(): Promise<string>; /** * Check if an account has a specific role * @param role Role bytes string * @param account Account address */ hasRole(role: string, account: string): Promise<boolean>; /** * Check if an account is an admin * @param account Account address */ isAdmin(account: string): Promise<boolean>; /** * Check if an account is an organizer * @param account Account address */ isOrganizer(account: string): Promise<boolean>; /** * Assign a role to an account * @param account Account address * @param role Role bytes string * @returns Transaction hash */ assignRole(account: string, role: string): Promise<string>; /** * Remove a role from an account * @param account Account address * @param role Role bytes string * @returns Transaction hash */ removeRole(account: string, role: string): Promise<string>; /** * Make an account an admin * @param account Account address * @returns Transaction hash */ makeAdmin(account: string): Promise<string>; /** * Make an account an organizer * @param account Account address * @returns Transaction hash */ makeOrganizer(account: string): Promise<string>; }