#multi-currency #currencies #module #pallet-balances #native #substrate #orml-tokens

no-std orml-currencies

Provide MultiCurrency implementation using pallet-balances and orml-tokens module

24 releases (6 stable)

1.5.0 Sep 17, 2025
1.4.0 Apr 28, 2025
1.3.0 Feb 9, 2025
1.1.0 Dec 10, 2024
0.1.1 Jun 5, 2020

#4 in #multi-currency

Download history 25/week @ 2026-02-15 115/week @ 2026-02-22 28/week @ 2026-03-01 44/week @ 2026-03-08 37/week @ 2026-03-15 52/week @ 2026-03-22 55/week @ 2026-03-29 74/week @ 2026-04-05 47/week @ 2026-04-12 38/week @ 2026-04-19 21/week @ 2026-04-26 32/week @ 2026-05-03 49/week @ 2026-05-10 86/week @ 2026-05-17 66/week @ 2026-05-24 17/week @ 2026-05-31

237 downloads per month

Apache-2.0 and GPL-3.0-only

155KB
3K SLoC

Currencies Module

Overview

The currencies module provides a mixed currencies system, by configuring a native currency which implements BasicCurrencyExtended, and a multi-currency which implements MultiCurrency.

It also provides an adapter, to adapt frame_support::traits::Currency implementations into BasicCurrencyExtended.

The currencies module provides functionality of both MultiCurrencyExtended and BasicCurrencyExtended, via unified interfaces, and all calls would be delegated to the underlying multi-currency and base currency system. A native currency ID could be set by Config::GetNativeCurrencyId, to identify the native currency.

Implementations

The currencies 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, in a given currency.
  • transfer_native_currency - Transfer some balance to another account, in native currency set in Config::NativeCurrency.
  • update_balance - Update balance by signed integer amount, in a given currency, root origin required.

Currencies Module

Overview

The currencies module provides a mixed currencies system, by configuring a native currency which implements BasicCurrencyExtended, and a multi-currency which implements MultiCurrency.

It also provides an adapter, to adapt frame_support::traits::Currency implementations into BasicCurrencyExtended.

The currencies module provides functionality of both MultiCurrencyExtended and BasicCurrencyExtended, via unified interfaces, and all calls would be delegated to the underlying multi-currency and base currency system. A native currency ID could be set by Config::GetNativeCurrencyId, to identify the native currency.

Dependencies

~32–45MB
~764K SLoC