use std::string;
use sui::dynamic_field;
use sui::dynamic_object_field;
use sage_admin::admin_access;
use sage_admin::apps;
use sage_analytics::analytics;
use sage_analytics::analytics_actions;
use sage_post::post;
use sage_user::user_shared;
use sage_user::user_witness;
use sage_shared::favorites;

Explore this module further in the Mover Registry: @sage/user

Structs

UserOwned

Represents the User data specific to identity and reputation.

public struct UserOwned has key

Constants

Represents that content was favorited.

const FAVORITE_ADD: u8 = 10;

Represents that content was unfavorited.

const FAVORITE_REMOVE: u8 = 11;

Error code for when there is no favorited content for the selected App.

const ENoAppFavorites: u64 = 370;

Functions

get_avatar

Returns the avatar for the OwnedUser.

public fun get_avatar(owned_user: &UserOwned): String

get_banner

Returns the banner for the OwnedUser.

public fun get_banner(owned_user: &UserOwned): String

get_description

Returns the description for the OwnedUser.

public fun get_description(owned_user: &UserOwned): String

get_key

Returns the lowercase name for the OwnedUser.

public fun get_key(owned_user: &UserOwned): String

get_name

Returns the name for the OwnedUser.

public fun get_name(owned_user: &UserOwned): String

get_owner

Returns the wallet address associated with the OwnedUser.

public fun get_owner(owned_user: &UserOwned): address

get_shared_user

Returns the address for the SharedUser associated with the OwnedUser.

public fun get_shared_user(owned_user: &UserOwned): address

get_channel_favorites_length

Get the number of Channels the User has favorited in the App.

public fun get_channel_favorites_length(app: &App, user: &UserOwned): u64

get_post_favorites_length

Get the number of Posts the User has favorited in the App.

public fun get_post_favorites_length(app: &App, user: &UserOwned): u64

get_user_favorites_length

Get the number of Users the User has favorited in the App.

public fun get_user_favorites_length(app: &App, user: &UserOwned): u64

get_total_rewards

Get the total amount of $TRUST rewards the User has been awarded through social actions.

public fun get_total_rewards(user: &UserOwned): u64

has_analytics

Returns true or false based on whether the OwnedUser has analytics for the specified App and reward epoch.

public fun has_analytics(owned_user: &mut UserOwned, app_address: address, epoch: u64,): bool