--- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -176,8 +176,9 @@ #[pallet::call] impl Pallet { + /// Create a collection + #[transactional] #[pallet::weight(>::create_collection())] - #[transactional] pub fn create_collection( origin: OriginFor, metadata: RmrkString, @@ -229,6 +230,7 @@ Ok(()) } + /// destroy collection #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn destroy_collection( @@ -255,6 +257,12 @@ Ok(()) } + /// Change the issuer of a collection + /// + /// Parameters: + /// - `origin`: sender of the transaction + /// - `collection_id`: collection id of the nft to change issuer of + /// - `new_issuer`: Collection's new issuer #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn change_collection_issuer( @@ -285,6 +293,7 @@ Ok(()) } + /// lock collection #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn lock_collection( @@ -316,6 +325,16 @@ Ok(()) } + /// Mints an NFT in the specified collection + /// Sets metadata and the royalty attribute + /// + /// Parameters: + /// - `collection_id`: The class of the asset to be minted. + /// - `nft_id`: The nft value of the asset to be minted. + /// - `recipient`: Receiver of the royalty + /// - `royalty`: Permillage reward from each trade for the Recipient + /// - `metadata`: Arbitrary data about an nft, e.g. IPFS hash + /// - `transferable`: Ability to transfer this NFT #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn mint_nft( @@ -385,6 +404,7 @@ Ok(()) } + /// burn nft #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn burn_nft( @@ -416,6 +436,13 @@ Ok(()) } + /// Transfers a NFT from an Account or NFT A to another Account or NFT B + /// + /// Parameters: + /// - `origin`: sender of the transaction + /// - `rmrk_collection_id`: collection id of the nft to be transferred + /// - `rmrk_nft_id`: nft id of the nft to be transferred + /// - `new_owner`: new owner of the nft which can be either an account or a NFT #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn send( @@ -520,6 +547,14 @@ Ok(()) } + /// Accepts an NFT sent from another account to self or owned NFT + /// + /// Parameters: + /// - `origin`: sender of the transaction + /// - `rmrk_collection_id`: collection id of the nft to be accepted + /// - `rmrk_nft_id`: nft id of the nft to be accepted + /// - `new_owner`: either origin's account ID or origin-owned NFT, whichever the NFT was + /// sent to #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn accept_nft( @@ -589,6 +624,12 @@ Ok(()) } + /// Rejects an NFT sent from another account to self or owned NFT + /// + /// Parameters: + /// - `origin`: sender of the transaction + /// - `rmrk_collection_id`: collection id of the nft to be accepted + /// - `rmrk_nft_id`: nft id of the nft to be accepted #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn reject_nft( @@ -625,6 +666,7 @@ Ok(()) } + /// accept the addition of a new resource to an existing NFT #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn accept_resource( @@ -681,6 +723,7 @@ Ok(()) } + /// accept the removal of a resource of an existing NFT #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn accept_resource_removal( @@ -738,6 +781,7 @@ Ok(()) } + /// set a custom value on an NFT #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn set_property( @@ -797,6 +841,7 @@ Ok(()) } + /// set a different order of resource priority #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn set_priority( @@ -835,6 +880,7 @@ Ok(()) } + /// Create basic resource #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn add_basic_resource( @@ -872,6 +918,7 @@ Ok(()) } + /// Create composable resource #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn add_composable_resource( @@ -912,6 +959,7 @@ Ok(()) } + /// Create slot resource #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn add_slot_resource( @@ -951,6 +999,7 @@ Ok(()) } + /// remove resource #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn remove_resource( --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -74,6 +74,16 @@ #[pallet::call] impl Pallet { + + /// Creates a new Base. + /// Modeled after [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + /// + /// Parameters: + /// - origin: Caller, will be assigned as the issuer of the Base + /// - base_type: media type, e.g. "svg" + /// - symbol: arbitrary client-chosen symbol + /// - parts: array of Fixed and Slot parts composing the base, confined in length by + /// RmrkPartsLimit #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn create_base( @@ -137,6 +147,19 @@ Ok(()) } + /// Adds a Theme to a Base. + /// Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md) + /// Themes are stored in the Themes storage + /// A Theme named "default" is required prior to adding other Themes. + /// + /// Parameters: + /// - origin: The caller of the function, must be issuer of the base + /// - base_id: The Base containing the Theme to be updated + /// - theme: The Theme to add to the Base. A Theme has a name and properties, which are an + /// array of [key, value, inherit]. + /// - key: arbitrary BoundedString, defined by client + /// - value: arbitrary BoundedString, defined by client + /// - inherit: optional bool #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))] #[transactional] pub fn theme_add(