Fees

Defines:

public struct PostFees has key {
        id: UID,
        app: address,
        custom_coin_type: TypeName,
        like_post_fee_custom: u64,
        like_post_fee_sui: u64,
        post_from_post_fee_custom: u64,
        post_from_post_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 PostFees

  2. Adds the PostFees address to the App dynamic field

  3. Emits the "PostFeesCreated" event:

    1. public struct PostFeesCreated has copy, drop {
              id: address,
              app: address,
              custom_coin_type: TypeName,
              like_post_fee_custom: u64,
              like_post_fee_sui: u64,
              post_from_post_fee_custom: u64,
              post_from_post_fee_sui: u64
      }
  4. Shares the PostFees

Update

The update function has these effects:

  1. Updates the PostFees data

  2. Emits the "PostFeesUpdated" event:

    1. public struct PostFeesUpdated has copy, drop {
              id: address,
              custom_coin_type: TypeName,
              like_post_fee_custom: u64,
              like_post_fee_sui: u64,
              post_from_post_fee_custom: u64,
              post_from_post_fee_sui: u64
      }

Last updated