common_primitives::capacity

Trait Nontransferable

Source
pub trait Nontransferable {
    type Balance: Balance;

    // Required methods
    fn balance(msa_id: MessageSourceId) -> Self::Balance;
    fn replenishable_balance(msa_id: MessageSourceId) -> Self::Balance;
    fn deduct(
        msa_id: MessageSourceId,
        capacity_amount: Self::Balance,
    ) -> Result<(), DispatchError>;
    fn deposit(
        msa_id: MessageSourceId,
        token_amount: Self::Balance,
        capacity_amount: Self::Balance,
    ) -> Result<(), DispatchError>;
}
Expand description

A trait for Non-transferable asset

Required Associated Types§

Source

type Balance: Balance

Scalar type for representing balance of an account.

Required Methods§

Source

fn balance(msa_id: MessageSourceId) -> Self::Balance

The available Capacity for an MSA.

Source

fn replenishable_balance(msa_id: MessageSourceId) -> Self::Balance

The replenishable Capacity for an MSA (the total capacity currently issued)

Source

fn deduct( msa_id: MessageSourceId, capacity_amount: Self::Balance, ) -> Result<(), DispatchError>

Reduce Capacity of an MSA by amount.

Source

fn deposit( msa_id: MessageSourceId, token_amount: Self::Balance, capacity_amount: Self::Balance, ) -> Result<(), DispatchError>

Increase Staked Token + Capacity amounts of an MSA. (unused)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§