difftreelog
doc(rmrk): style + minor revisions
in: master
3 files changed
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth49//! - FAQ: <https://coda.io/@rmrk/faq>49//! - FAQ: <https://coda.io/@rmrk/faq>50//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>50//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>51//! - RMRK specification repository: <https://github.com/rmrk-team/rmrk-spec>51//! - RMRK specification repository: <https://github.com/rmrk-team/rmrk-spec>52//! 52//!53//! ## Terminology53//! ## Terminology54//! 54//!55//! For more information on RMRK, see RMRK's own documentation.55//! For more information on RMRK, see RMRK's own documentation.56//! 56//!57//! ### Intro to RMRK57//! ### Intro to RMRK58//! 58//!59//! - **Resource:** Additional piece of metadata of an NFT usually serving to add 59//! - **Resource:** Additional piece of metadata of an NFT usually serving to add60//! a piece of media on top of the root metadata (NFT's own), be it a different wing 60//! a piece of media on top of the root metadata (NFT's own), be it a different wing61//! on the root template bird or something entirely unrelated.61//! on the root template bird or something entirely unrelated.62//! 62//!63//! - **Base:** A list of possible "components" - Parts, a combination of which can 63//! - **Base:** A list of possible "components" - Parts, a combination of which can64//! be appended/equipped to/on an NFT.64//! be appended/equipped to/on an NFT.65//! 65//!66//! - **Part:** Something that, together with other Parts, can constitute an NFT. 66//! - **Part:** Something that, together with other Parts, can constitute an NFT.67//! Parts are defined in the Base to which they belong. Parts can be either 67//! Parts are defined in the Base to which they belong. Parts can be either68//! of the `slot` type or `fixed` type. Slots are intended for equippables.68//! of the `slot` type or `fixed` type. Slots are intended for equippables.69//! Note that "part of something" and "Part of a Base" can be easily confused, 69//! Note that "part of something" and "Part of a Base" can be easily confused,70//! and in this documentation these words are distinguished by the capital letter.70//! and in this documentation these words are distinguished by the capital letter.71//! 71//!72//! - **Theme:** Named objects of variable => value pairs which get interpolated into 72//! - **Theme:** Named objects of variable => value pairs which get interpolated into73//! the Base's `themable` Parts. Themes can hold any value, but are often represented 73//! the Base's `themable` Parts. Themes can hold any value, but are often represented74//! in RMRK's examples as colors applied to visible Parts.74//! in RMRK's examples as colors applied to visible Parts.75//! 75//!76//! ### Peculiarities in Unique76//! ### Peculiarities in Unique77//! 77//!78//! - **Scoped properties:** Properties that are normally obscured from users. 78//! - **Scoped properties:** Properties that are normally obscured from users.79//! Their purpose is to contain structured metadata that was not included in the Unique standard 79//! Their purpose is to contain structured metadata that was not included in the Unique standard80//! for collections and tokens, meant to be operated on by proxies and other outliers. 80//! for collections and tokens, meant to be operated on by proxies and other outliers.81//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is 81//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is82//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined 82//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined83//! properties, which, along with other safeguards, makes them impossible to tamper with.83//! properties, which, along with other safeguards, makes them impossible to tamper with.84//! 84//!85//! - **Auxiliary properties:** A slightly different structure of properties, 85//! - **Auxiliary properties:** A slightly different structure of properties,86//! trading universality of use for more convenient storage, writes and access. 86//! trading universality of use for more convenient storage, writes and access.87//! Meant to be inaccessible to end users.87//! Meant to be inaccessible to end users.88//!88//!89//! ## Proxy Implementation89//! ## Proxy Implementation118//! RMRK introduces the concept of a Base, which is a catalgoue of Parts,118//! RMRK introduces the concept of a Base, which is a catalgoue of Parts,119//! possible components of an NFT. Due to its similarity with the functionality119//! possible components of an NFT. Due to its similarity with the functionality120//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes120//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes121//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and121//! are the collection's NFTs. See [`CollectionType`] and [`NftType`].122//! [`NftType`](pallet_rmrk_core::misc::NftType).123//! 122//!124//! ## Interface123//! ## Interface125//!124//!126//! ### Dispatchables125//! ### Dispatchables788787789 /// Accept an NFT sent from another account to self or an owned NFT.788 /// Accept an NFT sent from another account to self or an owned NFT.790 ///789 ///791 /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first.790 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.792 ///791 ///793 /// # Permissions:792 /// # Permissions:794 /// - Token-owner-to-be793 /// - Token-owner-to-be880 /// Reject an NFT sent from another account to self or owned NFT.879 /// Reject an NFT sent from another account to self or owned NFT.881 /// The NFT in question will not be sent back and burnt instead.880 /// The NFT in question will not be sent back and burnt instead.882 ///881 ///883 /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first.882 /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first.884 ///883 ///885 /// # Permissions:884 /// # Permissions:886 /// - Token-owner-to-be-not885 /// - Token-owner-to-be-not945 ///944 ///946 /// This transaction is needed when a resource is created and assigned to an NFT945 /// This transaction is needed when a resource is created and assigned to an NFT947 /// by a non-owner, i.e. the collection issuer, with one of the946 /// by a non-owner, i.e. the collection issuer, with one of the948 /// [`add_...` transactions](crate::pallet::Call::add_basic_resource).947 /// [`add_...` transactions](Pallet::add_basic_resource).949 ///948 ///950 /// # Permissions:949 /// # Permissions:951 /// - Token owner950 /// - Token owner999 /// Accept the removal of a removal-pending resource from an NFT.998 /// Accept the removal of a removal-pending resource from an NFT.1000 ///999 ///1001 /// This transaction is needed when a non-owner, i.e. the collection issuer,1000 /// This transaction is needed when a non-owner, i.e. the collection issuer,1002 /// requests a [removal](`crate::pallet::Call::remove_resource`) of a resource from an NFT.1001 /// requests a [removal](`Pallet::remove_resource`) of a resource from an NFT.1003 ///1002 ///1004 /// # Permissions:1003 /// # Permissions:1005 /// - Token owner1004 /// - Token owner1207 ///1206 ///1208 /// # Permissions:1207 /// # Permissions:1209 /// - Collection issuer - if not the token owner, adding the resource will warrant1208 /// - Collection issuer - if not the token owner, adding the resource will warrant1210 /// the owner's [acceptance](crate::pallet::Call::accept_resource).1209 /// the owner's [acceptance](Pallet::accept_resource).1211 ///1210 ///1212 /// # Arguments:1211 /// # Arguments:1213 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1212 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1249 ///1248 ///1250 /// # Permissions:1249 /// # Permissions:1251 /// - Collection issuer - if not the token owner, adding the resource will warrant1250 /// - Collection issuer - if not the token owner, adding the resource will warrant1252 /// the owner's [acceptance](crate::pallet::Call::accept_resource).1251 /// the owner's [acceptance](Pallet::accept_resource).1253 ///1252 ///1254 /// # Arguments:1253 /// # Arguments:1255 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1254 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1311 ///1310 ///1312 /// # Permissions:1311 /// # Permissions:1313 /// - Collection issuer - if not the token owner, adding the resource will warrant1312 /// - Collection issuer - if not the token owner, adding the resource will warrant1314 /// the owner's [acceptance](crate::pallet::Call::accept_resource).1313 /// the owner's [acceptance](Pallet::accept_resource).1315 ///1314 ///1316 /// # Arguments:1315 /// # Arguments:1317 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1316 /// - `rmrk_collection_id`: RMRK collection ID of the NFT.1349 /// Remove and erase a resource from an NFT.1348 /// Remove and erase a resource from an NFT.1350 ///1349 ///1351 /// If the sender does not own the NFT, then it will be pending confirmation,1350 /// If the sender does not own the NFT, then it will be pending confirmation,1352 /// and will have to be [accepted](crate::pallet::Call::accept_resource_removal) by the token owner.1351 /// and will have to be [accepted](Pallet::accept_resource_removal) by the token owner.1353 ///1352 ///1354 /// # Permissions1353 /// # Permissions1355 /// - Collection issuer1354 /// - Collection issuer160015991601 /// Get incremented resource ID from within an NFT's properties and store the new latest ID.1600 /// Get incremented resource ID from within an NFT's properties and store the new latest ID.1602 /// Thus, the returned resource ID should be used.1601 /// Thus, the returned resource ID should be used.1603 /// 1602 ///1604 /// Resource IDs are unique only across an NFT.1603 /// Resource IDs are unique only across an NFT.1605 fn acquire_next_resource_id(1604 fn acquire_next_resource_id(1606 collection_id: CollectionId,1605 collection_id: CollectionId,1720 Ok(())1719 Ok(())1721 }1720 }172217211723 /// Remove a Base ID from an NFT if they are associated. 1722 /// Remove a Base ID from an NFT if they are associated.1724 /// The Base itself is deleted if the number of associated NFTs reaches 0.1723 /// The Base itself is deleted if the number of associated NFTs reaches 0.1725 fn remove_associated_base_id(1724 fn remove_associated_base_id(1726 collection_id: CollectionId,1725 collection_id: CollectionId,pallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth52//! - FAQ: <https://coda.io/@rmrk/faq>52//! - FAQ: <https://coda.io/@rmrk/faq>53//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>53//! - Substrate code repository: <https://github.com/rmrk-team/rmrk-substrate>54//! - RMRK spec repository: <https://github.com/rmrk-team/rmrk-spec>54//! - RMRK spec repository: <https://github.com/rmrk-team/rmrk-spec>55//! 55//!56//! ## Terminology56//! ## Terminology57//! 57//!58//! For more information on RMRK, see RMRK's own documentation.58//! For more information on RMRK, see RMRK's own documentation.59//! 59//!60//! ### Intro to RMRK60//! ### Intro to RMRK61//! 61//!62//! - **Resource:** Additional piece of metadata of an NFT usually serving to add 62//! - **Resource:** Additional piece of metadata of an NFT usually serving to add63//! a piece of media on top of the root metadata (NFT's own), be it a different wing 63//! a piece of media on top of the root metadata (NFT's own), be it a different wing64//! on the root template bird or something entirely unrelated.64//! on the root template bird or something entirely unrelated.65//! 65//!66//! - **Base:** A list of possible "components" - Parts, a combination of which can 66//! - **Base:** A list of possible "components" - Parts, a combination of which can67//! be appended/equipped to/on an NFT.67//! be appended/equipped to/on an NFT.68//! 68//!69//! - **Part:** Something that, together with other Parts, can constitute an NFT. 69//! - **Part:** Something that, together with other Parts, can constitute an NFT.70//! Parts are defined in the Base to which they belong. Parts can be either 70//! Parts are defined in the Base to which they belong. Parts can be either71//! of the `slot` type or `fixed` type. Slots are intended for equippables.71//! of the `slot` type or `fixed` type. Slots are intended for equippables.72//! Note that "part of something" and "Part of a Base" can be easily confused, 72//! Note that "part of something" and "Part of a Base" can be easily confused,73//! and in this documentation these words are distinguished by the capital letter.73//! and in this documentation these words are distinguished by the capital letter.74//! 74//!75//! - **Theme:** Named objects of variable => value pairs which get interpolated into 75//! - **Theme:** Named objects of variable => value pairs which get interpolated into76//! the Base's `themable` Parts. Themes can hold any value, but are often represented 76//! the Base's `themable` Parts. Themes can hold any value, but are often represented77//! in RMRK's examples as colors applied to visible Parts.77//! in RMRK's examples as colors applied to visible Parts.78//! 78//!79//! ### Peculiarities in Unique79//! ### Peculiarities in Unique80//! 80//!81//! - **Scoped properties:** Properties that are normally obscured from users. 81//! - **Scoped properties:** Properties that are normally obscured from users.82//! Their purpose is to contain structured metadata that was not included in the Unique standard 82//! Their purpose is to contain structured metadata that was not included in the Unique standard83//! for collections and tokens, meant to be operated on by proxies and other outliers. 83//! for collections and tokens, meant to be operated on by proxies and other outliers.84//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is 84//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is85//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined 85//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined86//! properties, which, along with other safeguards, makes them impossible to tamper with.86//! properties, which, along with other safeguards, makes them impossible to tamper with.87//! 87//!88//! - **Auxiliary properties:** A slightly different structure of properties, 88//! - **Auxiliary properties:** A slightly different structure of properties,89//! trading universality of use for more convenient storage, writes and access. 89//! trading universality of use for more convenient storage, writes and access.90//! Meant to be inaccessible to end users.90//! Meant to be inaccessible to end users.91//!91//!92//! ## Proxy Implementation92//! ## Proxy Implementation121//! RMRK introduces the concept of a Base, which is a catalgoue of Parts,121//! RMRK introduces the concept of a Base, which is a catalgoue of Parts,122//! possible components of an NFT. Due to its similarity with the functionality122//! possible components of an NFT. Due to its similarity with the functionality123//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes123//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes124//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and124//! are the collection's NFTs. See [`CollectionType`] and [`NftType`].125//! [`NftType`](pallet_rmrk_core::misc::NftType).126//!125//!127//! ## Interface126//! ## Interface128//!127//!415}414}416415417impl<T: Config> Pallet<T> {416impl<T: Config> Pallet<T> {418 /// Create or renew an NFT serving as a Part.417 /// Create or renew an NFT serving as a Part inside a collection serving as a Base.419 fn create_part(418 fn create_part(420 sender: &T::CrossAccountId,419 sender: &T::CrossAccountId,421 collection: &NonfungibleHandle<T>,420 collection: &NonfungibleHandle<T>,primitives/rmrk-traits/src/resource.rsdiffbeforeafterboth151 "#)151 "#)152)]152)]153pub struct ResourceInfo<BoundedString, BoundedParts> {153pub struct ResourceInfo<BoundedString, BoundedParts> {154 /// ID a unique identifier for a resource across all those of a single NFT.154 /// ID is a unique identifier for a resource across all those of a single NFT.155 /// The combination of a collection ID, an NFT ID, and the resource ID must be 155 /// The combination of a collection ID, an NFT ID, and the resource ID must be156 /// unique across the entire RMRK ecosystem.156 /// unique across the entire RMRK ecosystem.157 //#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]157 //#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]158 pub id: ResourceId,158 pub id: ResourceId,