Actions
Create User
The create
function has these effects:
Asserts the payment matches the configuration
Asserts invite is not required or is included
If required, verifies invite exists and is valid
If included:
Asserts invite exists
Asserts invite is valid
Determine referer's wallet address
Deletes invite reference
Creates Membership and Posts tables
Creates a Soul
Creates a User
Adds the User name to the User Registry
Collects any payment
Emits the "UserCreated" event:
public struct UserCreated has copy, drop { id: address, avatar_hash: String, banner_hash: String, created_at: u64, description: String, invited_by: Option<address>, owner: address, soul: address, user_key: String, user_name: String }
Create Invite
Asserts authentication
Asserts invites are not required
Asserts the payment matches the configuration
Creates an Invite
Collects any payment
Emits the "InviteCreated" event:
public struct InviteCreated has copy, drop { invite_code: String, invite_key: String, user: address }
Create Invite (Admin)
Creates an Invite
Emits the "InviteCreated" event:
public struct InviteCreated has copy, drop { invite_code: String, invite_key: String, user: address }
Join
The join
function has these effects:
Asserts authentication
Asserts the payment matches the configuration
Asserts User is not following themself
Borrow Membership table from User
Add User to the Membership table
Emits the "UserMembershipUpdate" event:
public struct UserMembershipUpdate has copy, drop { account_type: u8, followed_user: address, message: u8, updated_at: u64, user: address }
Collect any payment
Leave
The leave
function has these effects:
Asserts the payment matches the configuration
Borrow Membership table from User
Remove User from the Membership table
Emits the "UserMembershipUpdate" event:
public struct UserMembershipUpdate has copy, drop { account_type: u8, followed_user: address, message: u8, updated_at: u64, user: address }
Collect any payment
Post
The post
function has these effects:
Asserts the payment matches the configuration
Borrow Posts table from User
Create Post
Add Post to Posts table
Collect any payment
Emits the "UserPostCreated" event:
public struct UserPostCreated has copy, drop { id: address, app: String, created_at: u64, created_by: address, data: String, description: String, title: String, user_key: String }
Return (post address, timestamp)
Update
The update
function has these effects:
Asserts the payment matches the configuration
Asserts new name matches old name, and that the User belongs to the wallet address
Update User data
Collect any payment
Emits the "UserUpdated" event:
public struct UserUpdated has copy, drop { avatar_hash: String, banner_hash: String, description: String, updated_at: u64, user_key: String, user_name: String }
Last updated