git.delta.rocks / unique-network / refs/commits / 9b4da675e61d

difftreelog

doc: minor fixes + typos

Farhad Hakimov2022-07-11parent: #6035f8d.patch.diff
in: master

7 files changed

modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
before · client/rpc/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617// Original License18use std::sync::Arc;1920use codec::{Decode, Encode};21use jsonrpsee::{22	core::{RpcResult as Result},23	proc_macros::rpc,24};25use anyhow::anyhow;26use up_data_structs::{27	RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,28	PropertyKeyPermission, TokenData, TokenChild,29};30use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};31use sp_blockchain::HeaderBackend;32use up_rpc::UniqueApi as UniqueRuntimeApi;3334// RMRK35use rmrk_rpc::RmrkApi as RmrkRuntimeApi;36use up_data_structs::{37	RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,38};3940pub use rmrk_unique_rpc::RmrkApiServer;4142#[rpc(server)]43#[async_trait]44pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {45	/// Get tokens owned by account46	#[method(name = "unique_accountTokens")]47	fn account_tokens(48		&self,49		collection: CollectionId,50		account: CrossAccountId,51		at: Option<BlockHash>,52	) -> Result<Vec<TokenId>>;53	/// Get tokens contained in collection54	#[method(name = "unique_collectionTokens")]55	fn collection_tokens(56		&self,57		collection: CollectionId,58		at: Option<BlockHash>,59	) -> Result<Vec<TokenId>>;60	/// Check if token exists61	#[method(name = "unique_tokenExists")]62	fn token_exists(63		&self,64		collection: CollectionId,65		token: TokenId,66		at: Option<BlockHash>,67	) -> Result<bool>;68	/// Get token owner69	#[method(name = "unique_tokenOwner")]70	fn token_owner(71		&self,72		collection: CollectionId,73		token: TokenId,74		at: Option<BlockHash>,75	) -> Result<Option<CrossAccountId>>;76	/// Get token owner, in case of nested token - find the parent recursively77	#[method(name = "unique_topmostTokenOwner")]78	fn topmost_token_owner(79		&self,80		collection: CollectionId,81		token: TokenId,82		at: Option<BlockHash>,83	) -> Result<Option<CrossAccountId>>;84	/// Get tokens nested directly into the token85	#[method(name = "unique_tokenChildren")]86	fn token_children(87		&self,88		collection: CollectionId,89		token: TokenId,90		at: Option<BlockHash>,91	) -> Result<Vec<TokenChild>>;92	/// Get collection properties93	#[method(name = "unique_collectionProperties")]94	fn collection_properties(95		&self,96		collection: CollectionId,97		keys: Option<Vec<String>>,98		at: Option<BlockHash>,99	) -> Result<Vec<Property>>;100	/// Get token properties101	#[method(name = "unique_tokenProperties")]102	fn token_properties(103		&self,104		collection: CollectionId,105		token_id: TokenId,106		keys: Option<Vec<String>>,107		at: Option<BlockHash>,108	) -> Result<Vec<Property>>;109	/// Get property permissions110	#[method(name = "unique_propertyPermissions")]111	fn property_permissions(112		&self,113		collection: CollectionId,114		keys: Option<Vec<String>>,115		at: Option<BlockHash>,116	) -> Result<Vec<PropertyKeyPermission>>;117	/// Get token data118	#[method(name = "unique_tokenData")]119	fn token_data(120		&self,121		collection: CollectionId,122		token_id: TokenId,123		keys: Option<Vec<String>>,124		at: Option<BlockHash>,125	) -> Result<TokenData<CrossAccountId>>;126	/// Get amount of unique collection tokens127	#[method(name = "unique_totalSupply")]128	fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;129	/// Get owned amount of any user tokens130	#[method(name = "unique_accountBalance")]131	fn account_balance(132		&self,133		collection: CollectionId,134		account: CrossAccountId,135		at: Option<BlockHash>,136	) -> Result<u32>;137	/// Get owned amount of specific account token138	#[method(name = "unique_balance")]139	fn balance(140		&self,141		collection: CollectionId,142		account: CrossAccountId,143		token: TokenId,144		at: Option<BlockHash>,145	) -> Result<String>;146	/// Get allowed amount147	#[method(name = "unique_allowance")]148	fn allowance(149		&self,150		collection: CollectionId,151		sender: CrossAccountId,152		spender: CrossAccountId,153		token: TokenId,154		at: Option<BlockHash>,155	) -> Result<String>;156	/// Get admin list157	#[method(name = "unique_adminlist")]158	fn adminlist(159		&self,160		collection: CollectionId,161		at: Option<BlockHash>,162	) -> Result<Vec<CrossAccountId>>;163	/// Get allowlist164	#[method(name = "unique_allowlist")]165	fn allowlist(166		&self,167		collection: CollectionId,168		at: Option<BlockHash>,169	) -> Result<Vec<CrossAccountId>>;170	/// Check if user is allowed to use collection171	#[method(name = "unique_allowed")]172	fn allowed(173		&self,174		collection: CollectionId,175		user: CrossAccountId,176		at: Option<BlockHash>,177	) -> Result<bool>;178	/// Get last token ID created in a collection179	#[method(name = "unique_lastTokenId")]180	fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;181	/// Get collection by specified ID182	#[method(name = "unique_collectionById")]183	fn collection_by_id(184		&self,185		collection: CollectionId,186		at: Option<BlockHash>,187	) -> Result<Option<RpcCollection<AccountId>>>;188	/// Get collection stats189	#[method(name = "unique_collectionStats")]190	fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;191	/// Get number of blocks when sponsored transaction is available192	#[method(name = "unique_nextSponsored")]193	fn next_sponsored(194		&self,195		collection: CollectionId,196		account: CrossAccountId,197		token: TokenId,198		at: Option<BlockHash>,199	) -> Result<Option<u64>>;200	/// Get effective collection limits201	#[method(name = "unique_effectiveCollectionLimits")]202	fn effective_collection_limits(203		&self,204		collection_id: CollectionId,205		at: Option<BlockHash>,206	) -> Result<Option<CollectionLimits>>;207	/// Get total pieces of token208	#[method(name = "unique_totalPieces")]209	fn total_pieces(210		&self,211		collection_id: CollectionId,212		token_id: TokenId,213		at: Option<BlockHash>,214	) -> Result<Option<u128>>;215}216217mod rmrk_unique_rpc {218	use super::*;219220	#[rpc(server)]221	#[async_trait]222	pub trait RmrkApi<223		BlockHash,224		AccountId,225		CollectionInfo,226		NftInfo,227		ResourceInfo,228		PropertyInfo,229		BaseInfo,230		PartType,231		Theme,232	>233	{234		#[method(name = "rmrk_lastCollectionIdx")]235		/// Get the latest created collection id236		fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;237238		#[method(name = "rmrk_collectionById")]239		/// Get collection by id240		fn collection_by_id(241			&self,242			id: RmrkCollectionId,243			at: Option<BlockHash>,244		) -> Result<Option<CollectionInfo>>;245246		#[method(name = "rmrk_nftById")]247		/// Get NFT by collection id and NFT id248		fn nft_by_id(249			&self,250			collection_id: RmrkCollectionId,251			nft_id: RmrkNftId,252			at: Option<BlockHash>,253		) -> Result<Option<NftInfo>>;254255		#[method(name = "rmrk_accountTokens")]256		/// Get tokens owned by an account in a collection257		fn account_tokens(258			&self,259			account_id: AccountId,260			collection_id: RmrkCollectionId,261			at: Option<BlockHash>,262		) -> Result<Vec<RmrkNftId>>;263264		#[method(name = "rmrk_nftChildren")]265		/// Get NFT children266		fn nft_children(267			&self,268			collection_id: RmrkCollectionId,269			nft_id: RmrkNftId,270			at: Option<BlockHash>,271		) -> Result<Vec<RmrkNftChild>>;272273		#[method(name = "rmrk_collectionProperties")]274		/// Get collection properties275		fn collection_properties(276			&self,277			collection_id: RmrkCollectionId,278			filter_keys: Option<Vec<String>>,279			at: Option<BlockHash>,280		) -> Result<Vec<PropertyInfo>>;281282		#[method(name = "rmrk_nftProperties")]283		/// Get NFT properties284		fn nft_properties(285			&self,286			collection_id: RmrkCollectionId,287			nft_id: RmrkNftId,288			filter_keys: Option<Vec<String>>,289			at: Option<BlockHash>,290		) -> Result<Vec<PropertyInfo>>;291292		#[method(name = "rmrk_nftResources")]293		/// Get NFT resources294		fn nft_resources(295			&self,296			collection_id: RmrkCollectionId,297			nft_id: RmrkNftId,298			at: Option<BlockHash>,299		) -> Result<Vec<ResourceInfo>>;300301		#[method(name = "rmrk_nftResourcePriority")]302		/// Get NFT resource priority303		fn nft_resource_priority(304			&self,305			collection_id: RmrkCollectionId,306			nft_id: RmrkNftId,307			resource_id: RmrkResourceId,308			at: Option<BlockHash>,309		) -> Result<Option<u32>>;310311		#[method(name = "rmrk_base")]312		/// Get base info313		fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;314315		#[method(name = "rmrk_baseParts")]316		/// Get all Base's parts317		fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;318319		#[method(name = "rmrk_themeNames")]320		/// Get Base's theme names321		fn theme_names(322			&self,323			base_id: RmrkBaseId,324			at: Option<BlockHash>,325		) -> Result<Vec<RmrkThemeName>>;326327		#[method(name = "rmrk_themes")]328		/// Get Theme info -- name, properties, and inherit flag329		fn theme(330			&self,331			base_id: RmrkBaseId,332			theme_name: String,333			filter_keys: Option<Vec<String>>,334			at: Option<BlockHash>,335		) -> Result<Option<Theme>>;336	}337}338339pub struct Unique<C, P> {340	client: Arc<C>,341	_marker: std::marker::PhantomData<P>,342}343344impl<C, P> Unique<C, P> {345	pub fn new(client: Arc<C>) -> Self {346		Self {347			client,348			_marker: Default::default(),349		}350	}351}352353pub struct Rmrk<C, P> {354	client: Arc<C>,355	_marker: std::marker::PhantomData<P>,356}357358impl<C, P> Rmrk<C, P> {359	pub fn new(client: Arc<C>) -> Self {360		Self {361			client,362			_marker: Default::default(),363		}364	}365}366367macro_rules! pass_method {368	(369		$method_name:ident(370			$($(#[map(|$map_arg:ident| $map:expr)])? $name:ident: $ty:ty),* $(,)?371		) -> $result:ty $(=> $mapper:expr)?,372		//$runtime_name:ident $(<$($lt: tt),+>)*373		$runtime_api_macro:ident374		$(; changed_in $ver:expr, $changed_method_name:ident ($($changed_name:expr), * $(,)?) => $fixer:expr)*375	) => {376		fn $method_name(377			&self,378			$(379				$name: $ty,380			)*381			at: Option<<Block as BlockT>::Hash>,382		) -> Result<$result> {383			let api = self.client.runtime_api();384			let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));385			let _api_version = if let Ok(Some(api_version)) =386				api.api_version::<$runtime_api_macro!()>(&at)387			{388				api_version389			} else {390				// unreachable for our runtime391				return Err(anyhow!("api is not available").into())392			};393394			let result = $(if _api_version < $ver {395				api.$changed_method_name(&at, $($changed_name),*).map(|r| r.map($fixer))396			} else)*397			{ api.$method_name(&at, $($((|$map_arg: $ty| $map))? ($name)),*) };398399			Ok(result400				.map_err(|e| anyhow!("unable to query: {e}"))?401				.map_err(|e| anyhow!("runtime error: {e:?}"))$(.map($mapper))??)402		}403	};404}405406macro_rules! unique_api {407	() => {408		dyn UniqueRuntimeApi<Block, CrossAccountId, AccountId>409	};410}411412macro_rules! rmrk_api {413	() => {414		dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>415	};416}417418#[allow(deprecated)]419impl<C, Block, CrossAccountId, AccountId>420	UniqueApiServer<<Block as BlockT>::Hash, CrossAccountId, AccountId> for Unique<C, Block>421where422	Block: BlockT,423	AccountId: Decode,424	C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,425	C::Api: UniqueRuntimeApi<Block, CrossAccountId, AccountId>,426	CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,427{428	pass_method!(429		account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>, unique_api430	);431	pass_method!(432		collection_tokens(collection: CollectionId) -> Vec<TokenId>, unique_api433	);434	pass_method!(435		token_exists(collection: CollectionId, token: TokenId) -> bool, unique_api436	);437	pass_method!(438		token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api439	);440	pass_method!(441		topmost_token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api442	);443	pass_method!(token_children(collection: CollectionId, token: TokenId) -> Vec<TokenChild>, unique_api);444	pass_method!(total_supply(collection: CollectionId) -> u32, unique_api);445	pass_method!(account_balance(collection: CollectionId, account: CrossAccountId) -> u32, unique_api);446	pass_method!(balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> String => |v| v.to_string(), unique_api);447	pass_method!(448		allowance(collection: CollectionId, sender: CrossAccountId, spender: CrossAccountId, token: TokenId) -> String => |v| v.to_string(),449		unique_api450	);451452	pass_method!(collection_properties(453		collection: CollectionId,454455		#[map(|keys| string_keys_to_bytes_keys(keys))]456		keys: Option<Vec<String>>457	) -> Vec<Property>, unique_api);458459	pass_method!(token_properties(460		collection: CollectionId,461		token_id: TokenId,462463		#[map(|keys| string_keys_to_bytes_keys(keys))]464		keys: Option<Vec<String>>465	) -> Vec<Property>, unique_api);466467	pass_method!(property_permissions(468		collection: CollectionId,469470		#[map(|keys| string_keys_to_bytes_keys(keys))]471		keys: Option<Vec<String>>472	) -> Vec<PropertyKeyPermission>, unique_api);473474	pass_method!(token_data(475		collection: CollectionId,476		token_id: TokenId,477478		#[map(|keys| string_keys_to_bytes_keys(keys))]479		keys: Option<Vec<String>>,480	) -> TokenData<CrossAccountId>, unique_api);481482	pass_method!(adminlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);483	pass_method!(allowlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);484	pass_method!(allowed(collection: CollectionId, user: CrossAccountId) -> bool, unique_api);485	pass_method!(last_token_id(collection: CollectionId) -> TokenId, unique_api);486	pass_method!(collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api);487	pass_method!(collection_stats() -> CollectionStats, unique_api);488	pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option<u64>, unique_api);489	pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);490	pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<u128>, unique_api);491}492493#[allow(deprecated)]494impl<495		C,496		Block,497		AccountId,498		CollectionInfo,499		NftInfo,500		ResourceInfo,501		PropertyInfo,502		BaseInfo,503		PartType,504		Theme,505	>506	rmrk_unique_rpc::RmrkApiServer<507		<Block as BlockT>::Hash,508		AccountId,509		CollectionInfo,510		NftInfo,511		ResourceInfo,512		PropertyInfo,513		BaseInfo,514		PartType,515		Theme,516	> for Rmrk<C, Block>517where518	C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,519	C::Api: RmrkRuntimeApi<520		Block,521		AccountId,522		CollectionInfo,523		NftInfo,524		ResourceInfo,525		PropertyInfo,526		BaseInfo,527		PartType,528		Theme,529	>,530	AccountId: Decode + Encode,531	CollectionInfo: Decode,532	NftInfo: Decode,533	ResourceInfo: Decode,534	PropertyInfo: Decode,535	BaseInfo: Decode,536	PartType: Decode,537	Theme: Decode,538	Block: BlockT,539{540	pass_method!(last_collection_idx() -> RmrkCollectionId, rmrk_api);541	pass_method!(collection_by_id(id: RmrkCollectionId) -> Option<CollectionInfo>, rmrk_api);542	pass_method!(nft_by_id(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Option<NftInfo>, rmrk_api);543	pass_method!(account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Vec<RmrkNftId>, rmrk_api);544	pass_method!(nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkNftChild>, rmrk_api);545	pass_method!(546		collection_properties(547			collection_id: RmrkCollectionId,548549			#[map(|keys| string_keys_to_bytes_keys(keys))]550			filter_keys: Option<Vec<String>>551		) -> Vec<PropertyInfo>,552		rmrk_api553	);554	pass_method!(555		nft_properties(556			collection_id: RmrkCollectionId,557			nft_id: RmrkNftId,558559			#[map(|keys| string_keys_to_bytes_keys(keys))]560			filter_keys: Option<Vec<String>>561		) -> Vec<PropertyInfo>,562		rmrk_api563	);564	pass_method!(nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<ResourceInfo>, rmrk_api);565	pass_method!(nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Option<u32>, rmrk_api);566	pass_method!(base(base_id: RmrkBaseId) -> Option<BaseInfo>, rmrk_api);567	pass_method!(base_parts(base_id: RmrkBaseId) -> Vec<PartType>, rmrk_api);568	pass_method!(theme_names(base_id: RmrkBaseId) -> Vec<RmrkThemeName>, rmrk_api);569	pass_method!(570		theme(571			base_id: RmrkBaseId,572573			#[map(|n| n.into_bytes())]574			theme_name: String,575576			#[map(|keys| string_keys_to_bytes_keys(keys))]577			filter_keys: Option<Vec<String>>578		) -> Option<Theme>, rmrk_api);579}580581fn string_keys_to_bytes_keys(keys: Option<Vec<String>>) -> Option<Vec<Vec<u8>>> {582	keys.map(|keys| keys.into_iter().map(|key| key.into_bytes()).collect())583}
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -334,7 +334,7 @@
 		///
 		/// * collection_id: ID of the collection to which the item belongs.
 		///
