Expand description

The traits for dealing with a single fungible token class and any associated types.

User-implememted traits

  • Inspect: Regular balance inspector functions.
  • Unbalanced: Low-level balance mutating functions. Does not guarantee proper book-keeping and so should not be called into directly from application code. Other traits depend on this and provide default implementations based on it.
  • UnbalancedHold: Low-level balance mutating functions for balances placed on hold. Does not guarantee proper book-keeping and so should not be called into directly from application code. Other traits depend on this and provide default implementations based on it.
  • Mutate: Regular balance mutator functions. Pre-implemented using Unbalanced, though the done_* functions should likely be reimplemented in case you want to do something following the operation such as emit events.
  • InspectHold: Inspector functions for balances on hold.
  • MutateHold: Mutator functions for balances on hold. Mostly pre-implemented using UnbalancedHold.
  • InspectFreeze: Inspector functions for frozen balance.
  • MutateFreeze: Mutator functions for frozen balance.
  • Balanced: One-sided mutator functions for regular balances, which return imbalance objects which guarantee eventual book-keeping. May be useful for some sophisticated operations where funds must be removed from an account before it is known precisely what should be done with them.

Re-exports

  • pub use freeze::Inspect as InspectFreeze;
  • pub use freeze::Mutate as MutateFreeze;
  • pub use hold::Balanced as BalancedHold;
  • pub use hold::Inspect as InspectHold;
  • pub use hold::Mutate as MutateHold;
  • pub use hold::Unbalanced as UnbalancedHold;

Modules

  • The traits for putting freezes within a single fungible token class.
  • The traits for putting holds within a single fungible token class.

Structs

  • Simple handler for an imbalance drop which decreases the total issuance of the system by the imbalance amount. Used for leftover credit.
  • Special dust type which can be type-safely converted into a Credit.
  • An imbalance in the system, representing a divergence of recorded token supply from the sum of the balances of all accounts. This is must_use in order to ensure it gets handled (placing into an account, settling from an account or altering the supply).
  • Simple handler for an imbalance drop which increases the total issuance of the system by the imbalance amount. Used for leftover debt.
  • Convert a fungibles trait implementation into a fungible trait implementation by identifying a single item.

Traits

  • A fungible token class where any creation and deletion of tokens is semi-explicit and where the total supply is maintained automatically.
  • Handler for when an imbalance gets dropped. This could handle either a credit (negative) or debt (positive) imbalance.
  • Trait for providing balance-inspection access to a fungible asset.
  • Trait for providing a basic fungible asset.
  • A fungible token class where the balance can be set arbitrarily.

Type Definitions

  • Imbalance implying that the total_issuance value is greater than the sum of all account balances.
  • Imbalance implying that the total_issuance value is less than the sum of all account balances.