Skip to main content
Explore this module further in the Mover Registry: @sage/user

Events

ChannelFavoritesUpdate

Emitted when a User favorites or unfavorites a Channel.

InviteCreated

Emitted when a new Invite is created.

PostFavoritesUpdate

Emitted when a User favorites or unfavorites a Post.

UserCreated

Emitted when a new User is created.

UserFavoritesUpdate

Emitted when a User favorites or unfavorites a User.

UserFollowsUpdate

Emitted when a User follows or unfollows another User.

UserFriendUpdate

Emitted when a User confirms friendship or unfriends another User.

UserFriendRequestUpdate

Emitted when a User requests friendship with another User.

UserPostCreated

Emitted when a new Post is created for a User.

UserUpdated

Emitted when a User is updated.

Constants

Maximum number of characters for User description.
Minimum number of characters for User name.
Maximum number of characters for User name.
User actions that are tracked by Analytics that result in $TRUST rewards.
Error code for invalid User description.
Error code for invalid User name.
Error code for attempt to create a User without a (required) Invite.
Error code for attempting to friend or follow the User’s own User.
Error code for attempting to update metadata for another’s User.
Error code for supplying a User who is not the author of a Post.
Error code for attempting to change the name for the User. Only the casing may be changed (e.g. “user” to “USER”)

Functions

add_favorite_channel

Allows a User to add a favorite Channel within an App. Aborts with ETypeMismatch if ChannelType is not a Channel.

add_favorite_post

Allows a User to add a favorite Post within an App. Aborts with ESuppliedAuthorMismatch if the supplied SharedUser is not the author of the Post.

add_favorite_user

Allows a User to add a favorite User within an App.

assert_user_description

Aborts with EInvalidUserDescription if the description is invalid.

assert_user_name

Aborts with EInvalidUsername if the name is invalid.

claim_reward

If User has an available claim on the App and for the specified epoch, then mints $TRUST and transfers it to the User’s wallet. Aborts with ENotSelf if the SharedUser does not belong to the wallet address.

comment

Create a comment on a Post. Aborts with ESuppliedAuthorMismatch if the supplied SharedUser is not the author of the parent Post.

create

Create a new User. Aborts with EInvalidUserDescription or EInvalidUsername if the description or name is invalid, EInviteRequired if an Invite is required and not supplied, EInviteDoesNotExist if invite info was supplied but does not exist in the registry, EInviteInvalid if invite info was supplied but is not valid, or EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

create_invite

Create an invite for another wallet address. Aborts with EInviteNotAllowed if invites are required, or EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

follow

User follows another User within an App. Aborts with ENoSelfJoin if attempting to follow one’s self, EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

friend_user

Creates a friend request between two Users if one does not exist, or creates a friendship if the other User had already requested to be friends. Aborts with ENotSelf if attempting to friend one’s self, or EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

like_post

User likes a Post. Aborts with ESuppliedAuthorMismatch if the SharedUser is not the author of the Post, or EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

post

Creates a Post on the User and returns the Post address and timestamp that it was made. Aborts with EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

remove_favorite_channel

Removes a Channel from being a favorite within an App.

remove_favorite_post

Removes a Post from being a favorite within an App.

remove_favorite_user

Removes a User from being a favorite within an App.

remove_friend_request

Removes a friend request to the User if they do not wish to connect to the requester. Aborts with ENotSelf if the SharedUser does not belong to the wallet address or if the request is not affiliated with the provided SharedUser.

unfollow

Unfollow a User. Aborts with EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

unfriend_user

Removes friendship between Users. Aborts with ENotSelf if the wallet does not own the OwnedUser or SharedUser, or EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.

update

Updates metadata on the OwnedUser. Aborts with EUserNameMismatch if attempting to change the name, or EIncorrectCoinType, EIncorrectCustomPayment, or EIncorrectSuiPayment if the payment was incorrect.