use std::string;
use std::type_name;
use sui::coin;
use sui::sui;
use sage_admin::admin;
use sage_admin::apps;

Explore this module further in the Mover Registry: @sage/admin

Structs

Royalties

Holds the configuration for how royalties may be paid out when fees are collected within the protocol.

public struct Royalties has key

Constants

Upper limit of what percentage can be collected by partner and protocol treasuries from a royalty payment, equivalent to 98%.

const FEE_LIMIT: u64 = 9800;

Scale used to determine the percentage for the FEE_LIMIT.

const SCALE: u64 = 10000;

Error encountered when attempting to set fee ranges within royalty payments that are out of bounds.

const EInvalidFeeValue: u64 = 370;

Functions

collect_payment

Transfers collected payments to the protocol treasury.

public fun collect_payment<CoinType>(custom_coin: Coin<CoinType>, sui_coin: Coin<SUI>)

distribute_payment

Transfers collected payments to the protocol treasury.

public fun distribute_payment<CoinType>(royalties: &Royalties, custom_payment: Coin<CoinType>, sui_payment: Coin<SUI>, recipient: address, ctx: &mut TxContext)