difftreelog
Merge commit '2074c933e3ff90b7ea5fc778111ead850fd4a5ea' into release-v922000
in: master
20 files changed
client/rpc/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617// Original License18use std::sync::Arc;1920use codec::{Decode, Encode};21use jsonrpsee::{22 core::{RpcResult as Result},23 proc_macros::rpc,24};25use anyhow::anyhow;26use up_data_structs::{27 RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,28 PropertyKeyPermission, TokenData,29};30use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};31use sp_blockchain::HeaderBackend;32use up_rpc::UniqueApi as UniqueRuntimeApi;3334// RMRK35use rmrk_rpc::RmrkApi as RmrkRuntimeApi;36use up_data_structs::{37 RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,38};3940pub use rmrk_unique_rpc::RmrkApiServer;4142#[rpc(server)]43#[async_trait]44pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {45 #[method(name = "unique_accountTokens")]46 fn account_tokens(47 &self,48 collection: CollectionId,49 account: CrossAccountId,50 at: Option<BlockHash>,51 ) -> Result<Vec<TokenId>>;52 #[method(name = "unique_collectionTokens")]53 fn collection_tokens(54 &self,55 collection: CollectionId,56 at: Option<BlockHash>,57 ) -> Result<Vec<TokenId>>;58 #[method(name = "unique_tokenExists")]59 fn token_exists(60 &self,61 collection: CollectionId,62 token: TokenId,63 at: Option<BlockHash>,64 ) -> Result<bool>;6566 #[method(name = "unique_tokenOwner")]67 fn token_owner(68 &self,69 collection: CollectionId,70 token: TokenId,71 at: Option<BlockHash>,72 ) -> Result<Option<CrossAccountId>>;73 #[method(name = "unique_topmostTokenOwner")]74 fn topmost_token_owner(75 &self,76 collection: CollectionId,77 token: TokenId,78 at: Option<BlockHash>,79 ) -> Result<Option<CrossAccountId>>;8081 #[method(name = "unique_collectionProperties")]82 fn collection_properties(83 &self,84 collection: CollectionId,85 keys: Option<Vec<String>>,86 at: Option<BlockHash>,87 ) -> Result<Vec<Property>>;8889 #[method(name = "unique_tokenProperties")]90 fn token_properties(91 &self,92 collection: CollectionId,93 token_id: TokenId,94 keys: Option<Vec<String>>,95 at: Option<BlockHash>,96 ) -> Result<Vec<Property>>;9798 #[method(name = "unique_propertyPermissions")]99 fn property_permissions(100 &self,101 collection: CollectionId,102 keys: Option<Vec<String>>,103 at: Option<BlockHash>,104 ) -> Result<Vec<PropertyKeyPermission>>;105106 #[method(name = "unique_tokenData")]107 fn token_data(108 &self,109 collection: CollectionId,110 token_id: TokenId,111 keys: Option<Vec<String>>,112 at: Option<BlockHash>,113 ) -> Result<TokenData<CrossAccountId>>;114115 #[method(name = "unique_totalSupply")]116 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;117 #[method(name = "unique_accountBalance")]118 fn account_balance(119 &self,120 collection: CollectionId,121 account: CrossAccountId,122 at: Option<BlockHash>,123 ) -> Result<u32>;124 #[method(name = "unique_balance")]125 fn balance(126 &self,127 collection: CollectionId,128 account: CrossAccountId,129 token: TokenId,130 at: Option<BlockHash>,131 ) -> Result<String>;132 #[method(name = "unique_allowance")]133 fn allowance(134 &self,135 collection: CollectionId,136 sender: CrossAccountId,137 spender: CrossAccountId,138 token: TokenId,139 at: Option<BlockHash>,140 ) -> Result<String>;141142 #[method(name = "unique_adminlist")]143 fn adminlist(144 &self,145 collection: CollectionId,146 at: Option<BlockHash>,147 ) -> Result<Vec<CrossAccountId>>;148 #[method(name = "unique_allowlist")]149 fn allowlist(150 &self,151 collection: CollectionId,152 at: Option<BlockHash>,153 ) -> Result<Vec<CrossAccountId>>;154 #[method(name = "unique_allowed")]155 fn allowed(156 &self,157 collection: CollectionId,158 user: CrossAccountId,159 at: Option<BlockHash>,160 ) -> Result<bool>;161 #[method(name = "unique_lastTokenId")]162 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;163 #[method(name = "unique_collectionById")]164 fn collection_by_id(165 &self,166 collection: CollectionId,167 at: Option<BlockHash>,168 ) -> Result<Option<RpcCollection<AccountId>>>;169 #[method(name = "unique_collectionStats")]170 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;171172 #[method(name = "unique_nextSponsored")]173 fn next_sponsored(174 &self,175 collection: CollectionId,176 account: CrossAccountId,177 token: TokenId,178 at: Option<BlockHash>,179 ) -> Result<Option<u64>>;180 #[method(name = "unique_effectiveCollectionLimits")]181 fn effective_collection_limits(182 &self,183 collection_id: CollectionId,184 at: Option<BlockHash>,185 ) -> Result<Option<CollectionLimits>>;186}187188mod rmrk_unique_rpc {189 use super::*;190191 #[rpc(server)]192 #[async_trait]193 pub trait RmrkApi<194 BlockHash,195 AccountId,196 CollectionInfo,197 NftInfo,198 ResourceInfo,199 PropertyInfo,200 BaseInfo,201 PartType,202 Theme,203 >204 {205 #[method(name = "rmrk_lastCollectionIdx")]206 /// Get the latest created collection id207 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;208209 #[method(name = "rmrk_collectionById")]210 /// Get collection by id211 fn collection_by_id(212 &self,213 id: RmrkCollectionId,214 at: Option<BlockHash>,215 ) -> Result<Option<CollectionInfo>>;216217 #[method(name = "rmrk_nftById")]218 /// Get NFT by collection id and NFT id219 fn nft_by_id(220 &self,221 collection_id: RmrkCollectionId,222 nft_id: RmrkNftId,223 at: Option<BlockHash>,224 ) -> Result<Option<NftInfo>>;225226 #[method(name = "rmrk_accountTokens")]227 /// Get tokens owned by an account in a collection228 fn account_tokens(229 &self,230 account_id: AccountId,231 collection_id: RmrkCollectionId,232 at: Option<BlockHash>,233 ) -> Result<Vec<RmrkNftId>>;234235 #[method(name = "rmrk_nftChildren")]236 /// Get NFT children237 fn nft_children(238 &self,239 collection_id: RmrkCollectionId,240 nft_id: RmrkNftId,241 at: Option<BlockHash>,242 ) -> Result<Vec<RmrkNftChild>>;243244 #[method(name = "rmrk_collectionProperties")]245 /// Get collection properties246 fn collection_properties(247 &self,248 collection_id: RmrkCollectionId,249 filter_keys: Option<Vec<String>>,250 at: Option<BlockHash>,251 ) -> Result<Vec<PropertyInfo>>;252253 #[method(name = "rmrk_nftProperties")]254 /// Get NFT properties255 fn nft_properties(256 &self,257 collection_id: RmrkCollectionId,258 nft_id: RmrkNftId,259 filter_keys: Option<Vec<String>>,260 at: Option<BlockHash>,261 ) -> Result<Vec<PropertyInfo>>;262263 #[method(name = "rmrk_nftResources")]264 /// Get NFT resources265 fn nft_resources(266 &self,267 collection_id: RmrkCollectionId,268 nft_id: RmrkNftId,269 at: Option<BlockHash>,270 ) -> Result<Vec<ResourceInfo>>;271272 #[method(name = "rmrk_nftResourcePriorities")]273 /// Get NFT resource priorities274 fn nft_resource_priorities(275 &self,276 collection_id: RmrkCollectionId,277 nft_id: RmrkNftId,278 at: Option<BlockHash>,279 ) -> Result<Vec<RmrkResourceId>>;280281 #[method(name = "rmrk_base")]282 /// Get base info283 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;284285 #[method(name = "rmrk_baseParts")]286 /// Get all Base's parts287 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;288289 #[method(name = "rmrk_themeNames")]290 fn theme_names(291 &self,292 base_id: RmrkBaseId,293 at: Option<BlockHash>,294 ) -> Result<Vec<RmrkThemeName>>;295296 #[method(name = "rmrk_themes")]297 fn theme(298 &self,299 base_id: RmrkBaseId,300 theme_name: String,301 filter_keys: Option<Vec<String>>,302 at: Option<BlockHash>,303 ) -> Result<Option<Theme>>;304 }305}306307pub struct Unique<C, P> {308 client: Arc<C>,309 _marker: std::marker::PhantomData<P>,310}311312impl<C, P> Unique<C, P> {313 pub fn new(client: Arc<C>) -> Self {314 Self {315 client,316 _marker: Default::default(),317 }318 }319}320321macro_rules! pass_method {322 (323 $method_name:ident(324 $($(#[map(|$map_arg:ident| $map:expr)])? $name:ident: $ty:ty),* $(,)?325 ) -> $result:ty $(=> $mapper:expr)?,326 //$runtime_name:ident $(<$($lt: tt),+>)*327 $runtime_api_macro:ident328 $(; changed_in $ver:expr, $changed_method_name:ident ($($changed_name:expr), * $(,)?) => $fixer:expr)*329 ) => {330 fn $method_name(331 &self,332 $(333 $name: $ty,334 )*335 at: Option<<Block as BlockT>::Hash>,336 ) -> Result<$result> {337 let api = self.client.runtime_api();338 let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));339 let _api_version = if let Ok(Some(api_version)) =340 api.api_version::<$runtime_api_macro!()>(&at)341 {342 api_version343 } else {344 // unreachable for our runtime345 return Err(anyhow!("api is not available").into())346 };347348 let result = $(if _api_version < $ver {349 api.$changed_method_name(&at, $($changed_name),*).map(|r| r.map($fixer))350 } else)*351 { api.$method_name(&at, $($((|$map_arg: $ty| $map))? ($name)),*) };352353 Ok(result354 .map_err(|e| anyhow!("unable to query: {e}"))?355 .map_err(|e| anyhow!("runtime error: {e:?}"))$(.map($mapper))??)356 }357 };358}359360macro_rules! unique_api {361 () => {362 dyn UniqueRuntimeApi<Block, CrossAccountId, AccountId>363 };364}365366macro_rules! rmrk_api {367 () => {368 dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>369 };370}371372#[allow(deprecated)]373impl<C, Block, CrossAccountId, AccountId>374 UniqueApiServer<<Block as BlockT>::Hash, CrossAccountId, AccountId> for Unique<C, Block>375where376 Block: BlockT,377 AccountId: Decode,378 C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,379 C::Api: UniqueRuntimeApi<Block, CrossAccountId, AccountId>,380 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,381{382 pass_method!(383 account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>, unique_api384 );385 pass_method!(386 collection_tokens(collection: CollectionId) -> Vec<TokenId>, unique_api387 );388 pass_method!(389 token_exists(collection: CollectionId, token: TokenId) -> bool, unique_api390 );391 pass_method!(392 token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api393 );394 pass_method!(395 topmost_token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api396 );397 pass_method!(total_supply(collection: CollectionId) -> u32, unique_api);398 pass_method!(account_balance(collection: CollectionId, account: CrossAccountId) -> u32, unique_api);399 pass_method!(balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> String => |v| v.to_string(), unique_api);400 pass_method!(401 allowance(collection: CollectionId, sender: CrossAccountId, spender: CrossAccountId, token: TokenId) -> String => |v| v.to_string(),402 unique_api403 );404405 pass_method!(collection_properties(406 collection: CollectionId,407408 #[map(|keys| string_keys_to_bytes_keys(keys))]409 keys: Option<Vec<String>>410 ) -> Vec<Property>, unique_api);411412 pass_method!(token_properties(413 collection: CollectionId,414 token_id: TokenId,415416 #[map(|keys| string_keys_to_bytes_keys(keys))]417 keys: Option<Vec<String>>418 ) -> Vec<Property>, unique_api);419420 pass_method!(property_permissions(421 collection: CollectionId,422423 #[map(|keys| string_keys_to_bytes_keys(keys))]424 keys: Option<Vec<String>>425 ) -> Vec<PropertyKeyPermission>, unique_api);426427 pass_method!(token_data(428 collection: CollectionId,429 token_id: TokenId,430431 #[map(|keys| string_keys_to_bytes_keys(keys))]432 keys: Option<Vec<String>>,433 ) -> TokenData<CrossAccountId>, unique_api);434435 pass_method!(adminlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);436 pass_method!(allowlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);437 pass_method!(allowed(collection: CollectionId, user: CrossAccountId) -> bool, unique_api);438 pass_method!(last_token_id(collection: CollectionId) -> TokenId, unique_api);439 pass_method!(collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api);440 pass_method!(collection_stats() -> CollectionStats, unique_api);441 pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option<u64>, unique_api);442 pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);443}444445#[allow(deprecated)]446impl<447 C,448 Block,449 AccountId,450 CollectionInfo,451 NftInfo,452 ResourceInfo,453 PropertyInfo,454 BaseInfo,455 PartType,456 Theme,457 >458 rmrk_unique_rpc::RmrkApiServer<459 <Block as BlockT>::Hash,460 AccountId,461 CollectionInfo,462 NftInfo,463 ResourceInfo,464 PropertyInfo,465 BaseInfo,466 PartType,467 Theme,468 > for Unique<C, Block>469where470 C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,471 C::Api: RmrkRuntimeApi<472 Block,473 AccountId,474 CollectionInfo,475 NftInfo,476 ResourceInfo,477 PropertyInfo,478 BaseInfo,479 PartType,480 Theme,481 >,482 AccountId: Decode + Encode,483 CollectionInfo: Decode,484 NftInfo: Decode,485 ResourceInfo: Decode,486 PropertyInfo: Decode,487 BaseInfo: Decode,488 PartType: Decode,489 Theme: Decode,490 Block: BlockT,491{492 pass_method!(last_collection_idx() -> RmrkCollectionId, rmrk_api);493 pass_method!(collection_by_id(id: RmrkCollectionId) -> Option<CollectionInfo>, rmrk_api);494 pass_method!(nft_by_id(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Option<NftInfo>, rmrk_api);495 pass_method!(account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Vec<RmrkNftId>, rmrk_api);496 pass_method!(nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkNftChild>, rmrk_api);497 pass_method!(498 collection_properties(499 collection_id: RmrkCollectionId,500501 #[map(|keys| string_keys_to_bytes_keys(keys))]502 filter_keys: Option<Vec<String>>503 ) -> Vec<PropertyInfo>,504 rmrk_api505 );506 pass_method!(507 nft_properties(508 collection_id: RmrkCollectionId,509 nft_id: RmrkNftId,510511 #[map(|keys| string_keys_to_bytes_keys(keys))]512 filter_keys: Option<Vec<String>>513 ) -> Vec<PropertyInfo>,514 rmrk_api515 );516 pass_method!(nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<ResourceInfo>, rmrk_api);517 pass_method!(nft_resource_priorities(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkResourceId>, rmrk_api);518 pass_method!(base(base_id: RmrkBaseId) -> Option<BaseInfo>, rmrk_api);519 pass_method!(base_parts(base_id: RmrkBaseId) -> Vec<PartType>, rmrk_api);520 pass_method!(theme_names(base_id: RmrkBaseId) -> Vec<RmrkThemeName>, rmrk_api);521 pass_method!(522 theme(523 base_id: RmrkBaseId,524525 #[map(|n| n.into_bytes())]526 theme_name: String,527528 #[map(|keys| string_keys_to_bytes_keys(keys))]529 filter_keys: Option<Vec<String>>530 ) -> Option<Theme>, rmrk_api);531}532533fn string_keys_to_bytes_keys(keys: Option<Vec<String>>) -> Option<Vec<Vec<u8>>> {534 keys.map(|keys| keys.into_iter().map(|key| key.into_bytes()).collect())535}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617// Original License18use std::sync::Arc;1920use codec::{Decode, Encode};21use jsonrpsee::{22 core::{RpcResult as Result},23 proc_macros::rpc,24};25use anyhow::anyhow;26use up_data_structs::{27 RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,28 PropertyKeyPermission, TokenData, TokenChild,29};30use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};31use sp_blockchain::HeaderBackend;32use up_rpc::UniqueApi as UniqueRuntimeApi;3334// RMRK35use rmrk_rpc::RmrkApi as RmrkRuntimeApi;36use up_data_structs::{37 RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,38};3940pub use rmrk_unique_rpc::RmrkApiServer;4142#[rpc(server)]43#[async_trait]44pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {45 #[method(name = "unique_accountTokens")]46 fn account_tokens(47 &self,48 collection: CollectionId,49 account: CrossAccountId,50 at: Option<BlockHash>,51 ) -> Result<Vec<TokenId>>;52 #[method(name = "unique_collectionTokens")]53 fn collection_tokens(54 &self,55 collection: CollectionId,56 at: Option<BlockHash>,57 ) -> Result<Vec<TokenId>>;58 #[method(name = "unique_tokenExists")]59 fn token_exists(60 &self,61 collection: CollectionId,62 token: TokenId,63 at: Option<BlockHash>,64 ) -> Result<bool>;6566 #[method(name = "unique_tokenOwner")]67 fn token_owner(68 &self,69 collection: CollectionId,70 token: TokenId,71 at: Option<BlockHash>,72 ) -> Result<Option<CrossAccountId>>;73 #[method(name = "unique_topmostTokenOwner")]74 fn topmost_token_owner(75 &self,76 collection: CollectionId,77 token: TokenId,78 at: Option<BlockHash>,79 ) -> Result<Option<CrossAccountId>>;80 #[method(name = "unique_tokenChildren")]81 fn token_children(82 &self,83 collection: CollectionId,84 token: TokenId,85 at: Option<BlockHash>,86 ) -> Result<Vec<TokenChild>>;8788 #[method(name = "unique_collectionProperties")]89 fn collection_properties(90 &self,91 collection: CollectionId,92 keys: Option<Vec<String>>,93 at: Option<BlockHash>,94 ) -> Result<Vec<Property>>;9596 #[method(name = "unique_tokenProperties")]97 fn token_properties(98 &self,99 collection: CollectionId,100 token_id: TokenId,101 keys: Option<Vec<String>>,102 at: Option<BlockHash>,103 ) -> Result<Vec<Property>>;104105 #[method(name = "unique_propertyPermissions")]106 fn property_permissions(107 &self,108 collection: CollectionId,109 keys: Option<Vec<String>>,110 at: Option<BlockHash>,111 ) -> Result<Vec<PropertyKeyPermission>>;112113 #[method(name = "unique_tokenData")]114 fn token_data(115 &self,116 collection: CollectionId,117 token_id: TokenId,118 keys: Option<Vec<String>>,119 at: Option<BlockHash>,120 ) -> Result<TokenData<CrossAccountId>>;121122 #[method(name = "unique_totalSupply")]123 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;124 #[method(name = "unique_accountBalance")]125 fn account_balance(126 &self,127 collection: CollectionId,128 account: CrossAccountId,129 at: Option<BlockHash>,130 ) -> Result<u32>;131 #[method(name = "unique_balance")]132 fn balance(133 &self,134 collection: CollectionId,135 account: CrossAccountId,136 token: TokenId,137 at: Option<BlockHash>,138 ) -> Result<String>;139 #[method(name = "unique_allowance")]140 fn allowance(141 &self,142 collection: CollectionId,143 sender: CrossAccountId,144 spender: CrossAccountId,145 token: TokenId,146 at: Option<BlockHash>,147 ) -> Result<String>;148149 #[method(name = "unique_adminlist")]150 fn adminlist(151 &self,152 collection: CollectionId,153 at: Option<BlockHash>,154 ) -> Result<Vec<CrossAccountId>>;155 #[method(name = "unique_allowlist")]156 fn allowlist(157 &self,158 collection: CollectionId,159 at: Option<BlockHash>,160 ) -> Result<Vec<CrossAccountId>>;161 #[method(name = "unique_allowed")]162 fn allowed(163 &self,164 collection: CollectionId,165 user: CrossAccountId,166 at: Option<BlockHash>,167 ) -> Result<bool>;168 #[method(name = "unique_lastTokenId")]169 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;170 #[method(name = "unique_collectionById")]171 fn collection_by_id(172 &self,173 collection: CollectionId,174 at: Option<BlockHash>,175 ) -> Result<Option<RpcCollection<AccountId>>>;176 #[method(name = "unique_collectionStats")]177 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;178179 #[method(name = "unique_nextSponsored")]180 fn next_sponsored(181 &self,182 collection: CollectionId,183 account: CrossAccountId,184 token: TokenId,185 at: Option<BlockHash>,186 ) -> Result<Option<u64>>;187 #[method(name = "unique_effectiveCollectionLimits")]188 fn effective_collection_limits(189 &self,190 collection_id: CollectionId,191 at: Option<BlockHash>,192 ) -> Result<Option<CollectionLimits>>;193}194195mod rmrk_unique_rpc {196 use super::*;197198 #[rpc(server)]199 #[async_trait]200 pub trait RmrkApi<201 BlockHash,202 AccountId,203 CollectionInfo,204 NftInfo,205 ResourceInfo,206 PropertyInfo,207 BaseInfo,208 PartType,209 Theme,210 >211 {212 #[method(name = "rmrk_lastCollectionIdx")]213 /// Get the latest created collection id214 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;215216 #[method(name = "rmrk_collectionById")]217 /// Get collection by id218 fn collection_by_id(219 &self,220 id: RmrkCollectionId,221 at: Option<BlockHash>,222 ) -> Result<Option<CollectionInfo>>;223224 #[method(name = "rmrk_nftById")]225 /// Get NFT by collection id and NFT id226 fn nft_by_id(227 &self,228 collection_id: RmrkCollectionId,229 nft_id: RmrkNftId,230 at: Option<BlockHash>,231 ) -> Result<Option<NftInfo>>;232233 #[method(name = "rmrk_accountTokens")]234 /// Get tokens owned by an account in a collection235 fn account_tokens(236 &self,237 account_id: AccountId,238 collection_id: RmrkCollectionId,239 at: Option<BlockHash>,240 ) -> Result<Vec<RmrkNftId>>;241242 #[method(name = "rmrk_nftChildren")]243 /// Get NFT children244 fn nft_children(245 &self,246 collection_id: RmrkCollectionId,247 nft_id: RmrkNftId,248 at: Option<BlockHash>,249 ) -> Result<Vec<RmrkNftChild>>;250251 #[method(name = "rmrk_collectionProperties")]252 /// Get collection properties253 fn collection_properties(254 &self,255 collection_id: RmrkCollectionId,256 filter_keys: Option<Vec<String>>,257 at: Option<BlockHash>,258 ) -> Result<Vec<PropertyInfo>>;259260 #[method(name = "rmrk_nftProperties")]261 /// Get NFT properties262 fn nft_properties(263 &self,264 collection_id: RmrkCollectionId,265 nft_id: RmrkNftId,266 filter_keys: Option<Vec<String>>,267 at: Option<BlockHash>,268 ) -> Result<Vec<PropertyInfo>>;269270 #[method(name = "rmrk_nftResources")]271 /// Get NFT resources272 fn nft_resources(273 &self,274 collection_id: RmrkCollectionId,275 nft_id: RmrkNftId,276 at: Option<BlockHash>,277 ) -> Result<Vec<ResourceInfo>>;278279 #[method(name = "rmrk_nftResourcePriorities")]280 /// Get NFT resource priorities281 fn nft_resource_priorities(282 &self,283 collection_id: RmrkCollectionId,284 nft_id: RmrkNftId,285 at: Option<BlockHash>,286 ) -> Result<Vec<RmrkResourceId>>;287288 #[method(name = "rmrk_base")]289 /// Get base info290 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;291292 #[method(name = "rmrk_baseParts")]293 /// Get all Base's parts294 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;295296 #[method(name = "rmrk_themeNames")]297 fn theme_names(298 &self,299 base_id: RmrkBaseId,300 at: Option<BlockHash>,301 ) -> Result<Vec<RmrkThemeName>>;302303 #[method(name = "rmrk_themes")]304 fn theme(305 &self,306 base_id: RmrkBaseId,307 theme_name: String,308 filter_keys: Option<Vec<String>>,309 at: Option<BlockHash>,310 ) -> Result<Option<Theme>>;311 }312}313314pub struct Unique<C, P> {315 client: Arc<C>,316 _marker: std::marker::PhantomData<P>,317}318319impl<C, P> Unique<C, P> {320 pub fn new(client: Arc<C>) -> Self {321 Self {322 client,323 _marker: Default::default(),324 }325 }326}327328macro_rules! pass_method {329 (330 $method_name:ident(331 $($(#[map(|$map_arg:ident| $map:expr)])? $name:ident: $ty:ty),* $(,)?332 ) -> $result:ty $(=> $mapper:expr)?,333 //$runtime_name:ident $(<$($lt: tt),+>)*334 $runtime_api_macro:ident335 $(; changed_in $ver:expr, $changed_method_name:ident ($($changed_name:expr), * $(,)?) => $fixer:expr)*336 ) => {337 fn $method_name(338 &self,339 $(340 $name: $ty,341 )*342 at: Option<<Block as BlockT>::Hash>,343 ) -> Result<$result> {344 let api = self.client.runtime_api();345 let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));346 let _api_version = if let Ok(Some(api_version)) =347 api.api_version::<$runtime_api_macro!()>(&at)348 {349 api_version350 } else {351 // unreachable for our runtime352 return Err(anyhow!("api is not available").into())353 };354355 let result = $(if _api_version < $ver {356 api.$changed_method_name(&at, $($changed_name),*).map(|r| r.map($fixer))357 } else)*358 { api.$method_name(&at, $($((|$map_arg: $ty| $map))? ($name)),*) };359360 Ok(result361 .map_err(|e| anyhow!("unable to query: {e}"))?362 .map_err(|e| anyhow!("runtime error: {e:?}"))$(.map($mapper))??)363 }364 };365}366367macro_rules! unique_api {368 () => {369 dyn UniqueRuntimeApi<Block, CrossAccountId, AccountId>370 };371}372373macro_rules! rmrk_api {374 () => {375 dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>376 };377}378379#[allow(deprecated)]380impl<C, Block, CrossAccountId, AccountId>381 UniqueApiServer<<Block as BlockT>::Hash, CrossAccountId, AccountId> for Unique<C, Block>382where383 Block: BlockT,384 AccountId: Decode,385 C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,386 C::Api: UniqueRuntimeApi<Block, CrossAccountId, AccountId>,387 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,388{389 pass_method!(390 account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>, unique_api391 );392 pass_method!(393 collection_tokens(collection: CollectionId) -> Vec<TokenId>, unique_api394 );395 pass_method!(396 token_exists(collection: CollectionId, token: TokenId) -> bool, unique_api397 );398 pass_method!(399 token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api400 );401 pass_method!(402 topmost_token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api403 );404 pass_method!(token_children(collection: CollectionId, token: TokenId) -> Vec<TokenChild>, unique_api);405 pass_method!(total_supply(collection: CollectionId) -> u32, unique_api);406 pass_method!(account_balance(collection: CollectionId, account: CrossAccountId) -> u32, unique_api);407 pass_method!(balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> String => |v| v.to_string(), unique_api);408 pass_method!(409 allowance(collection: CollectionId, sender: CrossAccountId, spender: CrossAccountId, token: TokenId) -> String => |v| v.to_string(),410 unique_api411 );412413 pass_method!(collection_properties(414 collection: CollectionId,415416 #[map(|keys| string_keys_to_bytes_keys(keys))]417 keys: Option<Vec<String>>418 ) -> Vec<Property>, unique_api);419420 pass_method!(token_properties(421 collection: CollectionId,422 token_id: TokenId,423424 #[map(|keys| string_keys_to_bytes_keys(keys))]425 keys: Option<Vec<String>>426 ) -> Vec<Property>, unique_api);427428 pass_method!(property_permissions(429 collection: CollectionId,430431 #[map(|keys| string_keys_to_bytes_keys(keys))]432 keys: Option<Vec<String>>433 ) -> Vec<PropertyKeyPermission>, unique_api);434435 pass_method!(token_data(436 collection: CollectionId,437 token_id: TokenId,438439 #[map(|keys| string_keys_to_bytes_keys(keys))]440 keys: Option<Vec<String>>,441 ) -> TokenData<CrossAccountId>, unique_api);442443 pass_method!(adminlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);444 pass_method!(allowlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);445 pass_method!(allowed(collection: CollectionId, user: CrossAccountId) -> bool, unique_api);446 pass_method!(last_token_id(collection: CollectionId) -> TokenId, unique_api);447 pass_method!(collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api);448 pass_method!(collection_stats() -> CollectionStats, unique_api);449 pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option<u64>, unique_api);450 pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);451}452453#[allow(deprecated)]454impl<455 C,456 Block,457 AccountId,458 CollectionInfo,459 NftInfo,460 ResourceInfo,461 PropertyInfo,462 BaseInfo,463 PartType,464 Theme,465 >466 rmrk_unique_rpc::RmrkApiServer<467 <Block as BlockT>::Hash,468 AccountId,469 CollectionInfo,470 NftInfo,471 ResourceInfo,472 PropertyInfo,473 BaseInfo,474 PartType,475 Theme,476 > for Unique<C, Block>477where478 C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,479 C::Api: RmrkRuntimeApi<480 Block,481 AccountId,482 CollectionInfo,483 NftInfo,484 ResourceInfo,485 PropertyInfo,486 BaseInfo,487 PartType,488 Theme,489 >,490 AccountId: Decode + Encode,491 CollectionInfo: Decode,492 NftInfo: Decode,493 ResourceInfo: Decode,494 PropertyInfo: Decode,495 BaseInfo: Decode,496 PartType: Decode,497 Theme: Decode,498 Block: BlockT,499{500 pass_method!(last_collection_idx() -> RmrkCollectionId, rmrk_api);501 pass_method!(collection_by_id(id: RmrkCollectionId) -> Option<CollectionInfo>, rmrk_api);502 pass_method!(nft_by_id(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Option<NftInfo>, rmrk_api);503 pass_method!(account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Vec<RmrkNftId>, rmrk_api);504 pass_method!(nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkNftChild>, rmrk_api);505 pass_method!(506 collection_properties(507 collection_id: RmrkCollectionId,508509 #[map(|keys| string_keys_to_bytes_keys(keys))]510 filter_keys: Option<Vec<String>>511 ) -> Vec<PropertyInfo>,512 rmrk_api513 );514 pass_method!(515 nft_properties(516 collection_id: RmrkCollectionId,517 nft_id: RmrkNftId,518519 #[map(|keys| string_keys_to_bytes_keys(keys))]520 filter_keys: Option<Vec<String>>521 ) -> Vec<PropertyInfo>,522 rmrk_api523 );524 pass_method!(nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<ResourceInfo>, rmrk_api);525 pass_method!(nft_resource_priorities(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkResourceId>, rmrk_api);526 pass_method!(base(base_id: RmrkBaseId) -> Option<BaseInfo>, rmrk_api);527 pass_method!(base_parts(base_id: RmrkBaseId) -> Vec<PartType>, rmrk_api);528 pass_method!(theme_names(base_id: RmrkBaseId) -> Vec<RmrkThemeName>, rmrk_api);529 pass_method!(530 theme(531 base_id: RmrkBaseId,532533 #[map(|n| n.into_bytes())]534 theme_name: String,535536 #[map(|keys| string_keys_to_bytes_keys(keys))]537 filter_keys: Option<Vec<String>>538 ) -> Option<Theme>, rmrk_api);539}540541fn string_keys_to_bytes_keys(keys: Option<Vec<String>>) -> Option<Vec<Vec<u8>>> {542 keys.map(|keys| keys.into_iter().map(|key| key.into_bytes()).collect())543}pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -40,6 +40,7 @@
MAX_TOKEN_PREFIX_LENGTH,
COLLECTION_ADMINS_LIMIT,
TokenId,
+ TokenChild,
CollectionStats,
MAX_TOKEN_OWNERSHIP,
CollectionMode,
@@ -502,6 +503,7 @@
CollectionStats,
CollectionId,
TokenId,
+ TokenChild,
PhantomType<(
TokenData<T::CrossAccountId>,
RpcCollection<T::AccountId>,
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -22,7 +22,7 @@
use up_data_structs::{
AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
mapping::TokenAddressMapping, NestingRule, budget::Budget, Property, PropertyPermission,
- PropertyKey, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty,
+ PropertyKey, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty, TokenChild,
};
use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};
use pallet_common::{
@@ -604,7 +604,7 @@
// =========
- <PalletStructure<T>>::unnest_if_nested(from, collection.id, token);
+ <PalletStructure<T>>::unnest_if_nested(&token_data.owner, collection.id, token);
<TokenData<T>>::insert(
(collection.id, token),
@@ -988,6 +988,15 @@
.is_some()
}
+ pub fn token_children_ids(collection_id: CollectionId, token_id: TokenId) -> Vec<TokenChild> {
+ <TokenChildren<T>>::iter_prefix((collection_id, token_id))
+ .map(|((child_collection_id, child_id), _)| TokenChild {
+ collection: child_collection_id,
+ token: child_id,
+ })
+ .collect()
+ }
+
/// Delegated to `create_multiple_items`
pub fn create_item(
collection: &NonfungibleHandle<T>,
pallets/structure/src/lib.rsdiffbeforeafterboth--- a/pallets/structure/src/lib.rs
+++ b/pallets/structure/src/lib.rs
@@ -191,8 +191,8 @@
token_id: TokenId,
nesting_budget: &dyn Budget,
) -> DispatchResult {
- Self::try_exec_if_owner_is_valid_nft(under, |d, parent_id| {
- d.check_nesting(from, (collection_id, token_id), parent_id, nesting_budget)
+ Self::try_exec_if_owner_is_valid_nft(under, |collection, parent_id| {
+ collection.check_nesting(from, (collection_id, token_id), parent_id, nesting_budget)
})
}
@@ -203,10 +203,10 @@
token_id: TokenId,
nesting_budget: &dyn Budget,
) -> DispatchResult {
- Self::try_exec_if_owner_is_valid_nft(under, |d, parent_id| {
- d.check_nesting(from, (collection_id, token_id), parent_id, nesting_budget)?;
+ Self::try_exec_if_owner_is_valid_nft(under, |collection, parent_id| {
+ collection.check_nesting(from, (collection_id, token_id), parent_id, nesting_budget)?;
- d.nest(parent_id, (collection_id, token_id));
+ collection.nest(parent_id, (collection_id, token_id));
Ok(())
})
@@ -217,8 +217,8 @@
collection_id: CollectionId,
token_id: TokenId,
) {
- Self::exec_if_owner_is_valid_nft(owner, |d, parent_id| {
- d.nest(parent_id, (collection_id, token_id))
+ Self::exec_if_owner_is_valid_nft(owner, |collection, parent_id| {
+ collection.nest(parent_id, (collection_id, token_id))
});
}
@@ -227,8 +227,8 @@
collection_id: CollectionId,
token_id: TokenId,
) {
- Self::exec_if_owner_is_valid_nft(owner, |d, parent_id| {
- d.unnest(parent_id, (collection_id, token_id))
+ Self::exec_if_owner_is_valid_nft(owner, |collection, parent_id| {
+ collection.unnest(parent_id, (collection_id, token_id))
});
}
@@ -236,8 +236,8 @@
account: &T::CrossAccountId,
action: impl FnOnce(&dyn CommonCollectionOperations<T>, TokenId),
) {
- Self::try_exec_if_owner_is_valid_nft(account, |d, id| {
- action(d, id);
+ Self::try_exec_if_owner_is_valid_nft(account, |collection, id| {
+ action(collection, id);
Ok(())
})
.unwrap();
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -585,6 +585,14 @@
#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
+// todo possibly rename to be used generally as an address pair
+pub struct TokenChild {
+ pub token: TokenId,
+ pub collection: CollectionId,
+}
+
+#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
+#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct CollectionStats {
pub created: u32,
pub destroyed: u32,
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -18,7 +18,7 @@
use up_data_structs::{
CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property,
- PropertyKeyPermission, TokenData,
+ PropertyKeyPermission, TokenData, TokenChild,
};
use sp_std::vec::Vec;
use codec::Decode;
@@ -41,6 +41,7 @@
fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;
fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>>;
+ fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>>;
fn collection_properties(collection: CollectionId, properties: Option<Vec<Vec<u8>>>) -> Result<Vec<Property>>;
runtime/common/src/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -29,7 +29,9 @@
Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))
}
-
+ fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>, DispatchError> {
+ Ok(<pallet_nonfungible::Pallet<Runtime>>::token_children_ids(collection, token))
+ }
fn collection_properties(
collection: CollectionId,
keys: Option<Vec<Vec<u8>>>
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -73,6 +73,7 @@
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping},
+ TokenChild,
};
// use pallet_contracts::weights::WeightInfo;
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -72,7 +72,8 @@
use up_data_structs::{
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
- mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}
+ mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping},
+ TokenChild,
};
// use pallet_contracts::weights::WeightInfo;
runtime/tests/src/tests.rsdiffbeforeafterboth--- a/runtime/tests/src/tests.rs
+++ b/runtime/tests/src/tests.rs
@@ -21,7 +21,7 @@
CreateReFungibleData, MAX_DECIMAL_POINTS, COLLECTION_ADMINS_LIMIT, TokenId,
MAX_TOKEN_OWNERSHIP, CreateCollectionData, CollectionMode, AccessMode, CollectionPermissions,
PropertyKeyPermission, PropertyPermission, Property, CollectionPropertiesVec,
- CollectionPropertiesPermissionsVec,
+ CollectionPropertiesPermissionsVec, TokenChild,
};
use frame_support::{assert_noop, assert_ok, assert_err};
use sp_std::convert::TryInto;
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -5,7 +5,7 @@
import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsTokenChild } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/storage' {
@@ -88,7 +88,7 @@
/**
* Not used by code, exists only to provide some types to metadata
**/
- dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32, PhantomTypeUpDataStructs]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32, UpDataStructsTokenChild, PhantomTypeUpDataStructs]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* List of collection admins
**/
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
-import type { PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenData } from './default';
+import type { PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default';
import type { AugmentedRpc } from '@polkadot/rpc-core/types';
import type { Metadata, StorageKey } from '@polkadot/types';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec';
@@ -639,6 +639,10 @@
**/
propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;
/**
+ * Get tokens nested directly into the token
+ **/
+ tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenChild>>>;
+ /**
* Get token data
**/
tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenData>>;
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingRule, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsRmrkAccountIdOrCollectionNftTuple, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkBasicResource, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkComposableResource, UpDataStructsRmrkEquippableList, UpDataStructsRmrkFixedPart, UpDataStructsRmrkNftChild, UpDataStructsRmrkNftInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkResourceTypes, UpDataStructsRmrkRoyaltyInfo, UpDataStructsRmrkSlotPart, UpDataStructsRmrkSlotResource, UpDataStructsRmrkTheme, UpDataStructsRmrkThemeProperty, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingRule, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsRmrkAccountIdOrCollectionNftTuple, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkBasicResource, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkComposableResource, UpDataStructsRmrkEquippableList, UpDataStructsRmrkFixedPart, UpDataStructsRmrkNftChild, UpDataStructsRmrkNftInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkResourceTypes, UpDataStructsRmrkRoyaltyInfo, UpDataStructsRmrkSlotPart, UpDataStructsRmrkSlotResource, UpDataStructsRmrkTheme, UpDataStructsRmrkThemeProperty, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
import type { Data, StorageKey } from '@polkadot/types';
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
@@ -1210,6 +1210,7 @@
UpDataStructsRpcCollection: UpDataStructsRpcCollection;
UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
+ UpDataStructsTokenChild: UpDataStructsTokenChild;
UpDataStructsTokenData: UpDataStructsTokenData;
UpgradeGoAhead: UpgradeGoAhead;
UpgradeRestriction: UpgradeRestriction;
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -1588,7 +1588,7 @@
}
/** @name PhantomTypeUpDataStructs */
-export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkNftInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkTheme, UpDataStructsRmrkNftChild]>> {}
+export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkNftInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkTheme, UpDataStructsRmrkNftChild]>> {}
/** @name PolkadotCorePrimitivesInboundDownwardMessage */
export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {
@@ -1861,7 +1861,6 @@
/** @name UpDataStructsCreateNftData */
export interface UpDataStructsCreateNftData extends Struct {
- readonly constData: Bytes;
readonly properties: Vec<UpDataStructsProperty>;
}
@@ -2101,6 +2100,12 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
+/** @name UpDataStructsTokenChild */
+export interface UpDataStructsTokenChild extends Struct {
+ readonly token: u32;
+ readonly collection: u32;
+}
+
/** @name UpDataStructsTokenData */
export interface UpDataStructsTokenData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -1479,17 +1479,16 @@
* Lookup186: up_data_structs::CreateNftData
**/
UpDataStructsCreateNftData: {
- constData: 'Bytes',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup188: up_data_structs::CreateFungibleData
+ * Lookup187: up_data_structs::CreateFungibleData
**/
UpDataStructsCreateFungibleData: {
value: 'u128'
},
/**
- * Lookup189: up_data_structs::CreateReFungibleData
+ * Lookup188: up_data_structs::CreateReFungibleData
**/
UpDataStructsCreateReFungibleData: {
constData: 'Bytes',
@@ -2282,18 +2281,25 @@
alive: 'u32'
},
/**
- * Lookup323: PhantomType::up_data_structs<T>
+ * Lookup323: up_data_structs::TokenChild
**/
- PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,PalletEvmAccountBasicCrossAccountIdRepr,UpDataStructsRmrkCollectionInfo,UpDataStructsRmrkNftInfo,UpDataStructsRmrkResourceInfo,UpDataStructsRmrkPropertyInfo,UpDataStructsRmrkBaseInfo,UpDataStructsRmrkPartType,UpDataStructsRmrkTheme,UpDataStructsRmrkNftChild);0]',
+ UpDataStructsTokenChild: {
+ token: 'u32',
+ collection: 'u32'
+ },
+ /**
+ * Lookup324: PhantomType::up_data_structs<T>
+ **/
+ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,UpDataStructsRmrkCollectionInfo,UpDataStructsRmrkNftInfo,UpDataStructsRmrkResourceInfo,UpDataStructsRmrkPropertyInfo,UpDataStructsRmrkBaseInfo,UpDataStructsRmrkPartType,UpDataStructsRmrkTheme,UpDataStructsRmrkNftChild);0]',
/**
- * Lookup325: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup326: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
owner: 'Option<PalletEvmAccountBasicCrossAccountIdRepr>'
},
/**
- * Lookup327: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup328: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -2308,7 +2314,7 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup328: up_data_structs::rmrk::CollectionInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
+ * Lookup329: up_data_structs::rmrk::CollectionInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
**/
UpDataStructsRmrkCollectionInfo: {
issuer: 'AccountId32',
@@ -2318,7 +2324,7 @@
nftsCount: 'u32'
},
/**
- * Lookup331: up_data_structs::rmrk::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup332: up_data_structs::rmrk::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkNftInfo: {
owner: 'UpDataStructsRmrkAccountIdOrCollectionNftTuple',
@@ -2328,7 +2334,7 @@
pending: 'bool'
},
/**
- * Lookup332: up_data_structs::rmrk::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
+ * Lookup333: up_data_structs::rmrk::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
**/
UpDataStructsRmrkAccountIdOrCollectionNftTuple: {
_enum: {
@@ -2337,14 +2343,14 @@
}
},
/**
- * Lookup334: up_data_structs::rmrk::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+ * Lookup335: up_data_structs::rmrk::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
**/
UpDataStructsRmrkRoyaltyInfo: {
recipient: 'AccountId32',
amount: 'Permill'
},
/**
- * Lookup335: 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>>
+ * 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',
@@ -2353,7 +2359,7 @@
pendingRemoval: 'bool'
},
/**
- * Lookup338: up_data_structs::rmrk::ResourceTypes<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup339: up_data_structs::rmrk::ResourceTypes<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkResourceTypes: {
_enum: {
@@ -2363,7 +2369,7 @@
}
},
/**
- * Lookup339: up_data_structs::rmrk::BasicResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup340: up_data_structs::rmrk::BasicResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkBasicResource: {
src: 'Option<Bytes>',
@@ -2372,7 +2378,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup341: up_data_structs::rmrk::ComposableResource<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup342: 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>',
@@ -2383,7 +2389,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup342: up_data_structs::rmrk::SlotResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup343: up_data_structs::rmrk::SlotResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkSlotResource: {
base: 'u32',
@@ -2394,14 +2400,14 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup343: up_data_structs::rmrk::PropertyInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup344: up_data_structs::rmrk::PropertyInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkPropertyInfo: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup346: up_data_structs::rmrk::BaseInfo<sp_core::crypto::AccountId32, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup347: up_data_structs::rmrk::BaseInfo<sp_core::crypto::AccountId32, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkBaseInfo: {
issuer: 'AccountId32',
@@ -2409,7 +2415,7 @@
symbol: 'Bytes'
},
/**
- * Lookup347: up_data_structs::rmrk::PartType<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup348: up_data_structs::rmrk::PartType<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkPartType: {
_enum: {
@@ -2418,7 +2424,7 @@
}
},
/**
- * Lookup349: up_data_structs::rmrk::FixedPart<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup350: up_data_structs::rmrk::FixedPart<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkFixedPart: {
id: 'u32',
@@ -2426,7 +2432,7 @@
src: 'Bytes'
},
/**
- * Lookup350: up_data_structs::rmrk::SlotPart<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup351: up_data_structs::rmrk::SlotPart<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkSlotPart: {
id: 'u32',
@@ -2435,7 +2441,7 @@
z: 'u32'
},
/**
- * Lookup351: up_data_structs::rmrk::EquippableList<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup352: up_data_structs::rmrk::EquippableList<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkEquippableList: {
_enum: {
@@ -2445,7 +2451,7 @@
}
},
/**
- * Lookup352: up_data_structs::rmrk::Theme<frame_support::storage::bounded_vec::BoundedVec<T, S>, PropertyList>
+ * Lookup353: up_data_structs::rmrk::Theme<frame_support::storage::bounded_vec::BoundedVec<T, S>, PropertyList>
**/
UpDataStructsRmrkTheme: {
name: 'Bytes',
@@ -2453,69 +2459,69 @@
inherit: 'bool'
},
/**
- * Lookup354: up_data_structs::rmrk::ThemeProperty<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+ * Lookup355: up_data_structs::rmrk::ThemeProperty<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsRmrkThemeProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup355: up_data_structs::rmrk::NftChild
+ * Lookup356: up_data_structs::rmrk::NftChild
**/
UpDataStructsRmrkNftChild: {
collectionId: 'u32',
nftId: 'u32'
},
/**
- * Lookup357: pallet_common::pallet::Error<T>
+ * Lookup358: pallet_common::pallet::Error<T>
**/
PalletCommonError: {
_enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'NestingIsDisabled', 'OnlyOwnerAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey']
},
/**
- * Lookup359: pallet_fungible::pallet::Error<T>
+ * Lookup360: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup360: pallet_refungible::ItemData
+ * Lookup361: pallet_refungible::ItemData
**/
PalletRefungibleItemData: {
constData: 'Bytes'
},
/**
- * Lookup364: pallet_refungible::pallet::Error<T>
+ * Lookup365: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup365: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup366: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup367: pallet_nonfungible::pallet::Error<T>
+ * Lookup368: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup368: pallet_structure::pallet::Error<T>
+ * Lookup369: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'TokenNotFound']
},
/**
- * Lookup371: pallet_evm::pallet::Error<T>
+ * Lookup372: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup374: fp_rpc::TransactionStatus
+ * Lookup375: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -2527,11 +2533,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup376: ethbloom::Bloom
+ * Lookup377: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup378: ethereum::receipt::ReceiptV3
+ * Lookup379: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -2541,7 +2547,7 @@
}
},
/**
- * Lookup379: ethereum::receipt::EIP658ReceiptData
+ * Lookup380: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -2550,7 +2556,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup380: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup381: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -2558,7 +2564,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup381: ethereum::header::Header
+ * Lookup382: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -2578,41 +2584,41 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup382: ethereum_types::hash::H64
+ * Lookup383: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup387: pallet_ethereum::pallet::Error<T>
+ * Lookup388: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup388: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup389: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup389: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup390: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup391: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup392: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
_enum: ['NoPermission']
},
/**
- * Lookup392: pallet_evm_migration::pallet::Error<T>
+ * Lookup393: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup394: sp_runtime::MultiSignature
+ * Lookup395: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -2622,43 +2628,43 @@
}
},
/**
- * Lookup395: sp_core::ed25519::Signature
+ * Lookup396: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup397: sp_core::sr25519::Signature
+ * Lookup398: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup398: sp_core::ecdsa::Signature
+ * Lookup399: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup401: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup402: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup402: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup403: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup405: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup406: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup406: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup407: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup407: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup408: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup408: opal_runtime::Runtime
+ * Lookup409: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup409: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup410: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/registry.tsdiffbeforeafterboth--- a/tests/src/interfaces/registry.ts
+++ b/tests/src/interfaces/registry.ts
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingRule, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsRmrkAccountIdOrCollectionNftTuple, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkBasicResource, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkComposableResource, UpDataStructsRmrkEquippableList, UpDataStructsRmrkFixedPart, UpDataStructsRmrkNftChild, UpDataStructsRmrkNftInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkResourceTypes, UpDataStructsRmrkRoyaltyInfo, UpDataStructsRmrkSlotPart, UpDataStructsRmrkSlotResource, UpDataStructsRmrkTheme, UpDataStructsRmrkThemeProperty, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingRule, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsRmrkAccountIdOrCollectionNftTuple, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkBasicResource, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkComposableResource, UpDataStructsRmrkEquippableList, UpDataStructsRmrkFixedPart, UpDataStructsRmrkNftChild, UpDataStructsRmrkNftInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkResourceTypes, UpDataStructsRmrkRoyaltyInfo, UpDataStructsRmrkSlotPart, UpDataStructsRmrkSlotResource, UpDataStructsRmrkTheme, UpDataStructsRmrkThemeProperty, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
declare module '@polkadot/types/types/registry' {
export interface InterfaceTypes {
@@ -188,6 +188,7 @@
UpDataStructsRpcCollection: UpDataStructsRpcCollection;
UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
+ UpDataStructsTokenChild: UpDataStructsTokenChild;
UpDataStructsTokenData: UpDataStructsTokenData;
XcmDoubleEncoded: XcmDoubleEncoded;
XcmV0Junction: XcmV0Junction;
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -1604,16 +1604,15 @@
/** @name UpDataStructsCreateNftData (186) */
export interface UpDataStructsCreateNftData extends Struct {
- readonly constData: Bytes;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateFungibleData (188) */
+ /** @name UpDataStructsCreateFungibleData (187) */
export interface UpDataStructsCreateFungibleData extends Struct {
readonly value: u128;
}
- /** @name UpDataStructsCreateReFungibleData (189) */
+ /** @name UpDataStructsCreateReFungibleData (188) */
export interface UpDataStructsCreateReFungibleData extends Struct {
readonly constData: Bytes;
readonly pieces: u128;
@@ -2469,16 +2468,22 @@
readonly alive: u32;
}
- /** @name PhantomTypeUpDataStructs (323) */
- export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkNftInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkTheme, UpDataStructsRmrkNftChild]>> {}
+ /** @name UpDataStructsTokenChild (323) */
+ export interface UpDataStructsTokenChild extends Struct {
+ readonly token: u32;
+ readonly collection: u32;
+ }
+
+ /** @name PhantomTypeUpDataStructs (324) */
+ export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, UpDataStructsRmrkCollectionInfo, UpDataStructsRmrkNftInfo, UpDataStructsRmrkResourceInfo, UpDataStructsRmrkPropertyInfo, UpDataStructsRmrkBaseInfo, UpDataStructsRmrkPartType, UpDataStructsRmrkTheme, UpDataStructsRmrkNftChild]>> {}
- /** @name UpDataStructsTokenData (325) */
+ /** @name UpDataStructsTokenData (326) */
export interface UpDataStructsTokenData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
}
- /** @name UpDataStructsRpcCollection (327) */
+ /** @name UpDataStructsRpcCollection (328) */
export interface UpDataStructsRpcCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -2492,7 +2497,7 @@
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsRmrkCollectionInfo (328) */
+ /** @name UpDataStructsRmrkCollectionInfo (329) */
export interface UpDataStructsRmrkCollectionInfo extends Struct {
readonly issuer: AccountId32;
readonly metadata: Bytes;
@@ -2501,7 +2506,7 @@
readonly nftsCount: u32;
}
- /** @name UpDataStructsRmrkNftInfo (331) */
+ /** @name UpDataStructsRmrkNftInfo (332) */
export interface UpDataStructsRmrkNftInfo extends Struct {
readonly owner: UpDataStructsRmrkAccountIdOrCollectionNftTuple;
readonly royalty: Option<UpDataStructsRmrkRoyaltyInfo>;
@@ -2510,7 +2515,7 @@
readonly pending: bool;
}
- /** @name UpDataStructsRmrkAccountIdOrCollectionNftTuple (332) */
+ /** @name UpDataStructsRmrkAccountIdOrCollectionNftTuple (333) */
export interface UpDataStructsRmrkAccountIdOrCollectionNftTuple extends Enum {
readonly isAccountId: boolean;
readonly asAccountId: AccountId32;
@@ -2519,13 +2524,13 @@
readonly type: 'AccountId' | 'CollectionAndNftTuple';
}
- /** @name UpDataStructsRmrkRoyaltyInfo (334) */
+ /** @name UpDataStructsRmrkRoyaltyInfo (335) */
export interface UpDataStructsRmrkRoyaltyInfo extends Struct {
readonly recipient: AccountId32;
readonly amount: Permill;
}
- /** @name UpDataStructsRmrkResourceInfo (335) */
+ /** @name UpDataStructsRmrkResourceInfo (336) */
export interface UpDataStructsRmrkResourceInfo extends Struct {
readonly id: Bytes;
readonly resource: UpDataStructsRmrkResourceTypes;
@@ -2533,7 +2538,7 @@
readonly pendingRemoval: bool;
}
- /** @name UpDataStructsRmrkResourceTypes (338) */
+ /** @name UpDataStructsRmrkResourceTypes (339) */
export interface UpDataStructsRmrkResourceTypes extends Enum {
readonly isBasic: boolean;
readonly asBasic: UpDataStructsRmrkBasicResource;
@@ -2544,7 +2549,7 @@
readonly type: 'Basic' | 'Composable' | 'Slot';
}
- /** @name UpDataStructsRmrkBasicResource (339) */
+ /** @name UpDataStructsRmrkBasicResource (340) */
export interface UpDataStructsRmrkBasicResource extends Struct {
readonly src: Option<Bytes>;
readonly metadata: Option<Bytes>;
@@ -2552,7 +2557,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name UpDataStructsRmrkComposableResource (341) */
+ /** @name UpDataStructsRmrkComposableResource (342) */
export interface UpDataStructsRmrkComposableResource extends Struct {
readonly parts: Vec<u32>;
readonly base: u32;
@@ -2562,7 +2567,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name UpDataStructsRmrkSlotResource (342) */
+ /** @name UpDataStructsRmrkSlotResource (343) */
export interface UpDataStructsRmrkSlotResource extends Struct {
readonly base: u32;
readonly src: Option<Bytes>;
@@ -2572,20 +2577,20 @@
readonly thumb: Option<Bytes>;
}
- /** @name UpDataStructsRmrkPropertyInfo (343) */
+ /** @name UpDataStructsRmrkPropertyInfo (344) */
export interface UpDataStructsRmrkPropertyInfo extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name UpDataStructsRmrkBaseInfo (346) */
+ /** @name UpDataStructsRmrkBaseInfo (347) */
export interface UpDataStructsRmrkBaseInfo extends Struct {
readonly issuer: AccountId32;
readonly baseType: Bytes;
readonly symbol: Bytes;
}
- /** @name UpDataStructsRmrkPartType (347) */
+ /** @name UpDataStructsRmrkPartType (348) */
export interface UpDataStructsRmrkPartType extends Enum {
readonly isFixedPart: boolean;
readonly asFixedPart: UpDataStructsRmrkFixedPart;
@@ -2594,14 +2599,14 @@
readonly type: 'FixedPart' | 'SlotPart';
}
- /** @name UpDataStructsRmrkFixedPart (349) */
+ /** @name UpDataStructsRmrkFixedPart (350) */
export interface UpDataStructsRmrkFixedPart extends Struct {
readonly id: u32;
readonly z: u32;
readonly src: Bytes;
}
- /** @name UpDataStructsRmrkSlotPart (350) */
+ /** @name UpDataStructsRmrkSlotPart (351) */
export interface UpDataStructsRmrkSlotPart extends Struct {
readonly id: u32;
readonly equippable: UpDataStructsRmrkEquippableList;
@@ -2609,7 +2614,7 @@
readonly z: u32;
}
- /** @name UpDataStructsRmrkEquippableList (351) */
+ /** @name UpDataStructsRmrkEquippableList (352) */
export interface UpDataStructsRmrkEquippableList extends Enum {
readonly isAll: boolean;
readonly isEmpty: boolean;
@@ -2618,26 +2623,26 @@
readonly type: 'All' | 'Empty' | 'Custom';
}
- /** @name UpDataStructsRmrkTheme (352) */
+ /** @name UpDataStructsRmrkTheme (353) */
export interface UpDataStructsRmrkTheme extends Struct {
readonly name: Bytes;
readonly properties: Vec<UpDataStructsRmrkThemeProperty>;
readonly inherit: bool;
}
- /** @name UpDataStructsRmrkThemeProperty (354) */
+ /** @name UpDataStructsRmrkThemeProperty (355) */
export interface UpDataStructsRmrkThemeProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name UpDataStructsRmrkNftChild (355) */
+ /** @name UpDataStructsRmrkNftChild (356) */
export interface UpDataStructsRmrkNftChild extends Struct {
readonly collectionId: u32;
readonly nftId: u32;
}
- /** @name PalletCommonError (357) */
+ /** @name PalletCommonError (358) */
export interface PalletCommonError extends Enum {
readonly isCollectionNotFound: boolean;
readonly isMustBeTokenOwner: boolean;
@@ -2675,7 +2680,7 @@
readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'NestingIsDisabled' | 'OnlyOwnerAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey';
}
- /** @name PalletFungibleError (359) */
+ /** @name PalletFungibleError (360) */
export interface PalletFungibleError extends Enum {
readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isFungibleItemsHaveNoId: boolean;
@@ -2685,12 +2690,12 @@
readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletRefungibleItemData (360) */
+ /** @name PalletRefungibleItemData (361) */
export interface PalletRefungibleItemData extends Struct {
readonly constData: Bytes;
}
- /** @name PalletRefungibleError (364) */
+ /** @name PalletRefungibleError (365) */
export interface PalletRefungibleError extends Enum {
readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isWrongRefungiblePieces: boolean;
@@ -2699,12 +2704,12 @@
readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletNonfungibleItemData (365) */
+ /** @name PalletNonfungibleItemData (366) */
export interface PalletNonfungibleItemData extends Struct {
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name PalletNonfungibleError (367) */
+ /** @name PalletNonfungibleError (368) */
export interface PalletNonfungibleError extends Enum {
readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isNonfungibleItemsHaveNoAmount: boolean;
@@ -2712,7 +2717,7 @@
readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
}
- /** @name PalletStructureError (368) */
+ /** @name PalletStructureError (369) */
export interface PalletStructureError extends Enum {
readonly isOuroborosDetected: boolean;
readonly isDepthLimit: boolean;
@@ -2720,7 +2725,7 @@
readonly type: 'OuroborosDetected' | 'DepthLimit' | 'TokenNotFound';
}
- /** @name PalletEvmError (371) */
+ /** @name PalletEvmError (372) */
export interface PalletEvmError extends Enum {
readonly isBalanceLow: boolean;
readonly isFeeOverflow: boolean;
@@ -2731,7 +2736,7 @@
readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';
}
- /** @name FpRpcTransactionStatus (374) */
+ /** @name FpRpcTransactionStatus (375) */
export interface FpRpcTransactionStatus extends Struct {
readonly transactionHash: H256;
readonly transactionIndex: u32;
@@ -2742,10 +2747,10 @@
readonly logsBloom: EthbloomBloom;
}
- /** @name EthbloomBloom (376) */
+ /** @name EthbloomBloom (377) */
export interface EthbloomBloom extends U8aFixed {}
- /** @name EthereumReceiptReceiptV3 (378) */
+ /** @name EthereumReceiptReceiptV3 (379) */
export interface EthereumReceiptReceiptV3 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumReceiptEip658ReceiptData;
@@ -2756,7 +2761,7 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumReceiptEip658ReceiptData (379) */
+ /** @name EthereumReceiptEip658ReceiptData (380) */
export interface EthereumReceiptEip658ReceiptData extends Struct {
readonly statusCode: u8;
readonly usedGas: U256;
@@ -2764,14 +2769,14 @@
readonly logs: Vec<EthereumLog>;
}
- /** @name EthereumBlock (380) */
+ /** @name EthereumBlock (381) */
export interface EthereumBlock extends Struct {
readonly header: EthereumHeader;
readonly transactions: Vec<EthereumTransactionTransactionV2>;
readonly ommers: Vec<EthereumHeader>;
}
- /** @name EthereumHeader (381) */
+ /** @name EthereumHeader (382) */
export interface EthereumHeader extends Struct {
readonly parentHash: H256;
readonly ommersHash: H256;
@@ -2790,24 +2795,24 @@
readonly nonce: EthereumTypesHashH64;
}
- /** @name EthereumTypesHashH64 (382) */
+ /** @name EthereumTypesHashH64 (383) */
export interface EthereumTypesHashH64 extends U8aFixed {}
- /** @name PalletEthereumError (387) */
+ /** @name PalletEthereumError (388) */
export interface PalletEthereumError extends Enum {
readonly isInvalidSignature: boolean;
readonly isPreLogExists: boolean;
readonly type: 'InvalidSignature' | 'PreLogExists';
}
- /** @name PalletEvmCoderSubstrateError (388) */
+ /** @name PalletEvmCoderSubstrateError (389) */
export interface PalletEvmCoderSubstrateError extends Enum {
readonly isOutOfGas: boolean;
readonly isOutOfFund: boolean;
readonly type: 'OutOfGas' | 'OutOfFund';
}
- /** @name PalletEvmContractHelpersSponsoringModeT (389) */
+ /** @name PalletEvmContractHelpersSponsoringModeT (390) */
export interface PalletEvmContractHelpersSponsoringModeT extends Enum {
readonly isDisabled: boolean;
readonly isAllowlisted: boolean;
@@ -2815,20 +2820,20 @@
readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
}
- /** @name PalletEvmContractHelpersError (391) */
+ /** @name PalletEvmContractHelpersError (392) */
export interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly type: 'NoPermission';
}
- /** @name PalletEvmMigrationError (392) */
+ /** @name PalletEvmMigrationError (393) */
export interface PalletEvmMigrationError extends Enum {
readonly isAccountNotEmpty: boolean;
readonly isAccountIsNotMigrating: boolean;
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
}
- /** @name SpRuntimeMultiSignature (394) */
+ /** @name SpRuntimeMultiSignature (395) */
export interface SpRuntimeMultiSignature extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Signature;
@@ -2839,34 +2844,34 @@
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
- /** @name SpCoreEd25519Signature (395) */
+ /** @name SpCoreEd25519Signature (396) */
export interface SpCoreEd25519Signature extends U8aFixed {}
- /** @name SpCoreSr25519Signature (397) */
+ /** @name SpCoreSr25519Signature (398) */
export interface SpCoreSr25519Signature extends U8aFixed {}
- /** @name SpCoreEcdsaSignature (398) */
+ /** @name SpCoreEcdsaSignature (399) */
export interface SpCoreEcdsaSignature extends U8aFixed {}
- /** @name FrameSystemExtensionsCheckSpecVersion (401) */
+ /** @name FrameSystemExtensionsCheckSpecVersion (402) */
export type FrameSystemExtensionsCheckSpecVersion = Null;
- /** @name FrameSystemExtensionsCheckGenesis (402) */
+ /** @name FrameSystemExtensionsCheckGenesis (403) */
export type FrameSystemExtensionsCheckGenesis = Null;
- /** @name FrameSystemExtensionsCheckNonce (405) */
+ /** @name FrameSystemExtensionsCheckNonce (406) */
export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
- /** @name FrameSystemExtensionsCheckWeight (406) */
+ /** @name FrameSystemExtensionsCheckWeight (407) */
export type FrameSystemExtensionsCheckWeight = Null;
- /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (407) */
+ /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (408) */
export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
- /** @name OpalRuntimeRuntime (408) */
+ /** @name OpalRuntimeRuntime (409) */
export type OpalRuntimeRuntime = Null;
- /** @name PalletEthereumFakeTransactionFinalizer (409) */
+ /** @name PalletEthereumFakeTransactionFinalizer (410) */
export type PalletEthereumFakeTransactionFinalizer = Null;
} // declare module
tests/src/interfaces/unique/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -50,6 +50,7 @@
allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),
tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),
topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),
+ tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec<UpDataStructsTokenChild>'),
constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),
variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),
collectionProperties: fun(
tests/src/nesting/nest.test.tsdiffbeforeafterboth--- a/tests/src/nesting/nest.test.ts
+++ b/tests/src/nesting/nest.test.ts
@@ -7,6 +7,7 @@
createItemExpectSuccess,
enableAllowListExpectSuccess,
enablePublicMintingExpectSuccess,
+ getTokenChildren,
getTokenOwner,
getTopmostTokenOwner,
normalizeAccountId,
@@ -76,8 +77,8 @@
api,
alice,
api.tx.unique.transferFrom(
- normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenA)}),
- normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenB)}),
+ normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenA)}),
+ normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenB)}),
collection,
tokenC,
1,
@@ -88,6 +89,63 @@
});
});
+ it('Checks token children', async () => {
+ await usingApi(async api => {
+ const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
+ await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: 'Owner'});
+ const collectionB = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
+
+ const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT');
+ const targetAddress = {Ethereum: tokenIdToAddress(collectionA, targetToken)};
+ let children = await getTokenChildren(api, collectionA, targetToken);
+ expect(children.length).to.be.equal(0, 'Children length check at creation');
+
+ // Create a nested NFT token
+ const tokenA = await createItemExpectSuccess(alice, collectionA, 'NFT', targetAddress);
+ children = await getTokenChildren(api, collectionA, targetToken);
+ expect(children.length).to.be.equal(1, 'Children length check at nesting #1');
+ expect(children).to.have.deep.members([
+ {token: tokenA, collection: collectionA},
+ ], 'Children contents check at nesting #1');
+
+ // Create then nest
+ const tokenB = await createItemExpectSuccess(alice, collectionA, 'NFT');
+ await transferExpectSuccess(collectionA, tokenB, alice, targetAddress);
+ children = await getTokenChildren(api, collectionA, targetToken);
+ expect(children.length).to.be.equal(2, 'Children length check at nesting #2');
+ expect(children).to.have.deep.members([
+ {token: tokenA, collection: collectionA},
+ {token: tokenB, collection: collectionA},
+ ], 'Children contents check at nesting #2');
+
+ // Move token B to a different user outside the nesting tree
+ await transferExpectSuccess(collectionA, tokenB, alice, bob);
+ children = await getTokenChildren(api, collectionA, targetToken);
+ expect(children.length).to.be.equal(1, 'Children length check at unnesting');
+ expect(children).to.be.have.deep.members([
+ {token: tokenA, collection: collectionA},
+ ], 'Children contents check at unnesting');
+
+ // Create a fungible token in another collection and then nest
+ const tokenC = await createItemExpectSuccess(alice, collectionB, 'Fungible');
+ await transferExpectSuccess(collectionB, tokenC, alice, targetAddress, 1, 'Fungible');
+ children = await getTokenChildren(api, collectionA, targetToken);
+ expect(children.length).to.be.equal(2, 'Children length check at nesting #3 (from another collection)');
+ expect(children).to.be.have.deep.members([
+ {token: tokenA, collection: collectionA},
+ {token: tokenC, collection: collectionB},
+ ], 'Children contents check at nesting #3 (from another collection)');
+
+ // Move the fungible token inside token A deeper in the nesting tree
+ await transferFromExpectSuccess(collectionB, tokenC, alice, targetAddress, {Ethereum: tokenIdToAddress(collectionA, tokenA)}, 1, 'Fungible');
+ children = await getTokenChildren(api, collectionA, targetToken);
+ expect(children.length).to.be.equal(1, 'Children length check at deeper nesting');
+ expect(children).to.be.have.deep.members([
+ {token: tokenA, collection: collectionA},
+ ], 'Children contents check at deeper nesting');
+ });
+ });
+
// ---------- Non-Fungible ----------
it('NFT: allows an Owner to nest/unnest their token', async () => {
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -27,6 +27,7 @@
import {default as usingApi, executeTransaction, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';
import {hexToStr, strToUTF16, utf16ToStr} from './util';
import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup';
+import {UpDataStructsTokenChild} from '../interfaces';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -1165,6 +1166,13 @@
if (owner == null) throw new Error('owner == null');
return normalizeAccountId(owner);
}
+export async function getTokenChildren(
+ api: ApiPromise,
+ collectionId: number,
+ tokenId: number,
+): Promise<UpDataStructsTokenChild[]> {
+ return (await api.rpc.unique.tokenChildren(collectionId, tokenId)).toJSON() as any;
+}
export async function isTokenExists(
api: ApiPromise,
collectionId: number,