Fees
Defines:
public struct UserFees has key {
id: UID,
app: address,
custom_coin_type: TypeName,
create_invite_fee_custom: u64,
create_invite_fee_sui: u64,
create_user_fee_custom: u64,
create_user_fee_sui: u64,
join_user_fee_custom: u64,
join_user_fee_sui: u64,
leave_user_fee_custom: u64,
leave_user_fee_sui: u64,
post_to_user_fee_custom: u64,
post_to_user_fee_sui: u64,
update_user_fee_custom: u64,
update_user_fee_sui: u64
}
Assert Payment **
The assert_*_payment
functions have these effects:
Throws error (370 - EIncorrectCoinType) if provided CoinType does not match the configured CoinType
Throws error (371 - EIncorrectCustomPayment) if the custom payment does not match the configured amount
Throws error (372 - EIncorrectSuiPayment) if the sui payment does not match the configured amount
Create
The create
function has these effects:
Creates UserFees
Adds the UserFees address to the App dynamic field
Emits the "UserFeesCreated" event:
public struct UserFeesCreated has copy, drop { id: address, app: address, custom_coin_type: TypeName, create_invite_fee_custom: u64, create_invite_fee_sui: u64, create_user_fee_custom: u64, create_user_fee_sui: u64, join_user_fee_custom: u64, join_user_fee_sui: u64, leave_user_fee_custom: u64, leave_user_fee_sui: u64, post_to_user_fee_custom: u64, post_to_user_fee_sui: u64, update_user_fee_custom: u64, update_user_fee_sui: u64 }
Shares the UserFees
Update
The update
function has these effects:
Updates the UserFees data
Emits the "UserFeesUpdated" event:
public struct UserFeesUpdated has copy, drop { id: address, custom_coin_type: TypeName, create_invite_fee_custom: u64, create_invite_fee_sui: u64, create_user_fee_custom: u64, create_user_fee_sui: u64, join_user_fee_custom: u64, join_user_fee_sui: u64, leave_user_fee_custom: u64, leave_user_fee_sui: u64, post_to_user_fee_custom: u64, post_to_user_fee_sui: u64, update_user_fee_custom: u64, update_user_fee_sui: u64 }
Last updated