difftreelog
feat add rmrk proxt extrinsics comments
in: master
2 files changed
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth176176177 #[pallet::call]177 #[pallet::call]178 impl<T: Config> Pallet<T> {178 impl<T: Config> Pallet<T> {179 /// Create a collection180 #[transactional]179 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]181 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]180 #[transactional]181 pub fn create_collection(182 pub fn create_collection(182 origin: OriginFor<T>,183 origin: OriginFor<T>,183 metadata: RmrkString,184 metadata: RmrkString,229 Ok(())230 Ok(())230 }231 }231232233 /// destroy collection232 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]234 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]233 #[transactional]235 #[transactional]234 pub fn destroy_collection(236 pub fn destroy_collection(255 Ok(())257 Ok(())256 }258 }257259260 /// Change the issuer of a collection261 ///262 /// Parameters:263 /// - `origin`: sender of the transaction264 /// - `collection_id`: collection id of the nft to change issuer of265 /// - `new_issuer`: Collection's new issuer258 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]266 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]259 #[transactional]267 #[transactional]260 pub fn change_collection_issuer(268 pub fn change_collection_issuer(285 Ok(())293 Ok(())286 }294 }287295296 /// lock collection288 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]297 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]289 #[transactional]298 #[transactional]290 pub fn lock_collection(299 pub fn lock_collection(316 Ok(())325 Ok(())317 }326 }318327328 /// Mints an NFT in the specified collection329 /// Sets metadata and the royalty attribute330 ///331 /// Parameters:332 /// - `collection_id`: The class of the asset to be minted.333 /// - `nft_id`: The nft value of the asset to be minted.334 /// - `recipient`: Receiver of the royalty335 /// - `royalty`: Permillage reward from each trade for the Recipient336 /// - `metadata`: Arbitrary data about an nft, e.g. IPFS hash337 /// - `transferable`: Ability to transfer this NFT319 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]338 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]320 #[transactional]339 #[transactional]321 pub fn mint_nft(340 pub fn mint_nft(385 Ok(())404 Ok(())386 }405 }387406407 /// burn nft388 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]408 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]389 #[transactional]409 #[transactional]390 pub fn burn_nft(410 pub fn burn_nft(416 Ok(())436 Ok(())417 }437 }418438439 /// Transfers a NFT from an Account or NFT A to another Account or NFT B440 ///441 /// Parameters:442 /// - `origin`: sender of the transaction443 /// - `rmrk_collection_id`: collection id of the nft to be transferred444 /// - `rmrk_nft_id`: nft id of the nft to be transferred445 /// - `new_owner`: new owner of the nft which can be either an account or a NFT419 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]446 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]420 #[transactional]447 #[transactional]421 pub fn send(448 pub fn send(520 Ok(())547 Ok(())521 }548 }522549550 /// Accepts an NFT sent from another account to self or owned NFT551 ///552 /// Parameters:553 /// - `origin`: sender of the transaction554 /// - `rmrk_collection_id`: collection id of the nft to be accepted555 /// - `rmrk_nft_id`: nft id of the nft to be accepted556 /// - `new_owner`: either origin's account ID or origin-owned NFT, whichever the NFT was557 /// sent to523 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]558 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]524 #[transactional]559 #[transactional]525 pub fn accept_nft(560 pub fn accept_nft(589 Ok(())624 Ok(())590 }625 }591626627 /// Rejects an NFT sent from another account to self or owned NFT628 ///629 /// Parameters:630 /// - `origin`: sender of the transaction631 /// - `rmrk_collection_id`: collection id of the nft to be accepted632 /// - `rmrk_nft_id`: nft id of the nft to be accepted592 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]633 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]593 #[transactional]634 #[transactional]594 pub fn reject_nft(635 pub fn reject_nft(625 Ok(())666 Ok(())626 }667 }627668669 /// accept the addition of a new resource to an existing NFT628 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]670 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]629 #[transactional]671 #[transactional]630 pub fn accept_resource(672 pub fn accept_resource(681 Ok(())723 Ok(())682 }724 }683725726 /// accept the removal of a resource of an existing NFT684 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]727 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]685 #[transactional]728 #[transactional]686 pub fn accept_resource_removal(729 pub fn accept_resource_removal(738 Ok(())781 Ok(())739 }782 }740783784 /// set a custom value on an NFT741 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]785 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]742 #[transactional]786 #[transactional]743 pub fn set_property(787 pub fn set_property(797 Ok(())841 Ok(())798 }842 }799843844 /// set a different order of resource priority800 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]845 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]801 #[transactional]846 #[transactional]802 pub fn set_priority(847 pub fn set_priority(835 Ok(())880 Ok(())836 }881 }837882883 /// Create basic resource838 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]884 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]839 #[transactional]885 #[transactional]840 pub fn add_basic_resource(886 pub fn add_basic_resource(872 Ok(())918 Ok(())873 }919 }874920921 /// Create composable resource875 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]922 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]876 #[transactional]923 #[transactional]877 pub fn add_composable_resource(924 pub fn add_composable_resource(912 Ok(())959 Ok(())913 }960 }914961962 /// Create slot resource915 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]963 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]916 #[transactional]964 #[transactional]917 pub fn add_slot_resource(965 pub fn add_slot_resource(951 Ok(())999 Ok(())952 }1000 }95310011002 /// remove resource954 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]1003 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]955 #[transactional]1004 #[transactional]956 pub fn remove_resource(1005 pub fn remove_resource(pallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth--- a/pallets/proxy-rmrk-equip/src/lib.rs
+++ b/pallets/proxy-rmrk-equip/src/lib.rs
@@ -74,6 +74,16 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
+
+ /// 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(