-		/// * item_id: ID of the item trasnferred.
+		/// * item_id: ID of the item transferred.
 		///
 		/// * sender: Original owner of the item.
 		///
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -58,13 +58,13 @@
 	pub enum Error<T> {
 		/// Not Fungible item data used to mint in Fungible collection.
 		NotFungibleDataUsedToMintFungibleCollectionToken,
-		/// Not default id passed as TokenId argument
+		/// Not default id passed as TokenId argument.
 		FungibleItemsHaveNoId,
-		/// Tried to set data for fungible item
+		/// Tried to set data for fungible item.
 		FungibleItemsDontHaveData,
-		/// Fungible token does not support nested
+		/// Fungible token does not support nesting.
 		FungibleDisallowsNesting,
-		/// Setting item properties is not allowed
+		/// Setting item properties is not allowed.
 		SettingPropertiesNotAllowed,
 	}
 
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -171,7 +171,7 @@
 		QueryKind = ValueQuery,
 	>;
 
-	/// Amount of tokens owned in a collection.s
+	/// Amount of tokens owned in a collection.
 	#[pallet::storage]
 	pub type AccountBalance<T: Config> = StorageNMap<
 		Key = (
@@ -182,7 +182,7 @@
 		QueryKind = ValueQuery,
 	>;
 
-	/// todo doc
+	/// todo:doc
 	#[pallet::storage]
 	pub type Allowance<T: Config> = StorageNMap<
 		Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -64,13 +64,13 @@
 	pub enum Error<T> {
 		/// Not Refungible item data used to mint in Refungible collection.
 		NotRefungibleDataUsedToMintFungibleCollectionToken,
-		/// Maximum refungibility exceeded
+		/// Maximum refungibility exceeded.
 		WrongRefungiblePieces,
-		/// Refungible token can't be repartitioned by user who isn't owns all pieces
+		/// Refungible token can't be repartitioned by user who isn't owns all pieces.
 		RepartitionWhileNotOwningAllPieces,
-		/// Refungible token can't nest other tokens
+		/// Refungible token can't nest other tokens.
 		RefungibleDisallowsNesting,
-		/// Setting item properties is not allowed
+		/// Setting item properties is not allowed.
 		SettingPropertiesNotAllowed,
 	}
 
@@ -605,7 +605,6 @@
 		Ok(())
 	}
 
