18 releases (9 breaking)

0.10.0 Apr 17, 2024
0.8.1 Apr 7, 2024
0.8.0 Mar 18, 2024
0.6.7 Nov 21, 2023
0.1.1 Jun 5, 2020

#2169 in Magic Beans

Download history 7/week @ 2024-01-29 13/week @ 2024-02-05 11/week @ 2024-02-12 36/week @ 2024-02-19 75/week @ 2024-02-26 44/week @ 2024-03-04 56/week @ 2024-03-11 169/week @ 2024-03-18 180/week @ 2024-04-01 204/week @ 2024-04-08 159/week @ 2024-04-15 33/week @ 2024-04-22 25/week @ 2024-04-29 13/week @ 2024-05-06

241 downloads per month
Used in pallet-mixer

Apache-2.0 and GPL-3.0-only

315KB
8K SLoC

Tokens Module

Overview

The tokens module provides fungible multi-currencies functionality that implements MultiCurrency trait.

The tokens module provides functions for:

  • Querying and setting the balance of a given account.
  • Getting and managing total issuance.
  • Balance transfer between accounts.
  • Depositing and withdrawing balance.
  • Slashing an account balance.

lib.rs:

Tokens Module

Overview

The tokens module provides fungible multi-currency functionality that implements MultiCurrency trait.

The tokens module provides functions for:

  • Querying and setting the balance of a given account.
  • Getting and managing total issuance.
  • Balance transfer between accounts.
  • Depositing and withdrawing balance.
  • Slashing an account balance.

Implementations

The tokens module provides implementations for following traits.

  • MultiCurrency - Abstraction over a fungible multi-currency system.
  • MultiCurrencyExtended - Extended MultiCurrency with additional helper types and methods, like updating balance by a given signed integer amount.

Interface

Dispatchable Functions

  • transfer - Transfer some balance to another account.
  • transfer_all - Transfer all balance to another account.

Genesis Config

The tokens module depends on the GenesisConfig. Endowed accounts could be configured in genesis configs.

Dependencies

~19–34MB
~582K SLoC