git.delta.rocks / unique-network / refs/commits / 4b3d05886c9a

difftreelog

feat(rmrk-proxy) add resource

Fahrrader2022-06-02parent: #47e3bf2.patch.diff
in: master

21 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6335,6 +6335,7 @@
  "pallet-common",
  "pallet-evm",
  "pallet-nonfungible",
+ "pallet-structure",
  "parity-scale-codec 3.1.2",
  "scale-info",
  "sp-core",
modifiedpallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/Cargo.toml
+++ b/pallets/proxy-rmrk-core/Cargo.toml
@@ -18,6 +18,7 @@
 sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
 pallet-common = { default-features = false, path = '../common' }
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
+pallet-structure = { default-features = false, path = "../../pallets/structure" }
 up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.22" }
 frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
@@ -33,6 +34,7 @@
     "up-data-structs/std",
     "pallet-common/std",
     "pallet-nonfungible/std",
+    "pallet-structure/std",
     "pallet-evm/std",
     'frame-benchmarking/std',
 ]
modifiedpallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/src/lib.rs
+++ b/pallets/proxy-rmrk-core/src/lib.rs
@@ -25,6 +25,7 @@
 	Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations,
 };
 use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle, TokenData};
+use pallet_structure::Pallet as PalletStructure;
 use pallet_evm::account::CrossAccountId;
 use core::convert::AsRef;
 
@@ -56,7 +57,7 @@
 
 	#[pallet::storage]
 	#[pallet::getter(fn collection_index_map)]
-	pub type CollectionIndexMap<T: Config> = 
+	pub type CollectionIndexMap<T: Config> =
 		StorageMap<_, Twox64Concat, RmrkCollectionId, CollectionId, ValueQuery>;
 
 	#[pallet::pallet]
@@ -98,6 +99,10 @@
 			key: RmrkKeyString,
 			value: RmrkValueString,
 		},
+		ResourceAdded {
+			nft_id: RmrkNftId,
+			resource_id: RmrkResourceId,
+		},
 	}
 
 	#[pallet::error]
@@ -106,7 +111,7 @@
 		CorruptedCollectionType,
 		NftTypeEncodeError,
 		RmrkPropertyKeyIsTooLong,
-		RmrkPropertyValueIsTooLong,
+		RmrkPropertyValueIsTooLong, // todo utilize that in RPCs
 
 		/* RMRK compatible events */
 		CollectionNotEmpty,
@@ -115,6 +120,7 @@
 		CollectionUnknown,
 		NoPermission,
 		CollectionFullOrLocked,
+		// todo add resource errors?
 	}
 
 	#[pallet::call]
@@ -143,29 +149,21 @@
 					.map_err(|_| <CommonError<T>>::CollectionTokenPrefixLimitExceeded)?,
 				..Default::default()
 			};
-
-			let collection_id_res =
-				<PalletNft<T>>::init_collection(T::CrossAccountId::from_sub(sender.clone()), data);
-
-			if let Err(DispatchError::Arithmetic(_)) = &collection_id_res {
-				return Err(<Error<T>>::NoAvailableCollectionId.into());
-			}
 
-			let unique_collection_id = collection_id_res?;
-			let rmrk_collection_id = <CollectionIndex<T>>::get();
-
 			<CollectionIndex<T>>::mutate(|n| *n += 1);
-			<CollectionIndexMap<T>>::insert(rmrk_collection_id, unique_collection_id);
 
-			<PalletCommon<T>>::set_scoped_collection_properties(
-				unique_collection_id,
-				PropertyScope::Rmrk,
+			let unique_collection_id = Self::init_collection(
+				T::CrossAccountId::from_sub(sender.clone()),
+				data,
 				[
 					Self::rmrk_property(Metadata, &metadata)?,
 					Self::rmrk_property(CollectionType, &misc::CollectionType::Regular)?,
 				]
 				.into_iter(),
-			)?;
+			)?; //collection_id_res?;
+			let rmrk_collection_id = <CollectionIndex<T>>::get();
+
+			<CollectionIndexMap<T>>::insert(rmrk_collection_id, unique_collection_id);
 
 			Self::deposit_event(Event::CollectionCreated {
 				issuer: sender,
@@ -290,13 +288,26 @@
 				&sender,
 				&cross_owner,
 				&collection,
-				NftType::Regular,
 				[
+					Self::rmrk_property(TokenType, &NftType::Regular)?,
 					Self::rmrk_property(RoyaltyInfo, &royalty_info)?,
 					Self::rmrk_property(Metadata, &metadata)?,
 					Self::rmrk_property(Equipped, &false)?,
-					Self::rmrk_property(ResourceCollection, &None::<CollectionId>)?,
-					Self::rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?,
+					Self::rmrk_property(
+						ResourceCollection,
+						&Self::init_collection(
+							sender.clone(),
+							CreateCollectionData {
+								..Default::default()
+							},
+							[Self::rmrk_property(
+								CollectionType,
+								&misc::CollectionType::Resource,
+							)?]
+							.into_iter(),
+						)?,
+					)?, // todo possibly add limits to the collection if rmrk warrants them
+					Self::rmrk_property(ResourcePriorities, &<Vec<u8>>::new())?, // todo create resource priorities?
 				]
 				.into_iter(),
 			)
@@ -392,6 +403,107 @@
 
 			Ok(())
 		}
+
+		#[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+		#[transactional]
+		pub fn add_basic_resource(
+			origin: OriginFor<T>,
+			collection_id: RmrkCollectionId,
+			nft_id: RmrkNftId,
+			resource: RmrkBasicResource,
+		) -> DispatchResult {
+			let sender = ensure_signed(origin.clone())?;
+
+			let resource_id = Self::resource_add(
+				sender,
+				Self::unique_collection_id(collection_id)?,
+				nft_id.into(),
+				[
+					Self::rmrk_property(TokenType, &NftType::Resource)?,
+					Self::rmrk_property(ResourceType, &misc::ResourceType::Basic)?,
+					Self::rmrk_property(Src, &resource.src)?,
+					Self::rmrk_property(Metadata, &resource.metadata)?,
+					Self::rmrk_property(License, &resource.license)?,
+					Self::rmrk_property(Thumb, &resource.thumb)?,
+				]
+				.into_iter(),
+			)?;
+
+			Self::deposit_event(Event::ResourceAdded {
+				nft_id,
+				resource_id,
+			});
+			Ok(())
+		}
+
+		#[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+		#[transactional]
+		pub fn add_composable_resource(
+			origin: OriginFor<T>,
+			collection_id: RmrkCollectionId,
+			nft_id: RmrkNftId,
+			_resource_id: RmrkBoundedResource,
+			resource: RmrkComposableResource,
+		) -> DispatchResult {
+			let sender = ensure_signed(origin.clone())?;
+
+			let resource_id = Self::resource_add(
+				sender,
+				Self::unique_collection_id(collection_id)?,
+				nft_id.into(),
+				[
+					Self::rmrk_property(TokenType, &NftType::Resource)?,
+					Self::rmrk_property(ResourceType, &misc::ResourceType::Composable)?,
+					Self::rmrk_property(Parts, &resource.parts)?,
+					Self::rmrk_property(Base, &resource.base)?,
+					Self::rmrk_property(Src, &resource.src)?,
+					Self::rmrk_property(Metadata, &resource.metadata)?,
+					Self::rmrk_property(License, &resource.license)?,
+					Self::rmrk_property(Thumb, &resource.thumb)?,
+				]
+				.into_iter(),
+			)?;
+
+			Self::deposit_event(Event::ResourceAdded {
+				nft_id,
+				resource_id,
+			});
+			Ok(())
+		}
+
+		#[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+		#[transactional]
+		pub fn add_slot_resource(
+			origin: OriginFor<T>,
+			collection_id: RmrkCollectionId,
+			nft_id: RmrkNftId,
+			resource: RmrkSlotResource,
+		) -> DispatchResult {
+			let sender = ensure_signed(origin.clone())?;
+
+			let resource_id = Self::resource_add(
+				sender,
+				Self::unique_collection_id(collection_id)?,
+				nft_id.into(),
+				[
+					Self::rmrk_property(TokenType, &NftType::Resource)?,
+					Self::rmrk_property(ResourceType, &misc::ResourceType::Slot)?,
+					Self::rmrk_property(Base, &resource.base)?,
+					Self::rmrk_property(Src, &resource.src)?,
+					Self::rmrk_property(Metadata, &resource.metadata)?,
+					Self::rmrk_property(Slot, &resource.slot)?,
+					Self::rmrk_property(License, &resource.license)?,
+					Self::rmrk_property(Thumb, &resource.thumb)?,
+				]
+				.into_iter(),
+			)?;
+
+			Self::deposit_event(Event::ResourceAdded {
+				nft_id,
+				resource_id,
+			});
+			Ok(())
+		}
 	}
 }
 
@@ -422,14 +534,32 @@
 		Ok(property)
 	}
 
+	fn init_collection(
+		sender: T::CrossAccountId,
+		data: CreateCollectionData<T::AccountId>,
+		properties: impl Iterator<Item = Property>,
+	) -> Result<CollectionId, DispatchError> {
+		let collection_id = <PalletNft<T>>::init_collection(sender, data);
+
+		if let Err(DispatchError::Arithmetic(_)) = &collection_id {
+			return Err(<Error<T>>::NoAvailableCollectionId.into());
+		}
+
+		<PalletCommon<T>>::set_scoped_collection_properties(
+			collection_id?,
+			PropertyScope::Rmrk,
+			properties,
+		)?;
+
+		collection_id
+	}
+
 	pub fn create_nft(
 		sender: &T::CrossAccountId,
 		owner: &T::CrossAccountId,
 		collection: &NonfungibleHandle<T>,
-		nft_type: NftType,
 		properties: impl Iterator<Item = Property>,
 	) -> Result<TokenId, DispatchError> {
-		todo!("store nft type");
 		let data = CreateNftExData {
 			properties: BoundedVec::default(),
 			owner: owner.clone(),
@@ -465,6 +595,57 @@
 		Ok(())
 	}
 
+	fn resource_add(
+		sender: T::AccountId,
+		collection_id: CollectionId,
+		token_id: TokenId,
+		resource_properties: impl Iterator<Item = Property>,
+	) -> Result<RmrkResourceId, DispatchError> {
+		let collection =
+			Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?;
+		ensure!(collection.owner == sender, Error::<T>::NoPermission);
+
+		// Check NFT lock status // todo depends on market, maybe later
+		//ensure!(!Pallet::<T>::is_locked(collection_id, nft_id), pallet_uniques::Error::<T>::Locked);
+
+		let sender = T::CrossAccountId::from_sub(sender);
+		let budget = budget::Value::new(10);
+		let pending = <PalletStructure<T>>::check_indirectly_owned(
+			sender.clone(),
+			collection_id,
+			token_id,
+			None,
+			&budget,
+		)?;
+
+		let resource_collection_id: CollectionId =
+			Self::get_nft_property(collection_id, token_id, ResourceCollection)?
+				.decode_or_default();
+		let resource_collection =
+			Self::get_typed_nft_collection(resource_collection_id, misc::CollectionType::Resource)?;
+
+		// todo probably add extra connections to bases, slots, etc., when RMRK starts to use them
+
+		let resource_id = Self::create_nft(
+			&sender, // todo owner of the nft?
+			&sender,
+			&resource_collection,
+			resource_properties.chain(
+				[
+					Self::rmrk_property(PendingResourceAccept, &pending)?,
+					Self::rmrk_property(PendingResourceRemoval, &false)?,
+				]
+				.into_iter(),
+			),
+		)
+		.map_err(|err| match err {
+			DispatchError::Arithmetic(_) => <Error<T>>::NoAvailableNftId.into(),
+			err => Self::map_common_err_to_proxy(err),
+		})?;
+
+		Ok(resource_id.0)
+	}
+
 	fn change_collection_owner(
 		collection_id: CollectionId,
 		collection_type: misc::CollectionType,
@@ -493,8 +674,11 @@
 		<CollectionIndex<T>>::get()
 	}
 
-	pub fn unique_collection_id(rmrk_collection_id: RmrkCollectionId) -> Result<CollectionId, DispatchError> {
-		<CollectionIndexMap<T>>::try_get(rmrk_collection_id).map_err(|_| <Error<T>>::CollectionUnknown.into())
+	pub fn unique_collection_id(
+		rmrk_collection_id: RmrkCollectionId,
+	) -> Result<CollectionId, DispatchError> {
+		<CollectionIndexMap<T>>::try_get(rmrk_collection_id)
+			.map_err(|_| <Error<T>>::CollectionUnknown.into())
 	}
 
 	pub fn get_nft_collection(
@@ -513,10 +697,6 @@
 		<CollectionHandle<T>>::try_get(collection_id).is_ok()
 	}
 
-	pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool {
-		<TokenData<T>>::contains_key((collection_id, nft_id))
-	}
-
 	pub fn get_collection_property(
 		collection_id: CollectionId,
 		key: RmrkProperty,
@@ -553,6 +733,15 @@
 		Ok(())
 	}
 
+	pub fn get_typed_nft_collection(
+		collection_id: CollectionId,
+		collection_type: misc::CollectionType,
+	) -> Result<NonfungibleHandle<T>, DispatchError> {
+		Self::ensure_collection_type(collection_id, collection_type)?;
+
+		Self::get_nft_collection(collection_id)
+	}
+
 	pub fn get_nft_property(
 		collection_id: CollectionId,
 		nft_id: TokenId,
@@ -560,17 +749,23 @@
 	) -> Result<PropertyValue, DispatchError> {
 		let nft_property = <PalletNft<T>>::token_properties((collection_id, nft_id))
 			.get(&Self::rmrk_property_key(key)?)
-			.ok_or(<Error<T>>::NoAvailableNftId)?
+			.ok_or(<Error<T>>::NoAvailableNftId)? // todo replace with better error
 			.clone();
 
 		Ok(nft_property)
 	}
 
+	pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool {
+		<TokenData<T>>::contains_key((collection_id, nft_id))
+	}
+
 	pub fn get_nft_type(
-		_collection_id: CollectionId,
-		_token_id: TokenId,
+		collection_id: CollectionId,
+		token_id: TokenId,
 	) -> Result<NftType, DispatchError> {
-		todo!("should get it from properties?")
+		Ok(Self::get_nft_property(collection_id, token_id, TokenType)?.decode_or_default())
+		// todo throw error
+		// NftTypeEncodeError?
 	}
 
 	pub fn ensure_nft_type(
@@ -673,15 +868,6 @@
 		});
 
 		Ok(properties)
-	}
-
-	pub fn get_typed_nft_collection(
-		collection_id: CollectionId,
-		collection_type: misc::CollectionType,
-	) -> Result<NonfungibleHandle<T>, DispatchError> {
-		Self::ensure_collection_type(collection_id, collection_type)?;
-
-		Self::get_nft_collection(collection_id)
 	}
 
 	fn map_common_err_to_proxy(err: DispatchError) -> DispatchError {
modifiedpallets/proxy-rmrk-core/src/misc.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/src/misc.rs
+++ b/pallets/proxy-rmrk-core/src/misc.rs
@@ -18,6 +18,7 @@
 	fn decode_or_default(&self) -> T;
 }
 
+// todo fail if unwrap doesn't work
 impl<T: Decode + Default, S> RmrkDecode<T, S> for BoundedVec<u8, S> {
 	fn decode_or_default(&self) -> T {
 		let mut value = self.as_slice();
@@ -30,6 +31,7 @@
 	fn rebind(&self) -> BoundedVec<u8, S>;
 }
 
+// todo fail if unwrap doesn't work
 impl<T, S> RmrkRebind<T, S> for BoundedVec<u8, T>
 where
 	BoundedVec<u8, S>: TryFrom<Vec<u8>>,
@@ -46,11 +48,22 @@
 	Base,
 }
 
-#[derive(Encode, Decode, PartialEq, Eq)]
+// todo remove default?
+#[derive(Encode, Decode, PartialEq, Eq, Default)]
 pub enum NftType {
+	#[default]
 	Regular,
 	Resource,
 	FixedPart,
 	SlotPart,
 	Theme,
 }
+
+// todo remove default?
+#[derive(Encode, Decode, PartialEq, Eq, Default)]
+pub enum ResourceType {
+	#[default]
+	Basic,
+	Composable,
+	Slot,
+}
modifiedpallets/proxy-rmrk-core/src/property.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/src/property.rs
+++ b/pallets/proxy-rmrk-core/src/property.rs
@@ -4,6 +4,7 @@
 pub enum RmrkProperty<'r> {
 	Metadata,
 	CollectionType,
+	TokenType,
 	RoyaltyInfo,
 	Equipped,
 	ResourceCollection,
@@ -47,6 +48,7 @@
 		match self {
 			Self::Metadata => key!("metadata"),
 			Self::CollectionType => key!("collection-type"),
+			Self::TokenType => key!("token-type"),
 			Self::RoyaltyInfo => key!("royalty-info"),
 			Self::Equipped => key!("equipped"),
 			Self::ResourceCollection => key!("resource-collection"),
modifiedpallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-equip/src/lib.rs
+++ b/pallets/proxy-rmrk-equip/src/lib.rs
@@ -166,8 +166,8 @@
 				&sender,
 				owner,
 				&collection,
-				NftType::Theme,
 				[
+					<PalletCore<T>>::rmrk_property(TokenType, &NftType::Theme)?,
 					<PalletCore<T>>::rmrk_property(ThemeName, &theme.name)?,
 					<PalletCore<T>>::rmrk_property(ThemeInherit, &theme.inherit)?,
 				]
@@ -212,8 +212,8 @@
 			sender,
 			owner,
 			collection,
-			nft_type,
 			[
+				<PalletCore<T>>::rmrk_property(TokenType, &nft_type)?,
 				<PalletCore<T>>::rmrk_property(Src, &src)?,
 				<PalletCore<T>>::rmrk_property(ZIndex, &z_index)?,
 			]
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
before · primitives/data-structs/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#![cfg_attr(not(feature = "std"), no_std)]1819use core::{20	convert::{TryFrom, TryInto},21	fmt,22};23use frame_support::{24	storage::{bounded_btree_map::BoundedBTreeMap, bounded_btree_set::BoundedBTreeSet},25	traits::Get,26	parameter_types,27};2829#[cfg(feature = "serde")]30use serde::{Serialize, Deserialize};3132use sp_core::U256;33use sp_runtime::{ArithmeticError, sp_std::prelude::Vec, Permill};34use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};35use frame_support::{BoundedVec, traits::ConstU32};36use derivative::Derivative;37use scale_info::TypeInfo;3839pub mod rmrk;4041// RMRK42use rmrk::{43	CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme, ThemeProperty,44};45pub use rmrk::{46	primitives::{47		CollectionId as RmrkCollectionId, NftId as RmrkNftId, BaseId as RmrkBaseId,48		PartId as RmrkPartId, ResourceId as RmrkResourceId,49	},50	NftChild as RmrkNftChild, AccountIdOrCollectionNftTuple as RmrkAccountIdOrCollectionNftTuple,51	FixedPart as RmrkFixedPart, SlotPart as RmrkSlotPart, EquippableList as RmrkEquippableList,52	BasicResource as RmrkBasicResource, ComposableResource as RmrkComposableResource,53	SlotResource as RmrkSlotResource,54};5556mod bounded;57pub mod budget;58pub mod mapping;59mod migration;6061pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;62pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000;63pub const MAX_SPONSOR_TIMEOUT: u32 = 10_368_000;6465pub const MAX_TOKEN_OWNERSHIP: u32 = if cfg!(not(feature = "limit-testing")) {66	100_00067} else {68	1069};70pub const COLLECTION_NUMBER_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) {71	100_00072} else {73	1074};75pub const CUSTOM_DATA_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) {76	204877} else {78	1079};80pub const COLLECTION_ADMINS_LIMIT: u32 = 5;81pub const COLLECTION_TOKEN_LIMIT: u32 = u32::MAX;82pub const ACCOUNT_TOKEN_OWNERSHIP_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) {83	1_000_00084} else {85	1086};8788// Timeouts for item types in passed blocks89pub const NFT_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;90pub const FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;91pub const REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;9293pub const SPONSOR_APPROVE_TIMEOUT: u32 = 5;9495// Schema limits96pub const OFFCHAIN_SCHEMA_LIMIT: u32 = 8192;97pub const VARIABLE_ON_CHAIN_SCHEMA_LIMIT: u32 = 8192;98pub const CONST_ON_CHAIN_SCHEMA_LIMIT: u32 = 32768;99100pub const COLLECTION_FIELD_LIMIT: u32 = CONST_ON_CHAIN_SCHEMA_LIMIT;101102pub const MAX_COLLECTION_NAME_LENGTH: u32 = 64;103pub const MAX_COLLECTION_DESCRIPTION_LENGTH: u32 = 256;104pub const MAX_TOKEN_PREFIX_LENGTH: u32 = 16;105106pub const MAX_PROPERTY_KEY_LENGTH: u32 = 256;107pub const MAX_PROPERTY_VALUE_LENGTH: u32 = 32768;108pub const MAX_PROPERTIES_PER_ITEM: u32 = 64;109110pub const MAX_COLLECTION_PROPERTIES_SIZE: u32 = 40960;111pub const MAX_TOKEN_PROPERTIES_SIZE: u32 = 32768;112113// RMRK constants114pub const RMRK_STRING_LIMIT: u32 = 128;115pub const RMRK_COLLECTION_SYMBOL_LIMIT: u32 = 100;116pub const RMRK_RESOURCE_SYMBOL_LIMIT: u32 = 10;117pub const RMRK_KEY_LIMIT: u32 = 32;118pub const RMRK_VALUE_LIMIT: u32 = 256;119120/// How much items can be created per single121/// create_many call122pub const MAX_ITEMS_PER_BATCH: u32 = 200;123124pub type CustomDataLimit = ConstU32<CUSTOM_DATA_LIMIT>;125126#[derive(127	Encode,128	Decode,129	PartialEq,130	Eq,131	PartialOrd,132	Ord,133	Clone,134	Copy,135	Debug,136	Default,137	TypeInfo,138	MaxEncodedLen,139)]140#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]141pub struct CollectionId(pub u32);142impl EncodeLike<u32> for CollectionId {}143impl EncodeLike<CollectionId> for u32 {}144145#[derive(146	Encode,147	Decode,148	PartialEq,149	Eq,150	PartialOrd,151	Ord,152	Clone,153	Copy,154	Debug,155	Default,156	TypeInfo,157	MaxEncodedLen,158)]159#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]160pub struct TokenId(pub u32);161impl EncodeLike<u32> for TokenId {}162impl EncodeLike<TokenId> for u32 {}163164impl TokenId {165	pub fn try_next(self) -> Result<TokenId, ArithmeticError> {166		self.0167			.checked_add(1)168			.ok_or(ArithmeticError::Overflow)169			.map(Self)170	}171}172173impl From<TokenId> for U256 {174	fn from(t: TokenId) -> Self {175		t.0.into()176	}177}178179impl TryFrom<U256> for TokenId {180	type Error = &'static str;181182	fn try_from(value: U256) -> Result<Self, Self::Error> {183		Ok(TokenId(value.try_into().map_err(|_| "too large token id")?))184	}185}186187#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]188#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]189pub struct TokenData<CrossAccountId> {190	pub properties: Vec<Property>,191	pub owner: Option<CrossAccountId>,192}193194pub struct OverflowError;195impl From<OverflowError> for &'static str {196	fn from(_: OverflowError) -> Self {197		"overflow occured"198	}199}200201pub type DecimalPoints = u8;202203#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]204#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]205pub enum CollectionMode {206	NFT,207	// decimal points208	Fungible(DecimalPoints),209	ReFungible,210}211212impl CollectionMode {213	pub fn id(&self) -> u8 {214		match self {215			CollectionMode::NFT => 1,216			CollectionMode::Fungible(_) => 2,217			CollectionMode::ReFungible => 3,218		}219	}220}221222pub trait SponsoringResolve<AccountId, Call> {223	fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>;224}225226#[derive(Encode, Decode, Eq, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]227#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]228pub enum AccessMode {229	Normal,230	AllowList,231}232impl Default for AccessMode {233	fn default() -> Self {234		Self::Normal235	}236}237238#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]239#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]240pub enum SchemaVersion {241	ImageURL,242	Unique,243}244impl Default for SchemaVersion {245	fn default() -> Self {246		Self::ImageURL247	}248}249250#[derive(Encode, Decode, Default, Debug, Clone, PartialEq, TypeInfo)]251#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]252pub struct Ownership<AccountId> {253	pub owner: AccountId,254	pub fraction: u128,255}256257#[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]258#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]259pub enum SponsorshipState<AccountId> {260	/// The fees are applied to the transaction sender261	Disabled,262	Unconfirmed(AccountId),263	/// Transactions are sponsored by specified account264	Confirmed(AccountId),265}266267impl<AccountId> SponsorshipState<AccountId> {268	pub fn sponsor(&self) -> Option<&AccountId> {269		match self {270			Self::Confirmed(sponsor) => Some(sponsor),271			_ => None,272		}273	}274275	pub fn pending_sponsor(&self) -> Option<&AccountId> {276		match self {277			Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),278			_ => None,279		}280	}281282	pub fn confirmed(&self) -> bool {283		matches!(self, Self::Confirmed(_))284	}285}286287impl<T> Default for SponsorshipState<T> {288	fn default() -> Self {289		Self::Disabled290	}291}292293/// Used in storage294#[struct_versioning::versioned(version = 2, upper)]295#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)]296pub struct Collection<AccountId> {297	pub owner: AccountId,298	pub mode: CollectionMode,299	#[version(..2)]300	pub access: AccessMode,301	pub name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,302	pub description: BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>,303	pub token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,304305	#[version(..2)]306	pub mint_mode: bool,307308	#[version(..2)]309	pub offchain_schema: BoundedVec<u8, ConstU32<OFFCHAIN_SCHEMA_LIMIT>>,310311	#[version(..2)]312	pub schema_version: SchemaVersion,313	pub sponsorship: SponsorshipState<AccountId>,314315	pub limits: CollectionLimits,316317	#[version(2.., upper(Default::default()))]318	pub permissions: CollectionPermissions,319320	#[version(..2)]321	pub variable_on_chain_schema: BoundedVec<u8, ConstU32<VARIABLE_ON_CHAIN_SCHEMA_LIMIT>>,322323	#[version(..2)]324	pub const_on_chain_schema: BoundedVec<u8, ConstU32<CONST_ON_CHAIN_SCHEMA_LIMIT>>,325326	#[version(..2)]327	pub meta_update_permission: MetaUpdatePermission,328}329330/// Used in RPC calls331#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]332#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]333pub struct RpcCollection<AccountId> {334	pub owner: AccountId,335	pub mode: CollectionMode,336	pub name: Vec<u16>,337	pub description: Vec<u16>,338	pub token_prefix: Vec<u8>,339	pub sponsorship: SponsorshipState<AccountId>,340	pub limits: CollectionLimits,341	pub permissions: CollectionPermissions,342	pub token_property_permissions: Vec<PropertyKeyPermission>,343	pub properties: Vec<Property>,344}345346#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)]347#[derivative(Debug, Default(bound = ""))]348pub struct CreateCollectionData<AccountId> {349	#[derivative(Default(value = "CollectionMode::NFT"))]350	pub mode: CollectionMode,351	pub access: Option<AccessMode>,352	pub name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,353	pub description: BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>,354	pub token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,355	pub pending_sponsor: Option<AccountId>,356	pub limits: Option<CollectionLimits>,357	pub permissions: Option<CollectionPermissions>,358	pub token_property_permissions: CollectionPropertiesPermissionsVec,359	pub properties: CollectionPropertiesVec,360}361362pub type CollectionPropertiesPermissionsVec =363	BoundedVec<PropertyKeyPermission, ConstU32<MAX_PROPERTIES_PER_ITEM>>;364365pub type CollectionPropertiesVec = BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;366367/// All fields are wrapped in `Option`s, where None means chain default368// When adding/removing fields from this struct - don't forget to also update clamp_limits369#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]370#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]371pub struct CollectionLimits {372	pub account_token_ownership_limit: Option<u32>,373	pub sponsored_data_size: Option<u32>,374375	/// FIXME should we delete this or repurpose it?376	/// None - setVariableMetadata is not sponsored377	/// Some(v) - setVariableMetadata is sponsored378	///           if there is v block between txs379	pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,380	pub token_limit: Option<u32>,381382	// Timeouts for item types in passed blocks383	pub sponsor_transfer_timeout: Option<u32>,384	pub sponsor_approve_timeout: Option<u32>,385	pub owner_can_transfer: Option<bool>,386	pub owner_can_destroy: Option<bool>,387	pub transfers_enabled: Option<bool>,388}389390impl CollectionLimits {391	pub fn account_token_ownership_limit(&self) -> u32 {392		self.account_token_ownership_limit393			.unwrap_or(ACCOUNT_TOKEN_OWNERSHIP_LIMIT)394			.min(MAX_TOKEN_OWNERSHIP)395	}396	pub fn sponsored_data_size(&self) -> u32 {397		self.sponsored_data_size398			.unwrap_or(CUSTOM_DATA_LIMIT)399			.min(CUSTOM_DATA_LIMIT)400	}401	pub fn token_limit(&self) -> u32 {402		self.token_limit403			.unwrap_or(COLLECTION_TOKEN_LIMIT)404			.min(COLLECTION_TOKEN_LIMIT)405	}406	pub fn sponsor_transfer_timeout(&self, default: u32) -> u32 {407		self.sponsor_transfer_timeout408			.unwrap_or(default)409			.min(MAX_SPONSOR_TIMEOUT)410	}411	pub fn sponsor_approve_timeout(&self) -> u32 {412		self.sponsor_approve_timeout413			.unwrap_or(SPONSOR_APPROVE_TIMEOUT)414			.min(MAX_SPONSOR_TIMEOUT)415	}416	pub fn owner_can_transfer(&self) -> bool {417		self.owner_can_transfer.unwrap_or(true)418	}419	pub fn owner_can_destroy(&self) -> bool {420		self.owner_can_destroy.unwrap_or(true)421	}422	pub fn transfers_enabled(&self) -> bool {423		self.transfers_enabled.unwrap_or(true)424	}425	pub fn sponsored_data_rate_limit(&self) -> Option<u32> {426		match self427			.sponsored_data_rate_limit428			.unwrap_or(SponsoringRateLimit::SponsoringDisabled)429		{430			SponsoringRateLimit::SponsoringDisabled => None,431			SponsoringRateLimit::Blocks(v) => Some(v.min(MAX_SPONSOR_TIMEOUT)),432		}433	}434}435436// When adding/removing fields from this struct - don't forget to also update clamp_limits437#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]438#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]439pub struct CollectionPermissions {440	pub access: Option<AccessMode>,441	pub mint_mode: Option<bool>,442	pub nesting: Option<NestingRule>,443}444445impl CollectionPermissions {446	pub fn access(&self) -> AccessMode {447		self.access.unwrap_or(AccessMode::Normal)448	}449	pub fn mint_mode(&self) -> bool {450		self.mint_mode.unwrap_or(false)451	}452	pub fn nesting(&self) -> &NestingRule {453		static DEFAULT: NestingRule = NestingRule::Disabled;454		self.nesting.as_ref().unwrap_or(&DEFAULT)455	}456}457458#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]459#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]460#[derivative(Debug)]461pub enum NestingRule {462	/// No one can nest tokens463	Disabled,464	/// Owner can nest any tokens465	Owner,466	/// Owner can nest tokens from specified collections467	OwnerRestricted(468		#[cfg_attr(feature = "serde1", serde(with = "bounded::set_serde"))]469		#[derivative(Debug(format_with = "bounded::set_debug"))]470		BoundedBTreeSet<CollectionId, ConstU32<16>>,471	),472	/// Used for tests473	Permissive,474}475476#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]477#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]478pub enum SponsoringRateLimit {479	SponsoringDisabled,480	Blocks(u32),481}482483#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]484#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]485#[derivative(Debug)]486pub struct CreateNftData {487	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]488	#[derivative(Debug(format_with = "bounded::vec_debug"))]489	pub properties: CollectionPropertiesVec,490}491492#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]493#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]494pub struct CreateFungibleData {495	pub value: u128,496}497498#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]499#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]500#[derivative(Debug)]501pub struct CreateReFungibleData {502	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]503	#[derivative(Debug(format_with = "bounded::vec_debug"))]504	pub const_data: BoundedVec<u8, CustomDataLimit>,505	pub pieces: u128,506}507508#[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]509#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]510pub enum MetaUpdatePermission {511	ItemOwner,512	Admin,513	None,514}515516#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]517#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]518pub enum CreateItemData {519	NFT(CreateNftData),520	Fungible(CreateFungibleData),521	ReFungible(CreateReFungibleData),522}523524#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]525#[derivative(Debug)]526pub struct CreateNftExData<CrossAccountId> {527	#[derivative(Debug(format_with = "bounded::vec_debug"))]528	pub properties: CollectionPropertiesVec,529	pub owner: CrossAccountId,530}531532#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]533#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]534pub struct CreateRefungibleExData<CrossAccountId> {535	#[derivative(Debug(format_with = "bounded::vec_debug"))]536	pub const_data: BoundedVec<u8, CustomDataLimit>,537	#[derivative(Debug(format_with = "bounded::map_debug"))]538	pub users: BoundedBTreeMap<CrossAccountId, u128, ConstU32<MAX_ITEMS_PER_BATCH>>,539}540541#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]542#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]543pub enum CreateItemExData<CrossAccountId> {544	NFT(545		#[derivative(Debug(format_with = "bounded::vec_debug"))]546		BoundedVec<CreateNftExData<CrossAccountId>, ConstU32<MAX_ITEMS_PER_BATCH>>,547	),548	Fungible(549		#[derivative(Debug(format_with = "bounded::map_debug"))]550		BoundedBTreeMap<CrossAccountId, u128, ConstU32<MAX_ITEMS_PER_BATCH>>,551	),552	/// Many tokens, each may have only one owner553	RefungibleMultipleItems(554		#[derivative(Debug(format_with = "bounded::vec_debug"))]555		BoundedVec<CreateRefungibleExData<CrossAccountId>, ConstU32<MAX_ITEMS_PER_BATCH>>,556	),557	/// Single token, which may have many owners558	RefungibleMultipleOwners(CreateRefungibleExData<CrossAccountId>),559}560561impl CreateItemData {562	pub fn data_size(&self) -> usize {563		match self {564			CreateItemData::ReFungible(data) => data.const_data.len(),565			_ => 0,566		}567	}568}569570impl From<CreateNftData> for CreateItemData {571	fn from(item: CreateNftData) -> Self {572		CreateItemData::NFT(item)573	}574}575576impl From<CreateReFungibleData> for CreateItemData {577	fn from(item: CreateReFungibleData) -> Self {578		CreateItemData::ReFungible(item)579	}580}581582impl From<CreateFungibleData> for CreateItemData {583	fn from(item: CreateFungibleData) -> Self {584		CreateItemData::Fungible(item)585	}586}587588#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]589#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]590// todo possibly rename to be used generally as an address pair591pub struct TokenChild {592	pub token: TokenId,593	pub collection: CollectionId,594}595596#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]597#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]598pub struct CollectionStats {599	pub created: u32,600	pub destroyed: u32,601	pub alive: u32,602}603604#[derive(Encode, Decode, Clone, Debug)]605#[cfg_attr(feature = "std", derive(PartialEq))]606pub struct PhantomType<T>(core::marker::PhantomData<T>);607608impl<T: TypeInfo + 'static> TypeInfo for PhantomType<T> {609	type Identity = PhantomType<T>;610611	fn type_info() -> scale_info::Type {612		use scale_info::{613			Type, Path,614			build::{FieldsBuilder, UnnamedFields},615			type_params,616		};617		Type::builder()618			.path(Path::new("up_data_structs", "PhantomType"))619			.type_params(type_params!(T))620			.composite(<FieldsBuilder<UnnamedFields>>::default().field(|b| b.ty::<[T; 0]>()))621	}622}623impl<T> MaxEncodedLen for PhantomType<T> {624	fn max_encoded_len() -> usize {625		0626	}627}628629pub type PropertyKey = BoundedVec<u8, ConstU32<MAX_PROPERTY_KEY_LENGTH>>;630pub type PropertyValue = BoundedVec<u8, ConstU32<MAX_PROPERTY_VALUE_LENGTH>>;631632#[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen, PartialEq, Clone)]633#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]634pub struct PropertyPermission {635	pub mutable: bool,636	pub collection_admin: bool,637	pub token_owner: bool,638}639640impl PropertyPermission {641	pub fn none() -> Self {642		Self {643			mutable: true,644			collection_admin: false,645			token_owner: false,646		}647	}648}649650#[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, MaxEncodedLen)]651#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]652pub struct Property {653	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]654	pub key: PropertyKey,655656	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]657	pub value: PropertyValue,658}659660impl Into<(PropertyKey, PropertyValue)> for Property {661	fn into(self) -> (PropertyKey, PropertyValue) {662		(self.key, self.value)663	}664}665666#[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen, PartialEq, Clone)]667#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]668pub struct PropertyKeyPermission {669	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]670	pub key: PropertyKey,671672	pub permission: PropertyPermission,673}674675impl Into<(PropertyKey, PropertyPermission)> for PropertyKeyPermission {676	fn into(self) -> (PropertyKey, PropertyPermission) {677		(self.key, self.permission)678	}679}680681#[derive(Debug)]682pub enum PropertiesError {683	NoSpaceForProperty,684	PropertyLimitReached,685	InvalidCharacterInPropertyKey,686	PropertyKeyIsTooLong,687	EmptyPropertyKey,688}689690#[derive(Clone, Copy)]691pub enum PropertyScope {692	None,693	Rmrk,694}695696impl PropertyScope {697	pub fn apply(self, key: PropertyKey) -> Result<PropertyKey, PropertiesError> {698		let scope_str: &[u8] = match self {699			Self::None => return Ok(key),700			Self::Rmrk => b"rmrk",701		};702703		[scope_str, b":", key.as_slice()]704			.concat()705			.try_into()706			.map_err(|_| PropertiesError::PropertyKeyIsTooLong)707	}708}709710pub trait TrySetProperty: Sized {711	type Value;712713	fn try_scoped_set(714		&mut self,715		scope: PropertyScope,716		key: PropertyKey,717		value: Self::Value,718	) -> Result<(), PropertiesError>;719720	fn try_scoped_set_from_iter<I, KV>(721		&mut self,722		scope: PropertyScope,723		iter: I,724	) -> Result<(), PropertiesError>725	where726		I: Iterator<Item = KV>,727		KV: Into<(PropertyKey, Self::Value)>,728	{729		for kv in iter {730			let (key, value) = kv.into();731			self.try_scoped_set(scope, key, value)?;732		}733734		Ok(())735	}736737	fn try_set(&mut self, key: PropertyKey, value: Self::Value) -> Result<(), PropertiesError> {738		self.try_scoped_set(PropertyScope::None, key, value)739	}740741	fn try_set_from_iter<I, KV>(&mut self, iter: I) -> Result<(), PropertiesError>742	where743		I: Iterator<Item = KV>,744		KV: Into<(PropertyKey, Self::Value)>,745	{746		self.try_scoped_set_from_iter(PropertyScope::None, iter)747	}748}749750#[derive(Encode, Decode, TypeInfo, Derivative, Clone, PartialEq, MaxEncodedLen)]751#[derivative(Default(bound = ""))]752pub struct PropertiesMap<Value>(753	BoundedBTreeMap<PropertyKey, Value, ConstU32<MAX_PROPERTIES_PER_ITEM>>,754);755756impl<Value> PropertiesMap<Value> {757	pub fn new() -> Self {758		Self(BoundedBTreeMap::new())759	}760761	pub fn remove(&mut self, key: &PropertyKey) -> Result<Option<Value>, PropertiesError> {762		Self::check_property_key(key)?;763764		Ok(self.0.remove(key))765	}766767	pub fn get(&self, key: &PropertyKey) -> Option<&Value> {768		self.0.get(key)769	}770771	pub fn contains_key(&self, key: &PropertyKey) -> bool {772		self.0.contains_key(key)773	}774775	fn check_property_key(key: &PropertyKey) -> Result<(), PropertiesError> {776		if key.is_empty() {777			return Err(PropertiesError::EmptyPropertyKey);778		}779780		for byte in key.as_slice().iter() {781			let byte = *byte;782783			if !byte.is_ascii_alphanumeric() && byte != b'_' && byte != b'-' {784				return Err(PropertiesError::InvalidCharacterInPropertyKey);785			}786		}787788		Ok(())789	}790}791792impl<Value> IntoIterator for PropertiesMap<Value> {793	type Item = (PropertyKey, Value);794	type IntoIter = <795		BoundedBTreeMap<796			PropertyKey,797			Value,798			ConstU32<MAX_PROPERTIES_PER_ITEM>799		> as IntoIterator800	>::IntoIter;801802	fn into_iter(self) -> Self::IntoIter {803		self.0.into_iter()804	}805}806807impl<Value> TrySetProperty for PropertiesMap<Value> {808	type Value = Value;809810	fn try_scoped_set(811		&mut self,812		scope: PropertyScope,813		key: PropertyKey,814		value: Self::Value,815	) -> Result<(), PropertiesError> {816		Self::check_property_key(&key)?;817818		let key = scope.apply(key)?;819		self.0820			.try_insert(key, value)821			.map_err(|_| PropertiesError::PropertyLimitReached)?;822823		Ok(())824	}825}826827pub type PropertiesPermissionMap = PropertiesMap<PropertyPermission>;828829#[derive(Encode, Decode, TypeInfo, Clone, PartialEq, MaxEncodedLen)]830pub struct Properties {831	map: PropertiesMap<PropertyValue>,832	consumed_space: u32,833	space_limit: u32,834}835836impl Properties {837	pub fn new(space_limit: u32) -> Self {838		Self {839			map: PropertiesMap::new(),840			consumed_space: 0,841			space_limit,842		}843	}844845	pub fn remove(&mut self, key: &PropertyKey) -> Result<Option<PropertyValue>, PropertiesError> {846		let value = self.map.remove(key)?;847848		if let Some(ref value) = value {849			let value_len = value.len() as u32;850			self.consumed_space -= value_len;851		}852853		Ok(value)854	}855856	pub fn get(&self, key: &PropertyKey) -> Option<&PropertyValue> {857		self.map.get(key)858	}859}860861impl IntoIterator for Properties {862	type Item = (PropertyKey, PropertyValue);863	type IntoIter = <PropertiesMap<PropertyValue> as IntoIterator>::IntoIter;864865	fn into_iter(self) -> Self::IntoIter {866		self.map.into_iter()867	}868}869870impl TrySetProperty for Properties {871	type Value = PropertyValue;872873	fn try_scoped_set(874		&mut self,875		scope: PropertyScope,876		key: PropertyKey,877		value: Self::Value,878	) -> Result<(), PropertiesError> {879		let value_len = value.len();880881		if self.consumed_space as usize + value_len > self.space_limit as usize882			&& !cfg!(feature = "runtime-benchmarks")883		{884			return Err(PropertiesError::NoSpaceForProperty);885		}886887		self.map.try_scoped_set(scope, key, value)?;888889		self.consumed_space += value_len as u32;890891		Ok(())892	}893}894895pub struct CollectionProperties;896897impl Get<Properties> for CollectionProperties {898	fn get() -> Properties {899		Properties::new(MAX_COLLECTION_PROPERTIES_SIZE)900	}901}902903pub struct TokenProperties;904905impl Get<Properties> for TokenProperties {906	fn get() -> Properties {907		Properties::new(MAX_TOKEN_PROPERTIES_SIZE)908	}909}910911// RMRK912// todo document?913parameter_types! {914	#[derive(PartialEq, TypeInfo)]915	pub const RmrkStringLimit: u32 = 128;916	#[derive(PartialEq)]917	pub const RmrkCollectionSymbolLimit: u32 = 100;918	#[derive(PartialEq)]919	pub const RmrkResourceSymbolLimit: u32 = 10;920	#[derive(PartialEq)]921	pub const RmrkKeyLimit: u32 = 32;922	#[derive(PartialEq)]923	pub const RmrkValueLimit: u32 = 256;924	#[derive(PartialEq)]925	pub const RmrkMaxCollectionsEquippablePerPart: u32 = 100;926	#[derive(PartialEq)]927	pub const RmrkPartsLimit: u32 = 3;928}929930impl From<RmrkCollectionId> for CollectionId {931	fn from(id: RmrkCollectionId) -> Self {932		Self(id)933	}934}935936impl From<RmrkNftId> for TokenId {937	fn from(id: RmrkNftId) -> Self {938		Self(id)939	}940}941942pub type RmrkCollectionInfo<AccountId> =943	CollectionInfo<RmrkString, RmrkCollectionSymbol, AccountId>;944pub type RmrkInstanceInfo<AccountId> = NftInfo<AccountId, Permill, RmrkString>;945pub type RmrkResourceInfo = ResourceInfo<RmrkBoundedResource, RmrkString, RmrkBoundedParts>;946pub type RmrkPropertyInfo = PropertyInfo<RmrkKeyString, RmrkValueString>;947pub type RmrkBaseInfo<AccountId> = BaseInfo<AccountId, RmrkString>;948pub type RmrkPartType =949	PartType<RmrkString, BoundedVec<RmrkCollectionId, RmrkMaxCollectionsEquippablePerPart>>;950pub type RmrkThemeProperty = ThemeProperty<RmrkString>;951pub type RmrkTheme = Theme<RmrkString, Vec<RmrkThemeProperty>>;952953pub type RmrkCollectionSymbol = BoundedVec<u8, RmrkCollectionSymbolLimit>;954pub type RmrkKeyString = BoundedVec<u8, RmrkKeyLimit>;955pub type RmrkValueString = BoundedVec<u8, RmrkValueLimit>;956957type RmrkBoundedResource = BoundedVec<u8, RmrkResourceSymbolLimit>;958type RmrkBoundedParts = BoundedVec<RmrkPartId, RmrkPartsLimit>;959960pub type RmrkRpcString = Vec<u8>;961pub type RmrkThemeName = RmrkRpcString;962pub type RmrkPropertyKey = RmrkRpcString;963964pub type RmrkString = BoundedVec<u8, RmrkStringLimit>;
after · primitives/data-structs/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#![cfg_attr(not(feature = "std"), no_std)]1819use core::{20	convert::{TryFrom, TryInto},21	fmt,22};23use frame_support::{24	storage::{bounded_btree_map::BoundedBTreeMap, bounded_btree_set::BoundedBTreeSet},25	traits::Get,26	parameter_types,27};2829#[cfg(feature = "serde")]30use serde::{Serialize, Deserialize};3132use sp_core::U256;33use sp_runtime::{ArithmeticError, sp_std::prelude::Vec, Permill};34use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};35use frame_support::{BoundedVec, traits::ConstU32};36use derivative::Derivative;37use scale_info::TypeInfo;3839pub mod rmrk;4041// RMRK42use rmrk::{43	CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme, ThemeProperty,44	ResourceTypes, BasicResource, ComposableResource, SlotResource,45};46pub use rmrk::{47	primitives::{48		CollectionId as RmrkCollectionId, NftId as RmrkNftId, BaseId as RmrkBaseId,49		PartId as RmrkPartId, ResourceId as RmrkResourceId,50	},51	NftChild as RmrkNftChild, AccountIdOrCollectionNftTuple as RmrkAccountIdOrCollectionNftTuple,52	FixedPart as RmrkFixedPart, SlotPart as RmrkSlotPart, EquippableList as RmrkEquippableList,53};5455mod bounded;56pub mod budget;57pub mod mapping;58mod migration;5960pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;61pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000;62pub const MAX_SPONSOR_TIMEOUT: u32 = 10_368_000;6364pub const MAX_TOKEN_OWNERSHIP: u32 = if cfg!(not(feature = "limit-testing")) {65	100_00066} else {67	1068};69pub const COLLECTION_NUMBER_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) {70	100_00071} else {72	1073};74pub const CUSTOM_DATA_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) {75	204876} else {77	1078};79pub const COLLECTION_ADMINS_LIMIT: u32 = 5;80pub const COLLECTION_TOKEN_LIMIT: u32 = u32::MAX;81pub const ACCOUNT_TOKEN_OWNERSHIP_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) {82	1_000_00083} else {84	1085};8687// Timeouts for item types in passed blocks88pub const NFT_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;89pub const FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;90pub const REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;9192pub const SPONSOR_APPROVE_TIMEOUT: u32 = 5;9394// Schema limits95pub const OFFCHAIN_SCHEMA_LIMIT: u32 = 8192;96pub const VARIABLE_ON_CHAIN_SCHEMA_LIMIT: u32 = 8192;97pub const CONST_ON_CHAIN_SCHEMA_LIMIT: u32 = 32768;9899pub const COLLECTION_FIELD_LIMIT: u32 = CONST_ON_CHAIN_SCHEMA_LIMIT;100101pub const MAX_COLLECTION_NAME_LENGTH: u32 = 64;102pub const MAX_COLLECTION_DESCRIPTION_LENGTH: u32 = 256;103pub const MAX_TOKEN_PREFIX_LENGTH: u32 = 16;104105pub const MAX_PROPERTY_KEY_LENGTH: u32 = 256;106pub const MAX_PROPERTY_VALUE_LENGTH: u32 = 32768;107pub const MAX_PROPERTIES_PER_ITEM: u32 = 64;108109pub const MAX_COLLECTION_PROPERTIES_SIZE: u32 = 40960;110pub const MAX_TOKEN_PROPERTIES_SIZE: u32 = 32768;111112// RMRK constants113pub const RMRK_STRING_LIMIT: u32 = 128;114pub const RMRK_COLLECTION_SYMBOL_LIMIT: u32 = 100;115pub const RMRK_RESOURCE_SYMBOL_LIMIT: u32 = 10;116pub const RMRK_KEY_LIMIT: u32 = 32;117pub const RMRK_VALUE_LIMIT: u32 = 256;118119/// How much items can be created per single120/// create_many call121pub const MAX_ITEMS_PER_BATCH: u32 = 200;122123pub type CustomDataLimit = ConstU32<CUSTOM_DATA_LIMIT>;124125#[derive(126	Encode,127	Decode,128	PartialEq,129	Eq,130	PartialOrd,131	Ord,132	Clone,133	Copy,134	Debug,135	Default,136	TypeInfo,137	MaxEncodedLen,138)]139#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]140pub struct CollectionId(pub u32);141impl EncodeLike<u32> for CollectionId {}142impl EncodeLike<CollectionId> for u32 {}143144#[derive(145	Encode,146	Decode,147	PartialEq,148	Eq,149	PartialOrd,150	Ord,151	Clone,152	Copy,153	Debug,154	Default,155	TypeInfo,156	MaxEncodedLen,157)]158#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]159pub struct TokenId(pub u32);160impl EncodeLike<u32> for TokenId {}161impl EncodeLike<TokenId> for u32 {}162163impl TokenId {164	pub fn try_next(self) -> Result<TokenId, ArithmeticError> {165		self.0166			.checked_add(1)167			.ok_or(ArithmeticError::Overflow)168			.map(Self)169	}170}171172impl From<TokenId> for U256 {173	fn from(t: TokenId) -> Self {174		t.0.into()175	}176}177178impl TryFrom<U256> for TokenId {179	type Error = &'static str;180181	fn try_from(value: U256) -> Result<Self, Self::Error> {182		Ok(TokenId(value.try_into().map_err(|_| "too large token id")?))183	}184}185186#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]187#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]188pub struct TokenData<CrossAccountId> {189	pub properties: Vec<Property>,190	pub owner: Option<CrossAccountId>,191}192193pub struct OverflowError;194impl From<OverflowError> for &'static str {195	fn from(_: OverflowError) -> Self {196		"overflow occured"197	}198}199200pub type DecimalPoints = u8;201202#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]203#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]204pub enum CollectionMode {205	NFT,206	// decimal points207	Fungible(DecimalPoints),208	ReFungible,209}210211impl CollectionMode {212	pub fn id(&self) -> u8 {213		match self {214			CollectionMode::NFT => 1,215			CollectionMode::Fungible(_) => 2,216			CollectionMode::ReFungible => 3,217		}218	}219}220221pub trait SponsoringResolve<AccountId, Call> {222	fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>;223}224225#[derive(Encode, Decode, Eq, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]226#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]227pub enum AccessMode {228	Normal,229	AllowList,230}231impl Default for AccessMode {232	fn default() -> Self {233		Self::Normal234	}235}236237#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]238#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]239pub enum SchemaVersion {240	ImageURL,241	Unique,242}243impl Default for SchemaVersion {244	fn default() -> Self {245		Self::ImageURL246	}247}248249#[derive(Encode, Decode, Default, Debug, Clone, PartialEq, TypeInfo)]250#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]251pub struct Ownership<AccountId> {252	pub owner: AccountId,253	pub fraction: u128,254}255256#[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]257#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]258pub enum SponsorshipState<AccountId> {259	/// The fees are applied to the transaction sender260	Disabled,261	Unconfirmed(AccountId),262	/// Transactions are sponsored by specified account263	Confirmed(AccountId),264}265266impl<AccountId> SponsorshipState<AccountId> {267	pub fn sponsor(&self) -> Option<&AccountId> {268		match self {269			Self::Confirmed(sponsor) => Some(sponsor),270			_ => None,271		}272	}273274	pub fn pending_sponsor(&self) -> Option<&AccountId> {275		match self {276			Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),277			_ => None,278		}279	}280281	pub fn confirmed(&self) -> bool {282		matches!(self, Self::Confirmed(_))283	}284}285286impl<T> Default for SponsorshipState<T> {287	fn default() -> Self {288		Self::Disabled289	}290}291292/// Used in storage293#[struct_versioning::versioned(version = 2, upper)]294#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)]295pub struct Collection<AccountId> {296	pub owner: AccountId,297	pub mode: CollectionMode,298	#[version(..2)]299	pub access: AccessMode,300	pub name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,301	pub description: BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>,302	pub token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,303304	#[version(..2)]305	pub mint_mode: bool,306307	#[version(..2)]308	pub offchain_schema: BoundedVec<u8, ConstU32<OFFCHAIN_SCHEMA_LIMIT>>,309310	#[version(..2)]311	pub schema_version: SchemaVersion,312	pub sponsorship: SponsorshipState<AccountId>,313314	pub limits: CollectionLimits,315316	#[version(2.., upper(Default::default()))]317	pub permissions: CollectionPermissions,318319	#[version(..2)]320	pub variable_on_chain_schema: BoundedVec<u8, ConstU32<VARIABLE_ON_CHAIN_SCHEMA_LIMIT>>,321322	#[version(..2)]323	pub const_on_chain_schema: BoundedVec<u8, ConstU32<CONST_ON_CHAIN_SCHEMA_LIMIT>>,324325	#[version(..2)]326	pub meta_update_permission: MetaUpdatePermission,327}328329/// Used in RPC calls330#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]331#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]332pub struct RpcCollection<AccountId> {333	pub owner: AccountId,334	pub mode: CollectionMode,335	pub name: Vec<u16>,336	pub description: Vec<u16>,337	pub token_prefix: Vec<u8>,338	pub sponsorship: SponsorshipState<AccountId>,339	pub limits: CollectionLimits,340	pub permissions: CollectionPermissions,341	pub token_property_permissions: Vec<PropertyKeyPermission>,342	pub properties: Vec<Property>,343}344345#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)]346#[derivative(Debug, Default(bound = ""))]347pub struct CreateCollectionData<AccountId> {348	#[derivative(Default(value = "CollectionMode::NFT"))]349	pub mode: CollectionMode,350	pub access: Option<AccessMode>,351	pub name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,352	pub description: BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>,353	pub token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,354	pub pending_sponsor: Option<AccountId>,355	pub limits: Option<CollectionLimits>,356	pub permissions: Option<CollectionPermissions>,357	pub token_property_permissions: CollectionPropertiesPermissionsVec,358	pub properties: CollectionPropertiesVec,359}360361pub type CollectionPropertiesPermissionsVec =362	BoundedVec<PropertyKeyPermission, ConstU32<MAX_PROPERTIES_PER_ITEM>>;363364pub type CollectionPropertiesVec = BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;365366/// All fields are wrapped in `Option`s, where None means chain default367// When adding/removing fields from this struct - don't forget to also update clamp_limits368#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]369#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]370pub struct CollectionLimits {371	pub account_token_ownership_limit: Option<u32>,372	pub sponsored_data_size: Option<u32>,373374	/// FIXME should we delete this or repurpose it?375	/// None - setVariableMetadata is not sponsored376	/// Some(v) - setVariableMetadata is sponsored377	///           if there is v block between txs378	pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,379	pub token_limit: Option<u32>,380381	// Timeouts for item types in passed blocks382	pub sponsor_transfer_timeout: Option<u32>,383	pub sponsor_approve_timeout: Option<u32>,384	pub owner_can_transfer: Option<bool>,385	pub owner_can_destroy: Option<bool>,386	pub transfers_enabled: Option<bool>,387}388389impl CollectionLimits {390	pub fn account_token_ownership_limit(&self) -> u32 {391		self.account_token_ownership_limit392			.unwrap_or(ACCOUNT_TOKEN_OWNERSHIP_LIMIT)393			.min(MAX_TOKEN_OWNERSHIP)394	}395	pub fn sponsored_data_size(&self) -> u32 {396		self.sponsored_data_size397			.unwrap_or(CUSTOM_DATA_LIMIT)398			.min(CUSTOM_DATA_LIMIT)399	}400	pub fn token_limit(&self) -> u32 {401		self.token_limit402			.unwrap_or(COLLECTION_TOKEN_LIMIT)403			.min(COLLECTION_TOKEN_LIMIT)404	}405	pub fn sponsor_transfer_timeout(&self, default: u32) -> u32 {406		self.sponsor_transfer_timeout407			.unwrap_or(default)408			.min(MAX_SPONSOR_TIMEOUT)409	}410	pub fn sponsor_approve_timeout(&self) -> u32 {411		self.sponsor_approve_timeout412			.unwrap_or(SPONSOR_APPROVE_TIMEOUT)413			.min(MAX_SPONSOR_TIMEOUT)414	}415	pub fn owner_can_transfer(&self) -> bool {416		self.owner_can_transfer.unwrap_or(true)417	}418	pub fn owner_can_destroy(&self) -> bool {419		self.owner_can_destroy.unwrap_or(true)420	}421	pub fn transfers_enabled(&self) -> bool {422		self.transfers_enabled.unwrap_or(true)423	}424	pub fn sponsored_data_rate_limit(&self) -> Option<u32> {425		match self426			.sponsored_data_rate_limit427			.unwrap_or(SponsoringRateLimit::SponsoringDisabled)428		{429			SponsoringRateLimit::SponsoringDisabled => None,430			SponsoringRateLimit::Blocks(v) => Some(v.min(MAX_SPONSOR_TIMEOUT)),431		}432	}433}434435// When adding/removing fields from this struct - don't forget to also update clamp_limits436#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]437#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]438pub struct CollectionPermissions {439	pub access: Option<AccessMode>,440	pub mint_mode: Option<bool>,441	pub nesting: Option<NestingRule>,442}443444impl CollectionPermissions {445	pub fn access(&self) -> AccessMode {446		self.access.unwrap_or(AccessMode::Normal)447	}448	pub fn mint_mode(&self) -> bool {449		self.mint_mode.unwrap_or(false)450	}451	pub fn nesting(&self) -> &NestingRule {452		static DEFAULT: NestingRule = NestingRule::Disabled;453		self.nesting.as_ref().unwrap_or(&DEFAULT)454	}455}456457#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]458#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]459#[derivative(Debug)]460pub enum NestingRule {461	/// No one can nest tokens462	Disabled,463	/// Owner can nest any tokens464	Owner,465	/// Owner can nest tokens from specified collections466	OwnerRestricted(467		#[cfg_attr(feature = "serde1", serde(with = "bounded::set_serde"))]468		#[derivative(Debug(format_with = "bounded::set_debug"))]469		BoundedBTreeSet<CollectionId, ConstU32<16>>,470	),471	/// Used for tests472	Permissive,473}474475#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]476#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]477pub enum SponsoringRateLimit {478	SponsoringDisabled,479	Blocks(u32),480}481482#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]483#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]484#[derivative(Debug)]485pub struct CreateNftData {486	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]487	#[derivative(Debug(format_with = "bounded::vec_debug"))]488	pub properties: CollectionPropertiesVec,489}490491#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]492#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]493pub struct CreateFungibleData {494	pub value: u128,495}496497#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]498#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]499#[derivative(Debug)]500pub struct CreateReFungibleData {501	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]502	#[derivative(Debug(format_with = "bounded::vec_debug"))]503	pub const_data: BoundedVec<u8, CustomDataLimit>,504	pub pieces: u128,505}506507#[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)]508#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]509pub enum MetaUpdatePermission {510	ItemOwner,511	Admin,512	None,513}514515#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]516#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]517pub enum CreateItemData {518	NFT(CreateNftData),519	Fungible(CreateFungibleData),520	ReFungible(CreateReFungibleData),521}522523#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]524#[derivative(Debug)]525pub struct CreateNftExData<CrossAccountId> {526	#[derivative(Debug(format_with = "bounded::vec_debug"))]527	pub properties: CollectionPropertiesVec,528	pub owner: CrossAccountId,529}530531#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]532#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]533pub struct CreateRefungibleExData<CrossAccountId> {534	#[derivative(Debug(format_with = "bounded::vec_debug"))]535	pub const_data: BoundedVec<u8, CustomDataLimit>,536	#[derivative(Debug(format_with = "bounded::map_debug"))]537	pub users: BoundedBTreeMap<CrossAccountId, u128, ConstU32<MAX_ITEMS_PER_BATCH>>,538}539540#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]541#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]542pub enum CreateItemExData<CrossAccountId> {543	NFT(544		#[derivative(Debug(format_with = "bounded::vec_debug"))]545		BoundedVec<CreateNftExData<CrossAccountId>, ConstU32<MAX_ITEMS_PER_BATCH>>,546	),547	Fungible(548		#[derivative(Debug(format_with = "bounded::map_debug"))]549		BoundedBTreeMap<CrossAccountId, u128, ConstU32<MAX_ITEMS_PER_BATCH>>,550	),551	/// Many tokens, each may have only one owner552	RefungibleMultipleItems(553		#[derivative(Debug(format_with = "bounded::vec_debug"))]554		BoundedVec<CreateRefungibleExData<CrossAccountId>, ConstU32<MAX_ITEMS_PER_BATCH>>,555	),556	/// Single token, which may have many owners557	RefungibleMultipleOwners(CreateRefungibleExData<CrossAccountId>),558}559560impl CreateItemData {561	pub fn data_size(&self) -> usize {562		match self {563			CreateItemData::ReFungible(data) => data.const_data.len(),564			_ => 0,565		}566	}567}568569impl From<CreateNftData> for CreateItemData {570	fn from(item: CreateNftData) -> Self {571		CreateItemData::NFT(item)572	}573}574575impl From<CreateReFungibleData> for CreateItemData {576	fn from(item: CreateReFungibleData) -> Self {577		CreateItemData::ReFungible(item)578	}579}580581impl From<CreateFungibleData> for CreateItemData {582	fn from(item: CreateFungibleData) -> Self {583		CreateItemData::Fungible(item)584	}585}586587#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]588#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]589// todo possibly rename to be used generally as an address pair590pub struct TokenChild {591	pub token: TokenId,592	pub collection: CollectionId,593}594595#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]596#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]597pub struct CollectionStats {598	pub created: u32,599	pub destroyed: u32,600	pub alive: u32,601}602603#[derive(Encode, Decode, Clone, Debug)]604#[cfg_attr(feature = "std", derive(PartialEq))]605pub struct PhantomType<T>(core::marker::PhantomData<T>);606607impl<T: TypeInfo + 'static> TypeInfo for PhantomType<T> {608	type Identity = PhantomType<T>;609610	fn type_info() -> scale_info::Type {611		use scale_info::{612			Type, Path,613			build::{FieldsBuilder, UnnamedFields},614			type_params,615		};616		Type::builder()617			.path(Path::new("up_data_structs", "PhantomType"))618			.type_params(type_params!(T))619			.composite(<FieldsBuilder<UnnamedFields>>::default().field(|b| b.ty::<[T; 0]>()))620	}621}622impl<T> MaxEncodedLen for PhantomType<T> {623	fn max_encoded_len() -> usize {624		0625	}626}627628pub type PropertyKey = BoundedVec<u8, ConstU32<MAX_PROPERTY_KEY_LENGTH>>;629pub type PropertyValue = BoundedVec<u8, ConstU32<MAX_PROPERTY_VALUE_LENGTH>>;630631#[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen, PartialEq, Clone)]632#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]633pub struct PropertyPermission {634	pub mutable: bool,635	pub collection_admin: bool,636	pub token_owner: bool,637}638639impl PropertyPermission {640	pub fn none() -> Self {641		Self {642			mutable: true,643			collection_admin: false,644			token_owner: false,645		}646	}647}648649#[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, MaxEncodedLen)]650#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]651pub struct Property {652	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]653	pub key: PropertyKey,654655	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]656	pub value: PropertyValue,657}658659impl Into<(PropertyKey, PropertyValue)> for Property {660	fn into(self) -> (PropertyKey, PropertyValue) {661		(self.key, self.value)662	}663}664665#[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen, PartialEq, Clone)]666#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]667pub struct PropertyKeyPermission {668	#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]669	pub key: PropertyKey,670671	pub permission: PropertyPermission,672}673674impl Into<(PropertyKey, PropertyPermission)> for PropertyKeyPermission {675	fn into(self) -> (PropertyKey, PropertyPermission) {676		(self.key, self.permission)677	}678}679680#[derive(Debug)]681pub enum PropertiesError {682	NoSpaceForProperty,683	PropertyLimitReached,684	InvalidCharacterInPropertyKey,685	PropertyKeyIsTooLong,686	EmptyPropertyKey,687}688689#[derive(Clone, Copy)]690pub enum PropertyScope {691	None,692	Rmrk,693}694695impl PropertyScope {696	pub fn apply(self, key: PropertyKey) -> Result<PropertyKey, PropertiesError> {697		let scope_str: &[u8] = match self {698			Self::None => return Ok(key),699			Self::Rmrk => b"rmrk",700		};701702		[scope_str, b":", key.as_slice()]703			.concat()704			.try_into()705			.map_err(|_| PropertiesError::PropertyKeyIsTooLong)706	}707}708709pub trait TrySetProperty: Sized {710	type Value;711712	fn try_scoped_set(713		&mut self,714		scope: PropertyScope,715		key: PropertyKey,716		value: Self::Value,717	) -> Result<(), PropertiesError>;718719	fn try_scoped_set_from_iter<I, KV>(720		&mut self,721		scope: PropertyScope,722		iter: I,723	) -> Result<(), PropertiesError>724	where725		I: Iterator<Item = KV>,726		KV: Into<(PropertyKey, Self::Value)>,727	{728		for kv in iter {729			let (key, value) = kv.into();730			self.try_scoped_set(scope, key, value)?;731		}732733		Ok(())734	}735736	fn try_set(&mut self, key: PropertyKey, value: Self::Value) -> Result<(), PropertiesError> {737		self.try_scoped_set(PropertyScope::None, key, value)738	}739740	fn try_set_from_iter<I, KV>(&mut self, iter: I) -> Result<(), PropertiesError>741	where742		I: Iterator<Item = KV>,743		KV: Into<(PropertyKey, Self::Value)>,744	{745		self.try_scoped_set_from_iter(PropertyScope::None, iter)746	}747}748749#[derive(Encode, Decode, TypeInfo, Derivative, Clone, PartialEq, MaxEncodedLen)]750#[derivative(Default(bound = ""))]751pub struct PropertiesMap<Value>(752	BoundedBTreeMap<PropertyKey, Value, ConstU32<MAX_PROPERTIES_PER_ITEM>>,753);754755impl<Value> PropertiesMap<Value> {756	pub fn new() -> Self {757		Self(BoundedBTreeMap::new())758	}759760	pub fn remove(&mut self, key: &PropertyKey) -> Result<Option<Value>, PropertiesError> {761		Self::check_property_key(key)?;762763		Ok(self.0.remove(key))764	}765766	pub fn get(&self, key: &PropertyKey) -> Option<&Value> {767		self.0.get(key)768	}769770	pub fn contains_key(&self, key: &PropertyKey) -> bool {771		self.0.contains_key(key)772	}773774	fn check_property_key(key: &PropertyKey) -> Result<(), PropertiesError> {775		if key.is_empty() {776			return Err(PropertiesError::EmptyPropertyKey);777		}778779		for byte in key.as_slice().iter() {780			let byte = *byte;781782			if !byte.is_ascii_alphanumeric() && byte != b'_' && byte != b'-' {783				return Err(PropertiesError::InvalidCharacterInPropertyKey);784			}785		}786787		Ok(())788	}789}790791impl<Value> IntoIterator for PropertiesMap<Value> {792	type Item = (PropertyKey, Value);793	type IntoIter = <794		BoundedBTreeMap<795			PropertyKey,796			Value,797			ConstU32<MAX_PROPERTIES_PER_ITEM>798		> as IntoIterator799	>::IntoIter;800801	fn into_iter(self) -> Self::IntoIter {802		self.0.into_iter()803	}804}805806impl<Value> TrySetProperty for PropertiesMap<Value> {807	type Value = Value;808809	fn try_scoped_set(810		&mut self,811		scope: PropertyScope,812		key: PropertyKey,813		value: Self::Value,814	) -> Result<(), PropertiesError> {815		Self::check_property_key(&key)?;816817		let key = scope.apply(key)?;818		self.0819			.try_insert(key, value)820			.map_err(|_| PropertiesError::PropertyLimitReached)?;821822		Ok(())823	}824}825826pub type PropertiesPermissionMap = PropertiesMap<PropertyPermission>;827828#[derive(Encode, Decode, TypeInfo, Clone, PartialEq, MaxEncodedLen)]829pub struct Properties {830	map: PropertiesMap<PropertyValue>,831	consumed_space: u32,832	space_limit: u32,833}834835impl Properties {836	pub fn new(space_limit: u32) -> Self {837		Self {838			map: PropertiesMap::new(),839			consumed_space: 0,840			space_limit,841		}842	}843844	pub fn remove(&mut self, key: &PropertyKey) -> Result<Option<PropertyValue>, PropertiesError> {845		let value = self.map.remove(key)?;846847		if let Some(ref value) = value {848			let value_len = value.len() as u32;849			self.consumed_space -= value_len;850		}851852		Ok(value)853	}854855	pub fn get(&self, key: &PropertyKey) -> Option<&PropertyValue> {856		self.map.get(key)857	}858}859860impl IntoIterator for Properties {861	type Item = (PropertyKey, PropertyValue);862	type IntoIter = <PropertiesMap<PropertyValue> as IntoIterator>::IntoIter;863864	fn into_iter(self) -> Self::IntoIter {865		self.map.into_iter()866	}867}868869impl TrySetProperty for Properties {870	type Value = PropertyValue;871872	fn try_scoped_set(873		&mut self,874		scope: PropertyScope,875		key: PropertyKey,876		value: Self::Value,877	) -> Result<(), PropertiesError> {878		let value_len = value.len();879880		if self.consumed_space as usize + value_len > self.space_limit as usize881			&& !cfg!(feature = "runtime-benchmarks")882		{883			return Err(PropertiesError::NoSpaceForProperty);884		}885886		self.map.try_scoped_set(scope, key, value)?;887888		self.consumed_space += value_len as u32;889890		Ok(())891	}892}893894pub struct CollectionProperties;895896impl Get<Properties> for CollectionProperties {897	fn get() -> Properties {898		Properties::new(MAX_COLLECTION_PROPERTIES_SIZE)899	}900}901902pub struct TokenProperties;903904impl Get<Properties> for TokenProperties {905	fn get() -> Properties {906		Properties::new(MAX_TOKEN_PROPERTIES_SIZE)907	}908}909910// RMRK911// todo document?912parameter_types! {913	#[derive(PartialEq, TypeInfo)]914	pub const RmrkStringLimit: u32 = 128;915	#[derive(PartialEq)]916	pub const RmrkCollectionSymbolLimit: u32 = 100;917	#[derive(PartialEq)]918	pub const RmrkResourceSymbolLimit: u32 = 10;919	#[derive(PartialEq)]920	pub const RmrkKeyLimit: u32 = 32;921	#[derive(PartialEq)]922	pub const RmrkValueLimit: u32 = 256;923	#[derive(PartialEq)]924	pub const RmrkMaxCollectionsEquippablePerPart: u32 = 100;925	#[derive(PartialEq)]926	pub const RmrkPartsLimit: u32 = 3;927}928929impl From<RmrkCollectionId> for CollectionId {930	fn from(id: RmrkCollectionId) -> Self {931		Self(id)932	}933}934935impl From<RmrkNftId> for TokenId {936	fn from(id: RmrkNftId) -> Self {937		Self(id)938	}939}940941pub type RmrkCollectionInfo<AccountId> =942	CollectionInfo<RmrkString, RmrkCollectionSymbol, AccountId>;943pub type RmrkInstanceInfo<AccountId> = NftInfo<AccountId, Permill, RmrkString>;944pub type RmrkResourceInfo = ResourceInfo<RmrkString, RmrkBoundedParts>;945pub type RmrkPropertyInfo = PropertyInfo<RmrkKeyString, RmrkValueString>;946pub type RmrkBaseInfo<AccountId> = BaseInfo<AccountId, RmrkString>;947pub type RmrkPartType =948	PartType<RmrkString, BoundedVec<RmrkCollectionId, RmrkMaxCollectionsEquippablePerPart>>;949pub type RmrkThemeProperty = ThemeProperty<RmrkString>;950pub type RmrkTheme = Theme<RmrkString, Vec<RmrkThemeProperty>>;951pub type RmrkResourceTypes = ResourceTypes<RmrkString, RmrkBoundedParts>;952953pub type RmrkBasicResource = BasicResource<RmrkString>;954pub type RmrkComposableResource = ComposableResource<RmrkString, RmrkBoundedParts>;955pub type RmrkSlotResource = SlotResource<RmrkString>;956957pub type RmrkString = BoundedVec<u8, RmrkStringLimit>;958pub type RmrkCollectionSymbol = BoundedVec<u8, RmrkCollectionSymbolLimit>;959pub type RmrkKeyString = BoundedVec<u8, RmrkKeyLimit>;960pub type RmrkValueString = BoundedVec<u8, RmrkValueLimit>;961pub type RmrkBoundedResource = BoundedVec<u8, RmrkResourceSymbolLimit>;962pub type RmrkBoundedParts = BoundedVec<RmrkPartId, RmrkPartsLimit>; // todo make sure it is needed963964pub type RmrkRpcString = Vec<u8>;965pub type RmrkThemeName = RmrkRpcString;966pub type RmrkPropertyKey = RmrkRpcString;
modifiedprimitives/data-structs/src/rmrk.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/rmrk.rs
+++ b/primitives/data-structs/src/rmrk.rs
@@ -282,17 +282,16 @@
 #[cfg_attr(
 	feature = "std",
 	serde(bound = r#"
-			BoundedResource: AsRef<[u8]>,
 			BoundedString: AsRef<[u8]>,
 			BoundedParts: AsRef<[PartId]>
 		"#)
 )]
-pub struct ResourceInfo<BoundedResource, BoundedString: Default, BoundedParts> {
+pub struct ResourceInfo<BoundedString: Default, BoundedParts> {
 	/// id is a 5-character string of reasonable uniqueness.
 	/// The combination of base ID and resource id should be unique across the entire RMRK
 	/// ecosystem which
-	#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]
-	pub id: BoundedResource,
+	//#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]
+	pub id: ResourceId,
 
 	/// Resource
 	pub resource: ResourceTypes<BoundedString, BoundedParts>,
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -152,6 +152,7 @@
                         Err(_) => return Ok(None),
                     };
 
+                    // todo replace dispatch... calls with calls to rmrkcore and NFT collection. There's no point trying non-NFT collections
                     let nfts_count = dispatch_unique_runtime!(collection_id.total_supply())?;
 
                     Ok(Some(RmrkCollectionInfo {
@@ -171,6 +172,7 @@
                     let nft_id = TokenId(nft_by_id);
                     if !RmrkCore::nft_exists(collection_id, nft_id) { return Ok(None); }
 
+                    // todo replace dispatch with collection
                     let owner = match dispatch_unique_runtime!(collection_id.token_owner(nft_id))? {
                         Some(owner) => match <Runtime as pallet_common::Config>::CrossTokenAddressMapping::address_to_token(&owner) {
                             Some((col, tok)) => RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(col.0, tok.0),
@@ -270,34 +272,51 @@
 
                 fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
                     use frame_support::BoundedVec;
-                    use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};
+                    use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, ResourceType, RmrkDecode}};
+                    use pallet_common::CommonCollectionOperations;
 
                     let collection_id = RmrkCore::unique_collection_id(collection_id)?;
-                    if !RmrkCore::collection_exists(collection_id) { return Ok(Vec::new()); } // todo make sure the collection type doesn't matter
+                    if RmrkCore::ensure_collection_type(collection_id, CollectionType::Regular).is_err() { return Ok(Vec::new()); }
 
                     let nft_id = TokenId(nft_id);
-                    if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Resource).is_err() { return Ok(Vec::new()); }
+                    if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Regular).is_err() { return Ok(Vec::new()); }
 
-                    let resource_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)
-                        .unwrap()
+                    let res_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)?
                         .decode_or_default();
-                    if RmrkCore::ensure_collection_type(collection_id, CollectionType::Resource).is_err() { return Ok(Vec::new()); }
+                    let resource_collection = RmrkCore::get_typed_nft_collection(res_collection_id, CollectionType::Resource)?;
 
-                    let resources = pallet_nonfungible::TokenProperties::<Runtime>::iter_prefix((resource_collection_id,))
-                        .filter_map(|(resource_id, properties)| Some(RmrkResourceInfo {
-                            id: BoundedVec::default(), // todo ResourceId property
-                            pending: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::PendingResourceAccept).unwrap().decode_or_default(),
-                            pending_removal: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::PendingResourceRemoval).unwrap().decode_or_default(),
-                            resource: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::ResourceType).unwrap().decode_or_default(),/* {
-                                RmrkResourceTypes::Basic(resource) => RmrkResourceTypes::Basic(),/*(RmrkBasicResource {
-                                    src: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Src).unwrap().decode_or_default(),
-                                    metadata: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Metadata).unwrap().decode_or_default(),
-                                    license: RmrkCore::get_nft_property_inner(properties, RmrkProperty::License).unwrap().decode_or_default(),
-                                    thumb: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Thumb).unwrap().decode_or_default(),
-                                },*///BasicResource<BoundedString>)
-                                _ => todo!(), //RmrkResourceTypes::Composable(ComposableResource<BoundedString, BoundedParts>),
-                                //RmrkResourceTypes::Slot(SlotResource<BoundedString>),
-                            },*/
+                    let resources = resource_collection
+                        .collection_tokens()
+                        .iter()
+                        .filter_map(|(res_id)| Some(RmrkResourceInfo {
+                            id: res_id.0,
+                            pending: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::PendingResourceAccept).unwrap().decode_or_default(),
+                            pending_removal: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::PendingResourceRemoval).unwrap().decode_or_default(),
+                            resource: match RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::ResourceType).unwrap().decode_or_default() {
+                                ResourceType::Basic => RmrkResourceTypes::Basic(RmrkBasicResource {
+                                    src: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Src).unwrap().decode_or_default(),
+                                    metadata: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Metadata).unwrap().decode_or_default(),
+                                    license: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::License).unwrap().decode_or_default(),
+                                    thumb: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Thumb).unwrap().decode_or_default(),
+                                }),
+                                ResourceType::Composable => RmrkResourceTypes::Composable(RmrkComposableResource {
+                                    parts: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Parts).unwrap().decode_or_default(),
+                                    base: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Base).unwrap().decode_or_default(),
+                                    src: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Src).unwrap().decode_or_default(),
+                                    metadata: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Metadata).unwrap().decode_or_default(),
+                                    license: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::License).unwrap().decode_or_default(),
+                                    thumb: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Thumb).unwrap().decode_or_default(),
+                                }),
+                                ResourceType::Slot => RmrkResourceTypes::Slot(RmrkSlotResource {
+                                    base: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Base).unwrap().decode_or_default(),
+                                    src: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Src).unwrap().decode_or_default(),
+                                    metadata: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Metadata).unwrap().decode_or_default(),
+                                    slot: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Slot).unwrap().decode_or_default(),
+                                    license: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::License).unwrap().decode_or_default(),
+                                    thumb: RmrkCore::get_nft_property(res_collection_id, *res_id, RmrkProperty::Thumb).unwrap().decode_or_default(),
+                                }),
+                                // todo refactor :|
+                            },
                         }))
                         .collect();
 
@@ -308,10 +327,10 @@
                     use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};
 
                     let collection_id = RmrkCore::unique_collection_id(collection_id)?;
-                    if !RmrkCore::collection_exists(collection_id) { return Ok(Vec::new()); } // todo ensure the collection type doesn't matter
+                    if RmrkCore::ensure_collection_type(collection_id, CollectionType::Regular).is_err() { return Ok(Vec::new()); }
 
                     let nft_id = TokenId(nft_id);
-                    if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Resource).is_err() { return Ok(Vec::new()); }
+                    if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Regular).is_err() { return Ok(Vec::new()); }
 
                     /*let resource_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)
                         .unwrap()
@@ -327,6 +346,7 @@
                         .sort_by_key(|(_, index)| *index)
                         .into_iter().map(|(resource_id, _)| resource_id)*/
                     let priorities = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourcePriorities)?.decode_or_default();
+                    // todo let it simply be default here after removing default from decode
 
                     Ok(priorities)
                 }
modifiedtests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -437,6 +437,33 @@
        **/
       [key: string]: AugmentedError<ApiType>;
     };
+    rmrkCore: {
+      CollectionFullOrLocked: AugmentedError<ApiType>;
+      CollectionNotEmpty: AugmentedError<ApiType>;
+      CollectionUnknown: AugmentedError<ApiType>;
+      CorruptedCollectionType: AugmentedError<ApiType>;
+      NftTypeEncodeError: AugmentedError<ApiType>;
+      NoAvailableCollectionId: AugmentedError<ApiType>;
+      NoAvailableNftId: AugmentedError<ApiType>;
+      NoPermission: AugmentedError<ApiType>;
+      RmrkPropertyKeyIsTooLong: AugmentedError<ApiType>;
+      RmrkPropertyValueIsTooLong: AugmentedError<ApiType>;
+      /**
+       * Generic error
+       **/
+      [key: string]: AugmentedError<ApiType>;
+    };
+    rmrkEquip: {
+      BaseDoesntExist: AugmentedError<ApiType>;
+      NeedsDefaultThemeFirst: AugmentedError<ApiType>;
+      NoAvailableBaseId: AugmentedError<ApiType>;
+      NoAvailablePartId: AugmentedError<ApiType>;
+      PermissionError: AugmentedError<ApiType>;
+      /**
+       * Generic error
+       **/
+      [key: string]: AugmentedError<ApiType>;
+    };
     structure: {
       /**
        * While searched for owner, encountered depth limit
modifiedtests/src/interfaces/augment-api-events.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -396,6 +396,27 @@
        **/
       [key: string]: AugmentedEvent<ApiType>;
     };
+    rmrkCore: {
+      CollectionCreated: AugmentedEvent<ApiType, [AccountId32, u32]>;
+      CollectionDestroyed: AugmentedEvent<ApiType, [AccountId32, u32]>;
+      CollectionLocked: AugmentedEvent<ApiType, [AccountId32, u32]>;
+      IssuerChanged: AugmentedEvent<ApiType, [AccountId32, AccountId32, u32]>;
+      NFTBurned: AugmentedEvent<ApiType, [AccountId32, u32]>;
+      NftMinted: AugmentedEvent<ApiType, [AccountId32, u32, u32]>;
+      PropertySet: AugmentedEvent<ApiType, [u32, Option<u32>, Bytes, Bytes]>;
+      ResourceAdded: AugmentedEvent<ApiType, [u32, u32]>;
+      /**
+       * Generic event
+       **/
+      [key: string]: AugmentedEvent<ApiType>;
+    };
+    rmrkEquip: {
+      BaseCreated: AugmentedEvent<ApiType, [AccountId32, u32]>;
+      /**
+       * Generic event
+       **/
+      [key: string]: AugmentedEvent<ApiType>;
+    };
     structure: {
       /**
        * Executed call on behalf of token
modifiedtests/src/interfaces/augment-api-query.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -415,6 +415,22 @@
        **/
       [key: string]: QueryableStorageEntry<ApiType>;
     };
+    rmrkCore: {
+      collectionIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+      collectionIndexMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+      /**
+       * Generic query
+       **/
+      [key: string]: QueryableStorageEntry<ApiType>;
+    };
+    rmrkEquip: {
+      baseHasDefaultTheme: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+      inernalPartId: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
+      /**
+       * Generic query
+       **/
+      [key: string]: QueryableStorageEntry<ApiType>;
+    };
     structure: {
       /**
        * Generic query
modifiedtests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -22,7 +22,7 @@
 import type { StorageKind } from '@polkadot/types/interfaces/offchain';
 import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
 import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
-import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
+import type { AccountId, AccountId32, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
 import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
 import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
 import type { IExtrinsic, Observable } from '@polkadot/types/types';
@@ -397,6 +397,60 @@
        **/
       queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfo>>;
     };
+    rmrk: {
+      /**
+       * Get tokens owned by an account in a collection
+       **/
+      accountTokens: AugmentedRpc<(accountId: AccountId32 | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;
+      /**
+       * Get base info
+       **/
+      base: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRmrkBaseInfo>>>;
+      /**
+       * Get all Base's parts
+       **/
+      baseParts: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsRmrkPartType>>>;
+      /**
+       * Get collection by id
+       **/
+      collectionById: AugmentedRpc<(id: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRmrkCollectionInfo>>>;
+      /**
+       * Get collection properties
+       **/
+      collectionProperties: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, filterKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsRmrkPropertyInfo>>>;
+      /**
+       * Get the latest created collection id
+       **/
+      lastCollectionIdx: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<u32>>;
+      /**
+       * Get NFT by collection id and NFT id
+       **/
+      nftById: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRmrkNftInfo>>>;
+      /**
+       * Get NFT children
+       **/
+      nftChildren: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsRmrkNftChild>>>;
+      /**
+       * Get NFT properties
+       **/
+      nftProperties: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, filterKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsRmrkPropertyInfo>>>;
+      /**
+       * Get NFT resource priorities
+       **/
+      nftResourcePriorities: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<Bytes>>>;
+      /**
+       * Get NFT resources
+       **/
+      nftResources: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsRmrkResourceInfo>>>;
+      /**
+       * Get Base's theme names
+       **/
+      themeNames: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<Bytes>>>;
+      /**
+       * Get Theme's keys values
+       **/
+      themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option<Vec<Text>> | null | object | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRmrkTheme>>>;
+    };
     rpc: {
       /**
        * Retrieves the list of RPC methods that are exposed by the node
modifiedtests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -4,8 +4,8 @@
 import type { ApiTypes } from '@polkadot/api-base/types';
 import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
 import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
-import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
+import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRmrkBasicResource, UpDataStructsRmrkComposableResource, UpDataStructsRmrkPartType, UpDataStructsRmrkSlotResource, UpDataStructsRmrkTheme, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
 
 declare module '@polkadot/api-base/types/submittable' {
   export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -346,6 +346,30 @@
        **/
       [key: string]: SubmittableExtrinsicFunction<ApiType>;
     };
+    rmrkCore: {
+      addBasicResource: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: UpDataStructsRmrkBasicResource | { src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, UpDataStructsRmrkBasicResource]>;
+      addComposableResource: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: Bytes | string | Uint8Array, resource: UpDataStructsRmrkComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, UpDataStructsRmrkComposableResource]>;
+      addSlotResource: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: UpDataStructsRmrkSlotResource | { base?: any; src?: any; metadata?: any; slot?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, UpDataStructsRmrkSlotResource]>;
+      burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
+      changeCollectionIssuer: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newIssuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
+      createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option<u32> | null | object | string | Uint8Array, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, Option<u32>, Bytes]>;
+      destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+      lockCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+      mintNft: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option<AccountId32> | null | object | string | Uint8Array, royaltyAmount: Option<Permill> | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32, Option<AccountId32>, Option<Permill>, Bytes]>;
+      setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact<u32> | AnyNumber | Uint8Array, maybeNftId: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Option<u32>, Bytes, Bytes]>;
+      /**
+       * Generic tx
+       **/
+      [key: string]: SubmittableExtrinsicFunction<ApiType>;
+    };
+    rmrkEquip: {
+      createBase: AugmentedSubmittable<(baseType: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, parts: Vec<UpDataStructsRmrkPartType> | (UpDataStructsRmrkPartType | { FixedPart: any } | { SlotPart: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Bytes, Bytes, Vec<UpDataStructsRmrkPartType>]>;
+      themeAdd: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, theme: UpDataStructsRmrkTheme | { name?: any; properties?: any; inherit?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsRmrkTheme]>;
+      /**
+       * Generic tx
+       **/
+      [key: string]: SubmittableExtrinsicFunction<ApiType>;
+    };
     structure: {
       /**
        * Generic tx
modifiedtests/src/interfaces/augment-types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -788,6 +788,12 @@
     PalletNonfungibleItemData: PalletNonfungibleItemData;
     PalletRefungibleError: PalletRefungibleError;
     PalletRefungibleItemData: PalletRefungibleItemData;
+    PalletRmrkCoreCall: PalletRmrkCoreCall;
+    PalletRmrkCoreError: PalletRmrkCoreError;
+    PalletRmrkCoreEvent: PalletRmrkCoreEvent;
+    PalletRmrkEquipCall: PalletRmrkEquipCall;
+    PalletRmrkEquipError: PalletRmrkEquipError;
+    PalletRmrkEquipEvent: PalletRmrkEquipEvent;
     PalletsOrigin: PalletsOrigin;
     PalletStorageMetadataLatest: PalletStorageMetadataLatest;
     PalletStorageMetadataV14: PalletStorageMetadataV14;
modifiedtests/src/interfaces/default/types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -1129,6 +1129,169 @@
   readonly constData: Bytes;
 }
 
+/** @name PalletRmrkCoreCall */
+export interface PalletRmrkCoreCall extends Enum {
+  readonly isCreateCollection: boolean;
+  readonly asCreateCollection: {
+    readonly metadata: Bytes;
+    readonly max: Option<u32>;
+    readonly symbol: Bytes;
+  } & Struct;
+  readonly isDestroyCollection: boolean;
+  readonly asDestroyCollection: {
+    readonly collectionId: u32;
+  } & Struct;
+  readonly isChangeCollectionIssuer: boolean;
+  readonly asChangeCollectionIssuer: {
+    readonly collectionId: u32;
+    readonly newIssuer: MultiAddress;
+  } & Struct;
+  readonly isLockCollection: boolean;
+  readonly asLockCollection: {
+    readonly collectionId: u32;
+  } & Struct;
+  readonly isMintNft: boolean;
+  readonly asMintNft: {
+    readonly owner: AccountId32;
+    readonly collectionId: u32;
+    readonly recipient: Option<AccountId32>;
+    readonly royaltyAmount: Option<Permill>;
+    readonly metadata: Bytes;
+  } & Struct;
+  readonly isBurnNft: boolean;
+  readonly asBurnNft: {
+    readonly collectionId: u32;
+    readonly nftId: u32;
+  } & Struct;
+  readonly isSetProperty: boolean;
+  readonly asSetProperty: {
+    readonly rmrkCollectionId: Compact<u32>;
+    readonly maybeNftId: Option<u32>;
+    readonly key: Bytes;
+    readonly value: Bytes;
+  } & Struct;
+  readonly isAddBasicResource: boolean;
+  readonly asAddBasicResource: {
+    readonly collectionId: u32;
+    readonly nftId: u32;
+    readonly resource: UpDataStructsRmrkBasicResource;
+  } & Struct;
+  readonly isAddComposableResource: boolean;
+  readonly asAddComposableResource: {
+    readonly collectionId: u32;
+    readonly nftId: u32;
+    readonly resourceId: Bytes;
+    readonly resource: UpDataStructsRmrkComposableResource;
+  } & Struct;
+  readonly isAddSlotResource: boolean;
+  readonly asAddSlotResource: {
+    readonly collectionId: u32;
+    readonly nftId: u32;
+    readonly resource: UpDataStructsRmrkSlotResource;
+  } & Struct;
+  readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'SetProperty' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource';
+}
+
+/** @name PalletRmrkCoreError */
+export interface PalletRmrkCoreError extends Enum {
+  readonly isCorruptedCollectionType: boolean;
+  readonly isNftTypeEncodeError: boolean;
+  readonly isRmrkPropertyKeyIsTooLong: boolean;
+  readonly isRmrkPropertyValueIsTooLong: boolean;
+  readonly isCollectionNotEmpty: boolean;
+  readonly isNoAvailableCollectionId: boolean;
+  readonly isNoAvailableNftId: boolean;
+  readonly isCollectionUnknown: boolean;
+  readonly isNoPermission: boolean;
+  readonly isCollectionFullOrLocked: boolean;
+  readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'CollectionFullOrLocked';
+}
+
+/** @name PalletRmrkCoreEvent */
+export interface PalletRmrkCoreEvent extends Enum {
+  readonly isCollectionCreated: boolean;
+  readonly asCollectionCreated: {
+    readonly issuer: AccountId32;
+    readonly collectionId: u32;
+  } & Struct;
+  readonly isCollectionDestroyed: boolean;
+  readonly asCollectionDestroyed: {
+    readonly issuer: AccountId32;
+    readonly collectionId: u32;
+  } & Struct;
+  readonly isIssuerChanged: boolean;
+  readonly asIssuerChanged: {
+    readonly oldIssuer: AccountId32;
+    readonly newIssuer: AccountId32;
+    readonly collectionId: u32;
+  } & Struct;
+  readonly isCollectionLocked: boolean;
+  readonly asCollectionLocked: {
+    readonly issuer: AccountId32;
+    readonly collectionId: u32;
+  } & Struct;
+  readonly isNftMinted: boolean;
+  readonly asNftMinted: {
+    readonly owner: AccountId32;
+    readonly collectionId: u32;
+    readonly nftId: u32;
+  } & Struct;
+  readonly isNftBurned: boolean;
+  readonly asNftBurned: {
+    readonly owner: AccountId32;
+    readonly nftId: u32;
+  } & Struct;
+  readonly isPropertySet: boolean;
+  readonly asPropertySet: {
+    readonly collectionId: u32;
+    readonly maybeNftId: Option<u32>;
+    readonly key: Bytes;
+    readonly value: Bytes;
+  } & Struct;
+  readonly isResourceAdded: boolean;
+  readonly asResourceAdded: {
+    readonly nftId: u32;
+    readonly resourceId: u32;
+  } & Struct;
+  readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'PropertySet' | 'ResourceAdded';
+}
+
+/** @name PalletRmrkEquipCall */
+export interface PalletRmrkEquipCall extends Enum {
+  readonly isCreateBase: boolean;
+  readonly asCreateBase: {
+    readonly baseType: Bytes;
+    readonly symbol: Bytes;
+    readonly parts: Vec<UpDataStructsRmrkPartType>;
+  } & Struct;
+  readonly isThemeAdd: boolean;
+  readonly asThemeAdd: {
+    readonly baseId: u32;
+    readonly theme: UpDataStructsRmrkTheme;
+  } & Struct;
+  readonly type: 'CreateBase' | 'ThemeAdd';
+}
+
+/** @name PalletRmrkEquipError */
+export interface PalletRmrkEquipError extends Enum {
+  readonly isPermissionError: boolean;
+  readonly isNoAvailableBaseId: boolean;
+  readonly isNoAvailablePartId: boolean;
+  readonly isBaseDoesntExist: boolean;
+  readonly isNeedsDefaultThemeFirst: boolean;
+  readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst';
+}
+
+/** @name PalletRmrkEquipEvent */
+export interface PalletRmrkEquipEvent extends Enum {
+  readonly isBaseCreated: boolean;
+  readonly asBaseCreated: {
+    readonly issuer: AccountId32;
+    readonly baseId: u32;
+  } & Struct;
+  readonly type: 'BaseCreated';
+}
+
 /** @name PalletStructureCall */
 export interface PalletStructureCall extends Null {}
 
@@ -2014,7 +2177,7 @@
 
 /** @name UpDataStructsRmrkResourceInfo */
 export interface UpDataStructsRmrkResourceInfo extends Struct {
-  readonly id: Bytes;
+  readonly id: u32;
   readonly resource: UpDataStructsRmrkResourceTypes;
   readonly pending: bool;
   readonly pendingRemoval: bool;
modifiedtests/src/interfaces/lookup.tsdiffbeforeafterboth
--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -1528,8 +1528,161 @@
    **/
   PalletStructureCall: 'Null',
   /**
-   * Lookup206: pallet_evm::pallet::Call<T>
+   * Lookup206: pallet_rmrk_core::pallet::Call<T>
+   **/
+  PalletRmrkCoreCall: {
+    _enum: {
+      create_collection: {
+        metadata: 'Bytes',
+        max: 'Option<u32>',
+        symbol: 'Bytes',
+      },
+      destroy_collection: {
+        collectionId: 'u32',
+      },
+      change_collection_issuer: {
+        collectionId: 'u32',
+        newIssuer: 'MultiAddress',
+      },
+      lock_collection: {
+        collectionId: 'u32',
+      },
+      mint_nft: {
+        owner: 'AccountId32',
+        collectionId: 'u32',
+        recipient: 'Option<AccountId32>',
+        royaltyAmount: 'Option<Permill>',
+        metadata: 'Bytes',
+      },
+      burn_nft: {
+        collectionId: 'u32',
+        nftId: 'u32',
+      },
+      set_property: {
+        rmrkCollectionId: 'Compact<u32>',
+        maybeNftId: 'Option<u32>',
+        key: 'Bytes',
+        value: 'Bytes',
+      },
+      add_basic_resource: {
+        collectionId: 'u32',
+        nftId: 'u32',
+        resource: 'UpDataStructsRmrkBasicResource',
+      },
+      add_composable_resource: {
+        collectionId: 'u32',
+        nftId: 'u32',
+        resourceId: 'Bytes',
+        resource: 'UpDataStructsRmrkComposableResource',
+      },
+      add_slot_resource: {
+        collectionId: 'u32',
+        nftId: 'u32',
+        resource: 'UpDataStructsRmrkSlotResource'
+      }
+    }
+  },
+  /**
+   * Lookup212: up_data_structs::rmrk::BasicResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkBasicResource: {
+    src: 'Option<Bytes>',
+    metadata: 'Option<Bytes>',
+    license: 'Option<Bytes>',
+    thumb: 'Option<Bytes>'
+  },
+  /**
+   * Lookup215: up_data_structs::rmrk::ComposableResource<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkComposableResource: {
+    parts: 'Vec<u32>',
+    base: 'u32',
+    src: 'Option<Bytes>',
+    metadata: 'Option<Bytes>',
+    license: 'Option<Bytes>',
+    thumb: 'Option<Bytes>'
+  },
+  /**
+   * Lookup217: up_data_structs::rmrk::SlotResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkSlotResource: {
+    base: 'u32',
+    src: 'Option<Bytes>',
+    metadata: 'Option<Bytes>',
+    slot: 'u32',
+    license: 'Option<Bytes>',
+    thumb: 'Option<Bytes>'
+  },
+  /**
+   * Lookup218: pallet_rmrk_equip::pallet::Call<T>
+   **/
+  PalletRmrkEquipCall: {
+    _enum: {
+      create_base: {
+        baseType: 'Bytes',
+        symbol: 'Bytes',
+        parts: 'Vec<UpDataStructsRmrkPartType>',
+      },
+      theme_add: {
+        baseId: 'u32',
+        theme: 'UpDataStructsRmrkTheme'
+      }
+    }
+  },
+  /**
+   * Lookup220: up_data_structs::rmrk::PartType<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
+  UpDataStructsRmrkPartType: {
+    _enum: {
+      FixedPart: 'UpDataStructsRmrkFixedPart',
+      SlotPart: 'UpDataStructsRmrkSlotPart'
+    }
+  },
+  /**
+   * Lookup222: up_data_structs::rmrk::FixedPart<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkFixedPart: {
+    id: 'u32',
+    z: 'u32',
+    src: 'Bytes'
+  },
+  /**
+   * Lookup223: up_data_structs::rmrk::SlotPart<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkSlotPart: {
+    id: 'u32',
+    equippable: 'UpDataStructsRmrkEquippableList',
+    src: 'Bytes',
+    z: 'u32'
+  },
+  /**
+   * Lookup224: up_data_structs::rmrk::EquippableList<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkEquippableList: {
+    _enum: {
+      All: 'Null',
+      Empty: 'Null',
+      Custom: 'Vec<u32>'
+    }
+  },
+  /**
+   * Lookup226: up_data_structs::rmrk::Theme<frame_support::storage::bounded_vec::BoundedVec<T, S>, PropertyList>
+   **/
+  UpDataStructsRmrkTheme: {
+    name: 'Bytes',
+    properties: 'Vec<UpDataStructsRmrkThemeProperty>',
+    inherit: 'bool'
+  },
+  /**
+   * Lookup228: up_data_structs::rmrk::ThemeProperty<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   **/
+  UpDataStructsRmrkThemeProperty: {
+    key: 'Bytes',
+    value: 'Bytes'
+  },
+  /**
+   * Lookup229: pallet_evm::pallet::Call<T>
+   **/
   PalletEvmCall: {
     _enum: {
       withdraw: {
@@ -1571,7 +1724,7 @@
     }
   },
   /**
-   * Lookup212: pallet_ethereum::pallet::Call<T>
+   * Lookup235: pallet_ethereum::pallet::Call<T>
    **/
   PalletEthereumCall: {
     _enum: {
@@ -1581,7 +1734,7 @@
     }
   },
   /**
-   * Lookup213: ethereum::transaction::TransactionV2
+   * Lookup236: ethereum::transaction::TransactionV2
    **/
   EthereumTransactionTransactionV2: {
     _enum: {
@@ -1591,7 +1744,7 @@
     }
   },
   /**
-   * Lookup214: ethereum::transaction::LegacyTransaction
+   * Lookup237: ethereum::transaction::LegacyTransaction
    **/
   EthereumTransactionLegacyTransaction: {
     nonce: 'U256',
@@ -1603,7 +1756,7 @@
     signature: 'EthereumTransactionTransactionSignature'
   },
   /**
-   * Lookup215: ethereum::transaction::TransactionAction
+   * Lookup238: ethereum::transaction::TransactionAction
    **/
   EthereumTransactionTransactionAction: {
     _enum: {
@@ -1612,7 +1765,7 @@
     }
   },
   /**
-   * Lookup216: ethereum::transaction::TransactionSignature
+   * Lookup239: ethereum::transaction::TransactionSignature
    **/
   EthereumTransactionTransactionSignature: {
     v: 'u64',
@@ -1620,7 +1773,7 @@
     s: 'H256'
   },
   /**
-   * Lookup218: ethereum::transaction::EIP2930Transaction
+   * Lookup241: ethereum::transaction::EIP2930Transaction
    **/
   EthereumTransactionEip2930Transaction: {
     chainId: 'u64',
@@ -1636,14 +1789,14 @@
     s: 'H256'
   },
   /**
-   * Lookup220: ethereum::transaction::AccessListItem
+   * Lookup243: ethereum::transaction::AccessListItem
    **/
   EthereumTransactionAccessListItem: {
     address: 'H160',
     storageKeys: 'Vec<H256>'
   },
   /**
-   * Lookup221: ethereum::transaction::EIP1559Transaction
+   * Lookup244: ethereum::transaction::EIP1559Transaction
    **/
   EthereumTransactionEip1559Transaction: {
     chainId: 'u64',
@@ -1660,7 +1813,7 @@
     s: 'H256'
   },
   /**
-   * Lookup222: pallet_evm_migration::pallet::Call<T>
+   * Lookup245: pallet_evm_migration::pallet::Call<T>
    **/
   PalletEvmMigrationCall: {
     _enum: {
@@ -1678,7 +1831,7 @@
     }
   },
   /**
-   * Lookup225: pallet_sudo::pallet::Event<T>
+   * Lookup248: pallet_sudo::pallet::Event<T>
    **/
   PalletSudoEvent: {
     _enum: {
@@ -1694,7 +1847,7 @@
     }
   },
   /**
-   * Lookup227: sp_runtime::DispatchError
+   * Lookup250: sp_runtime::DispatchError
    **/
   SpRuntimeDispatchError: {
     _enum: {
@@ -1711,38 +1864,38 @@
     }
   },
   /**
-   * Lookup228: sp_runtime::ModuleError
+   * Lookup251: sp_runtime::ModuleError
    **/
   SpRuntimeModuleError: {
     index: 'u8',
     error: '[u8;4]'
   },
   /**
-   * Lookup229: sp_runtime::TokenError
+   * Lookup252: sp_runtime::TokenError
    **/
   SpRuntimeTokenError: {
     _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported']
   },
   /**
-   * Lookup230: sp_runtime::ArithmeticError
+   * Lookup253: sp_runtime::ArithmeticError
    **/
   SpRuntimeArithmeticError: {
     _enum: ['Underflow', 'Overflow', 'DivisionByZero']
   },
   /**
-   * Lookup231: sp_runtime::TransactionalError
+   * Lookup254: sp_runtime::TransactionalError
    **/
   SpRuntimeTransactionalError: {
     _enum: ['LimitReached', 'NoLayer']
   },
   /**
-   * Lookup232: pallet_sudo::pallet::Error<T>
+   * Lookup255: pallet_sudo::pallet::Error<T>
    **/
   PalletSudoError: {
     _enum: ['RequireSudo']
   },
   /**
-   * Lookup233: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
+   * Lookup256: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
    **/
   FrameSystemAccountInfo: {
     nonce: 'u32',
@@ -1752,7 +1905,7 @@
     data: 'PalletBalancesAccountData'
   },
   /**
-   * Lookup234: frame_support::weights::PerDispatchClass<T>
+   * Lookup257: frame_support::weights::PerDispatchClass<T>
    **/
   FrameSupportWeightsPerDispatchClassU64: {
     normal: 'u64',
@@ -1760,13 +1913,13 @@
     mandatory: 'u64'
   },
   /**
-   * Lookup235: sp_runtime::generic::digest::Digest
+   * Lookup258: sp_runtime::generic::digest::Digest
    **/
   SpRuntimeDigest: {
     logs: 'Vec<SpRuntimeDigestDigestItem>'
   },
   /**
-   * Lookup237: sp_runtime::generic::digest::DigestItem
+   * Lookup260: sp_runtime::generic::digest::DigestItem
    **/
   SpRuntimeDigestDigestItem: {
     _enum: {
@@ -1782,7 +1935,7 @@
     }
   },
   /**
-   * Lookup239: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
+   * Lookup262: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
    **/
   FrameSystemEventRecord: {
     phase: 'FrameSystemPhase',
@@ -1790,7 +1943,7 @@
     topics: 'Vec<H256>'
   },
   /**
-   * Lookup241: frame_system::pallet::Event<T>
+   * Lookup264: frame_system::pallet::Event<T>
    **/
   FrameSystemEvent: {
     _enum: {
@@ -1818,7 +1971,7 @@
     }
   },
   /**
-   * Lookup242: frame_support::weights::DispatchInfo
+   * Lookup265: frame_support::weights::DispatchInfo
    **/
   FrameSupportWeightsDispatchInfo: {
     weight: 'u64',
@@ -1826,19 +1979,19 @@
     paysFee: 'FrameSupportWeightsPays'
   },
   /**
-   * Lookup243: frame_support::weights::DispatchClass
+   * Lookup266: frame_support::weights::DispatchClass
    **/
   FrameSupportWeightsDispatchClass: {
     _enum: ['Normal', 'Operational', 'Mandatory']
   },
   /**
-   * Lookup244: frame_support::weights::Pays
+   * Lookup267: frame_support::weights::Pays
    **/
   FrameSupportWeightsPays: {
     _enum: ['Yes', 'No']
   },
   /**
-   * Lookup245: orml_vesting::module::Event<T>
+   * Lookup268: orml_vesting::module::Event<T>
    **/
   OrmlVestingModuleEvent: {
     _enum: {
@@ -1857,7 +2010,7 @@
     }
   },
   /**
-   * Lookup246: cumulus_pallet_xcmp_queue::pallet::Event<T>
+   * Lookup269: cumulus_pallet_xcmp_queue::pallet::Event<T>
    **/
   CumulusPalletXcmpQueueEvent: {
     _enum: {
@@ -1872,7 +2025,7 @@
     }
   },
   /**
-   * Lookup247: pallet_xcm::pallet::Event<T>
+   * Lookup270: pallet_xcm::pallet::Event<T>
    **/
   PalletXcmEvent: {
     _enum: {
@@ -1895,7 +2048,7 @@
     }
   },
   /**
-   * Lookup248: xcm::v2::traits::Outcome
+   * Lookup271: xcm::v2::traits::Outcome
    **/
   XcmV2TraitsOutcome: {
     _enum: {
@@ -1905,7 +2058,7 @@
     }
   },
   /**
-   * Lookup250: cumulus_pallet_xcm::pallet::Event<T>
+   * Lookup273: cumulus_pallet_xcm::pallet::Event<T>
    **/
   CumulusPalletXcmEvent: {
     _enum: {
@@ -1915,7 +2068,7 @@
     }
   },
   /**
-   * Lookup251: cumulus_pallet_dmp_queue::pallet::Event<T>
+   * Lookup274: cumulus_pallet_dmp_queue::pallet::Event<T>
    **/
   CumulusPalletDmpQueueEvent: {
     _enum: {
@@ -1928,7 +2081,7 @@
     }
   },
   /**
-   * Lookup252: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+   * Lookup275: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
    **/
   PalletUniqueRawEvent: {
     _enum: {
@@ -1945,7 +2098,7 @@
     }
   },
   /**
-   * Lookup253: pallet_common::pallet::Event<T>
+   * Lookup276: pallet_common::pallet::Event<T>
    **/
   PalletCommonEvent: {
     _enum: {
@@ -1963,7 +2116,7 @@
     }
   },
   /**
-   * Lookup254: pallet_structure::pallet::Event<T>
+   * Lookup277: pallet_structure::pallet::Event<T>
    **/
   PalletStructureEvent: {
     _enum: {
@@ -1971,8 +2124,62 @@
     }
   },
   /**
-   * Lookup255: pallet_evm::pallet::Event<T>
+   * Lookup278: pallet_rmrk_core::pallet::Event<T>
    **/
+  PalletRmrkCoreEvent: {
+    _enum: {
+      CollectionCreated: {
+        issuer: 'AccountId32',
+        collectionId: 'u32',
+      },
+      CollectionDestroyed: {
+        issuer: 'AccountId32',
+        collectionId: 'u32',
+      },
+      IssuerChanged: {
+        oldIssuer: 'AccountId32',
+        newIssuer: 'AccountId32',
+        collectionId: 'u32',
+      },
+      CollectionLocked: {
+        issuer: 'AccountId32',
+        collectionId: 'u32',
+      },
+      NftMinted: {
+        owner: 'AccountId32',
+        collectionId: 'u32',
+        nftId: 'u32',
+      },
+      NFTBurned: {
+        owner: 'AccountId32',
+        nftId: 'u32',
+      },
+      PropertySet: {
+        collectionId: 'u32',
+        maybeNftId: 'Option<u32>',
+        key: 'Bytes',
+        value: 'Bytes',
+      },
+      ResourceAdded: {
+        nftId: 'u32',
+        resourceId: 'u32'
+      }
+    }
+  },
+  /**
+   * Lookup279: pallet_rmrk_equip::pallet::Event<T>
+   **/
+  PalletRmrkEquipEvent: {
+    _enum: {
+      BaseCreated: {
+        issuer: 'AccountId32',
+        baseId: 'u32'
+      }
+    }
+  },
+  /**
+   * Lookup280: pallet_evm::pallet::Event<T>
+   **/
   PalletEvmEvent: {
     _enum: {
       Log: 'EthereumLog',
@@ -1985,7 +2192,7 @@
     }
   },
   /**
-   * Lookup256: ethereum::log::Log
+   * Lookup281: ethereum::log::Log
    **/
   EthereumLog: {
     address: 'H160',
@@ -1993,7 +2200,7 @@
     data: 'Bytes'
   },
   /**
-   * Lookup257: pallet_ethereum::pallet::Event
+   * Lookup282: pallet_ethereum::pallet::Event
    **/
   PalletEthereumEvent: {
     _enum: {
@@ -2001,7 +2208,7 @@
     }
   },
   /**
-   * Lookup258: evm_core::error::ExitReason
+   * Lookup283: evm_core::error::ExitReason
    **/
   EvmCoreErrorExitReason: {
     _enum: {
@@ -2012,13 +2219,13 @@
     }
   },
   /**
-   * Lookup259: evm_core::error::ExitSucceed
+   * Lookup284: evm_core::error::ExitSucceed
    **/
   EvmCoreErrorExitSucceed: {
     _enum: ['Stopped', 'Returned', 'Suicided']
   },
   /**
-   * Lookup260: evm_core::error::ExitError
+   * Lookup285: evm_core::error::ExitError
    **/
   EvmCoreErrorExitError: {
     _enum: {
@@ -2040,13 +2247,13 @@
     }
   },
   /**
-   * Lookup263: evm_core::error::ExitRevert
+   * Lookup288: evm_core::error::ExitRevert
    **/
   EvmCoreErrorExitRevert: {
     _enum: ['Reverted']
   },
   /**
-   * Lookup264: evm_core::error::ExitFatal
+   * Lookup289: evm_core::error::ExitFatal
    **/
   EvmCoreErrorExitFatal: {
     _enum: {
@@ -2057,7 +2264,7 @@
     }
   },
   /**
-   * Lookup265: frame_system::Phase
+   * Lookup290: frame_system::Phase
    **/
   FrameSystemPhase: {
     _enum: {
@@ -2067,14 +2274,14 @@
     }
   },
   /**
-   * Lookup267: frame_system::LastRuntimeUpgradeInfo
+   * Lookup292: frame_system::LastRuntimeUpgradeInfo
    **/
   FrameSystemLastRuntimeUpgradeInfo: {
     specVersion: 'Compact<u32>',
     specName: 'Text'
   },
   /**
-   * Lookup268: frame_system::limits::BlockWeights
+   * Lookup293: frame_system::limits::BlockWeights
    **/
   FrameSystemLimitsBlockWeights: {
     baseBlock: 'u64',
@@ -2082,7 +2289,7 @@
     perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
   },
   /**
-   * Lookup269: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
+   * Lookup294: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
    **/
   FrameSupportWeightsPerDispatchClassWeightsPerClass: {
     normal: 'FrameSystemLimitsWeightsPerClass',
@@ -2090,7 +2297,7 @@
     mandatory: 'FrameSystemLimitsWeightsPerClass'
   },
   /**
-   * Lookup270: frame_system::limits::WeightsPerClass
+   * Lookup295: frame_system::limits::WeightsPerClass
    **/
   FrameSystemLimitsWeightsPerClass: {
     baseExtrinsic: 'u64',
@@ -2099,13 +2306,13 @@
     reserved: 'Option<u64>'
   },
   /**
-   * Lookup272: frame_system::limits::BlockLength
+   * Lookup297: frame_system::limits::BlockLength
    **/
   FrameSystemLimitsBlockLength: {
     max: 'FrameSupportWeightsPerDispatchClassU32'
   },
   /**
-   * Lookup273: frame_support::weights::PerDispatchClass<T>
+   * Lookup298: frame_support::weights::PerDispatchClass<T>
    **/
   FrameSupportWeightsPerDispatchClassU32: {
     normal: 'u32',
@@ -2113,14 +2320,14 @@
     mandatory: 'u32'
   },
   /**
-   * Lookup274: frame_support::weights::RuntimeDbWeight
+   * Lookup299: frame_support::weights::RuntimeDbWeight
    **/
   FrameSupportWeightsRuntimeDbWeight: {
     read: 'u64',
     write: 'u64'
   },
   /**
-   * Lookup275: sp_version::RuntimeVersion
+   * Lookup300: sp_version::RuntimeVersion
    **/
   SpVersionRuntimeVersion: {
     specName: 'Text',
@@ -2133,19 +2340,19 @@
     stateVersion: 'u8'
   },
   /**
-   * Lookup279: frame_system::pallet::Error<T>
+   * Lookup304: frame_system::pallet::Error<T>
    **/
   FrameSystemError: {
     _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
   },
   /**
-   * Lookup281: orml_vesting::module::Error<T>
+   * Lookup306: orml_vesting::module::Error<T>
    **/
   OrmlVestingModuleError: {
     _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
   },
   /**
-   * Lookup283: cumulus_pallet_xcmp_queue::InboundChannelDetails
+   * Lookup308: cumulus_pallet_xcmp_queue::InboundChannelDetails
    **/
   CumulusPalletXcmpQueueInboundChannelDetails: {
     sender: 'u32',
@@ -2153,19 +2360,19 @@
     messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
   },
   /**
-   * Lookup284: cumulus_pallet_xcmp_queue::InboundState
+   * Lookup309: cumulus_pallet_xcmp_queue::InboundState
    **/
   CumulusPalletXcmpQueueInboundState: {
     _enum: ['Ok', 'Suspended']
   },
   /**
-   * Lookup287: polkadot_parachain::primitives::XcmpMessageFormat
+   * Lookup312: polkadot_parachain::primitives::XcmpMessageFormat
    **/
   PolkadotParachainPrimitivesXcmpMessageFormat: {
     _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
   },
   /**
-   * Lookup290: cumulus_pallet_xcmp_queue::OutboundChannelDetails
+   * Lookup315: cumulus_pallet_xcmp_queue::OutboundChannelDetails
    **/
   CumulusPalletXcmpQueueOutboundChannelDetails: {
     recipient: 'u32',
@@ -2175,13 +2382,13 @@
     lastIndex: 'u16'
   },
   /**
-   * Lookup291: cumulus_pallet_xcmp_queue::OutboundState
+   * Lookup316: cumulus_pallet_xcmp_queue::OutboundState
    **/
   CumulusPalletXcmpQueueOutboundState: {
     _enum: ['Ok', 'Suspended']
   },
   /**
-   * Lookup293: cumulus_pallet_xcmp_queue::QueueConfigData
+   * Lookup318: cumulus_pallet_xcmp_queue::QueueConfigData
    **/
   CumulusPalletXcmpQueueQueueConfigData: {
     suspendThreshold: 'u32',
@@ -2192,29 +2399,29 @@
     xcmpMaxIndividualWeight: 'u64'
   },
   /**
-   * Lookup295: cumulus_pallet_xcmp_queue::pallet::Error<T>
+   * Lookup320: cumulus_pallet_xcmp_queue::pallet::Error<T>
    **/
   CumulusPalletXcmpQueueError: {
     _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
   },
   /**
-   * Lookup296: pallet_xcm::pallet::Error<T>
+   * Lookup321: pallet_xcm::pallet::Error<T>
    **/
   PalletXcmError: {
     _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
   },
   /**
-   * Lookup297: cumulus_pallet_xcm::pallet::Error<T>
+   * Lookup322: cumulus_pallet_xcm::pallet::Error<T>
    **/
   CumulusPalletXcmError: 'Null',
   /**
-   * Lookup298: cumulus_pallet_dmp_queue::ConfigData
+   * Lookup323: cumulus_pallet_dmp_queue::ConfigData
    **/
   CumulusPalletDmpQueueConfigData: {
     maxIndividual: 'u64'
   },
   /**
-   * Lookup299: cumulus_pallet_dmp_queue::PageIndexData
+   * Lookup324: cumulus_pallet_dmp_queue::PageIndexData
    **/
   CumulusPalletDmpQueuePageIndexData: {
     beginUsed: 'u32',
@@ -2222,19 +2429,19 @@
     overweightCount: 'u64'
   },
   /**
-   * Lookup302: cumulus_pallet_dmp_queue::pallet::Error<T>
+   * Lookup327: cumulus_pallet_dmp_queue::pallet::Error<T>
    **/
   CumulusPalletDmpQueueError: {
     _enum: ['Unknown', 'OverLimit']
   },
   /**
-   * Lookup306: pallet_unique::Error<T>
+   * Lookup331: pallet_unique::Error<T>
    **/
   PalletUniqueError: {
     _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument']
   },
   /**
-   * Lookup307: up_data_structs::Collection<sp_core::crypto::AccountId32>
+   * Lookup332: up_data_structs::Collection<sp_core::crypto::AccountId32>
    **/
   UpDataStructsCollection: {
     owner: 'AccountId32',
@@ -2247,7 +2454,7 @@
     permissions: 'UpDataStructsCollectionPermissions'
   },
   /**
-   * Lookup308: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+   * Lookup333: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
    **/
   UpDataStructsSponsorshipState: {
     _enum: {
@@ -2257,7 +2464,7 @@
     }
   },
   /**
-   * Lookup309: up_data_structs::Properties
+   * Lookup334: up_data_structs::Properties
    **/
   UpDataStructsProperties: {
     map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2265,15 +2472,15 @@
     spaceLimit: 'u32'
   },
   /**
-   * Lookup310: up_data_structs::PropertiesMap<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup335: up_data_structs::PropertiesMap<frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
   /**
-   * Lookup315: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
+   * Lookup340: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
    **/
   UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
   /**
-   * Lookup322: up_data_structs::CollectionStats
+   * Lookup347: up_data_structs::CollectionStats
    **/
   UpDataStructsCollectionStats: {
     created: 'u32',
@@ -2353,7 +2560,7 @@
    * Lookup336: up_data_structs::rmrk::ResourceInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   UpDataStructsRmrkResourceInfo: {
-    id: 'Bytes',
+    id: 'u32',
     resource: 'UpDataStructsRmrkResourceTypes',
     pending: 'bool',
     pendingRemoval: 'bool'
modifiedtests/src/interfaces/registry.tsdiffbeforeafterboth
--- a/tests/src/interfaces/registry.ts
+++ b/tests/src/interfaces/registry.ts
@@ -104,6 +104,12 @@
     PalletNonfungibleItemData: PalletNonfungibleItemData;
     PalletRefungibleError: PalletRefungibleError;
     PalletRefungibleItemData: PalletRefungibleItemData;
+    PalletRmrkCoreCall: PalletRmrkCoreCall;
+    PalletRmrkCoreError: PalletRmrkCoreError;
+    PalletRmrkCoreEvent: PalletRmrkCoreEvent;
+    PalletRmrkEquipCall: PalletRmrkEquipCall;
+    PalletRmrkEquipError: PalletRmrkEquipError;
+    PalletRmrkEquipEvent: PalletRmrkEquipEvent;
     PalletStructureCall: PalletStructureCall;
     PalletStructureError: PalletStructureError;
     PalletStructureEvent: PalletStructureEvent;
modifiedtests/src/interfaces/rmrk/definitions.tsdiffbeforeafterboth
--- a/tests/src/interfaces/rmrk/definitions.ts
+++ b/tests/src/interfaces/rmrk/definitions.ts
@@ -58,7 +58,10 @@
     ),
     collectionProperties: fn(
       'Get collection properties',
-      [{name: 'collectionId', type: 'u32'}],
+      [
+        {name: 'collectionId', type: 'u32'},
+        {name: 'filterKeys', type: 'Vec<String>', isOptional: true},
+      ],
       'Vec<UpDataStructsRmrkPropertyInfo>',
     ),
     nftProperties: fn(
@@ -66,6 +69,7 @@
       [
         {name: 'collectionId', type: 'u32'},
         {name: 'nftId', type: 'u32'},
+        {name: 'filterKeys', type: 'Vec<String>', isOptional: true},
       ],
       'Vec<UpDataStructsRmrkPropertyInfo>',
     ),
modifiedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth
--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -1649,7 +1649,160 @@
   /** @name PalletStructureCall (205) */
   export type PalletStructureCall = Null;
 
-  /** @name PalletEvmCall (206) */
+  /** @name PalletRmrkCoreCall (206) */
+  export interface PalletRmrkCoreCall extends Enum {
+    readonly isCreateCollection: boolean;
+    readonly asCreateCollection: {
+      readonly metadata: Bytes;
+      readonly max: Option<u32>;
+      readonly symbol: Bytes;
+    } & Struct;
+    readonly isDestroyCollection: boolean;
+    readonly asDestroyCollection: {
+      readonly collectionId: u32;
+    } & Struct;
+    readonly isChangeCollectionIssuer: boolean;
+    readonly asChangeCollectionIssuer: {
+      readonly collectionId: u32;
+      readonly newIssuer: MultiAddress;
+    } & Struct;
+    readonly isLockCollection: boolean;
+    readonly asLockCollection: {
+      readonly collectionId: u32;
+    } & Struct;
+    readonly isMintNft: boolean;
+    readonly asMintNft: {
+      readonly owner: AccountId32;
+      readonly collectionId: u32;
+      readonly recipient: Option<AccountId32>;
+      readonly royaltyAmount: Option<Permill>;
+      readonly metadata: Bytes;
+    } & Struct;
+    readonly isBurnNft: boolean;
+    readonly asBurnNft: {
+      readonly collectionId: u32;
+      readonly nftId: u32;
+    } & Struct;
+    readonly isSetProperty: boolean;
+    readonly asSetProperty: {
+      readonly rmrkCollectionId: Compact<u32>;
+      readonly maybeNftId: Option<u32>;
+      readonly key: Bytes;
+      readonly value: Bytes;
+    } & Struct;
+    readonly isAddBasicResource: boolean;
+    readonly asAddBasicResource: {
+      readonly collectionId: u32;
+      readonly nftId: u32;
+      readonly resource: UpDataStructsRmrkBasicResource;
+    } & Struct;
+    readonly isAddComposableResource: boolean;
+    readonly asAddComposableResource: {
+      readonly collectionId: u32;
+      readonly nftId: u32;
+      readonly resourceId: Bytes;
+      readonly resource: UpDataStructsRmrkComposableResource;
+    } & Struct;
+    readonly isAddSlotResource: boolean;
+    readonly asAddSlotResource: {
+      readonly collectionId: u32;
+      readonly nftId: u32;
+      readonly resource: UpDataStructsRmrkSlotResource;
+    } & Struct;
+    readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'SetProperty' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource';
+  }
+
+  /** @name UpDataStructsRmrkBasicResource (212) */
+  export interface UpDataStructsRmrkBasicResource extends Struct {
+    readonly src: Option<Bytes>;
+    readonly metadata: Option<Bytes>;
+    readonly license: Option<Bytes>;
+    readonly thumb: Option<Bytes>;
+  }
+
+  /** @name UpDataStructsRmrkComposableResource (215) */
+  export interface UpDataStructsRmrkComposableResource extends Struct {
+    readonly parts: Vec<u32>;
+    readonly base: u32;
+    readonly src: Option<Bytes>;
+    readonly metadata: Option<Bytes>;
+    readonly license: Option<Bytes>;
+    readonly thumb: Option<Bytes>;
+  }
+
+  /** @name UpDataStructsRmrkSlotResource (217) */
+  export interface UpDataStructsRmrkSlotResource extends Struct {
+    readonly base: u32;
+    readonly src: Option<Bytes>;
+    readonly metadata: Option<Bytes>;
+    readonly slot: u32;
+    readonly license: Option<Bytes>;
+    readonly thumb: Option<Bytes>;
+  }
+
+  /** @name PalletRmrkEquipCall (218) */
+  export interface PalletRmrkEquipCall extends Enum {
+    readonly isCreateBase: boolean;
+    readonly asCreateBase: {
+      readonly baseType: Bytes;
+      readonly symbol: Bytes;
+      readonly parts: Vec<UpDataStructsRmrkPartType>;
+    } & Struct;
+    readonly isThemeAdd: boolean;
+    readonly asThemeAdd: {
+      readonly baseId: u32;
+      readonly theme: UpDataStructsRmrkTheme;
+    } & Struct;
+    readonly type: 'CreateBase' | 'ThemeAdd';
+  }
+
+  /** @name UpDataStructsRmrkPartType (220) */
+  export interface UpDataStructsRmrkPartType extends Enum {
+    readonly isFixedPart: boolean;
+    readonly asFixedPart: UpDataStructsRmrkFixedPart;
+    readonly isSlotPart: boolean;
+    readonly asSlotPart: UpDataStructsRmrkSlotPart;
+    readonly type: 'FixedPart' | 'SlotPart';
+  }
+
+  /** @name UpDataStructsRmrkFixedPart (222) */
+  export interface UpDataStructsRmrkFixedPart extends Struct {
+    readonly id: u32;
+    readonly z: u32;
+    readonly src: Bytes;
+  }
+
+  /** @name UpDataStructsRmrkSlotPart (223) */
+  export interface UpDataStructsRmrkSlotPart extends Struct {
+    readonly id: u32;
+    readonly equippable: UpDataStructsRmrkEquippableList;
+    readonly src: Bytes;
+    readonly z: u32;
+  }
+
+  /** @name UpDataStructsRmrkEquippableList (224) */
+  export interface UpDataStructsRmrkEquippableList extends Enum {
+    readonly isAll: boolean;
+    readonly isEmpty: boolean;
+    readonly isCustom: boolean;
+    readonly asCustom: Vec<u32>;
+    readonly type: 'All' | 'Empty' | 'Custom';
+  }
+
+  /** @name UpDataStructsRmrkTheme (226) */
+  export interface UpDataStructsRmrkTheme extends Struct {
+    readonly name: Bytes;
+    readonly properties: Vec<UpDataStructsRmrkThemeProperty>;
+    readonly inherit: bool;
+  }
+
+  /** @name UpDataStructsRmrkThemeProperty (228) */
+  export interface UpDataStructsRmrkThemeProperty extends Struct {
+    readonly key: Bytes;
+    readonly value: Bytes;
+  }
+
+  /** @name PalletEvmCall (229) */
   export interface PalletEvmCall extends Enum {
     readonly isWithdraw: boolean;
     readonly asWithdraw: {
@@ -1694,7 +1847,7 @@
     readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';
   }
 
-  /** @name PalletEthereumCall (212) */
+  /** @name PalletEthereumCall (235) */
   export interface PalletEthereumCall extends Enum {
     readonly isTransact: boolean;
     readonly asTransact: {
@@ -1703,7 +1856,7 @@
     readonly type: 'Transact';
   }
 
-  /** @name EthereumTransactionTransactionV2 (213) */
+  /** @name EthereumTransactionTransactionV2 (236) */
   export interface EthereumTransactionTransactionV2 extends Enum {
     readonly isLegacy: boolean;
     readonly asLegacy: EthereumTransactionLegacyTransaction;
@@ -1714,7 +1867,7 @@
     readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
   }
 
-  /** @name EthereumTransactionLegacyTransaction (214) */
+  /** @name EthereumTransactionLegacyTransaction (237) */
   export interface EthereumTransactionLegacyTransaction extends Struct {
     readonly nonce: U256;
     readonly gasPrice: U256;
@@ -1725,7 +1878,7 @@
     readonly signature: EthereumTransactionTransactionSignature;
   }
 
-  /** @name EthereumTransactionTransactionAction (215) */
+  /** @name EthereumTransactionTransactionAction (238) */
   export interface EthereumTransactionTransactionAction extends Enum {
     readonly isCall: boolean;
     readonly asCall: H160;
@@ -1733,14 +1886,14 @@
     readonly type: 'Call' | 'Create';
   }
 
-  /** @name EthereumTransactionTransactionSignature (216) */
+  /** @name EthereumTransactionTransactionSignature (239) */
   export interface EthereumTransactionTransactionSignature extends Struct {
     readonly v: u64;
     readonly r: H256;
     readonly s: H256;
   }
 
-  /** @name EthereumTransactionEip2930Transaction (218) */
+  /** @name EthereumTransactionEip2930Transaction (241) */
   export interface EthereumTransactionEip2930Transaction extends Struct {
     readonly chainId: u64;
     readonly nonce: U256;
@@ -1755,13 +1908,13 @@
     readonly s: H256;
   }
 
-  /** @name EthereumTransactionAccessListItem (220) */
+  /** @name EthereumTransactionAccessListItem (243) */
   export interface EthereumTransactionAccessListItem extends Struct {
     readonly address: H160;
     readonly storageKeys: Vec<H256>;
   }
 
-  /** @name EthereumTransactionEip1559Transaction (221) */
+  /** @name EthereumTransactionEip1559Transaction (244) */
   export interface EthereumTransactionEip1559Transaction extends Struct {
     readonly chainId: u64;
     readonly nonce: U256;
@@ -1777,7 +1930,7 @@
     readonly s: H256;
   }
 
-  /** @name PalletEvmMigrationCall (222) */
+  /** @name PalletEvmMigrationCall (245) */
   export interface PalletEvmMigrationCall extends Enum {
     readonly isBegin: boolean;
     readonly asBegin: {
@@ -1796,7 +1949,7 @@
     readonly type: 'Begin' | 'SetData' | 'Finish';
   }
 
-  /** @name PalletSudoEvent (225) */
+  /** @name PalletSudoEvent (248) */
   export interface PalletSudoEvent extends Enum {
     readonly isSudid: boolean;
     readonly asSudid: {
@@ -1813,7 +1966,7 @@
     readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';
   }
 
-  /** @name SpRuntimeDispatchError (227) */
+  /** @name SpRuntimeDispatchError (250) */
   export interface SpRuntimeDispatchError extends Enum {
     readonly isOther: boolean;
     readonly isCannotLookup: boolean;
@@ -1832,13 +1985,13 @@
     readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';
   }
 
-  /** @name SpRuntimeModuleError (228) */
+  /** @name SpRuntimeModuleError (251) */
   export interface SpRuntimeModuleError extends Struct {
     readonly index: u8;
     readonly error: U8aFixed;
   }
 
-  /** @name SpRuntimeTokenError (229) */
+  /** @name SpRuntimeTokenError (252) */
   export interface SpRuntimeTokenError extends Enum {
     readonly isNoFunds: boolean;
     readonly isWouldDie: boolean;
@@ -1850,7 +2003,7 @@
     readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';
   }
 
-  /** @name SpRuntimeArithmeticError (230) */
+  /** @name SpRuntimeArithmeticError (253) */
   export interface SpRuntimeArithmeticError extends Enum {
     readonly isUnderflow: boolean;
     readonly isOverflow: boolean;
@@ -1858,20 +2011,20 @@
     readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';
   }
 
-  /** @name SpRuntimeTransactionalError (231) */
+  /** @name SpRuntimeTransactionalError (254) */
   export interface SpRuntimeTransactionalError extends Enum {
     readonly isLimitReached: boolean;
     readonly isNoLayer: boolean;
     readonly type: 'LimitReached' | 'NoLayer';
   }
 
-  /** @name PalletSudoError (232) */
+  /** @name PalletSudoError (255) */
   export interface PalletSudoError extends Enum {
     readonly isRequireSudo: boolean;
     readonly type: 'RequireSudo';
   }
 
-  /** @name FrameSystemAccountInfo (233) */
+  /** @name FrameSystemAccountInfo (256) */
   export interface FrameSystemAccountInfo extends Struct {
     readonly nonce: u32;
     readonly consumers: u32;
@@ -1880,19 +2033,19 @@
     readonly data: PalletBalancesAccountData;
   }
 
-  /** @name FrameSupportWeightsPerDispatchClassU64 (234) */
+  /** @name FrameSupportWeightsPerDispatchClassU64 (257) */
   export interface FrameSupportWeightsPerDispatchClassU64 extends Struct {
     readonly normal: u64;
     readonly operational: u64;
     readonly mandatory: u64;
   }
 
-  /** @name SpRuntimeDigest (235) */
+  /** @name SpRuntimeDigest (258) */
   export interface SpRuntimeDigest extends Struct {
     readonly logs: Vec<SpRuntimeDigestDigestItem>;
   }
 
-  /** @name SpRuntimeDigestDigestItem (237) */
+  /** @name SpRuntimeDigestDigestItem (260) */
   export interface SpRuntimeDigestDigestItem extends Enum {
     readonly isOther: boolean;
     readonly asOther: Bytes;
@@ -1906,14 +2059,14 @@
     readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';
   }
 
-  /** @name FrameSystemEventRecord (239) */
+  /** @name FrameSystemEventRecord (262) */
   export interface FrameSystemEventRecord extends Struct {
     readonly phase: FrameSystemPhase;
     readonly event: Event;
     readonly topics: Vec<H256>;
   }
 
-  /** @name FrameSystemEvent (241) */
+  /** @name FrameSystemEvent (264) */
   export interface FrameSystemEvent extends Enum {
     readonly isExtrinsicSuccess: boolean;
     readonly asExtrinsicSuccess: {
@@ -1941,14 +2094,14 @@
     readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';
   }
 
-  /** @name FrameSupportWeightsDispatchInfo (242) */
+  /** @name FrameSupportWeightsDispatchInfo (265) */
   export interface FrameSupportWeightsDispatchInfo extends Struct {
     readonly weight: u64;
     readonly class: FrameSupportWeightsDispatchClass;
     readonly paysFee: FrameSupportWeightsPays;
   }
 
-  /** @name FrameSupportWeightsDispatchClass (243) */
+  /** @name FrameSupportWeightsDispatchClass (266) */
   export interface FrameSupportWeightsDispatchClass extends Enum {
     readonly isNormal: boolean;
     readonly isOperational: boolean;
@@ -1956,14 +2109,14 @@
     readonly type: 'Normal' | 'Operational' | 'Mandatory';
   }
 
-  /** @name FrameSupportWeightsPays (244) */
+  /** @name FrameSupportWeightsPays (267) */
   export interface FrameSupportWeightsPays extends Enum {
     readonly isYes: boolean;
     readonly isNo: boolean;
     readonly type: 'Yes' | 'No';
   }
 
-  /** @name OrmlVestingModuleEvent (245) */
+  /** @name OrmlVestingModuleEvent (268) */
   export interface OrmlVestingModuleEvent extends Enum {
     readonly isVestingScheduleAdded: boolean;
     readonly asVestingScheduleAdded: {
@@ -1983,7 +2136,7 @@
     readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';
   }
 
-  /** @name CumulusPalletXcmpQueueEvent (246) */
+  /** @name CumulusPalletXcmpQueueEvent (269) */
   export interface CumulusPalletXcmpQueueEvent extends Enum {
     readonly isSuccess: boolean;
     readonly asSuccess: Option<H256>;
@@ -2004,7 +2157,7 @@
     readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';
   }
 
-  /** @name PalletXcmEvent (247) */
+  /** @name PalletXcmEvent (270) */
   export interface PalletXcmEvent extends Enum {
     readonly isAttempted: boolean;
     readonly asAttempted: XcmV2TraitsOutcome;
@@ -2041,7 +2194,7 @@
     readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';
   }
 
-  /** @name XcmV2TraitsOutcome (248) */
+  /** @name XcmV2TraitsOutcome (271) */
   export interface XcmV2TraitsOutcome extends Enum {
     readonly isComplete: boolean;
     readonly asComplete: u64;
@@ -2052,7 +2205,7 @@
     readonly type: 'Complete' | 'Incomplete' | 'Error';
   }
 
-  /** @name CumulusPalletXcmEvent (250) */
+  /** @name CumulusPalletXcmEvent (273) */
   export interface CumulusPalletXcmEvent extends Enum {
     readonly isInvalidFormat: boolean;
     readonly asInvalidFormat: U8aFixed;
@@ -2063,7 +2216,7 @@
     readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';
   }
 
-  /** @name CumulusPalletDmpQueueEvent (251) */
+  /** @name CumulusPalletDmpQueueEvent (274) */
   export interface CumulusPalletDmpQueueEvent extends Enum {
     readonly isInvalidFormat: boolean;
     readonly asInvalidFormat: U8aFixed;
@@ -2080,7 +2233,7 @@
     readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';
   }
 
-  /** @name PalletUniqueRawEvent (252) */
+  /** @name PalletUniqueRawEvent (275) */
   export interface PalletUniqueRawEvent extends Enum {
     readonly isCollectionSponsorRemoved: boolean;
     readonly asCollectionSponsorRemoved: u32;
@@ -2105,7 +2258,7 @@
     readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';
   }
 
-  /** @name PalletCommonEvent (253) */
+  /** @name PalletCommonEvent (276) */
   export interface PalletCommonEvent extends Enum {
     readonly isCollectionCreated: boolean;
     readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;
@@ -2132,14 +2285,73 @@
     readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';
   }
 
-  /** @name PalletStructureEvent (254) */
+  /** @name PalletStructureEvent (277) */
   export interface PalletStructureEvent extends Enum {
     readonly isExecuted: boolean;
     readonly asExecuted: Result<Null, SpRuntimeDispatchError>;
     readonly type: 'Executed';
   }
 
-  /** @name PalletEvmEvent (255) */
+  /** @name PalletRmrkCoreEvent (278) */
+  export interface PalletRmrkCoreEvent extends Enum {
+    readonly isCollectionCreated: boolean;
+    readonly asCollectionCreated: {
+      readonly issuer: AccountId32;
+      readonly collectionId: u32;
+    } & Struct;
+    readonly isCollectionDestroyed: boolean;
+    readonly asCollectionDestroyed: {
+      readonly issuer: AccountId32;
+      readonly collectionId: u32;
+    } & Struct;
+    readonly isIssuerChanged: boolean;
+    readonly asIssuerChanged: {
+      readonly oldIssuer: AccountId32;
+      readonly newIssuer: AccountId32;
+      readonly collectionId: u32;
+    } & Struct;
+    readonly isCollectionLocked: boolean;
+    readonly asCollectionLocked: {
+      readonly issuer: AccountId32;
+      readonly collectionId: u32;
+    } & Struct;
+    readonly isNftMinted: boolean;
+    readonly asNftMinted: {
+      readonly owner: AccountId32;
+      readonly collectionId: u32;
+      readonly nftId: u32;
+    } & Struct;
+    readonly isNftBurned: boolean;
+    readonly asNftBurned: {
+      readonly owner: AccountId32;
+      readonly nftId: u32;
+    } & Struct;
+    readonly isPropertySet: boolean;
+    readonly asPropertySet: {
+      readonly collectionId: u32;
+      readonly maybeNftId: Option<u32>;
+      readonly key: Bytes;
+      readonly value: Bytes;
+    } & Struct;
+    readonly isResourceAdded: boolean;
+    readonly asResourceAdded: {
+      readonly nftId: u32;
+      readonly resourceId: u32;
+    } & Struct;
+    readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'PropertySet' | 'ResourceAdded';
+  }
+
+  /** @name PalletRmrkEquipEvent (279) */
+  export interface PalletRmrkEquipEvent extends Enum {
+    readonly isBaseCreated: boolean;
+    readonly asBaseCreated: {
+      readonly issuer: AccountId32;
+      readonly baseId: u32;
+    } & Struct;
+    readonly type: 'BaseCreated';
+  }
+
+  /** @name PalletEvmEvent (280) */
   export interface PalletEvmEvent extends Enum {
     readonly isLog: boolean;
     readonly asLog: EthereumLog;
@@ -2158,21 +2370,21 @@
     readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';
   }
 
-  /** @name EthereumLog (256) */
+  /** @name EthereumLog (281) */
   export interface EthereumLog extends Struct {
     readonly address: H160;
     readonly topics: Vec<H256>;
     readonly data: Bytes;
   }
 
-  /** @name PalletEthereumEvent (257) */
+  /** @name PalletEthereumEvent (282) */
   export interface PalletEthereumEvent extends Enum {
     readonly isExecuted: boolean;
     readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;
     readonly type: 'Executed';
   }
 
-  /** @name EvmCoreErrorExitReason (258) */
+  /** @name EvmCoreErrorExitReason (283) */
   export interface EvmCoreErrorExitReason extends Enum {
     readonly isSucceed: boolean;
     readonly asSucceed: EvmCoreErrorExitSucceed;
@@ -2185,7 +2397,7 @@
     readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';
   }
 
-  /** @name EvmCoreErrorExitSucceed (259) */
+  /** @name EvmCoreErrorExitSucceed (284) */
   export interface EvmCoreErrorExitSucceed extends Enum {
     readonly isStopped: boolean;
     readonly isReturned: boolean;
@@ -2193,7 +2405,7 @@
     readonly type: 'Stopped' | 'Returned' | 'Suicided';
   }
 
-  /** @name EvmCoreErrorExitError (260) */
+  /** @name EvmCoreErrorExitError (285) */
   export interface EvmCoreErrorExitError extends Enum {
     readonly isStackUnderflow: boolean;
     readonly isStackOverflow: boolean;
@@ -2214,13 +2426,13 @@
     readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';
   }
 
-  /** @name EvmCoreErrorExitRevert (263) */
+  /** @name EvmCoreErrorExitRevert (288) */
   export interface EvmCoreErrorExitRevert extends Enum {
     readonly isReverted: boolean;
     readonly type: 'Reverted';
   }
 
-  /** @name EvmCoreErrorExitFatal (264) */
+  /** @name EvmCoreErrorExitFatal (289) */
   export interface EvmCoreErrorExitFatal extends Enum {
     readonly isNotSupported: boolean;
     readonly isUnhandledInterrupt: boolean;
@@ -2231,7 +2443,7 @@
     readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';
   }
 
-  /** @name FrameSystemPhase (265) */
+  /** @name FrameSystemPhase (290) */
   export interface FrameSystemPhase extends Enum {
     readonly isApplyExtrinsic: boolean;
     readonly asApplyExtrinsic: u32;
@@ -2240,27 +2452,27 @@
     readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';
   }
 
-  /** @name FrameSystemLastRuntimeUpgradeInfo (267) */
+  /** @name FrameSystemLastRuntimeUpgradeInfo (292) */
   export interface FrameSystemLastRuntimeUpgradeInfo extends Struct {
     readonly specVersion: Compact<u32>;
     readonly specName: Text;
   }
 
-  /** @name FrameSystemLimitsBlockWeights (268) */
+  /** @name FrameSystemLimitsBlockWeights (293) */
   export interface FrameSystemLimitsBlockWeights extends Struct {
     readonly baseBlock: u64;
     readonly maxBlock: u64;
     readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;
   }
 
-  /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (269) */
+  /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (294) */
   export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {
     readonly normal: FrameSystemLimitsWeightsPerClass;
     readonly operational: FrameSystemLimitsWeightsPerClass;
     readonly mandatory: FrameSystemLimitsWeightsPerClass;
   }
 
-  /** @name FrameSystemLimitsWeightsPerClass (270) */
+  /** @name FrameSystemLimitsWeightsPerClass (295) */
   export interface FrameSystemLimitsWeightsPerClass extends Struct {
     readonly baseExtrinsic: u64;
     readonly maxExtrinsic: Option<u64>;
@@ -2268,25 +2480,25 @@
     readonly reserved: Option<u64>;
   }
 
-  /** @name FrameSystemLimitsBlockLength (272) */
+  /** @name FrameSystemLimitsBlockLength (297) */
   export interface FrameSystemLimitsBlockLength extends Struct {
     readonly max: FrameSupportWeightsPerDispatchClassU32;
   }
 
-  /** @name FrameSupportWeightsPerDispatchClassU32 (273) */
+  /** @name FrameSupportWeightsPerDispatchClassU32 (298) */
   export interface FrameSupportWeightsPerDispatchClassU32 extends Struct {
     readonly normal: u32;
     readonly operational: u32;
     readonly mandatory: u32;
   }
 
-  /** @name FrameSupportWeightsRuntimeDbWeight (274) */
+  /** @name FrameSupportWeightsRuntimeDbWeight (299) */
   export interface FrameSupportWeightsRuntimeDbWeight extends Struct {
     readonly read: u64;
     readonly write: u64;
   }
 
-  /** @name SpVersionRuntimeVersion (275) */
+  /** @name SpVersionRuntimeVersion (300) */
   export interface SpVersionRuntimeVersion extends Struct {
     readonly specName: Text;
     readonly implName: Text;
@@ -2298,7 +2510,7 @@
     readonly stateVersion: u8;
   }
 
-  /** @name FrameSystemError (279) */
+  /** @name FrameSystemError (304) */
   export interface FrameSystemError extends Enum {
     readonly isInvalidSpecName: boolean;
     readonly isSpecVersionNeedsToIncrease: boolean;
@@ -2309,7 +2521,7 @@
     readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';
   }
 
-  /** @name OrmlVestingModuleError (281) */
+  /** @name OrmlVestingModuleError (306) */
   export interface OrmlVestingModuleError extends Enum {
     readonly isZeroVestingPeriod: boolean;
     readonly isZeroVestingPeriodCount: boolean;
@@ -2320,21 +2532,21 @@
     readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';
   }
 
-  /** @name CumulusPalletXcmpQueueInboundChannelDetails (283) */
+  /** @name CumulusPalletXcmpQueueInboundChannelDetails (308) */
   export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {
     readonly sender: u32;
     readonly state: CumulusPalletXcmpQueueInboundState;
     readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;
   }
 
-  /** @name CumulusPalletXcmpQueueInboundState (284) */
+  /** @name CumulusPalletXcmpQueueInboundState (309) */
   export interface CumulusPalletXcmpQueueInboundState extends Enum {
     readonly isOk: boolean;
     readonly isSuspended: boolean;
     readonly type: 'Ok' | 'Suspended';
   }
 
-  /** @name PolkadotParachainPrimitivesXcmpMessageFormat (287) */
+  /** @name PolkadotParachainPrimitivesXcmpMessageFormat (312) */
   export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {
     readonly isConcatenatedVersionedXcm: boolean;
     readonly isConcatenatedEncodedBlob: boolean;
@@ -2342,7 +2554,7 @@
     readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';
   }
 
-  /** @name CumulusPalletXcmpQueueOutboundChannelDetails (290) */
+  /** @name CumulusPalletXcmpQueueOutboundChannelDetails (315) */
   export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {
     readonly recipient: u32;
     readonly state: CumulusPalletXcmpQueueOutboundState;
@@ -2351,14 +2563,14 @@
     readonly lastIndex: u16;
   }
 
-  /** @name CumulusPalletXcmpQueueOutboundState (291) */
+  /** @name CumulusPalletXcmpQueueOutboundState (316) */
   export interface CumulusPalletXcmpQueueOutboundState extends Enum {
     readonly isOk: boolean;
     readonly isSuspended: boolean;
     readonly type: 'Ok' | 'Suspended';
   }
 
-  /** @name CumulusPalletXcmpQueueQueueConfigData (293) */
+  /** @name CumulusPalletXcmpQueueQueueConfigData (318) */
   export interface CumulusPalletXcmpQueueQueueConfigData extends Struct {
     readonly suspendThreshold: u32;
     readonly dropThreshold: u32;
@@ -2368,7 +2580,7 @@
     readonly xcmpMaxIndividualWeight: u64;
   }
 
-  /** @name CumulusPalletXcmpQueueError (295) */
+  /** @name CumulusPalletXcmpQueueError (320) */
   export interface CumulusPalletXcmpQueueError extends Enum {
     readonly isFailedToSend: boolean;
     readonly isBadXcmOrigin: boolean;
@@ -2378,7 +2590,7 @@
     readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';
   }
 
-  /** @name PalletXcmError (296) */
+  /** @name PalletXcmError (321) */
   export interface PalletXcmError extends Enum {
     readonly isUnreachable: boolean;
     readonly isSendFailure: boolean;
@@ -2396,29 +2608,29 @@
     readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';
   }
 
-  /** @name CumulusPalletXcmError (297) */
+  /** @name CumulusPalletXcmError (322) */
   export type CumulusPalletXcmError = Null;
 
-  /** @name CumulusPalletDmpQueueConfigData (298) */
+  /** @name CumulusPalletDmpQueueConfigData (323) */
   export interface CumulusPalletDmpQueueConfigData extends Struct {
     readonly maxIndividual: u64;
   }
 
-  /** @name CumulusPalletDmpQueuePageIndexData (299) */
+  /** @name CumulusPalletDmpQueuePageIndexData (324) */
   export interface CumulusPalletDmpQueuePageIndexData extends Struct {
     readonly beginUsed: u32;
     readonly endUsed: u32;
     readonly overweightCount: u64;
   }
 
-  /** @name CumulusPalletDmpQueueError (302) */
+  /** @name CumulusPalletDmpQueueError (327) */
   export interface CumulusPalletDmpQueueError extends Enum {
     readonly isUnknown: boolean;
     readonly isOverLimit: boolean;
     readonly type: 'Unknown' | 'OverLimit';
   }
 
-  /** @name PalletUniqueError (306) */
+  /** @name PalletUniqueError (331) */
   export interface PalletUniqueError extends Enum {
     readonly isCollectionDecimalPointLimitExceeded: boolean;
     readonly isConfirmUnsetSponsorFail: boolean;
@@ -2426,7 +2638,7 @@
     readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument';
   }
 
-  /** @name UpDataStructsCollection (307) */
+  /** @name UpDataStructsCollection (332) */
   export interface UpDataStructsCollection extends Struct {
     readonly owner: AccountId32;
     readonly mode: UpDataStructsCollectionMode;
@@ -2438,7 +2650,7 @@
     readonly permissions: UpDataStructsCollectionPermissions;
   }
 
-  /** @name UpDataStructsSponsorshipState (308) */
+  /** @name UpDataStructsSponsorshipState (333) */
   export interface UpDataStructsSponsorshipState extends Enum {
     readonly isDisabled: boolean;
     readonly isUnconfirmed: boolean;
@@ -2448,20 +2660,20 @@
     readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
   }
 
-  /** @name UpDataStructsProperties (309) */
+  /** @name UpDataStructsProperties (334) */
   export interface UpDataStructsProperties extends Struct {
     readonly map: UpDataStructsPropertiesMapBoundedVec;
     readonly consumedSpace: u32;
     readonly spaceLimit: u32;
   }
 
-  /** @name UpDataStructsPropertiesMapBoundedVec (310) */
+  /** @name UpDataStructsPropertiesMapBoundedVec (335) */
   export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
 
-  /** @name UpDataStructsPropertiesMapPropertyPermission (315) */
+  /** @name UpDataStructsPropertiesMapPropertyPermission (340) */
   export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
 
-  /** @name UpDataStructsCollectionStats (322) */
+  /** @name UpDataStructsCollectionStats (347) */
   export interface UpDataStructsCollectionStats extends Struct {
     readonly created: u32;
     readonly destroyed: u32;
@@ -2532,7 +2744,7 @@
 
   /** @name UpDataStructsRmrkResourceInfo (336) */
   export interface UpDataStructsRmrkResourceInfo extends Struct {
-    readonly id: Bytes;
+    readonly id: u32;
     readonly resource: UpDataStructsRmrkResourceTypes;
     readonly pending: bool;
     readonly pendingRemoval: bool;
modifiedtests/src/interfaces/types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/types.ts
+++ b/tests/src/interfaces/types.ts
@@ -2,4 +2,5 @@
 /* eslint-disable */
 
 export * from './unique/types';
+export * from './rmrk/types';
 export * from './default/types';