-	/// todo:doc oh look, a precedent. not pub, too. but it has an unclear use-case.
 	/// Returns allowance, which should be set after transaction
 	fn check_allowed(
 		collection: &RefungibleHandle<T>,
modifiedpallets/structure/src/lib.rsdiffbeforeafterboth
--- a/pallets/structure/src/lib.rs
+++ b/pallets/structure/src/lib.rs
@@ -31,7 +31,7 @@
 		DepthLimit,
 		/// While iterating over children, reached the breadth limit.
 		BreadthLimit,
-		/// Couldn't find the token owner that is a token. Perhaps, it does not yet exist. todo:doc? rephrase?
+		/// Couldn't find the token owner that is itself a token.
 		TokenNotFound,
 	}
 
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -286,7 +286,7 @@
 	}
 }
 
-/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version)
+/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version).
 #[struct_versioning::versioned(version = 2, upper)]
 #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
 pub struct Collection<AccountId> {
@@ -327,7 +327,7 @@
 	pub meta_update_permission: MetaUpdatePermission,
 }
 
-/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version)
+/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version).
 #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]
 #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
 pub struct RpcCollection<AccountId> {
@@ -568,7 +568,7 @@
 	ReFungible(CreateReFungibleData),
 }
 
-/// Explicit NFT creation data with meta parameters
+/// Explicit NFT creation data with meta parameters.
 #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]
 #[derivative(Debug)]
 pub struct CreateNftExData<CrossAccountId> {
@@ -577,7 +577,7 @@
 	pub owner: CrossAccountId,
 }
 
-/// Explicit RFT creation data with meta parameters
+/// Explicit RFT creation data with meta parameters.
 #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]
 #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]
 pub struct CreateRefungibleExData<CrossAccountId> {
@@ -587,7 +587,7 @@
 	pub users: BoundedBTreeMap<CrossAccountId, u128, ConstU32<MAX_ITEMS_PER_BATCH>>,
 }
 
-/// Explicit item creation data with meta parameters, namely the owner
+/// Explicit item creation data with meta parameters, namely the owner.
 #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]
 #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]
 pub enum CreateItemExData<CrossAccountId> {
@@ -635,7 +635,7 @@
 	}
 }
 
-/// Token's address, dictated by its collection and token IDs
+/// Token's address, dictated by its collection and token IDs.
 #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
 #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
 // todo possibly rename to be used generally as an address pair