Trading trait and deal with metadata in Mutate trait for nonfungibles_v2 (#1561)

I have added some Traits that are missing and are useful for dealing
with non-fungible tokens on other pallets and their implementations for
NFTs pallet.

- In the Mutate trait, added methods for dealing with the metadata:
`set_metadata`, `set_collection_metadata`, `clear_metadata` and
`clear_collection_metadata`.
The motivation of adding this methods coming from a StackExchange
question asking for it: [Setting metadata of an item of the Nfts pallet
in a custom
pallet](https://substrate.stackexchange.com/questions/9974/setting-metadata-of-an-item-of-the-nfts-pallet-in-a-custom-pallet)

- A Trait for trading non-fungible items. The methods in that Trait are
`buy_item`, `set_price` and `item_price`
An example of where this Trait can be useful is a pallet that deals with
[NFT
Royalties](https://forum.polkadot.network/t/nfts-royalty-pallet/3766)
and needs to perform this actions.

---------

Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>
This commit is contained in:
Alex Bean
2023-10-18 12:33:29 +02:00
committed by GitHub
parent d3ea69b7ac
commit 3aaf62add4
4 changed files with 153 additions and 3 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ pub use tokens::{
},
fungible, fungibles,
imbalance::{Imbalance, OnUnbalanced, SignedImbalance},
nonfungible, nonfungibles, BalanceStatus, ExistenceRequirement, Locker, WithdrawReasons,
nonfungible, nonfungible_v2, nonfungibles, nonfungibles_v2, BalanceStatus,
ExistenceRequirement, Locker, WithdrawReasons,
};
mod members;