pub trait Nontransferable {
    type Balance: Balance;

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

A trait for Non-transferable asset

Required Associated Types§

type Balance: Balance

Scalar type for representing balance of an account.

Required Methods§

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

The available Capacity for an MSA.

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

Reduce Capacity of an MSA by amount.

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

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Config> Nontransferable for Pallet<T>

Nontransferable functions are intended for capacity spend and recharge. Implementations of Nontransferable MUST NOT be concerned with StakingType.

§

type Balance = <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance