difftreelog
doc: adjust documentation style
in: master
2 files changed
pallets/common/src/lib.rsdiffbeforeafterboth288 ///288 ///289 /// # Arguments289 /// # Arguments290 ///290 ///291 /// * collection_id: Globally unique identifier of newly created collection.291 /// * collection_id - Globally unique identifier of newly created collection.292 ///293 /// * mode: [CollectionMode] converted into u8.292 /// * mode - [CollectionMode] converted into u8.294 ///295 /// * account_id: Collection owner.293 /// * account_id - Collection owner.296 CollectionCreated(CollectionId, u8, T::AccountId),294 CollectionCreated(CollectionId, u8, T::AccountId),297295298 /// New collection was destroyed296 /// New collection was destroyed299 ///297 ///300 /// # Arguments298 /// # Arguments301 ///299 ///302 /// * collection_id: Globally unique identifier of collection that has been destroyed.300 /// * collection_id - Globally unique identifier of collection that has been destroyed.303 CollectionDestroyed(CollectionId),301 CollectionDestroyed(CollectionId),304302305 /// New item was created.303 /// New item was created.306 ///304 ///307 /// # Arguments305 /// # Arguments308 ///306 ///309 /// * collection_id: ID of the collection where the item was created.307 /// * collection_id - ID of the collection where the item was created.310 ///311 /// * item_id: ID of the item. Unique within the collection.308 /// * item_id - ID of the item. Unique within the collection.312 ///313 /// * recipient: Owner of the newly created item.309 /// * recipient - Owner of the newly created item.314 ///315 /// * amount: The amount of tokens that were created (always 1 for NFT).310 /// * amount - The amount of tokens that were created (always 1 for NFT).316 ItemCreated(CollectionId, TokenId, T::CrossAccountId, u128),311 ItemCreated(CollectionId, TokenId, T::CrossAccountId, u128),317312318 /// Collection item was burned.313 /// Collection item was burned.319 ///314 ///320 /// # Arguments315 /// # Arguments321 ///316 ///322 /// * collection_id: Identifier of the collection to which the burned NFT belonged.317 /// * collection_id - Identifier of the collection to which the burned NFT belonged.323 ///324 /// * item_id: Identifier of burned NFT.318 /// * item_id - Identifier of burned NFT.325 ///326 /// * owner: Which user has destroyed their tokens.319 /// * owner - Which user has destroyed their tokens.327 ///328 /// * amount: The amount of tokens that were destroyed (always 1 for NFT).320 /// * amount - Amount of tokens that were destroyed (always 1 for NFT).329 ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128),321 ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128),330322331 /// Item was transferred.323 /// Item was transferred.332 ///324 ///333 /// # Arguments325 /// # Arguments334 ///326 ///335 /// * collection_id: ID of the collection to which the item belongs.327 /// * collection_id - ID of the collection to which the item belongs.336 ///337 /// * item_id: ID of the item transferred.328 /// * item_id - ID of the item transferred.338 ///339 /// * sender: Original owner of the item.329 /// * sender - Original owner of the item.340 ///341 /// * recipient: New owner of the item.330 /// * recipient - New owner of the item.342 ///343 /// * amount: The amount of tokens that were transferred (always 1 for NFT).331 /// * amount - Amount of tokens that were transferred (always 1 for NFT).344 Transfer(332 Transfer(345 CollectionId,333 CollectionId,346 TokenId,334 TokenId,353 ///341 ///354 /// # Arguments342 /// # Arguments355 ///343 ///356 /// * collection_id344 /// * collection_id - todo:doc flesh out357 ///358 /// * item_id345 /// * item_id359 ///360 /// * sender346 /// * sender361 ///362 /// * spender347 /// * spender363 ///364 /// * amount348 /// * amount365 Approved(349 Approved(366 CollectionId,350 CollectionId,374 ///358 ///375 /// # Arguments359 /// # Arguments376 ///360 ///377 /// * collection_id: ID of the collection, whose property was just set.361 /// * collection_id - ID of the collection, whose property was just set.378 ///379 /// * property_key: Key of the property that was just set.362 /// * property_key - Key of the property that was just set.380 CollectionPropertySet(CollectionId, PropertyKey),363 CollectionPropertySet(CollectionId, PropertyKey),381364382 /// Collection property was deleted.365 /// Collection property was deleted.383 ///366 ///384 /// # Arguments367 /// # Arguments385 ///368 ///386 /// * collection_id: ID of the collection, whose property was just deleted.369 /// * collection_id - ID of the collection, whose property was just deleted.387 ///388 /// * property_key: Key of the property that was just deleted.370 /// * property_key - Key of the property that was just deleted.389 CollectionPropertyDeleted(CollectionId, PropertyKey),371 CollectionPropertyDeleted(CollectionId, PropertyKey),390372391 /// Item property was added or edited.373 /// Item property was added or edited.392 ///374 ///393 /// # Arguments375 /// # Arguments394 ///376 ///395 /// * collection_id: ID of the collection, whose token's property was just set.377 /// * collection_id - ID of the collection, whose token's property was just set.396 ///397 /// * item_id: ID of the item, whose property was just set.378 /// * item_id - ID of the item, whose property was just set.398 ///399 /// * property_key: Key of the property that was just set.379 /// * property_key - Key of the property that was just set.400 TokenPropertySet(CollectionId, TokenId, PropertyKey),380 TokenPropertySet(CollectionId, TokenId, PropertyKey),401381402 /// Item property was deleted.382 /// Item property was deleted.403 ///383 ///404 /// # Arguments384 /// # Arguments405 ///385 ///406 /// * collection_id: ID of the collection, whose token's property was just deleted.386 /// * collection_id - ID of the collection, whose token's property was just deleted.407 ///408 /// * item_id: ID of the item, whose property was just deleted.387 /// * item_id - ID of the item, whose property was just deleted.409 ///410 /// * property_key: Key of the property that was just deleted.388 /// * property_key - Key of the property that was just deleted.411 TokenPropertyDeleted(CollectionId, TokenId, PropertyKey),389 TokenPropertyDeleted(CollectionId, TokenId, PropertyKey),412390413 /// Token property permission was added or updated for a collection.391 /// Token property permission was added or updated for a collection.414 ///392 ///415 /// # Arguments393 /// # Arguments416 ///394 ///417 /// * collection_id: ID of the collection, whose permissions were just set/updated.395 /// * collection_id - ID of the collection, whose permissions were just set/updated.418 ///419 /// * property_key: Key of the property of the set/updated permission.396 /// * property_key - Key of the property of the set/updated permission.420 PropertyPermissionSet(CollectionId, PropertyKey),397 PropertyPermissionSet(CollectionId, PropertyKey),421 }398 }422399pallets/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)?);