Architecture
Build
Resources
- Contracts
- Admin
- Analytics
- Channel
- Post
- Reward
- Shared
- Trust
- User
- Utils
User
Fees
Validates and manages fees related to user actions.
Copy
use std::string;
use std::type_name;
use sui::coin;
use sui::event;
use sui::sui;
use sage_admin::admin;
use sage_admin::apps;
Explore this module further in the Mover Registry: @sage/user
Structs
UserFees
Holds the fee amounts for User
actions.
Copy
public struct UserFees has key
Copy
id: sui::object::UID,
app: address,
custom_coin_type: std::type_name::TypeName,
create_invite_fee_custom: u64,
create_invite_fee_sui: u64,
create_user_fee_custom: u64,
create_user_fee_sui: u64,
follow_user_fee_custom: u64,
follow_user_fee_sui: u64,
friend_user_fee_custom: u64,
friend_user_fee_sui: u64,
post_to_user_fee_custom: u64,
post_to_user_fee_sui: u64,
unfollow_user_fee_custom: u64,
unfollow_user_fee_sui: u64,
unfriend_user_fee_custom: u64,
unfriend_user_fee_sui: u64,
update_user_fee_custom: u64,
update_user_fee_sui: u64
Events
UserFeesCreated
Emitted when a new UserFees
is created.
Copy
public struct UserFeesCreated has copy, drop
Copy
app_id: address,
user_fees_id: address,
custom_coin_type: std::type_name::TypeName,
create_invite_fee_custom: u64,
create_invite_fee_sui: u64,
create_user_fee_custom: u64,
create_user_fee_sui: u64,
follow_user_fee_custom: u64,
follow_user_fee_sui: u64,
friend_user_fee_custom: u64,
friend_user_fee_sui: u64,
post_to_user_fee_custom: u64,
post_to_user_fee_sui: u64,
unfollow_user_fee_custom: u64,
unfollow_user_fee_sui: u64,
unfriend_user_fee_custom: u64,
unfriend_user_fee_sui: u64,
update_user_fee_custom: u64,
update_user_fee_sui: u64
UserFeesUpdated
Emitted when a UserFees
is updated.
Copy
public struct UserFeesUpdated has copy, drop
Copy
user_fees_id: address,
custom_coin_type: std::type_name::TypeName,
create_invite_fee_custom: u64,
create_invite_fee_sui: u64,
create_user_fee_custom: u64,
create_user_fee_sui: u64,
follow_user_fee_custom: u64,
follow_user_fee_sui: u64,
friend_user_fee_custom: u64,
friend_user_fee_sui: u64,
post_to_user_fee_custom: u64,
post_to_user_fee_sui: u64,
unfollow_user_fee_custom: u64,
unfollow_user_fee_sui: u64,
unfriend_user_fee_custom: u64,
unfriend_user_fee_sui: u64,
update_user_fee_custom: u64,
update_user_fee_sui: u64
Constants
Incorrect coin type passed in for the custom_coin
.
Copy
const EIncorrectCoinType: u64 = 370;
Incorrect amount of custom_coin
.
Copy
const EIncorrectCustomPayment: u64 = 371;
Incorrect amount of sui_coin
.
Copy
const EIncorrectSuiPayment: u64 = 372;
Assistant
Responses are generated using AI and may contain mistakes.