Use cases

Supported currencies

For now, we will support the following currencies but in the future all the currencies will be supported which are in the asset registry:

Specs

We already have the data storage model implemented by using a single currency (BSX). The goal would be to extend these data models in order to support multiple currencies for our marketplace.

Storages

In order to make the new changes backward compatible with the old state, we are planning to introduce two changes relating to storages

  1. Introducing a new StorageMap called PricesInCurrency. This storage would store all the prices listed in the supported non-native currencies,
  2. Introducing a new StorageMap called OffersInCurrency. This storage would store all the offers listed in the supported non-native currencies,

Extrinsic changes

The existing extrinsics will remain intact and they will use the default currency (KSM). Next to them, there will be two new externsics to support multiple currencies. The only difference between the signature of the new externsics and the corresponding existing externsics is that the new ones will have an additional asset_id as parameter.

pub fn set_price_in_currency(
			origin: OriginFor<T>,
			class_id: T::NftClassId,
			instance_id: T::NftInstanceId,
			new_price: Option<BalanceOf<T>>,
			**asset_id: AssetId**
		) -> DispatchResult {...}

pub fn make_offer_in_currency(
			origin: OriginFor<T>,
			class_id: T::NftClassId,
			instance_id: T::NftInstanceId,
			amount: BalanceOf<T>,
			**asset_id: AssetId**
			expires: T::BlockNumber,
		) -> DispatchResult {...}