> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sageprotocol.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Fees

> Maintains registries mapping app addresses to channel addresses and ensures consistency.

```rust theme={null}
use std::string;
use std::type_name;
use sui::coin;
use sui::event;
use sui::sui;
use sage_admin::admin;
use sage_admin::apps;
```

<Tip>
  Explore this module further in the Mover Registry: @sage/channel
</Tip>

## Structs

### `ChannelFees`

Holds the fee amounts for `Channel` actions.

```rust theme={null}
public struct ChannelFees has key
```

<Expandable title="Fields">
  ```rust theme={null}
    id: sui::object::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: std::type_name::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
  ```
</Expandable>

## Events

### `ChannelFeesCreated`

Emitted when a new `ChannelFees` is created.

```rust theme={null}
public struct ChannelFeesCreated has copy, drop
```

<Expandable title="Fields">
  ```rust theme={null}
    app_id: address,
    channel_fees_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: std::type_name::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
  ```
</Expandable>

### `ChannelFeesUpdated`

Emitted when a `ChannelFees` is updated.

```rust theme={null}
public struct ChannelFeesUpdated has copy, drop
```

<Expandable title="Fields">
  ```rust theme={null}
    channel_fees_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: std::type_name::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
  ```
</Expandable>

## Constants

Incorrect coin type passed in for the `custom_coin`.

```rust theme={null}
const EIncorrectCoinType: u64 = 370;
```

Incorrect amount of `custom_coin`.

```rust theme={null}
const EIncorrectCustomPayment: u64 = 371;
```

Incorrect amount of `sui_coin`.

```rust theme={null}
const EIncorrectSuiPayment: u64 = 372;
```
