Fees

Defines:

public struct ChannelFees has key {
        id: UID,
        add_channel_moderator_fee_custom: u64,
        add_channel_moderator_fee_sui: u64,
        app: address,
        create_channel_fee_custom: u64,
        create_channel_fee_sui: u64,
        custom_coin_type: TypeName,
        join_channel_fee_custom: u64,
        join_channel_fee_sui: u64,
        leave_channel_fee_custom: u64,
        leave_channel_fee_sui: u64,
        post_to_channel_fee_custom: u64,
        post_to_channel_fee_sui: u64,
        remove_channel_moderator_fee_custom: u64,
        remove_channel_moderator_fee_sui: u64,
        update_channel_fee_custom: u64,
        update_channel_fee_sui: u64
}

Assert Payment **

The assert_*_payment functions have these effects:

  1. Throws error (370 - EIncorrectCoinType) if provided CoinType does not match the configured CoinType

  2. Throws error (371 - EIncorrectCustomPayment) if the custom payment does not match the configured amount

  3. Throws error (372 - EIncorrectSuiPayment) if the sui payment does not match the configured amount

Create

The create function has these effects:

  1. Creates ChannelFees

  2. Adds the ChannelFees address to the App dynamic field

  3. Emits the "ChannelFeesCreated" event:

    1. public struct ChannelFeesCreated has copy, drop {
              id: address,
              add_channel_moderator_fee_custom: u64,
              add_channel_moderator_fee_sui: u64,
              app: address,
              create_channel_fee_custom: u64,
              create_channel_fee_sui: u64,
              custom_coin_type: TypeName,
              join_channel_fee_custom: u64,
              join_channel_fee_sui: u64,
              leave_channel_fee_custom: u64,
              leave_channel_fee_sui: u64,
              post_to_channel_fee_custom: u64,
              post_to_channel_fee_sui: u64,
              remove_channel_moderator_fee_custom: u64,
              remove_channel_moderator_fee_sui: u64,
              update_channel_fee_custom: u64,
              update_channel_fee_sui: u64
      }
  4. Shares the ChannelFees

Update

The update function has these effects:

  1. Updates the ChannelFees data

  2. Emits the "ChannelFeesUpdated" event:

    1. public struct ChannelFeesUpdated has copy, drop {
              id: address,
              add_channel_moderator_fee_custom: u64,
              add_channel_moderator_fee_sui: u64,
              create_channel_fee_custom: u64,
              create_channel_fee_sui: u64,
              custom_coin_type: TypeName,
              join_channel_fee_custom: u64,
              join_channel_fee_sui: u64,
              leave_channel_fee_custom: u64,
              leave_channel_fee_sui: u64,
              post_to_channel_fee_custom: u64,
              post_to_channel_fee_sui: u64,
              remove_channel_moderator_fee_custom: u64,
              remove_channel_moderator_fee_sui: u64,
              update_channel_fee_custom: u64,
              update_channel_fee_sui: u64
      }

Last updated