difftreelog
doc: adjust documentation style
in: master
2 files changed
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -288,59 +288,47 @@
///
/// # Arguments
///
- /// * collection_id: Globally unique identifier of newly created collection.
- ///
- /// * mode: [CollectionMode] converted into u8.
- ///
- /// * account_id: Collection owner.
+ /// * collection_id - Globally unique identifier of newly created collection.
+ /// * mode - [CollectionMode] converted into u8.
+ /// * account_id - Collection owner.
CollectionCreated(CollectionId, u8, T::AccountId),
/// New collection was destroyed
///
/// # Arguments
///
- /// * collection_id: Globally unique identifier of collection that has been destroyed.
+ /// * collection_id - Globally unique identifier of collection that has been destroyed.
CollectionDestroyed(CollectionId),
/// New item was created.
///
/// # Arguments
///
- /// * collection_id: ID of the collection where the item was created.
- ///
- /// * item_id: ID of the item. Unique within the collection.
- ///
- /// * recipient: Owner of the newly created item.
- ///
- /// * amount: The amount of tokens that were created (always 1 for NFT).
+ /// * collection_id - ID of the collection where the item was created.
+ /// * item_id - ID of the item. Unique within the collection.
+ /// * recipient - Owner of the newly created item.
+ /// * amount - The amount of tokens that were created (always 1 for NFT).
ItemCreated(CollectionId, TokenId, T::CrossAccountId, u128),
/// Collection item was burned.
///
/// # Arguments
///
- /// * collection_id: Identifier of the collection to which the burned NFT belonged.
- ///
- /// * item_id: Identifier of burned NFT.
- ///
- /// * owner: Which user has destroyed their tokens.
- ///
- /// * amount: The amount of tokens that were destroyed (always 1 for NFT).
+ /// * collection_id - Identifier of the collection to which the burned NFT belonged.
+ /// * item_id - Identifier of burned NFT.
+ /// * owner - Which user has destroyed their tokens.
+ /// * amount - Amount of tokens that were destroyed (always 1 for NFT).
ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128),
/// Item was transferred.
///
/// # Arguments
///
- /// * collection_id: ID of the collection to which the item belongs.
- ///
- /// * item_id: ID of the item transferred.
- ///
- /// * sender: Original owner of the item.
- ///
- /// * recipient: New owner of the item.
- ///
- /// * amount: The amount of tokens that were transferred (always 1 for NFT).
+ /// * collection_id - ID of the collection to which the item belongs.
+ /// * item_id - ID of the item transferred.
+ /// * sender - Original owner of the item.
+ /// * recipient - New owner of the item.
+ /// * amount - Amount of tokens that were transferred (always 1 for NFT).
Transfer(
CollectionId,
TokenId,
@@ -352,15 +340,11 @@
/// Sponsoring allowance was approved.
///
/// # Arguments
- ///
- /// * collection_id
///
+ /// * collection_id - todo:doc flesh out
/// * item_id
- ///
/// * sender
- ///
/// * spender
- ///
/// * amount
Approved(
CollectionId,
@@ -374,49 +358,42 @@
///
/// # Arguments
///
- /// * collection_id: ID of the collection, whose property was just set.
- ///
- /// * property_key: Key of the property that was just set.
+ /// * collection_id - ID of the collection, whose property was just set.
+ /// * property_key - Key of the property that was just set.
CollectionPropertySet(CollectionId, PropertyKey),
/// Collection property was deleted.
///
/// # Arguments
///
- /// * collection_id: ID of the collection, whose property was just deleted.
- ///
- /// * property_key: Key of the property that was just deleted.
+ /// * collection_id - ID of the collection, whose property was just deleted.
+ /// * property_key - Key of the property that was just deleted.
CollectionPropertyDeleted(CollectionId, PropertyKey),
/// Item property was added or edited.
///
/// # Arguments
///
- /// * collection_id: ID of the collection, whose token's property was just set.
- ///
- /// * item_id: ID of the item, whose property was just set.
- ///
- /// * property_key: Key of the property that was just set.
+ /// * collection_id - ID of the collection, whose token's property was just set.
+ /// * item_id - ID of the item, whose property was just set.
+ /// * property_key - Key of the property that was just set.
TokenPropertySet(CollectionId, TokenId, PropertyKey),
/// Item property was deleted.
///
/// # Arguments
///
- /// * collection_id: ID of the collection, whose token's property was just deleted.
- ///
- /// * item_id: ID of the item, whose property was just deleted.
- ///
- /// * property_key: Key of the property that was just deleted.
+ /// * collection_id - ID of the collection, whose token's property was just deleted.
+ /// * item_id - ID of the item, whose property was just deleted.
+ /// * property_key - Key of the property that was just deleted.
TokenPropertyDeleted(CollectionId, TokenId, PropertyKey),
/// Token property permission was added or updated for a collection.
///
/// # Arguments
///
- /// * collection_id: ID of the collection, whose permissions were just set/updated.
- ///
- /// * property_key: Key of the property of the set/updated permission.
+ /// * collection_id - ID of the collection, whose permissions were just set/updated.
+ /// * property_key - Key of the property of the set/updated permission.
PropertyPermissionSet(CollectionId, PropertyKey),
}
pallets/unique/src/lib.rsdiffbeforeafterboth261 /// # Arguments261 /// # Arguments262 ///262 ///263 /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.263 /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.264 ///265 /// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.264 /// * collection_description - UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.266 ///267 /// * token_prefix: UTF-8 string with token prefix.265 /// * token_prefix - UTF-8 string with token prefix.268 ///269 /// * mode: [CollectionMode] collection type and type dependent data.266 /// * mode - [CollectionMode] collection type and type dependent data.270 // returns collection ID267 // returns collection ID271 #[weight = <SelfWeightOf<T>>::create_collection()]268 #[weight = <SelfWeightOf<T>>::create_collection()]272 #[transactional]269 #[transactional]316 ///313 ///317 /// # Arguments314 /// # Arguments318 ///315 ///319 /// * collection_id: collection to destroy.316 /// * collection_id - collection to destroy.320 #[weight = <SelfWeightOf<T>>::destroy_collection()]317 #[weight = <SelfWeightOf<T>>::destroy_collection()]321 #[transactional]318 #[transactional]322 pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {319 pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {349 /// # Arguments346 /// # Arguments350 ///347 ///351 /// * collection_id.348 /// * collection_id.352 ///353 /// * address.349 /// * address.354 #[weight = <SelfWeightOf<T>>::add_to_allow_list()]350 #[weight = <SelfWeightOf<T>>::add_to_allow_list()]355 #[transactional]351 #[transactional]384 /// # Arguments380 /// # Arguments385 ///381 ///386 /// * collection_id.382 /// * collection_id.387 ///388 /// * address.383 /// * address.389 #[weight = <SelfWeightOf<T>>::remove_from_allow_list()]384 #[weight = <SelfWeightOf<T>>::remove_from_allow_list()]390 #[transactional]385 #[transactional]418 /// # Arguments413 /// # Arguments419 ///414 ///420 /// * collection_id.415 /// * collection_id.421 ///422 /// * new_owner.416 /// * new_owner.423 #[weight = <SelfWeightOf<T>>::change_collection_owner()]417 #[weight = <SelfWeightOf<T>>::change_collection_owner()]424 #[transactional]418 #[transactional]449 ///443 ///450 /// # Arguments444 /// # Arguments451 ///445 ///452 /// * collection_id: ID of the Collection to add admin for.446 /// * collection_id - ID of the Collection to add admin for.453 ///454 /// * new_admin: Address of new admin to add.447 /// * new_admin - Address of new admin to add.455 #[weight = <SelfWeightOf<T>>::add_collection_admin()]448 #[weight = <SelfWeightOf<T>>::add_collection_admin()]456 #[transactional]449 #[transactional]457 pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult {450 pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult {476 ///469 ///477 /// # Arguments470 /// # Arguments478 ///471 ///479 /// * collection_id: ID of the Collection to remove admin for.472 /// * collection_id - ID of the Collection to remove admin for.480 ///481 /// * account_id: Address of admin to remove.473 /// * account_id - Address of admin to remove.482 #[weight = <SelfWeightOf<T>>::remove_collection_admin()]474 #[weight = <SelfWeightOf<T>>::remove_collection_admin()]483 #[transactional]475 #[transactional]484 pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {476 pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {504 /// # Arguments496 /// # Arguments505 ///497 ///506 /// * collection_id.498 /// * collection_id.507 ///508 /// * new_sponsor.499 /// * new_sponsor.509 #[weight = <SelfWeightOf<T>>::set_collection_sponsor()]500 #[weight = <SelfWeightOf<T>>::set_collection_sponsor()]510 #[transactional]501 #[transactional]529 ///520 ///530 /// # Permissions521 /// # Permissions531 ///522 ///532 /// * The sponsor to-be523 /// * Sponsor-to-be533 ///524 ///534 /// # Arguments525 /// # Arguments535 ///526 ///593 ///584 ///594 /// # Arguments585 /// # Arguments595 ///586 ///596 /// * collection_id: ID of the collection.587 /// * collection_id - ID of the collection.597 ///598 /// * owner: Address, initial owner of the NFT.588 /// * owner - Address, initial owner of the NFT.599 ///600 /// * data: Token data to store on chain.589 /// * data - Token data to store on chain.601 #[weight = T::CommonWeightInfo::create_item()]590 #[weight = T::CommonWeightInfo::create_item()]602 #[transactional]591 #[transactional]603 pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo {592 pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo {620 ///609 ///621 /// # Arguments610 /// # Arguments622 ///611 ///623 /// * collection_id: ID of the collection.612 /// * collection_id - ID of the collection.624 ///613 /// * owner - Address, initial owner of the NFT.625 /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].614 /// * items_data - Array items properties. Each property is an array of bytes itself, see [`create_item`].626 ///627 /// * owner: Address, initial owner of the NFT.628 #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)]615 #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)]629 #[transactional]616 #[transactional]630 pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResultWithPostInfo {617 pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResultWithPostInfo {645 /// # Arguments632 /// # Arguments646 ///633 ///647 /// * collection_id.634 /// * collection_id.648 ///649 /// * properties: a vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, '-', '_', and '.' as symbols.635 /// * properties - Vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, '-', '_', and '.' as symbols.650 #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)]636 #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)]651 #[transactional]637 #[transactional]652 pub fn set_collection_properties(638 pub fn set_collection_properties(671 /// # Arguments657 /// # Arguments672 ///658 ///673 /// * collection_id.659 /// * collection_id.674 ///675 /// * property_keys: a vector of keys of the properties to be deleted.660 /// * property_keys - Vector of keys of the properties to be deleted.676 #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)]661 #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)]677 #[transactional]662 #[transactional]678 pub fn delete_collection_properties(663 pub fn delete_collection_properties(699 /// # Arguments684 /// # Arguments700 ///685 ///701 /// * collection_id.686 /// * collection_id.702 ///703 /// * token_id.687 /// * token_id.704 ///705 /// * properties: a vector of key-value pairs stored as the token's metadata. Keys support Latin letters, '-', '_', and '.' as symbols.688 /// * properties - Vector of key-value pairs stored as the token's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols.706 #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)]689 #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)]707 #[transactional]690 #[transactional]708 pub fn set_token_properties(691 pub fn set_token_properties(731 /// # Arguments714 /// # Arguments732 ///715 ///733 /// * collection_id.716 /// * collection_id.734 ///735 /// * token_id.717 /// * token_id.736 ///737 /// * property_keys: a vector of keys of the properties to be deleted.718 /// * property_keys - Vector of keys of the properties to be deleted.738 #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)]719 #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)]739 #[transactional]720 #[transactional]740 pub fn delete_token_properties(721 pub fn delete_token_properties(761 /// # Arguments742 /// # Arguments762 ///743 ///763 /// * collection_id.744 /// * collection_id.764 ///765 /// * property_permissions: a vector of permissions for property keys. Keys support Latin letters, '-', '_', and '.' as symbols.745 /// * property_permissions - Vector of permissions for property keys. Keys support Latin letters, `-`, `_`, and `.` as symbols.766 #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)]746 #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)]767 #[transactional]747 #[transactional]768 pub fn set_token_property_permissions(748 pub fn set_token_property_permissions(790 ///770 ///791 /// # Arguments771 /// # Arguments792 ///772 ///793 /// * collection_id: ID of the collection.773 /// * collection_id - ID of the collection.794 ///795 /// * data: explicit item creation data.774 /// * data - Explicit item creation data.796 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]775 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]797 #[transactional]776 #[transactional]798 pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData<T::CrossAccountId>) -> DispatchResultWithPostInfo {777 pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData<T::CrossAccountId>) -> DispatchResultWithPostInfo {810 ///789 ///811 /// # Arguments790 /// # Arguments812 ///791 ///813 /// * collection_id: ID of the collection.792 /// * collection_id - ID of the collection.814 ///815 /// * value: New flag value.793 /// * value - New flag value.816 #[weight = <SelfWeightOf<T>>::set_transfers_enabled_flag()]794 #[weight = <SelfWeightOf<T>>::set_transfers_enabled_flag()]817 #[transactional]795 #[transactional]818 pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {796 pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {837 ///815 ///838 /// # Arguments816 /// # Arguments839 ///817 ///840 /// * collection_id: ID of the collection.818 /// * collection_id - ID of the collection.841 ///842 /// * item_id: ID of NFT to burn.819 /// * item_id - ID of NFT to burn.843 #[weight = T::CommonWeightInfo::burn_item()]820 #[weight = T::CommonWeightInfo::burn_item()]844 #[transactional]821 #[transactional]845 pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {822 pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {867 ///844 ///868 /// # Arguments845 /// # Arguments869 ///846 ///870 /// * collection_id: ID of the collection.847 /// * collection_id - ID of the collection.871 ///872 /// * item_id: ID of NFT to burn.848 /// * item_id - ID of NFT to burn.873 ///849 /// * from - The owner of the item from whom it is taken away.874 /// * from: owner of item875 #[weight = T::CommonWeightInfo::burn_from()]850 #[weight = T::CommonWeightInfo::burn_from()]876 #[transactional]851 #[transactional]877 pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {852 pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {891 ///866 ///892 /// # Arguments867 /// # Arguments893 ///868 ///894 /// * recipient: Address of token recipient.869 /// * recipient - Address of token recipient.895 ///870 ///896 /// * collection_id.871 /// * collection_id.897 ///872 ///898 /// * item_id: ID of the item873 /// * item_id - ID of the item899 /// * Non-Fungible Mode: Required.874 /// * Non-Fungible Mode: Required.900 /// * Fungible Mode: Ignored.875 /// * Fungible Mode: Ignored.901 /// * Re-Fungible Mode: Required.876 /// * Re-Fungible Mode: Required.902 ///877 ///903 /// * value: Amount to transfer.878 /// * value - Amount to transfer.904 /// * Non-Fungible Mode: Ignored879 /// * Non-Fungible Mode: Ignored905 /// * Fungible Mode: Must specify transferred amount880 /// * Fungible Mode: Must specify transferred amount906 /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)881 /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)923 ///898 ///924 /// # Arguments899 /// # Arguments925 ///900 ///926 /// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).901 /// * approved - Address that is approved to transfer this NFT or zero (if needed to remove approval).927 ///928 /// * collection_id.902 /// * collection_id.929 ///930 /// * item_id: ID of the item.903 /// * item_id - ID of the item.931 #[weight = T::CommonWeightInfo::approve()]904 #[weight = T::CommonWeightInfo::approve()]932 #[transactional]905 #[transactional]933 pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo {906 pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo {947 ///920 ///948 /// # Arguments921 /// # Arguments949 ///922 ///950 /// * from: Address that owns token.923 /// * from - Address that currently owns the token.951 ///952 /// * recipient: Address of token recipient.924 /// * recipient - Address of the new token-owner-to-be.953 ///954 /// * collection_id.925 /// * collection_id.955 ///956 /// * item_id: ID of the item.926 /// * item_id - ID of the item to be transferred.957 ///958 /// * value: Amount to transfer.927 /// * value - Amount to transfer.959 #[weight = T::CommonWeightInfo::transfer_from()]928 #[weight = T::CommonWeightInfo::transfer_from()]960 #[transactional]929 #[transactional]961 pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo {930 pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo {966 }935 }967936968 /// Set specific limits of a collection. Empty, or None fields mean chain default.937 /// Set specific limits of a collection. Empty, or None fields mean chain default.969 ///.938 ///970 /// # Permissions939 /// # Permissions971 ///940 ///972 /// * Collection Owner941 /// * Collection Owner975 /// # Arguments944 /// # Arguments976 ///945 ///977 /// * collection_id.946 /// * collection_id.978 ///979 /// * new_limit: The new limits of the collection. They will overwrite the current ones.947 /// * new_limit - New limits of the collection. They will overwrite the current ones.980 #[weight = <SelfWeightOf<T>>::set_collection_limits()]948 #[weight = <SelfWeightOf<T>>::set_collection_limits()]981 #[transactional]949 #[transactional]982 pub fn set_collection_limits(950 pub fn set_collection_limits(1009 /// # Arguments977 /// # Arguments1010 ///978 ///1011 /// * collection_id.979 /// * collection_id.1012 ///1013 /// * new_permission: The new permissions of the collection. They will overwrite the current ones.980 /// * new_permission - New permissions of the collection. They will overwrite the current ones.1014 #[weight = <SelfWeightOf<T>>::set_collection_limits()]981 #[weight = <SelfWeightOf<T>>::set_collection_limits()]1015 #[transactional]982 #[transactional]1016 pub fn set_collection_permissions(983 pub fn set_collection_permissions(1042 /// # Arguments1009 /// # Arguments1043 ///1010 ///1044 /// * collection_id.1011 /// * collection_id.1045 ///1046 /// * token: the ID of the RFT.1012 /// * token_id - ID of the RFT.1047 ///1048 /// * amount: The new number of parts into which the token shall be partitioned.1013 /// * amount - New number of parts into which the token shall be partitioned.1049 #[weight = T::RefungibleExtensionsWeightInfo::repartition()]1014 #[weight = T::RefungibleExtensionsWeightInfo::repartition()]1050 #[transactional]1015 #[transactional]1051 pub fn repartition(1016 pub fn repartition(1052 origin,1017 origin,1053 collection_id: CollectionId,1018 collection_id: CollectionId,1054 token: TokenId,1019 token_id: TokenId,1055 amount: u128,1020 amount: u128,1056 ) -> DispatchResultWithPostInfo {1021 ) -> DispatchResultWithPostInfo {1057 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);1022 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);