/auth
Search
K
Comment on page

hasRoleWallet( )

Function to check whether the user has the specific role by a wallet address. If the wallet does not have that role associated with it, the function returns an error.

Usage

const { data } = await client.user.hasRoleWallet({
address: '0x123....efg',
role: 'Member',
});
console.log('HasRole: ', data?.hasRole);

Return Value

{
data?: {
hasRole: boolean;
};
error: ErrorMessage | null;
headers: Object;
statusCode: number;
}

Configuration

address

String that represents an address.
const { data } = await client.user.hasRoleWallet({
address: '0x123....efg',
role: 'Member',
});
console.log('HasRole: ', data?.hasRole);

role

String that represents a role.
const { data } = await client.user.hasRoleWallet({
address: '0x123....efg',
role: 'Member',
});
console.log('HasRole: ', data?.hasRole);

organizationID (optional)

String that represents an organization's ID.
const { data } = await client.user.hasRoleWallet({
address: '0x123....efg',
role: 'Member',
organizationID: 'org.abc',
});
console.log('HasRole: ', data?.hasRole);