👥Groups

Groups (or Spaces) are subsets of posts by members and non-members of the group. Groups are NFT's that are owned by users.

Table of Contents


Events

logLeaveGroup

This event is emitted when a member leaves a group.

logJoinGroup

This event is emitted when a new member joins a group.

logUpdateGroupNameFormat

This event is emitted when the group name's format is updated.


Public Functions

getOwnerOfGroupByID

Retrieves the owner address of the specified group.

Inputs

Name
Type
Description

groupID

uint256

Unique ID of the group

Returns

Name
Type
Description

address

Address of the owner of group

// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const owner = await contract.getOwnerOfGroupByID(groupID);

getMembersOfGroupByID

Retrieves the member addresses of the specified group.

Inputs

Name
Type
Description

groupID

uint256

Unique ID of the group

Returns

Name
Type
Description

address[]

Addresses of the members of the group

// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const members = await contract.getMembersOfGroupByID(groupID);

isMemberOfGroupByID

Checks if a user or group is a member of the specified group.

Inputs

Name
Type
Description

groupID

uint256

Unique ID of the group

member

address

Address of the member

Returns

Name
Type
Description

bool

True if they are a member, false otherwise

// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const memberAddress = '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520'; // Replace with your member address
const isMember = await contract.isMemberOfGroupByID(groupID, memberAddress);

getGroupID

Gets the Group ID of a group from the group name.

Inputs

Name
Type
Description

groupName

string

Name of the group

Returns

Name
Type
Description

uint256

Unique ID of the group

// Example usage with ethers.js
const groupName = 'GroupName'; // Replace with your group name
const groupID = await contract.getGroupID(groupName);

getGroupAddressFromID

Gets the Group address of a group from the group ID.

Inputs

Name
Type
Description

groupID

uint256

Unique ID of the group

Returns

Name
Type
Description

address

Address of the group

// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const groupAddress = await contract.getGroupAddressFromID(groupID);

getGroupIDFromAddress

Gets the Group ID of a group from the group address.

Inputs

Name
Type
Description

groupAddress

address

Address of the group

Returns

Name
Type
Description

uint256

Unique ID of the group

// Example usage with ethers.js
const groupAddress = '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520'; // Replace with your group address
const groupID = await contract.getGroupIDFromAddress(groupAddress);

getOwnerOfGroupByAddress

Gets the owner address of a group from the group address.

Inputs

Name
Type
Description

groupAddress

address

Address of the group

Returns

Name
Type
Description

address

Address of the group owner

// Example usage with ethers.js
const groupAddress = '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520'; // Replace with your group address
const ownerAddress = await contract

Last updated