Actions
Add Moderator
The add_moderator_as_owner
function has these effects:
Borrows the Moderators table stored on the Channel
Asserts the sender is the owner of the Moderation table
Asserts the payment matches the configuration
Adds the provided address as a new moderator
Emits the "ChannelModerationUpdate" event:
public struct ChannelModerationUpdate has copy, drop { channel_key: String, message: u8, moderator_type: u8, updated_at: u64, user: address }
Collects any payment
Add Moderator (Admin)
The add_moderator_as_admin
function has these effects:
Borrows the Moderators table stored on the Channel
Adds the provided address as a new moderator
Emits the "ChannelModerationUpdate" event:
public struct ChannelModerationUpdate has copy, drop { channel_key: String, message: u8, moderator_type: u8, updated_at: u64, user: address }
Create
The create
function has these effects:
Asserts authentication
Asserts the payment matches the configuration
Creates Membership, Moderation, and Post tables for the Channel
Creates the Channel
Adds the lowercase channel key into the Channel Registry
Collects any payment
Emits the "ChannelCreated", "ChannelMembershipUpdate", and "ChannelModerationUpdate" events:
public struct ChannelCreated has copy, drop { id: address, avatar_hash: String, banner_hash: String, channel_key: String, channel_name: String, created_at: u64, created_by: address, description: String }
public struct ChannelMembershipUpdate has copy, drop { account_type: u8, channel_key: String, message: u8, updated_at: u64, user: address }
public struct ChannelModerationUpdate has copy, drop { channel_key: String, message: u8, moderator_type: u8, updated_at: u64, user: address }
Returns the Channel address
Join
The join
function has these effects:
Asserts authentication
Asserts the payment matches the configuration
Borrows the Membership table stored on the Channel
Adds address as wallet member
Emits the "ChannelMembershipUpdate" event:
public struct ChannelMembershipUpdate has copy, drop { account_type: u8, channel_key: String, message: u8, updated_at: u64, user: address }
Collects any payment
Leave
The leave
function has these effects:
Asserts the payment matches the configuration
Borrows the Membership table stored on the Channel
Removes address as a member
Emits the "ChannelMembershipUpdate" event:
public struct ChannelMembershipUpdate has copy, drop { account_type: u8, channel_key: String, message: u8, updated_at: u64, user: address }
Collects any payment
Post
The post
function has these effects:
Borrows the Membership table stored on the Channel
Asserts address is member of the Channel
Asserts the payment matches the configuration
Borrows the Posts table stored on the Channel
Creates Post and stores it in the Posts table
Collects any payment
Emits the "ChannelPostCreated" event:
public struct ChannelPostCreated has copy, drop { id: address, app: String, channel_key: String, created_at: u64, created_by: address, data: String, description: String, title: String }
Returns the (post_address, post_timestamp)
Remove Moderator
The remove_moderator_as_owner
function has these effects:
Borrows the Moderators table stored on the Channel
Asserts the sender is the owner of the Moderation table
Asserts the payment matches the configuration
Removes the provided address as a moderator
Emits the "ChannelModerationUpdate" event:
public struct ChannelModerationUpdate has copy, drop { channel_key: String, message: u8, moderator_type: u8, updated_at: u64, user: address }
Collects any payment
Remove Moderator (Admin)
Theremove_moderator_as_admin
function has these effects:
Borrows the Moderators table stored on the Channel
Removes the provided address as a moderator
Emits the "ChannelModerationUpdate" event:
public struct ChannelModerationUpdate has copy, drop { channel_key: String, message: u8, moderator_type: u8, updated_at: u64, user: address }
Update
The update_as_owner
function has these effects:
Borrows the Moderators table stored on the Channel
Asserts the sender is a moderator of the Moderation table
Asserts the payment matches the configuration
Updates the Channel data
Emits the "ChannelUpdated" event:
public struct ChannelUpdated has copy, drop { avatar_hash: String, banner_hash: String, channel_key: String, channel_name: String, description: String, updated_at: u64 }
Collects any payment
Update (Admin)
The update_as_owner
function has these effects:
Borrows the Moderators table stored on the Channel
Asserts the sender is a moderator of the Moderation table
Asserts the payment matches the configuration
Updates the Channel data
Emits the "ChannelUpdated" event:
public struct ChannelUpdated has copy, drop { avatar_hash: String, banner_hash: String, channel_key: String, channel_name: String, description: String, updated_at: u64 }
Collects any payment
Last updated