difftreelog
add rpc methods + tests
in: master
17 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 sp_runtime::traits::{AtLeast32BitUnsigned, Member};27use up_data_structs::{28 RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,29 PropertyKeyPermission, TokenData, TokenChild,30};31use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};32use sp_blockchain::HeaderBackend;33use up_rpc::UniqueApi as UniqueRuntimeApi;3435// RMRK36use rmrk_rpc::RmrkApi as RmrkRuntimeApi;37use up_data_structs::{38 RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,39};4041pub use rmrk_unique_rpc::RmrkApiServer;4243#[rpc(server)]44#[async_trait]45pub trait UniqueApi<BlockHash, BlockNumber, CrossAccountId, AccountId> {46 /// Get tokens owned by account.47 #[method(name = "unique_accountTokens")]48 fn account_tokens(49 &self,50 collection: CollectionId,51 account: CrossAccountId,52 at: Option<BlockHash>,53 ) -> Result<Vec<TokenId>>;5455 /// Get tokens contained within a collection.56 #[method(name = "unique_collectionTokens")]57 fn collection_tokens(58 &self,59 collection: CollectionId,60 at: Option<BlockHash>,61 ) -> Result<Vec<TokenId>>;6263 /// Check if the token exists.64 #[method(name = "unique_tokenExists")]65 fn token_exists(66 &self,67 collection: CollectionId,68 token: TokenId,69 at: Option<BlockHash>,70 ) -> Result<bool>;7172 /// Get the token owner.73 #[method(name = "unique_tokenOwner")]74 fn token_owner(75 &self,76 collection: CollectionId,77 token: TokenId,78 at: Option<BlockHash>,79 ) -> Result<Option<CrossAccountId>>;8081 /// Returns 10 tokens owners in no particular order.82 #[method(name = "unique_tokenOwners")]83 fn token_owners(84 &self,85 collection: CollectionId,86 token: TokenId,87 at: Option<BlockHash>,88 ) -> Result<Vec<CrossAccountId>>;8990 /// Get the topmost token owner in the hierarchy of a possibly nested token.91 #[method(name = "unique_topmostTokenOwner")]92 fn topmost_token_owner(93 &self,94 collection: CollectionId,95 token: TokenId,96 at: Option<BlockHash>,97 ) -> Result<Option<CrossAccountId>>;9899 /// Get tokens nested directly into the token.100 #[method(name = "unique_tokenChildren")]101 fn token_children(102 &self,103 collection: CollectionId,104 token: TokenId,105 at: Option<BlockHash>,106 ) -> Result<Vec<TokenChild>>;107108 /// Get collection properties, optionally limited to the provided keys.109 #[method(name = "unique_collectionProperties")]110 fn collection_properties(111 &self,112 collection: CollectionId,113 keys: Option<Vec<String>>,114 at: Option<BlockHash>,115 ) -> Result<Vec<Property>>;116117 /// Get token properties, optionally limited to the provided keys.118 #[method(name = "unique_tokenProperties")]119 fn token_properties(120 &self,121 collection: CollectionId,122 token_id: TokenId,123 keys: Option<Vec<String>>,124 at: Option<BlockHash>,125 ) -> Result<Vec<Property>>;126127 /// Get property permissions, optionally limited to the provided keys.128 #[method(name = "unique_propertyPermissions")]129 fn property_permissions(130 &self,131 collection: CollectionId,132 keys: Option<Vec<String>>,133 at: Option<BlockHash>,134 ) -> Result<Vec<PropertyKeyPermission>>;135136 /// Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT.137 #[method(name = "unique_tokenData")]138 fn token_data(139 &self,140 collection: CollectionId,141 token_id: TokenId,142 keys: Option<Vec<String>>,143 at: Option<BlockHash>,144 ) -> Result<TokenData<CrossAccountId>>;145146 /// Get the amount of distinctive tokens present in a collection.147 #[method(name = "unique_totalSupply")]148 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;149150 /// Get the amount of any user tokens owned by an account.151 #[method(name = "unique_accountBalance")]152 fn account_balance(153 &self,154 collection: CollectionId,155 account: CrossAccountId,156 at: Option<BlockHash>,157 ) -> Result<u32>;158159 /// Get the amount of a specific token owned by an account.160 #[method(name = "unique_balance")]161 fn balance(162 &self,163 collection: CollectionId,164 account: CrossAccountId,165 token: TokenId,166 at: Option<BlockHash>,167 ) -> Result<String>;168169 /// Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor.170 #[method(name = "unique_allowance")]171 fn allowance(172 &self,173 collection: CollectionId,174 sender: CrossAccountId,175 spender: CrossAccountId,176 token: TokenId,177 at: Option<BlockHash>,178 ) -> Result<String>;179180 /// Get the list of admin accounts of a collection.181 #[method(name = "unique_adminlist")]182 fn adminlist(183 &self,184 collection: CollectionId,185 at: Option<BlockHash>,186 ) -> Result<Vec<CrossAccountId>>;187188 /// Get the list of accounts allowed to operate within a collection.189 #[method(name = "unique_allowlist")]190 fn allowlist(191 &self,192 collection: CollectionId,193 at: Option<BlockHash>,194 ) -> Result<Vec<CrossAccountId>>;195196 /// Check if a user is allowed to operate within a collection.197 #[method(name = "unique_allowed")]198 fn allowed(199 &self,200 collection: CollectionId,201 user: CrossAccountId,202 at: Option<BlockHash>,203 ) -> Result<bool>;204205 /// Get the last token ID created in a collection.206 #[method(name = "unique_lastTokenId")]207 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;208209 /// Get collection info by the specified ID.210 #[method(name = "unique_collectionById")]211 fn collection_by_id(212 &self,213 collection: CollectionId,214 at: Option<BlockHash>,215 ) -> Result<Option<RpcCollection<AccountId>>>;216217 /// Get chain stats about collections.218 #[method(name = "unique_collectionStats")]219 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;220221 /// Get the number of blocks until sponsoring a transaction is available.222 #[method(name = "unique_nextSponsored")]223 fn next_sponsored(224 &self,225 collection: CollectionId,226 account: CrossAccountId,227 token: TokenId,228 at: Option<BlockHash>,229 ) -> Result<Option<u64>>;230231 /// Get effective collection limits. If not explicitly set, get the chain defaults.232 #[method(name = "unique_effectiveCollectionLimits")]233 fn effective_collection_limits(234 &self,235 collection_id: CollectionId,236 at: Option<BlockHash>,237 ) -> Result<Option<CollectionLimits>>;238239 /// Get the total amount of pieces of an RFT.240 #[method(name = "unique_totalPieces")]241 fn total_pieces(242 &self,243 collection_id: CollectionId,244 token_id: TokenId,245 at: Option<BlockHash>,246 ) -> Result<Option<u128>>;247248 /// Returns the total amount of staked tokens.249 #[method(name = "unique_totalStaked")]250 fn total_staked(&self, staker: Option<CrossAccountId>, at: Option<BlockHash>)251 -> Result<String>;252253 ///Returns the total amount of staked tokens per block when staked.254 #[method(name = "unique_totalStakedPerBlock")]255 fn total_staked_per_block(256 &self,257 staker: CrossAccountId,258 at: Option<BlockHash>,259 ) -> Result<Vec<(BlockNumber, String)>>;260261 /// Return the total amount locked by staking tokens.262 #[method(name = "unique_totalStakingLocked")]263 fn total_staking_locked(&self, staker: CrossAccountId, at: Option<BlockHash>)264 -> Result<String>;265}266267mod rmrk_unique_rpc {268 use super::*;269270 #[rpc(server)]271 #[async_trait]272 pub trait RmrkApi<273 BlockHash,274 AccountId,275 CollectionInfo,276 NftInfo,277 ResourceInfo,278 PropertyInfo,279 BaseInfo,280 PartType,281 Theme,282 >283 {284 /// Get the latest created collection ID.285 #[method(name = "rmrk_lastCollectionIdx")]286 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;287288 /// Get collection info by ID.289 #[method(name = "rmrk_collectionById")]290 fn collection_by_id(291 &self,292 id: RmrkCollectionId,293 at: Option<BlockHash>,294 ) -> Result<Option<CollectionInfo>>;295296 /// Get NFT info by collection and NFT IDs.297 #[method(name = "rmrk_nftById")]298 fn nft_by_id(299 &self,300 collection_id: RmrkCollectionId,301 nft_id: RmrkNftId,302 at: Option<BlockHash>,303 ) -> Result<Option<NftInfo>>;304305 /// Get tokens owned by an account in a collection.306 #[method(name = "rmrk_accountTokens")]307 fn account_tokens(308 &self,309 account_id: AccountId,310 collection_id: RmrkCollectionId,311 at: Option<BlockHash>,312 ) -> Result<Vec<RmrkNftId>>;313314 /// Get tokens nested in an NFT - its direct children (not the children's children).315 #[method(name = "rmrk_nftChildren")]316 fn nft_children(317 &self,318 collection_id: RmrkCollectionId,319 nft_id: RmrkNftId,320 at: Option<BlockHash>,321 ) -> Result<Vec<RmrkNftChild>>;322323 /// Get collection properties, created by the user - not the proxy-specific properties.324 #[method(name = "rmrk_collectionProperties")]325 fn collection_properties(326 &self,327 collection_id: RmrkCollectionId,328 filter_keys: Option<Vec<String>>,329 at: Option<BlockHash>,330 ) -> Result<Vec<PropertyInfo>>;331332 /// Get NFT properties, created by the user - not the proxy-specific properties.333 #[method(name = "rmrk_nftProperties")]334 fn nft_properties(335 &self,336 collection_id: RmrkCollectionId,337 nft_id: RmrkNftId,338 filter_keys: Option<Vec<String>>,339 at: Option<BlockHash>,340 ) -> Result<Vec<PropertyInfo>>;341342 /// Get data of resources of an NFT.343 #[method(name = "rmrk_nftResources")]344 fn nft_resources(345 &self,346 collection_id: RmrkCollectionId,347 nft_id: RmrkNftId,348 at: Option<BlockHash>,349 ) -> Result<Vec<ResourceInfo>>;350351 /// Get the priority of a resource in an NFT.352 #[method(name = "rmrk_nftResourcePriority")]353 fn nft_resource_priority(354 &self,355 collection_id: RmrkCollectionId,356 nft_id: RmrkNftId,357 resource_id: RmrkResourceId,358 at: Option<BlockHash>,359 ) -> Result<Option<u32>>;360361 /// Get base info by its ID.362 #[method(name = "rmrk_base")]363 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;364365 /// Get all parts of a base.366 #[method(name = "rmrk_baseParts")]367 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;368369 /// Get the theme names belonging to a base.370 #[method(name = "rmrk_themeNames")]371 fn theme_names(372 &self,373 base_id: RmrkBaseId,374 at: Option<BlockHash>,375 ) -> Result<Vec<RmrkThemeName>>;376377 /// Get theme info, including properties, optionally limited to the provided keys.378 #[method(name = "rmrk_themes")]379 fn theme(380 &self,381 base_id: RmrkBaseId,382 theme_name: String,383 filter_keys: Option<Vec<String>>,384 at: Option<BlockHash>,385 ) -> Result<Option<Theme>>;386 }387}388389pub struct Unique<C, P> {390 client: Arc<C>,391 _marker: std::marker::PhantomData<P>,392}393394impl<C, P> Unique<C, P> {395 pub fn new(client: Arc<C>) -> Self {396 Self {397 client,398 _marker: Default::default(),399 }400 }401}402403pub struct Rmrk<C, P> {404 client: Arc<C>,405 _marker: std::marker::PhantomData<P>,406}407408impl<C, P> Rmrk<C, P> {409 pub fn new(client: Arc<C>) -> Self {410 Self {411 client,412 _marker: Default::default(),413 }414 }415}416417macro_rules! pass_method {418 (419 $method_name:ident(420 $($(#[map(|$map_arg:ident| $map:expr)])? $name:ident: $ty:ty),* $(,)?421 ) -> $result:ty $(=> $mapper:expr)?,422 //$runtime_name:ident $(<$($lt: tt),+>)*423 $runtime_api_macro:ident424 $(; changed_in $ver:expr, $changed_method_name:ident ($($changed_name:expr), * $(,)?) => $fixer:expr)*425 ) => {426 fn $method_name(427 &self,428 $(429 $name: $ty,430 )*431 at: Option<<Block as BlockT>::Hash>,432 ) -> Result<$result> {433 let api = self.client.runtime_api();434 let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));435 let _api_version = if let Ok(Some(api_version)) =436 api.api_version::<$runtime_api_macro!()>(&at)437 {438 api_version439 } else {440 // unreachable for our runtime441 return Err(anyhow!("api is not available").into())442 };443444 let result = $(if _api_version < $ver {445 api.$changed_method_name(&at, $($changed_name),*).map(|r| r.map($fixer))446 } else)*447 { api.$method_name(&at, $($((|$map_arg: $ty| $map))? ($name)),*) };448449 Ok(result450 .map_err(|e| anyhow!("unable to query: {e}"))?451 .map_err(|e| anyhow!("runtime error: {e:?}"))$(.map($mapper))??)452 }453 };454}455456macro_rules! unique_api {457 () => {458 dyn UniqueRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>459 };460}461462macro_rules! rmrk_api {463 () => {464 dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>465 };466}467468#[allow(deprecated)]469impl<C, Block, BlockNumber, CrossAccountId, AccountId>470 UniqueApiServer<<Block as BlockT>::Hash, BlockNumber, CrossAccountId, AccountId>471 for Unique<C, Block>472where473 Block: BlockT,474 BlockNumber: Decode + Member + AtLeast32BitUnsigned,475 AccountId: Decode,476 C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,477 C::Api: UniqueRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>,478 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,479{480 pass_method!(481 account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>, unique_api482 );483 pass_method!(484 collection_tokens(collection: CollectionId) -> Vec<TokenId>, unique_api485 );486 pass_method!(487 token_exists(collection: CollectionId, token: TokenId) -> bool, unique_api488 );489 pass_method!(490 token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api491 );492 pass_method!(493 topmost_token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api494 );495 pass_method!(token_children(collection: CollectionId, token: TokenId) -> Vec<TokenChild>, unique_api);496 pass_method!(total_supply(collection: CollectionId) -> u32, unique_api);497 pass_method!(account_balance(collection: CollectionId, account: CrossAccountId) -> u32, unique_api);498 pass_method!(balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> String => |v| v.to_string(), unique_api);499 pass_method!(500 allowance(collection: CollectionId, sender: CrossAccountId, spender: CrossAccountId, token: TokenId) -> String => |v| v.to_string(),501 unique_api502 );503504 pass_method!(collection_properties(505 collection: CollectionId,506507 #[map(|keys| string_keys_to_bytes_keys(keys))]508 keys: Option<Vec<String>>509 ) -> Vec<Property>, unique_api);510511 pass_method!(token_properties(512 collection: CollectionId,513 token_id: TokenId,514515 #[map(|keys| string_keys_to_bytes_keys(keys))]516 keys: Option<Vec<String>>517 ) -> Vec<Property>, unique_api);518519 pass_method!(property_permissions(520 collection: CollectionId,521522 #[map(|keys| string_keys_to_bytes_keys(keys))]523 keys: Option<Vec<String>>524 ) -> Vec<PropertyKeyPermission>, unique_api);525526 pass_method!(token_data(527 collection: CollectionId,528 token_id: TokenId,529530 #[map(|keys| string_keys_to_bytes_keys(keys))]531 keys: Option<Vec<String>>,532 ) -> TokenData<CrossAccountId>, unique_api);533534 pass_method!(adminlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);535 pass_method!(allowlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);536 pass_method!(allowed(collection: CollectionId, user: CrossAccountId) -> bool, unique_api);537 pass_method!(last_token_id(collection: CollectionId) -> TokenId, unique_api);538 pass_method!(collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api);539 pass_method!(collection_stats() -> CollectionStats, unique_api);540 pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option<u64>, unique_api);541 pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);542 pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<String> => |o| o.map(|number| number.to_string()) , unique_api);543 pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec<CrossAccountId>, unique_api);544 pass_method!(total_staked(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), unique_api);545 pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>546 |v| v547 .into_iter()548 .map(|(b, a)| (b, a.to_string()))549 .collect::<Vec<_>>(), unique_api);550 pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api);551}552553#[allow(deprecated)]554impl<555 C,556 Block,557 AccountId,558 CollectionInfo,559 NftInfo,560 ResourceInfo,561 PropertyInfo,562 BaseInfo,563 PartType,564 Theme,565 >566 rmrk_unique_rpc::RmrkApiServer<567 <Block as BlockT>::Hash,568 AccountId,569 CollectionInfo,570 NftInfo,571 ResourceInfo,572 PropertyInfo,573 BaseInfo,574 PartType,575 Theme,576 > for Rmrk<C, Block>577where578 C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,579 C::Api: RmrkRuntimeApi<580 Block,581 AccountId,582 CollectionInfo,583 NftInfo,584 ResourceInfo,585 PropertyInfo,586 BaseInfo,587 PartType,588 Theme,589 >,590 AccountId: Decode + Encode,591 CollectionInfo: Decode,592 NftInfo: Decode,593 ResourceInfo: Decode,594 PropertyInfo: Decode,595 BaseInfo: Decode,596 PartType: Decode,597 Theme: Decode,598 Block: BlockT,599{600 pass_method!(last_collection_idx() -> RmrkCollectionId, rmrk_api);601 pass_method!(collection_by_id(id: RmrkCollectionId) -> Option<CollectionInfo>, rmrk_api);602 pass_method!(nft_by_id(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Option<NftInfo>, rmrk_api);603 pass_method!(account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Vec<RmrkNftId>, rmrk_api);604 pass_method!(nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkNftChild>, rmrk_api);605 pass_method!(606 collection_properties(607 collection_id: RmrkCollectionId,608609 #[map(|keys| string_keys_to_bytes_keys(keys))]610 filter_keys: Option<Vec<String>>611 ) -> Vec<PropertyInfo>,612 rmrk_api613 );614 pass_method!(615 nft_properties(616 collection_id: RmrkCollectionId,617 nft_id: RmrkNftId,618619 #[map(|keys| string_keys_to_bytes_keys(keys))]620 filter_keys: Option<Vec<String>>621 ) -> Vec<PropertyInfo>,622 rmrk_api623 );624 pass_method!(nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<ResourceInfo>, rmrk_api);625 pass_method!(nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Option<u32>, rmrk_api);626 pass_method!(base(base_id: RmrkBaseId) -> Option<BaseInfo>, rmrk_api);627 pass_method!(base_parts(base_id: RmrkBaseId) -> Vec<PartType>, rmrk_api);628 pass_method!(theme_names(base_id: RmrkBaseId) -> Vec<RmrkThemeName>, rmrk_api);629 pass_method!(630 theme(631 base_id: RmrkBaseId,632633 #[map(|n| n.into_bytes())]634 theme_name: String,635636 #[map(|keys| string_keys_to_bytes_keys(keys))]637 filter_keys: Option<Vec<String>>638 ) -> Option<Theme>, rmrk_api);639}640641fn string_keys_to_bytes_keys(keys: Option<Vec<String>>) -> Option<Vec<Vec<u8>>> {642 keys.map(|keys| keys.into_iter().map(|key| key.into_bytes()).collect())643}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 sp_runtime::traits::{AtLeast32BitUnsigned, Member};27use up_data_structs::{28 RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,29 PropertyKeyPermission, TokenData, TokenChild,30};31use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};32use sp_blockchain::HeaderBackend;33use up_rpc::UniqueApi as UniqueRuntimeApi;3435// RMRK36use rmrk_rpc::RmrkApi as RmrkRuntimeApi;37use up_data_structs::{38 RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,39};4041pub use rmrk_unique_rpc::RmrkApiServer;4243#[rpc(server)]44#[async_trait]45pub trait UniqueApi<BlockHash, BlockNumber, CrossAccountId, AccountId> {46 /// Get tokens owned by account.47 #[method(name = "unique_accountTokens")]48 fn account_tokens(49 &self,50 collection: CollectionId,51 account: CrossAccountId,52 at: Option<BlockHash>,53 ) -> Result<Vec<TokenId>>;5455 /// Get tokens contained within a collection.56 #[method(name = "unique_collectionTokens")]57 fn collection_tokens(58 &self,59 collection: CollectionId,60 at: Option<BlockHash>,61 ) -> Result<Vec<TokenId>>;6263 /// Check if the token exists.64 #[method(name = "unique_tokenExists")]65 fn token_exists(66 &self,67 collection: CollectionId,68 token: TokenId,69 at: Option<BlockHash>,70 ) -> Result<bool>;7172 /// Get the token owner.73 #[method(name = "unique_tokenOwner")]74 fn token_owner(75 &self,76 collection: CollectionId,77 token: TokenId,78 at: Option<BlockHash>,79 ) -> Result<Option<CrossAccountId>>;8081 /// Returns 10 tokens owners in no particular order.82 #[method(name = "unique_tokenOwners")]83 fn token_owners(84 &self,85 collection: CollectionId,86 token: TokenId,87 at: Option<BlockHash>,88 ) -> Result<Vec<CrossAccountId>>;8990 /// Get the topmost token owner in the hierarchy of a possibly nested token.91 #[method(name = "unique_topmostTokenOwner")]92 fn topmost_token_owner(93 &self,94 collection: CollectionId,95 token: TokenId,96 at: Option<BlockHash>,97 ) -> Result<Option<CrossAccountId>>;9899 /// Get tokens nested directly into the token.100 #[method(name = "unique_tokenChildren")]101 fn token_children(102 &self,103 collection: CollectionId,104 token: TokenId,105 at: Option<BlockHash>,106 ) -> Result<Vec<TokenChild>>;107108 /// Get collection properties, optionally limited to the provided keys.109 #[method(name = "unique_collectionProperties")]110 fn collection_properties(111 &self,112 collection: CollectionId,113 keys: Option<Vec<String>>,114 at: Option<BlockHash>,115 ) -> Result<Vec<Property>>;116117 /// Get token properties, optionally limited to the provided keys.118 #[method(name = "unique_tokenProperties")]119 fn token_properties(120 &self,121 collection: CollectionId,122 token_id: TokenId,123 keys: Option<Vec<String>>,124 at: Option<BlockHash>,125 ) -> Result<Vec<Property>>;126127 /// Get property permissions, optionally limited to the provided keys.128 #[method(name = "unique_propertyPermissions")]129 fn property_permissions(130 &self,131 collection: CollectionId,132 keys: Option<Vec<String>>,133 at: Option<BlockHash>,134 ) -> Result<Vec<PropertyKeyPermission>>;135136 /// Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT.137 #[method(name = "unique_tokenData")]138 fn token_data(139 &self,140 collection: CollectionId,141 token_id: TokenId,142 keys: Option<Vec<String>>,143 at: Option<BlockHash>,144 ) -> Result<TokenData<CrossAccountId>>;145146 /// Get the amount of distinctive tokens present in a collection.147 #[method(name = "unique_totalSupply")]148 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;149150 /// Get the amount of any user tokens owned by an account.151 #[method(name = "unique_accountBalance")]152 fn account_balance(153 &self,154 collection: CollectionId,155 account: CrossAccountId,156 at: Option<BlockHash>,157 ) -> Result<u32>;158159 /// Get the amount of a specific token owned by an account.160 #[method(name = "unique_balance")]161 fn balance(162 &self,163 collection: CollectionId,164 account: CrossAccountId,165 token: TokenId,166 at: Option<BlockHash>,167 ) -> Result<String>;168169 /// Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor.170 #[method(name = "unique_allowance")]171 fn allowance(172 &self,173 collection: CollectionId,174 sender: CrossAccountId,175 spender: CrossAccountId,176 token: TokenId,177 at: Option<BlockHash>,178 ) -> Result<String>;179180 /// Get the list of admin accounts of a collection.181 #[method(name = "unique_adminlist")]182 fn adminlist(183 &self,184 collection: CollectionId,185 at: Option<BlockHash>,186 ) -> Result<Vec<CrossAccountId>>;187188 /// Get the list of accounts allowed to operate within a collection.189 #[method(name = "unique_allowlist")]190 fn allowlist(191 &self,192 collection: CollectionId,193 at: Option<BlockHash>,194 ) -> Result<Vec<CrossAccountId>>;195196 /// Check if a user is allowed to operate within a collection.197 #[method(name = "unique_allowed")]198 fn allowed(199 &self,200 collection: CollectionId,201 user: CrossAccountId,202 at: Option<BlockHash>,203 ) -> Result<bool>;204205 /// Get the last token ID created in a collection.206 #[method(name = "unique_lastTokenId")]207 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;208209 /// Get collection info by the specified ID.210 #[method(name = "unique_collectionById")]211 fn collection_by_id(212 &self,213 collection: CollectionId,214 at: Option<BlockHash>,215 ) -> Result<Option<RpcCollection<AccountId>>>;216217 /// Get chain stats about collections.218 #[method(name = "unique_collectionStats")]219 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;220221 /// Get the number of blocks until sponsoring a transaction is available.222 #[method(name = "unique_nextSponsored")]223 fn next_sponsored(224 &self,225 collection: CollectionId,226 account: CrossAccountId,227 token: TokenId,228 at: Option<BlockHash>,229 ) -> Result<Option<u64>>;230231 /// Get effective collection limits. If not explicitly set, get the chain defaults.232 #[method(name = "unique_effectiveCollectionLimits")]233 fn effective_collection_limits(234 &self,235 collection_id: CollectionId,236 at: Option<BlockHash>,237 ) -> Result<Option<CollectionLimits>>;238239 /// Get the total amount of pieces of an RFT.240 #[method(name = "unique_totalPieces")]241 fn total_pieces(242 &self,243 collection_id: CollectionId,244 token_id: TokenId,245 at: Option<BlockHash>,246 ) -> Result<Option<u128>>;247248 /// Returns the total amount of staked tokens.249 #[method(name = "unique_totalStaked")]250 fn total_staked(&self, staker: Option<CrossAccountId>, at: Option<BlockHash>)251 -> Result<String>;252253 ///Returns the total amount of staked tokens per block when staked.254 #[method(name = "unique_totalStakedPerBlock")]255 fn total_staked_per_block(256 &self,257 staker: CrossAccountId,258 at: Option<BlockHash>,259 ) -> Result<Vec<(BlockNumber, String)>>;260261 /// Return the total amount locked by staking tokens.262 #[method(name = "unique_totalStakingLocked")]263 fn total_staking_locked(&self, staker: CrossAccountId, at: Option<BlockHash>)264 -> Result<String>;265266 /// Return the total amount locked by staking tokens.267 #[method(name = "unique_pendingUnstake")]268 fn pending_unstake(269 &self,270 staker: Option<CrossAccountId>,271 at: Option<BlockHash>,272 ) -> Result<String>;273}274275mod rmrk_unique_rpc {276 use super::*;277278 #[rpc(server)]279 #[async_trait]280 pub trait RmrkApi<281 BlockHash,282 AccountId,283 CollectionInfo,284 NftInfo,285 ResourceInfo,286 PropertyInfo,287 BaseInfo,288 PartType,289 Theme,290 >291 {292 /// Get the latest created collection ID.293 #[method(name = "rmrk_lastCollectionIdx")]294 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;295296 /// Get collection info by ID.297 #[method(name = "rmrk_collectionById")]298 fn collection_by_id(299 &self,300 id: RmrkCollectionId,301 at: Option<BlockHash>,302 ) -> Result<Option<CollectionInfo>>;303304 /// Get NFT info by collection and NFT IDs.305 #[method(name = "rmrk_nftById")]306 fn nft_by_id(307 &self,308 collection_id: RmrkCollectionId,309 nft_id: RmrkNftId,310 at: Option<BlockHash>,311 ) -> Result<Option<NftInfo>>;312313 /// Get tokens owned by an account in a collection.314 #[method(name = "rmrk_accountTokens")]315 fn account_tokens(316 &self,317 account_id: AccountId,318 collection_id: RmrkCollectionId,319 at: Option<BlockHash>,320 ) -> Result<Vec<RmrkNftId>>;321322 /// Get tokens nested in an NFT - its direct children (not the children's children).323 #[method(name = "rmrk_nftChildren")]324 fn nft_children(325 &self,326 collection_id: RmrkCollectionId,327 nft_id: RmrkNftId,328 at: Option<BlockHash>,329 ) -> Result<Vec<RmrkNftChild>>;330331 /// Get collection properties, created by the user - not the proxy-specific properties.332 #[method(name = "rmrk_collectionProperties")]333 fn collection_properties(334 &self,335 collection_id: RmrkCollectionId,336 filter_keys: Option<Vec<String>>,337 at: Option<BlockHash>,338 ) -> Result<Vec<PropertyInfo>>;339340 /// Get NFT properties, created by the user - not the proxy-specific properties.341 #[method(name = "rmrk_nftProperties")]342 fn nft_properties(343 &self,344 collection_id: RmrkCollectionId,345 nft_id: RmrkNftId,346 filter_keys: Option<Vec<String>>,347 at: Option<BlockHash>,348 ) -> Result<Vec<PropertyInfo>>;349350 /// Get data of resources of an NFT.351 #[method(name = "rmrk_nftResources")]352 fn nft_resources(353 &self,354 collection_id: RmrkCollectionId,355 nft_id: RmrkNftId,356 at: Option<BlockHash>,357 ) -> Result<Vec<ResourceInfo>>;358359 /// Get the priority of a resource in an NFT.360 #[method(name = "rmrk_nftResourcePriority")]361 fn nft_resource_priority(362 &self,363 collection_id: RmrkCollectionId,364 nft_id: RmrkNftId,365 resource_id: RmrkResourceId,366 at: Option<BlockHash>,367 ) -> Result<Option<u32>>;368369 /// Get base info by its ID.370 #[method(name = "rmrk_base")]371 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;372373 /// Get all parts of a base.374 #[method(name = "rmrk_baseParts")]375 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;376377 /// Get the theme names belonging to a base.378 #[method(name = "rmrk_themeNames")]379 fn theme_names(380 &self,381 base_id: RmrkBaseId,382 at: Option<BlockHash>,383 ) -> Result<Vec<RmrkThemeName>>;384385 /// Get theme info, including properties, optionally limited to the provided keys.386 #[method(name = "rmrk_themes")]387 fn theme(388 &self,389 base_id: RmrkBaseId,390 theme_name: String,391 filter_keys: Option<Vec<String>>,392 at: Option<BlockHash>,393 ) -> Result<Option<Theme>>;394 }395}396397pub struct Unique<C, P> {398 client: Arc<C>,399 _marker: std::marker::PhantomData<P>,400}401402impl<C, P> Unique<C, P> {403 pub fn new(client: Arc<C>) -> Self {404 Self {405 client,406 _marker: Default::default(),407 }408 }409}410411pub struct Rmrk<C, P> {412 client: Arc<C>,413 _marker: std::marker::PhantomData<P>,414}415416impl<C, P> Rmrk<C, P> {417 pub fn new(client: Arc<C>) -> Self {418 Self {419 client,420 _marker: Default::default(),421 }422 }423}424425macro_rules! pass_method {426 (427 $method_name:ident(428 $($(#[map(|$map_arg:ident| $map:expr)])? $name:ident: $ty:ty),* $(,)?429 ) -> $result:ty $(=> $mapper:expr)?,430 //$runtime_name:ident $(<$($lt: tt),+>)*431 $runtime_api_macro:ident432 $(; changed_in $ver:expr, $changed_method_name:ident ($($changed_name:expr), * $(,)?) => $fixer:expr)*433 ) => {434 fn $method_name(435 &self,436 $(437 $name: $ty,438 )*439 at: Option<<Block as BlockT>::Hash>,440 ) -> Result<$result> {441 let api = self.client.runtime_api();442 let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));443 let _api_version = if let Ok(Some(api_version)) =444 api.api_version::<$runtime_api_macro!()>(&at)445 {446 api_version447 } else {448 // unreachable for our runtime449 return Err(anyhow!("api is not available").into())450 };451452 let result = $(if _api_version < $ver {453 api.$changed_method_name(&at, $($changed_name),*).map(|r| r.map($fixer))454 } else)*455 { api.$method_name(&at, $($((|$map_arg: $ty| $map))? ($name)),*) };456457 Ok(result458 .map_err(|e| anyhow!("unable to query: {e}"))?459 .map_err(|e| anyhow!("runtime error: {e:?}"))$(.map($mapper))??)460 }461 };462}463464macro_rules! unique_api {465 () => {466 dyn UniqueRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>467 };468}469470macro_rules! rmrk_api {471 () => {472 dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>473 };474}475476#[allow(deprecated)]477impl<C, Block, BlockNumber, CrossAccountId, AccountId>478 UniqueApiServer<<Block as BlockT>::Hash, BlockNumber, CrossAccountId, AccountId>479 for Unique<C, Block>480where481 Block: BlockT,482 BlockNumber: Decode + Member + AtLeast32BitUnsigned,483 AccountId: Decode,484 C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,485 C::Api: UniqueRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>,486 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,487{488 pass_method!(489 account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>, unique_api490 );491 pass_method!(492 collection_tokens(collection: CollectionId) -> Vec<TokenId>, unique_api493 );494 pass_method!(495 token_exists(collection: CollectionId, token: TokenId) -> bool, unique_api496 );497 pass_method!(498 token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api499 );500 pass_method!(501 topmost_token_owner(collection: CollectionId, token: TokenId) -> Option<CrossAccountId>, unique_api502 );503 pass_method!(token_children(collection: CollectionId, token: TokenId) -> Vec<TokenChild>, unique_api);504 pass_method!(total_supply(collection: CollectionId) -> u32, unique_api);505 pass_method!(account_balance(collection: CollectionId, account: CrossAccountId) -> u32, unique_api);506 pass_method!(balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> String => |v| v.to_string(), unique_api);507 pass_method!(508 allowance(collection: CollectionId, sender: CrossAccountId, spender: CrossAccountId, token: TokenId) -> String => |v| v.to_string(),509 unique_api510 );511512 pass_method!(collection_properties(513 collection: CollectionId,514515 #[map(|keys| string_keys_to_bytes_keys(keys))]516 keys: Option<Vec<String>>517 ) -> Vec<Property>, unique_api);518519 pass_method!(token_properties(520 collection: CollectionId,521 token_id: TokenId,522523 #[map(|keys| string_keys_to_bytes_keys(keys))]524 keys: Option<Vec<String>>525 ) -> Vec<Property>, unique_api);526527 pass_method!(property_permissions(528 collection: CollectionId,529530 #[map(|keys| string_keys_to_bytes_keys(keys))]531 keys: Option<Vec<String>>532 ) -> Vec<PropertyKeyPermission>, unique_api);533534 pass_method!(token_data(535 collection: CollectionId,536 token_id: TokenId,537538 #[map(|keys| string_keys_to_bytes_keys(keys))]539 keys: Option<Vec<String>>,540 ) -> TokenData<CrossAccountId>, unique_api);541542 pass_method!(adminlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);543 pass_method!(allowlist(collection: CollectionId) -> Vec<CrossAccountId>, unique_api);544 pass_method!(allowed(collection: CollectionId, user: CrossAccountId) -> bool, unique_api);545 pass_method!(last_token_id(collection: CollectionId) -> TokenId, unique_api);546 pass_method!(collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api);547 pass_method!(collection_stats() -> CollectionStats, unique_api);548 pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option<u64>, unique_api);549 pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);550 pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<String> => |o| o.map(|number| number.to_string()) , unique_api);551 pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec<CrossAccountId>, unique_api);552 pass_method!(total_staked(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), unique_api);553 pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>554 |v| v555 .into_iter()556 .map(|(b, a)| (b, a.to_string()))557 .collect::<Vec<_>>(), unique_api);558 pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api);559 pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), unique_api);560}561562#[allow(deprecated)]563impl<564 C,565 Block,566 AccountId,567 CollectionInfo,568 NftInfo,569 ResourceInfo,570 PropertyInfo,571 BaseInfo,572 PartType,573 Theme,574 >575 rmrk_unique_rpc::RmrkApiServer<576 <Block as BlockT>::Hash,577 AccountId,578 CollectionInfo,579 NftInfo,580 ResourceInfo,581 PropertyInfo,582 BaseInfo,583 PartType,584 Theme,585 > for Rmrk<C, Block>586where587 C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,588 C::Api: RmrkRuntimeApi<589 Block,590 AccountId,591 CollectionInfo,592 NftInfo,593 ResourceInfo,594 PropertyInfo,595 BaseInfo,596 PartType,597 Theme,598 >,599 AccountId: Decode + Encode,600 CollectionInfo: Decode,601 NftInfo: Decode,602 ResourceInfo: Decode,603 PropertyInfo: Decode,604 BaseInfo: Decode,605 PartType: Decode,606 Theme: Decode,607 Block: BlockT,608{609 pass_method!(last_collection_idx() -> RmrkCollectionId, rmrk_api);610 pass_method!(collection_by_id(id: RmrkCollectionId) -> Option<CollectionInfo>, rmrk_api);611 pass_method!(nft_by_id(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Option<NftInfo>, rmrk_api);612 pass_method!(account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Vec<RmrkNftId>, rmrk_api);613 pass_method!(nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<RmrkNftChild>, rmrk_api);614 pass_method!(615 collection_properties(616 collection_id: RmrkCollectionId,617618 #[map(|keys| string_keys_to_bytes_keys(keys))]619 filter_keys: Option<Vec<String>>620 ) -> Vec<PropertyInfo>,621 rmrk_api622 );623 pass_method!(624 nft_properties(625 collection_id: RmrkCollectionId,626 nft_id: RmrkNftId,627628 #[map(|keys| string_keys_to_bytes_keys(keys))]629 filter_keys: Option<Vec<String>>630 ) -> Vec<PropertyInfo>,631 rmrk_api632 );633 pass_method!(nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Vec<ResourceInfo>, rmrk_api);634 pass_method!(nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Option<u32>, rmrk_api);635 pass_method!(base(base_id: RmrkBaseId) -> Option<BaseInfo>, rmrk_api);636 pass_method!(base_parts(base_id: RmrkBaseId) -> Vec<PartType>, rmrk_api);637 pass_method!(theme_names(base_id: RmrkBaseId) -> Vec<RmrkThemeName>, rmrk_api);638 pass_method!(639 theme(640 base_id: RmrkBaseId,641642 #[map(|n| n.into_bytes())]643 theme_name: String,644645 #[map(|keys| string_keys_to_bytes_keys(keys))]646 filter_keys: Option<Vec<String>>647 ) -> Option<Theme>, rmrk_api);648}649650fn string_keys_to_bytes_keys(keys: Option<Vec<String>>) -> Option<Vec<Vec<u8>>> {651 keys.map(|keys| keys.into_iter().map(|key| key.into_bytes()).collect())652}node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -63,7 +63,7 @@
use fc_rpc_core::types::FilterPool;
use fc_mapping_sync::{MappingSyncWorker, SyncStrategy};
-use unique_runtime_common::types::{
+use up_common::types::opaque::{
AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block, BlockNumber,
};
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -31,12 +31,12 @@
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
-pub mod types;
-
#[cfg(test)]
mod tests;
+pub mod types;
+pub mod weights;
-use sp_std::vec::Vec;
+use sp_std::{vec::Vec, iter::Sum};
use codec::EncodeLike;
use pallet_balances::BalanceLock;
pub use types::ExtendedLockableCurrency;
@@ -48,6 +48,9 @@
},
ensure,
};
+
+use weights::WeightInfo;
+
pub use pallet::*;
use pallet_evm::account::CrossAccountId;
use sp_runtime::{
@@ -79,6 +82,9 @@
type TreasuryAccountId: Get<Self::AccountId>;
+ /// Weight information for extrinsics in this pallet.
+ type WeightInfo: WeightInfo;
+
// The block number provider
type BlockNumberProvider: BlockNumberProvider<BlockNumber = Self::BlockNumber>;
@@ -136,6 +142,7 @@
fn on_initialize(current_block: T::BlockNumber) -> Weight
where
<T as frame_system::Config>::BlockNumber: From<u32>,
+ // <<T as pallet::Config>::Currency as Currency<T::AccountId>>::Balance: Sum,
{
PendingUnstake::<T>::iter()
.filter_map(|((staker, block), amount)| {
@@ -172,7 +179,7 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::set_admin_address())]
pub fn set_admin_address(origin: OriginFor<T>, admin: T::AccountId) -> DispatchResult {
ensure_root(origin)?;
<Admin<T>>::set(Some(admin));
@@ -180,7 +187,7 @@
Ok(())
}
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::start_app_promotion())]
pub fn start_app_promotion(
origin: OriginFor<T>,
promotion_start_relay_block: T::BlockNumber,
@@ -201,7 +208,7 @@
Ok(())
}
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::stake())]
pub fn stake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {
let staker_id = ensure_signed(staker)?;
@@ -210,10 +217,16 @@
ensure!(balance >= amount, ArithmeticError::Underflow);
- Self::set_lock_unchecked(&staker_id, amount);
+ <<T as Config>::Currency as Currency<T::AccountId>>::ensure_can_withdraw(
+ &staker_id,
+ amount,
+ WithdrawReasons::all(),
+ balance - amount,
+ )?;
+
+ Self::add_lock_balance(&staker_id, amount)?;
- let block_number =
- <T::BlockNumberProvider as BlockNumberProvider>::current_block_number();
+ let block_number = frame_system::Pallet::<T>::block_number();
<Staked<T>>::insert(
(&staker_id, block_number),
@@ -231,7 +244,7 @@
Ok(())
}
- #[pallet::weight(0)]
+ #[pallet::weight(T::WeightInfo::unstake())]
pub fn unstake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {
let staker_id = ensure_signed(staker)?;
@@ -249,7 +262,7 @@
.ok_or(ArithmeticError::Underflow)?,
);
- let block = <T::BlockNumberProvider>::current_block_number() + WEEK.into();
+ let block = frame_system::Pallet::<T>::block_number() + WEEK.into();
<PendingUnstake<T>>::insert(
(&staker_id, block),
<PendingUnstake<T>>::get((&staker_id, block))
@@ -400,8 +413,8 @@
fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {
Self::get_locked_balance(staker)
- .map(|l| l.amount)
- .and_then(|b| b.checked_add(&amount))
+ .map_or(<BalanceOf<T>>::default(), |l| l.amount)
+ .checked_add(&amount)
.map(|new_lock| Self::set_lock_unchecked(staker, new_lock))
.ok_or(ArithmeticError::Overflow.into())
}
@@ -437,10 +450,11 @@
pub fn total_staked_by_id_per_block(
staker: impl EncodeLike<T::AccountId>,
) -> Option<Vec<(T::BlockNumber, BalanceOf<T>)>> {
- let staked = Staked::<T>::iter_prefix((staker,))
+ let mut staked = Staked::<T>::iter_prefix((staker,))
.into_iter()
.map(|(block, amount)| (block, amount))
.collect::<Vec<_>>();
+ staked.sort_by_key(|(block, _)| *block);
if !staked.is_empty() {
Some(staked)
} else {
@@ -495,3 +509,14 @@
day_rate * base
}
}
+
+impl<T: Config> Pallet<T>
+where
+ <<T as pallet::Config>::Currency as Currency<T::AccountId>>::Balance: Sum,
+{
+ pub fn cross_id_pending_unstake(staker: Option<T::CrossAccountId>) -> BalanceOf<T> {
+ staker.map_or(PendingUnstake::<T>::iter_values().sum(), |s| {
+ PendingUnstake::<T>::iter_prefix_values((s.as_sub(),)).sum()
+ })
+ }
+}
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -129,5 +129,6 @@
fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;
fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
fn total_staking_locked(staker: CrossAccountId) -> Result<u128>;
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;
}
}
runtime/common/config/pallets/app_promotion.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/pallets/app_promotion.rs
@@ -0,0 +1,27 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use crate::{
+ runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider},
+ Runtime, Balances,
+};
+
+impl pallet_app_promotion::Config for Runtime {
+ type Currency = Balances;
+ type WeightInfo = pallet_app_promotion::weights::SubstrateWeight<Self>;
+ type TreasuryAccountId = TreasuryAccountId;
+ type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
+}
runtime/common/config/pallets/mod.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -40,6 +40,9 @@
#[cfg(feature = "scheduler")]
pub mod scheduler;
+#[cfg(feature = "app-promotion")]
+pub mod app_promotion;
+
parameter_types! {
pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();
pub const CollectionCreationPrice: Balance = 2 * UNIQUE;
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -77,6 +77,9 @@
#[runtimes(opal)]
RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
+ #[runtimes(opal)]
+ Promotion: pallet_app_promotion::{Pallet, Call, Storage} = 73,
+
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -190,7 +190,6 @@
fn total_staked(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked(staker).unwrap_or_default())
- // Ok(0)
}
fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {
@@ -198,9 +197,12 @@
}
fn total_staking_locked(staker: CrossAccountId) -> Result<u128, DispatchError> {
- // Ok(0)
Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_locked_balance(staker))
}
+
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
+ Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake(staker))
+ }
}
impl rmrk_rpc::RmrkApi<
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -124,11 +124,12 @@
"orml-vesting/std",
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'scheduler', 'rmrk']
+opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion']
refungible = []
scheduler = []
rmrk = []
+app-promotion = []
################################################################################
# Substrate Dependencies
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api';
-import {IKeyringPair} from '@polkadot/types/types';
+import {IKeyringPair, ITuple} from '@polkadot/types/types';
import {
createMultipleItemsExpectSuccess,
@@ -33,26 +33,38 @@
U128_MAX,
burnFromExpectSuccess,
UNIQUE,
+ getModuleNames,
+ Pallets,
+ getBlockNumber,
} from './util/helpers';
-import chai from 'chai';
+import chai, {use} from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import getBalance from './substrate/get-balance';
-import { unique } from './interfaces/definitions';
+import getBalance, {getBalanceSingle} from './substrate/get-balance';
+import {unique} from './interfaces/definitions';
+import {usingPlaygrounds} from './util/playgrounds';
+import {default as waitNewBlocks} from './substrate/wait-new-blocks';
+
+import BN from 'bn.js';
+import {mnemonicGenerate} from '@polkadot/util-crypto';
+import {UniqueHelper} from './util/playgrounds/unique';
chai.use(chaiAsPromised);
const expect = chai.expect;
let alice: IKeyringPair;
let bob: IKeyringPair;
let palletAdmin: IKeyringPair;
+let nominal: bigint;
describe('integration test: AppPromotion', () => {
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
alice = privateKeyWrapper('//Alice');
bob = privateKeyWrapper('//Bob');
palletAdmin = privateKeyWrapper('//palletAdmin');
- const tx = api.tx.sudo.sudo(api.tx.promotion.setAdminAddress(palletAdmin.addressRaw));
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw));
+ nominal = helper.balance.getOneTokenNominal();
await submitTransactionAsync(alice, tx);
});
});
@@ -69,22 +81,110 @@
// assert: query appPromotion.staked(Alice) equal [100, 200]
// assert: query appPromotion.totalStaked() increased by 200
- await usingApi(async (api, privateKeyWrapper) => {
- await submitTransactionAsync(alice, api.tx.balances.transfer(bob.addressRaw, 10n * UNIQUE));
- const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alice.address, bob.address]);
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt();
+ const staker = await createUser();
+
+ const firstStakedBlock = await helper.chain.getLatestBlockNumber();
+
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled;
+ expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal);
+ expect(9n * nominal - await helper.balance.getSubstrate(staker.address) <= nominal / 2n).to.be.true;
+ expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal);
+ expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + nominal);
- console.log(`alice: ${alicesBalanceBefore} \n bob: ${bobsBalanceBefore}`);
+ await waitNewBlocks(helper.api!, 1);
+ const secondStakedBlock = await helper.chain.getLatestBlockNumber();
- await submitTransactionAsync(alice, api.tx.promotion.stake(1n * UNIQUE));
- await submitTransactionAsync(bob, api.tx.promotion.stake(1n * UNIQUE));
- const alice_total_staked = (await (api.rpc.unique.totalStaked(normalizeAccountId(alice)))).toBigInt();
- const bob_total_staked = (await api.rpc.unique.totalStaked(normalizeAccountId(bob))).toBigInt();
-
- console.log(`alice staked: ${alice_total_staked} \n bob staked: ${bob_total_staked}, total staked: ${(await api.rpc.unique.totalStaked()).toBigInt()}`);
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled;
+ expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(3n * nominal);
+
+ const stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()]);
+ expect(stakedPerBlock.map((x) => x[1])).to.be.deep.equal([nominal, 2n * nominal]);
+ });
+ });
+
+ it('will throws if stake amount is more than total free balance', async () => {
+ // arrange: Alice balance = 1000
+ // assert: Alice calls appPromotion.stake(1000) throws /// because Alice needs some fee
+
+ // act: Alice calls appPromotion.stake(700)
+ // assert: Alice calls appPromotion.stake(400) throws /// because Alice has ~300 free QTZ and 700 locked
+
+ await usingPlaygrounds(async helper => {
+ const staker = await createUser();
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.rejected;
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(7n * nominal))).to.be.eventually.fulfilled;
+ await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(4n * nominal))).to.be.eventually.rejected;
});
});
+
+ it.skip('for different accounts in one block is possible', async () => {
+ // arrange: Alice, Bob, Charlie, Dave balance = 1000
+ // arrange: Alice, Bob, Charlie, Dave calls appPromotion.stake(100) in the same time
+
+ // assert: query appPromotion.staked(Alice/Bob/Charlie/Dave) equal [100]
+ await usingPlaygrounds(async helper => {
+ const crowd = await creteAccounts([10n, 10n, 10n, 10n], alice, helper);
+ // const promises = crowd.map(async user => submitTransactionAsync(user, helper.api!.tx.promotion.stake(nominal)));
+ // await expect(Promise.all(promises)).to.be.eventually.fulfilled;
+ });
+ });
+
+});
+
+describe.skip('unstake balance extrinsic', () => {
+ before(async function() {
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
+ alice = privateKeyWrapper('//Alice');
+ bob = privateKeyWrapper('//Bob');
+ palletAdmin = privateKeyWrapper('//palletAdmin');
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw));
+ nominal = helper.balance.getOneTokenNominal();
+ await submitTransactionAsync(alice, tx);
+ });
+ });
+ it('will change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => {
+ // arrange: Alice balance = 1000
+ // arrange: Alice calls appPromotion.stake(Alice, 500)
+
+ // act: Alice calls appPromotion.unstake(300)
+ // assert: Alice reserved balance to equal 300
+ // assert: query appPromotion.staked(Alice) equal [200] /// 500 - 300
+ // assert: query appPromotion.pendingUnstake(Alice) to equal [300]
+ // assert: query appPromotion.totalStaked() decreased by 300
+ });
+});
+
+
+
+async function createUser(amount?: bigint) {
+ return await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ const user: IKeyringPair = privateKeyWrapper(`//Alice+${(new Date()).getTime()}`);
+ await helper.balance.transferToSubstrate(alice, user.address, amount ? amount : 10n * helper.balance.getOneTokenNominal());
+ return user;
+ });
+}
+
+const creteAccounts = async (balances: bigint[], donor: IKeyringPair, helper: UniqueHelper) => {
+ let nonce = await helper.chain.getNonce(donor.address);
+ const tokenNominal = helper.balance.getOneTokenNominal();
+ const transactions = [];
+ const accounts = [];
+ for (const balance of balances) {
+ const recepient = helper.util.fromSeed(mnemonicGenerate());
+ accounts.push(recepient);
+ if (balance !== 0n){
+ const tx = helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]);
+ transactions.push(helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ nonce++;
+ }
+ }
-});
\ No newline at end of file
+ await Promise.all(transactions);
+ return accounts;
+};
\ No newline at end of file
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -703,6 +703,10 @@
**/
nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;
/**
+ * Returns the total amount of unstaked tokens
+ **/
+ pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
* Get property permissions, optionally limited to the provided keys
**/
propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -5,1266 +5,8 @@
export default {
/**
- * Lookup3: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
- **/
- FrameSystemAccountInfo: {
- nonce: 'u32',
- consumers: 'u32',
- providers: 'u32',
- sufficients: 'u32',
- data: 'PalletBalancesAccountData'
- },
- /**
- * Lookup5: pallet_balances::AccountData<Balance>
- **/
- PalletBalancesAccountData: {
- free: 'u128',
- reserved: 'u128',
- miscFrozen: 'u128',
- feeFrozen: 'u128'
- },
- /**
- * Lookup7: frame_support::weights::PerDispatchClass<T>
- **/
- FrameSupportWeightsPerDispatchClassU64: {
- normal: 'u64',
- operational: 'u64',
- mandatory: 'u64'
- },
- /**
- * Lookup11: sp_runtime::generic::digest::Digest
- **/
- SpRuntimeDigest: {
- logs: 'Vec<SpRuntimeDigestDigestItem>'
- },
- /**
- * Lookup13: sp_runtime::generic::digest::DigestItem
- **/
- SpRuntimeDigestDigestItem: {
- _enum: {
- Other: 'Bytes',
- __Unused1: 'Null',
- __Unused2: 'Null',
- __Unused3: 'Null',
- Consensus: '([u8;4],Bytes)',
- Seal: '([u8;4],Bytes)',
- PreRuntime: '([u8;4],Bytes)',
- __Unused7: 'Null',
- RuntimeEnvironmentUpdated: 'Null'
- }
- },
- /**
- * Lookup16: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
- **/
- FrameSystemEventRecord: {
- phase: 'FrameSystemPhase',
- event: 'Event',
- topics: 'Vec<H256>'
- },
- /**
- * Lookup18: frame_system::pallet::Event<T>
- **/
- FrameSystemEvent: {
- _enum: {
- ExtrinsicSuccess: {
- dispatchInfo: 'FrameSupportWeightsDispatchInfo',
- },
- ExtrinsicFailed: {
- dispatchError: 'SpRuntimeDispatchError',
- dispatchInfo: 'FrameSupportWeightsDispatchInfo',
- },
- CodeUpdated: 'Null',
- NewAccount: {
- account: 'AccountId32',
- },
- KilledAccount: {
- account: 'AccountId32',
- },
- Remarked: {
- _alias: {
- hash_: 'hash',
- },
- sender: 'AccountId32',
- hash_: 'H256'
- }
- }
- },
- /**
- * Lookup19: frame_support::weights::DispatchInfo
- **/
- FrameSupportWeightsDispatchInfo: {
- weight: 'u64',
- class: 'FrameSupportWeightsDispatchClass',
- paysFee: 'FrameSupportWeightsPays'
- },
- /**
- * Lookup20: frame_support::weights::DispatchClass
- **/
- FrameSupportWeightsDispatchClass: {
- _enum: ['Normal', 'Operational', 'Mandatory']
- },
- /**
- * Lookup21: frame_support::weights::Pays
- **/
- FrameSupportWeightsPays: {
- _enum: ['Yes', 'No']
- },
- /**
- * Lookup22: sp_runtime::DispatchError
- **/
- SpRuntimeDispatchError: {
- _enum: {
- Other: 'Null',
- CannotLookup: 'Null',
- BadOrigin: 'Null',
- Module: 'SpRuntimeModuleError',
- ConsumerRemaining: 'Null',
- NoProviders: 'Null',
- TooManyConsumers: 'Null',
- Token: 'SpRuntimeTokenError',
- Arithmetic: 'SpRuntimeArithmeticError',
- Transactional: 'SpRuntimeTransactionalError'
- }
- },
- /**
- * Lookup23: sp_runtime::ModuleError
- **/
- SpRuntimeModuleError: {
- index: 'u8',
- error: '[u8;4]'
- },
- /**
- * Lookup24: sp_runtime::TokenError
- **/
- SpRuntimeTokenError: {
- _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported']
- },
- /**
- * Lookup25: sp_runtime::ArithmeticError
- **/
- SpRuntimeArithmeticError: {
- _enum: ['Underflow', 'Overflow', 'DivisionByZero']
- },
- /**
- * Lookup26: sp_runtime::TransactionalError
- **/
- SpRuntimeTransactionalError: {
- _enum: ['LimitReached', 'NoLayer']
- },
- /**
- * Lookup27: cumulus_pallet_parachain_system::pallet::Event<T>
- **/
- CumulusPalletParachainSystemEvent: {
- _enum: {
- ValidationFunctionStored: 'Null',
- ValidationFunctionApplied: {
- relayChainBlockNum: 'u32',
- },
- ValidationFunctionDiscarded: 'Null',
- UpgradeAuthorized: {
- codeHash: 'H256',
- },
- DownwardMessagesReceived: {
- count: 'u32',
- },
- DownwardMessagesProcessed: {
- weightUsed: 'u64',
- dmqHead: 'H256'
- }
- }
- },
- /**
- * Lookup28: pallet_balances::pallet::Event<T, I>
- **/
- PalletBalancesEvent: {
- _enum: {
- Endowed: {
- account: 'AccountId32',
- freeBalance: 'u128',
- },
- DustLost: {
- account: 'AccountId32',
- amount: 'u128',
- },
- Transfer: {
- from: 'AccountId32',
- to: 'AccountId32',
- amount: 'u128',
- },
- BalanceSet: {
- who: 'AccountId32',
- free: 'u128',
- reserved: 'u128',
- },
- Reserved: {
- who: 'AccountId32',
- amount: 'u128',
- },
- Unreserved: {
- who: 'AccountId32',
- amount: 'u128',
- },
- ReserveRepatriated: {
- from: 'AccountId32',
- to: 'AccountId32',
- amount: 'u128',
- destinationStatus: 'FrameSupportTokensMiscBalanceStatus',
- },
- Deposit: {
- who: 'AccountId32',
- amount: 'u128',
- },
- Withdraw: {
- who: 'AccountId32',
- amount: 'u128',
- },
- Slashed: {
- who: 'AccountId32',
- amount: 'u128'
- }
- }
- },
- /**
- * Lookup29: frame_support::traits::tokens::misc::BalanceStatus
- **/
- FrameSupportTokensMiscBalanceStatus: {
- _enum: ['Free', 'Reserved']
- },
- /**
- * Lookup30: pallet_transaction_payment::pallet::Event<T>
- **/
- PalletTransactionPaymentEvent: {
- _enum: {
- TransactionFeePaid: {
- who: 'AccountId32',
- actualFee: 'u128',
- tip: 'u128'
- }
- }
- },
- /**
- * Lookup31: pallet_treasury::pallet::Event<T, I>
- **/
- PalletTreasuryEvent: {
- _enum: {
- Proposed: {
- proposalIndex: 'u32',
- },
- Spending: {
- budgetRemaining: 'u128',
- },
- Awarded: {
- proposalIndex: 'u32',
- award: 'u128',
- account: 'AccountId32',
- },
- Rejected: {
- proposalIndex: 'u32',
- slashed: 'u128',
- },
- Burnt: {
- burntFunds: 'u128',
- },
- Rollover: {
- rolloverBalance: 'u128',
- },
- Deposit: {
- value: 'u128',
- },
- SpendApproved: {
- proposalIndex: 'u32',
- amount: 'u128',
- beneficiary: 'AccountId32'
- }
- }
- },
- /**
- * Lookup32: pallet_sudo::pallet::Event<T>
- **/
- PalletSudoEvent: {
- _enum: {
- Sudid: {
- sudoResult: 'Result<Null, SpRuntimeDispatchError>',
- },
- KeyChanged: {
- oldSudoer: 'Option<AccountId32>',
- },
- SudoAsDone: {
- sudoResult: 'Result<Null, SpRuntimeDispatchError>'
- }
- }
- },
- /**
- * Lookup36: orml_vesting::module::Event<T>
- **/
- OrmlVestingModuleEvent: {
- _enum: {
- VestingScheduleAdded: {
- from: 'AccountId32',
- to: 'AccountId32',
- vestingSchedule: 'OrmlVestingVestingSchedule',
- },
- Claimed: {
- who: 'AccountId32',
- amount: 'u128',
- },
- VestingSchedulesUpdated: {
- who: 'AccountId32'
- }
- }
- },
- /**
- * Lookup37: orml_vesting::VestingSchedule<BlockNumber, Balance>
- **/
- OrmlVestingVestingSchedule: {
- start: 'u32',
- period: 'u32',
- periodCount: 'u32',
- perPeriod: 'Compact<u128>'
- },
- /**
- * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event<T>
- **/
- CumulusPalletXcmpQueueEvent: {
- _enum: {
- Success: {
- messageHash: 'Option<H256>',
- weight: 'u64',
- },
- Fail: {
- messageHash: 'Option<H256>',
- error: 'XcmV2TraitsError',
- weight: 'u64',
- },
- BadVersion: {
- messageHash: 'Option<H256>',
- },
- BadFormat: {
- messageHash: 'Option<H256>',
- },
- UpwardMessageSent: {
- messageHash: 'Option<H256>',
- },
- XcmpMessageSent: {
- messageHash: 'Option<H256>',
- },
- OverweightEnqueued: {
- sender: 'u32',
- sentAt: 'u32',
- index: 'u64',
- required: 'u64',
- },
- OverweightServiced: {
- index: 'u64',
- used: 'u64'
- }
- }
- },
- /**
- * Lookup41: xcm::v2::traits::Error
- **/
- XcmV2TraitsError: {
- _enum: {
- Overflow: 'Null',
- Unimplemented: 'Null',
- UntrustedReserveLocation: 'Null',
- UntrustedTeleportLocation: 'Null',
- MultiLocationFull: 'Null',
- MultiLocationNotInvertible: 'Null',
- BadOrigin: 'Null',
- InvalidLocation: 'Null',
- AssetNotFound: 'Null',
- FailedToTransactAsset: 'Null',
- NotWithdrawable: 'Null',
- LocationCannotHold: 'Null',
- ExceedsMaxMessageSize: 'Null',
- DestinationUnsupported: 'Null',
- Transport: 'Null',
- Unroutable: 'Null',
- UnknownClaim: 'Null',
- FailedToDecode: 'Null',
- MaxWeightInvalid: 'Null',
- NotHoldingFees: 'Null',
- TooExpensive: 'Null',
- Trap: 'u64',
- UnhandledXcmVersion: 'Null',
- WeightLimitReached: 'u64',
- Barrier: 'Null',
- WeightNotComputable: 'Null'
- }
- },
- /**
- * Lookup43: pallet_xcm::pallet::Event<T>
- **/
- PalletXcmEvent: {
- _enum: {
- Attempted: 'XcmV2TraitsOutcome',
- Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)',
- UnexpectedResponse: '(XcmV1MultiLocation,u64)',
- ResponseReady: '(u64,XcmV2Response)',
- Notified: '(u64,u8,u8)',
- NotifyOverweight: '(u64,u8,u8,u64,u64)',
- NotifyDispatchError: '(u64,u8,u8)',
- NotifyDecodeFailed: '(u64,u8,u8)',
- InvalidResponder: '(XcmV1MultiLocation,u64,Option<XcmV1MultiLocation>)',
- InvalidResponderVersion: '(XcmV1MultiLocation,u64)',
- ResponseTaken: 'u64',
- AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)',
- VersionChangeNotified: '(XcmV1MultiLocation,u32)',
- SupportedVersionChanged: '(XcmV1MultiLocation,u32)',
- NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)',
- NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)'
- }
- },
- /**
- * Lookup44: xcm::v2::traits::Outcome
- **/
- XcmV2TraitsOutcome: {
- _enum: {
- Complete: 'u64',
- Incomplete: '(u64,XcmV2TraitsError)',
- Error: 'XcmV2TraitsError'
- }
- },
- /**
- * Lookup45: xcm::v1::multilocation::MultiLocation
- **/
- XcmV1MultiLocation: {
- parents: 'u8',
- interior: 'XcmV1MultilocationJunctions'
- },
- /**
- * Lookup46: xcm::v1::multilocation::Junctions
- **/
- XcmV1MultilocationJunctions: {
- _enum: {
- Here: 'Null',
- X1: 'XcmV1Junction',
- X2: '(XcmV1Junction,XcmV1Junction)',
- X3: '(XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X4: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X5: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X6: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X7: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)',
- X8: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)'
- }
- },
- /**
- * Lookup47: xcm::v1::junction::Junction
- **/
- XcmV1Junction: {
- _enum: {
- Parachain: 'Compact<u32>',
- AccountId32: {
- network: 'XcmV0JunctionNetworkId',
- id: '[u8;32]',
- },
- AccountIndex64: {
- network: 'XcmV0JunctionNetworkId',
- index: 'Compact<u64>',
- },
- AccountKey20: {
- network: 'XcmV0JunctionNetworkId',
- key: '[u8;20]',
- },
- PalletInstance: 'u8',
- GeneralIndex: 'Compact<u128>',
- GeneralKey: 'Bytes',
- OnlyChild: 'Null',
- Plurality: {
- id: 'XcmV0JunctionBodyId',
- part: 'XcmV0JunctionBodyPart'
- }
- }
- },
- /**
- * Lookup49: xcm::v0::junction::NetworkId
- **/
- XcmV0JunctionNetworkId: {
- _enum: {
- Any: 'Null',
- Named: 'Bytes',
- Polkadot: 'Null',
- Kusama: 'Null'
- }
- },
- /**
- * Lookup53: xcm::v0::junction::BodyId
- **/
- XcmV0JunctionBodyId: {
- _enum: {
- Unit: 'Null',
- Named: 'Bytes',
- Index: 'Compact<u32>',
- Executive: 'Null',
- Technical: 'Null',
- Legislative: 'Null',
- Judicial: 'Null'
- }
- },
- /**
- * Lookup54: xcm::v0::junction::BodyPart
- **/
- XcmV0JunctionBodyPart: {
- _enum: {
- Voice: 'Null',
- Members: {
- count: 'Compact<u32>',
- },
- Fraction: {
- nom: 'Compact<u32>',
- denom: 'Compact<u32>',
- },
- AtLeastProportion: {
- nom: 'Compact<u32>',
- denom: 'Compact<u32>',
- },
- MoreThanProportion: {
- nom: 'Compact<u32>',
- denom: 'Compact<u32>'
- }
- }
- },
- /**
- * Lookup55: xcm::v2::Xcm<Call>
- **/
- XcmV2Xcm: 'Vec<XcmV2Instruction>',
- /**
- * Lookup57: xcm::v2::Instruction<Call>
- **/
- XcmV2Instruction: {
- _enum: {
- WithdrawAsset: 'XcmV1MultiassetMultiAssets',
- ReserveAssetDeposited: 'XcmV1MultiassetMultiAssets',
- ReceiveTeleportedAsset: 'XcmV1MultiassetMultiAssets',
- QueryResponse: {
- queryId: 'Compact<u64>',
- response: 'XcmV2Response',
- maxWeight: 'Compact<u64>',
- },
- TransferAsset: {
- assets: 'XcmV1MultiassetMultiAssets',
- beneficiary: 'XcmV1MultiLocation',
- },
- TransferReserveAsset: {
- assets: 'XcmV1MultiassetMultiAssets',
- dest: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- Transact: {
- originType: 'XcmV0OriginKind',
- requireWeightAtMost: 'Compact<u64>',
- call: 'XcmDoubleEncoded',
- },
- HrmpNewChannelOpenRequest: {
- sender: 'Compact<u32>',
- maxMessageSize: 'Compact<u32>',
- maxCapacity: 'Compact<u32>',
- },
- HrmpChannelAccepted: {
- recipient: 'Compact<u32>',
- },
- HrmpChannelClosing: {
- initiator: 'Compact<u32>',
- sender: 'Compact<u32>',
- recipient: 'Compact<u32>',
- },
- ClearOrigin: 'Null',
- DescendOrigin: 'XcmV1MultilocationJunctions',
- ReportError: {
- queryId: 'Compact<u64>',
- dest: 'XcmV1MultiLocation',
- maxResponseWeight: 'Compact<u64>',
- },
- DepositAsset: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- maxAssets: 'Compact<u32>',
- beneficiary: 'XcmV1MultiLocation',
- },
- DepositReserveAsset: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- maxAssets: 'Compact<u32>',
- dest: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- ExchangeAsset: {
- give: 'XcmV1MultiassetMultiAssetFilter',
- receive: 'XcmV1MultiassetMultiAssets',
- },
- InitiateReserveWithdraw: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- reserve: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- InitiateTeleport: {
- assets: 'XcmV1MultiassetMultiAssetFilter',
- dest: 'XcmV1MultiLocation',
- xcm: 'XcmV2Xcm',
- },
- QueryHolding: {
- queryId: 'Compact<u64>',
- dest: 'XcmV1MultiLocation',
- assets: 'XcmV1MultiassetMultiAssetFilter',
- maxResponseWeight: 'Compact<u64>',
- },
- BuyExecution: {
- fees: 'XcmV1MultiAsset',
- weightLimit: 'XcmV2WeightLimit',
- },
- RefundSurplus: 'Null',
- SetErrorHandler: 'XcmV2Xcm',
- SetAppendix: 'XcmV2Xcm',
- ClearError: 'Null',
- ClaimAsset: {
- assets: 'XcmV1MultiassetMultiAssets',
- ticket: 'XcmV1MultiLocation',
- },
- Trap: 'Compact<u64>',
- SubscribeVersion: {
- queryId: 'Compact<u64>',
- maxResponseWeight: 'Compact<u64>',
- },
- UnsubscribeVersion: 'Null'
- }
- },
- /**
- * Lookup58: xcm::v1::multiasset::MultiAssets
- **/
- XcmV1MultiassetMultiAssets: 'Vec<XcmV1MultiAsset>',
- /**
- * Lookup60: xcm::v1::multiasset::MultiAsset
- **/
- XcmV1MultiAsset: {
- id: 'XcmV1MultiassetAssetId',
- fun: 'XcmV1MultiassetFungibility'
- },
- /**
- * Lookup61: xcm::v1::multiasset::AssetId
- **/
- XcmV1MultiassetAssetId: {
- _enum: {
- Concrete: 'XcmV1MultiLocation',
- Abstract: 'Bytes'
- }
- },
- /**
- * Lookup62: xcm::v1::multiasset::Fungibility
- **/
- XcmV1MultiassetFungibility: {
- _enum: {
- Fungible: 'Compact<u128>',
- NonFungible: 'XcmV1MultiassetAssetInstance'
- }
- },
- /**
- * Lookup63: xcm::v1::multiasset::AssetInstance
- **/
- XcmV1MultiassetAssetInstance: {
- _enum: {
- Undefined: 'Null',
- Index: 'Compact<u128>',
- Array4: '[u8;4]',
- Array8: '[u8;8]',
- Array16: '[u8;16]',
- Array32: '[u8;32]',
- Blob: 'Bytes'
- }
- },
- /**
- * Lookup66: xcm::v2::Response
- **/
- XcmV2Response: {
- _enum: {
- Null: 'Null',
- Assets: 'XcmV1MultiassetMultiAssets',
- ExecutionResult: 'Option<(u32,XcmV2TraitsError)>',
- Version: 'u32'
- }
- },
- /**
- * Lookup69: xcm::v0::OriginKind
- **/
- XcmV0OriginKind: {
- _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
- },
- /**
- * Lookup70: xcm::double_encoded::DoubleEncoded<T>
- **/
- XcmDoubleEncoded: {
- encoded: 'Bytes'
- },
- /**
- * Lookup71: xcm::v1::multiasset::MultiAssetFilter
- **/
- XcmV1MultiassetMultiAssetFilter: {
- _enum: {
- Definite: 'XcmV1MultiassetMultiAssets',
- Wild: 'XcmV1MultiassetWildMultiAsset'
- }
- },
- /**
- * Lookup72: xcm::v1::multiasset::WildMultiAsset
- **/
- XcmV1MultiassetWildMultiAsset: {
- _enum: {
- All: 'Null',
- AllOf: {
- id: 'XcmV1MultiassetAssetId',
- fun: 'XcmV1MultiassetWildFungibility'
- }
- }
- },
- /**
- * Lookup73: xcm::v1::multiasset::WildFungibility
- **/
- XcmV1MultiassetWildFungibility: {
- _enum: ['Fungible', 'NonFungible']
- },
- /**
- * Lookup74: xcm::v2::WeightLimit
- **/
- XcmV2WeightLimit: {
- _enum: {
- Unlimited: 'Null',
- Limited: 'Compact<u64>'
- }
- },
- /**
- * Lookup76: xcm::VersionedMultiAssets
- **/
- XcmVersionedMultiAssets: {
- _enum: {
- V0: 'Vec<XcmV0MultiAsset>',
- V1: 'XcmV1MultiassetMultiAssets'
- }
- },
- /**
- * Lookup78: xcm::v0::multi_asset::MultiAsset
- **/
- XcmV0MultiAsset: {
- _enum: {
- None: 'Null',
- All: 'Null',
- AllFungible: 'Null',
- AllNonFungible: 'Null',
- AllAbstractFungible: {
- id: 'Bytes',
- },
- AllAbstractNonFungible: {
- class: 'Bytes',
- },
- AllConcreteFungible: {
- id: 'XcmV0MultiLocation',
- },
- AllConcreteNonFungible: {
- class: 'XcmV0MultiLocation',
- },
- AbstractFungible: {
- id: 'Bytes',
- amount: 'Compact<u128>',
- },
- AbstractNonFungible: {
- class: 'Bytes',
- instance: 'XcmV1MultiassetAssetInstance',
- },
- ConcreteFungible: {
- id: 'XcmV0MultiLocation',
- amount: 'Compact<u128>',
- },
- ConcreteNonFungible: {
- class: 'XcmV0MultiLocation',
- instance: 'XcmV1MultiassetAssetInstance'
- }
- }
- },
- /**
- * Lookup79: xcm::v0::multi_location::MultiLocation
- **/
- XcmV0MultiLocation: {
- _enum: {
- Null: 'Null',
- X1: 'XcmV0Junction',
- X2: '(XcmV0Junction,XcmV0Junction)',
- X3: '(XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X4: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X5: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X6: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X7: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)',
- X8: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)'
- }
- },
- /**
- * Lookup80: xcm::v0::junction::Junction
- **/
- XcmV0Junction: {
- _enum: {
- Parent: 'Null',
- Parachain: 'Compact<u32>',
- AccountId32: {
- network: 'XcmV0JunctionNetworkId',
- id: '[u8;32]',
- },
- AccountIndex64: {
- network: 'XcmV0JunctionNetworkId',
- index: 'Compact<u64>',
- },
- AccountKey20: {
- network: 'XcmV0JunctionNetworkId',
- key: '[u8;20]',
- },
- PalletInstance: 'u8',
- GeneralIndex: 'Compact<u128>',
- GeneralKey: 'Bytes',
- OnlyChild: 'Null',
- Plurality: {
- id: 'XcmV0JunctionBodyId',
- part: 'XcmV0JunctionBodyPart'
- }
- }
- },
- /**
- * Lookup81: xcm::VersionedMultiLocation
- **/
- XcmVersionedMultiLocation: {
- _enum: {
- V0: 'XcmV0MultiLocation',
- V1: 'XcmV1MultiLocation'
- }
- },
- /**
- * Lookup82: cumulus_pallet_xcm::pallet::Event<T>
- **/
- CumulusPalletXcmEvent: {
- _enum: {
- InvalidFormat: '[u8;8]',
- UnsupportedVersion: '[u8;8]',
- ExecutedDownward: '([u8;8],XcmV2TraitsOutcome)'
- }
- },
- /**
- * Lookup83: cumulus_pallet_dmp_queue::pallet::Event<T>
- **/
- CumulusPalletDmpQueueEvent: {
- _enum: {
- InvalidFormat: {
- messageId: '[u8;32]',
- },
- UnsupportedVersion: {
- messageId: '[u8;32]',
- },
- ExecutedDownward: {
- messageId: '[u8;32]',
- outcome: 'XcmV2TraitsOutcome',
- },
- WeightExhausted: {
- messageId: '[u8;32]',
- remainingWeight: 'u64',
- requiredWeight: 'u64',
- },
- OverweightEnqueued: {
- messageId: '[u8;32]',
- overweightIndex: 'u64',
- requiredWeight: 'u64',
- },
- OverweightServiced: {
- overweightIndex: 'u64',
- weightUsed: 'u64'
- }
- }
- },
- /**
- * Lookup84: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
- **/
- PalletUniqueRawEvent: {
- _enum: {
- CollectionSponsorRemoved: 'u32',
- CollectionAdminAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- CollectionOwnedChanged: '(u32,AccountId32)',
- CollectionSponsorSet: '(u32,AccountId32)',
- SponsorshipConfirmed: '(u32,AccountId32)',
- CollectionAdminRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- AllowListAddressRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- AllowListAddressAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)',
- CollectionLimitSet: 'u32',
- CollectionPermissionSet: 'u32'
- }
- },
- /**
- * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>
- **/
- PalletEvmAccountBasicCrossAccountIdRepr: {
- _enum: {
- Substrate: 'AccountId32',
- Ethereum: 'H160'
- }
- },
- /**
- * Lookup88: pallet_unique_scheduler::pallet::Event<T>
- **/
- PalletUniqueSchedulerEvent: {
- _enum: {
- Scheduled: {
- when: 'u32',
- index: 'u32',
- },
- Canceled: {
- when: 'u32',
- index: 'u32',
- },
- Dispatched: {
- task: '(u32,u32)',
- id: 'Option<[u8;16]>',
- result: 'Result<Null, SpRuntimeDispatchError>',
- },
- CallLookupFailed: {
- task: '(u32,u32)',
- id: 'Option<[u8;16]>',
- error: 'FrameSupportScheduleLookupError'
- }
- }
- },
- /**
- * Lookup91: frame_support::traits::schedule::LookupError
- **/
- FrameSupportScheduleLookupError: {
- _enum: ['Unknown', 'BadFormat']
- },
- /**
- * Lookup92: pallet_common::pallet::Event<T>
- **/
- PalletCommonEvent: {
- _enum: {
- CollectionCreated: '(u32,u8,AccountId32)',
- CollectionDestroyed: 'u32',
- ItemCreated: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- ItemDestroyed: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- Transfer: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- Approved: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)',
- CollectionPropertySet: '(u32,Bytes)',
- CollectionPropertyDeleted: '(u32,Bytes)',
- TokenPropertySet: '(u32,u32,Bytes)',
- TokenPropertyDeleted: '(u32,u32,Bytes)',
- PropertyPermissionSet: '(u32,Bytes)'
- }
- },
- /**
- * Lookup95: pallet_structure::pallet::Event<T>
- **/
- PalletStructureEvent: {
- _enum: {
- Executed: 'Result<Null, SpRuntimeDispatchError>'
- }
- },
- /**
- * Lookup96: pallet_rmrk_core::pallet::Event<T>
- **/
- PalletRmrkCoreEvent: {
- _enum: {
- CollectionCreated: {
- issuer: 'AccountId32',
- collectionId: 'u32',
- },
- CollectionDestroyed: {
- issuer: 'AccountId32',
- collectionId: 'u32',
- },
- IssuerChanged: {
- oldIssuer: 'AccountId32',
- newIssuer: 'AccountId32',
- collectionId: 'u32',
- },
- CollectionLocked: {
- issuer: 'AccountId32',
- collectionId: 'u32',
- },
- NftMinted: {
- owner: 'AccountId32',
- collectionId: 'u32',
- nftId: 'u32',
- },
- NFTBurned: {
- owner: 'AccountId32',
- nftId: 'u32',
- },
- NFTSent: {
- sender: 'AccountId32',
- recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
- collectionId: 'u32',
- nftId: 'u32',
- approvalRequired: 'bool',
- },
- NFTAccepted: {
- sender: 'AccountId32',
- recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
- collectionId: 'u32',
- nftId: 'u32',
- },
- NFTRejected: {
- sender: 'AccountId32',
- collectionId: 'u32',
- nftId: 'u32',
- },
- PropertySet: {
- collectionId: 'u32',
- maybeNftId: 'Option<u32>',
- key: 'Bytes',
- value: 'Bytes',
- },
- ResourceAdded: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- ResourceRemoval: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- ResourceAccepted: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- ResourceRemovalAccepted: {
- nftId: 'u32',
- resourceId: 'u32',
- },
- PrioritySet: {
- collectionId: 'u32',
- nftId: 'u32'
- }
- }
- },
- /**
- * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
- **/
- RmrkTraitsNftAccountIdOrCollectionNftTuple: {
- _enum: {
- AccountId: 'AccountId32',
- CollectionAndNftTuple: '(u32,u32)'
- }
- },
- /**
- * Lookup102: pallet_rmrk_equip::pallet::Event<T>
- **/
- PalletRmrkEquipEvent: {
- _enum: {
- BaseCreated: {
- issuer: 'AccountId32',
- baseId: 'u32',
- },
- EquippablesUpdated: {
- baseId: 'u32',
- slotId: 'u32'
- }
- }
- },
- /**
- * Lookup103: pallet_evm::pallet::Event<T>
- **/
- PalletEvmEvent: {
- _enum: {
- Log: 'EthereumLog',
- Created: 'H160',
- CreatedFailed: 'H160',
- Executed: 'H160',
- ExecutedFailed: 'H160',
- BalanceDeposit: '(AccountId32,H160,U256)',
- BalanceWithdraw: '(AccountId32,H160,U256)'
- }
- },
- /**
- * Lookup104: ethereum::log::Log
- **/
- EthereumLog: {
- address: 'H160',
- topics: 'Vec<H256>',
- data: 'Bytes'
- },
- /**
- * Lookup108: pallet_ethereum::pallet::Event
- **/
- PalletEthereumEvent: {
- _enum: {
- Executed: '(H160,H160,H256,EvmCoreErrorExitReason)'
- }
- },
- /**
- * Lookup109: evm_core::error::ExitReason
- **/
- EvmCoreErrorExitReason: {
- _enum: {
- Succeed: 'EvmCoreErrorExitSucceed',
- Error: 'EvmCoreErrorExitError',
- Revert: 'EvmCoreErrorExitRevert',
- Fatal: 'EvmCoreErrorExitFatal'
- }
- },
- /**
- * Lookup110: evm_core::error::ExitSucceed
- **/
- EvmCoreErrorExitSucceed: {
- _enum: ['Stopped', 'Returned', 'Suicided']
- },
- /**
- * Lookup111: evm_core::error::ExitError
- **/
- EvmCoreErrorExitError: {
- _enum: {
- StackUnderflow: 'Null',
- StackOverflow: 'Null',
- InvalidJump: 'Null',
- InvalidRange: 'Null',
- DesignatedInvalid: 'Null',
- CallTooDeep: 'Null',
- CreateCollision: 'Null',
- CreateContractLimit: 'Null',
- OutOfOffset: 'Null',
- OutOfGas: 'Null',
- OutOfFund: 'Null',
- PCUnderflow: 'Null',
- CreateEmpty: 'Null',
- Other: 'Text',
- InvalidCode: 'Null'
- }
- },
- /**
- * Lookup114: evm_core::error::ExitRevert
- **/
- EvmCoreErrorExitRevert: {
- _enum: ['Reverted']
- },
- /**
- * Lookup115: evm_core::error::ExitFatal
- **/
- EvmCoreErrorExitFatal: {
- _enum: {
- NotSupported: 'Null',
- UnhandledInterrupt: 'Null',
- CallErrorAsFatal: 'EvmCoreErrorExitError',
- Other: 'Text'
- }
- },
- /**
- * Lookup116: frame_system::Phase
- **/
- FrameSystemPhase: {
- _enum: {
- ApplyExtrinsic: 'u32',
- Finalization: 'Null',
- Initialization: 'Null'
- }
- },
- /**
- * Lookup118: frame_system::LastRuntimeUpgradeInfo
- **/
- FrameSystemLastRuntimeUpgradeInfo: {
- specVersion: 'Compact<u32>',
- specName: 'Text'
- },
- /**
- * Lookup119: frame_system::pallet::Call<T>
- **/
- FrameSystemCall: {
- _enum: {
- fill_block: {
- ratio: 'Perbill',
- },
- remark: {
- remark: 'Bytes',
- },
- set_heap_pages: {
- pages: 'u64',
- },
- set_code: {
- code: 'Bytes',
- },
- set_code_without_checks: {
- code: 'Bytes',
- },
- set_storage: {
- items: 'Vec<(Bytes,Bytes)>',
- },
- kill_storage: {
- _alias: {
- keys_: 'keys',
- },
- keys_: 'Vec<Bytes>',
- },
- kill_prefix: {
- prefix: 'Bytes',
- subkeys: 'u32',
- },
- remark_with_event: {
- remark: 'Bytes'
- }
- }
- },
- /**
- * Lookup124: frame_system::limits::BlockWeights
- **/
- FrameSystemLimitsBlockWeights: {
- baseBlock: 'u64',
- maxBlock: 'u64',
- perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
- },
- /**
- * Lookup125: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
- **/
- FrameSupportWeightsPerDispatchClassWeightsPerClass: {
- normal: 'FrameSystemLimitsWeightsPerClass',
- operational: 'FrameSystemLimitsWeightsPerClass',
- mandatory: 'FrameSystemLimitsWeightsPerClass'
- },
- /**
- * Lookup126: frame_system::limits::WeightsPerClass
- **/
- FrameSystemLimitsWeightsPerClass: {
- baseExtrinsic: 'u64',
- maxExtrinsic: 'Option<u64>',
- maxTotal: 'Option<u64>',
- reserved: 'Option<u64>'
- },
- /**
- * Lookup128: frame_system::limits::BlockLength
+ * Lookup2: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
**/
- FrameSystemLimitsBlockLength: {
- max: 'FrameSupportWeightsPerDispatchClassU32'
- },
- /**
- * Lookup129: frame_support::weights::PerDispatchClass<T>
- **/
- FrameSupportWeightsPerDispatchClassU32: {
- normal: 'u32',
- operational: 'u32',
- mandatory: 'u32'
- },
- /**
- * Lookup130: frame_support::weights::RuntimeDbWeight
- **/
- FrameSupportWeightsRuntimeDbWeight: {
- read: 'u64',
- write: 'u64'
- },
- /**
- * Lookup131: sp_version::RuntimeVersion
- **/
- SpVersionRuntimeVersion: {
- specName: 'Text',
- implName: 'Text',
- authoringVersion: 'u32',
- specVersion: 'u32',
- implVersion: 'u32',
- apis: 'Vec<([u8;8],u32)>',
- transactionVersion: 'u32',
- stateVersion: 'u8'
- },
- /**
- * Lookup136: frame_system::pallet::Error<T>
- **/
- FrameSystemError: {
- _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
- },
- /**
- * Lookup137: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
- **/
PolkadotPrimitivesV2PersistedValidationData: {
parentHead: 'Bytes',
relayParentNumber: 'u32',
@@ -1272,19 +14,19 @@
maxPovSize: 'u32'
},
/**
- * Lookup140: polkadot_primitives::v2::UpgradeRestriction
+ * Lookup9: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
- * Lookup141: sp_trie::storage_proof::StorageProof
+ * Lookup10: sp_trie::storage_proof::StorageProof
**/
SpTrieStorageProof: {
trieNodes: 'BTreeSet<Bytes>'
},
/**
- * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
+ * Lookup13: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
**/
CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: {
dmqMqcHead: 'H256',
@@ -1293,7 +35,7 @@
egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>'
},
/**
- * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel
+ * Lookup18: polkadot_primitives::v2::AbridgedHrmpChannel
**/
PolkadotPrimitivesV2AbridgedHrmpChannel: {
maxCapacity: 'u32',
@@ -1304,7 +46,7 @@
mqcHead: 'Option<H256>'
},
/**
- * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration
+ * Lookup20: polkadot_primitives::v2::AbridgedHostConfiguration
**/
PolkadotPrimitivesV2AbridgedHostConfiguration: {
maxCodeSize: 'u32',
@@ -1318,14 +60,14 @@
validationUpgradeDelay: 'u32'
},
/**
- * Lookup153: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
+ * Lookup26: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
**/
PolkadotCorePrimitivesOutboundHrmpMessage: {
recipient: 'u32',
data: 'Bytes'
},
/**
- * Lookup154: cumulus_pallet_parachain_system::pallet::Call<T>
+ * Lookup28: cumulus_pallet_parachain_system::pallet::Call<T>
**/
CumulusPalletParachainSystemCall: {
_enum: {
@@ -1344,7 +86,7 @@
}
},
/**
- * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData
+ * Lookup29: cumulus_primitives_parachain_inherent::ParachainInherentData
**/
CumulusPrimitivesParachainInherentParachainInherentData: {
validationData: 'PolkadotPrimitivesV2PersistedValidationData',
@@ -1353,27 +95,58 @@
horizontalMessages: 'BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>'
},
/**
- * Lookup157: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
+ * Lookup31: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
- * Lookup160: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
+ * Lookup34: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
- * Lookup163: cumulus_pallet_parachain_system::pallet::Error<T>
+ * Lookup37: cumulus_pallet_parachain_system::pallet::Event<T>
+ **/
+ CumulusPalletParachainSystemEvent: {
+ _enum: {
+ ValidationFunctionStored: 'Null',
+ ValidationFunctionApplied: {
+ relayChainBlockNum: 'u32',
+ },
+ ValidationFunctionDiscarded: 'Null',
+ UpgradeAuthorized: {
+ codeHash: 'H256',
+ },
+ DownwardMessagesReceived: {
+ count: 'u32',
+ },
+ DownwardMessagesProcessed: {
+ weightUsed: 'u64',
+ dmqHead: 'H256'
+ }
+ }
+ },
+ /**
+ * Lookup38: cumulus_pallet_parachain_system::pallet::Error<T>
**/
CumulusPalletParachainSystemError: {
_enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized']
},
/**
- * Lookup165: pallet_balances::BalanceLock<Balance>
+ * Lookup41: pallet_balances::AccountData<Balance>
+ **/
+ PalletBalancesAccountData: {
+ free: 'u128',
+ reserved: 'u128',
+ miscFrozen: 'u128',
+ feeFrozen: 'u128'
+ },
+ /**
+ * Lookup43: pallet_balances::BalanceLock<Balance>
**/
PalletBalancesBalanceLock: {
id: '[u8;8]',
@@ -1381,13 +154,13 @@
reasons: 'PalletBalancesReasons'
},
/**
- * Lookup166: pallet_balances::Reasons
+ * Lookup45: pallet_balances::Reasons
**/
PalletBalancesReasons: {
_enum: ['Fee', 'Misc', 'All']
},
/**
- * Lookup169: pallet_balances::ReserveData<ReserveIdentifier, Balance>
+ * Lookup48: pallet_balances::ReserveData<ReserveIdentifier, Balance>
**/
PalletBalancesReserveData: {
id: '[u8;16]',
@@ -2706,13 +1479,13 @@
_enum: ['Unknown', 'OverLimit']
},
/**
- * Lookup347: pallet_unique::Error<T>
+ * Lookup346: pallet_unique::Error<T>
**/
PalletUniqueError: {
_enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']
},
/**
- * Lookup350: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
+ * Lookup349: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
**/
PalletUniqueSchedulerScheduledV3: {
maybeId: 'Option<[u8;16]>',
@@ -2722,7 +1495,7 @@
origin: 'OpalRuntimeOriginCaller'
},
/**
- * Lookup351: opal_runtime::OriginCaller
+ * Lookup350: opal_runtime::OriginCaller
**/
OpalRuntimeOriginCaller: {
_enum: {
@@ -2831,7 +1604,7 @@
}
},
/**
- * Lookup352: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
+ * Lookup351: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
**/
FrameSupportDispatchRawOrigin: {
_enum: {
@@ -2841,7 +1614,7 @@
}
},
/**
- * Lookup353: pallet_xcm::pallet::Origin
+ * Lookup352: pallet_xcm::pallet::Origin
**/
PalletXcmOrigin: {
_enum: {
@@ -2850,7 +1623,7 @@
}
},
/**
- * Lookup354: cumulus_pallet_xcm::pallet::Origin
+ * Lookup353: cumulus_pallet_xcm::pallet::Origin
**/
CumulusPalletXcmOrigin: {
_enum: {
@@ -2859,7 +1632,7 @@
}
},
/**
- * Lookup355: pallet_ethereum::RawOrigin
+ * Lookup354: pallet_ethereum::RawOrigin
**/
PalletEthereumRawOrigin: {
_enum: {
@@ -2867,17 +1640,17 @@
}
},
/**
- * Lookup356: sp_core::Void
+ * Lookup355: sp_core::Void
**/
SpCoreVoid: 'Null',
/**
- * Lookup357: pallet_unique_scheduler::pallet::Error<T>
+ * Lookup356: pallet_unique_scheduler::pallet::Error<T>
**/
PalletUniqueSchedulerError: {
_enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange']
},
/**
- * Lookup358: up_data_structs::Collection<sp_core::crypto::AccountId32>
+ * Lookup357: up_data_structs::Collection<sp_core::crypto::AccountId32>
**/
UpDataStructsCollection: {
owner: 'AccountId32',
@@ -2891,7 +1664,7 @@
externalCollection: 'bool'
},
/**
- * Lookup359: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+ * Lookup358: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
**/
UpDataStructsSponsorshipState: {
_enum: {
@@ -2901,7 +1674,7 @@
}
},
/**
- * Lookup360: up_data_structs::Properties
+ * Lookup359: up_data_structs::Properties
**/
UpDataStructsProperties: {
map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2909,7 +1682,7 @@
spaceLimit: 'u32'
},
/**
- * Lookup361: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup360: up_data_structs::PropertiesMap<frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
/**
@@ -2917,7 +1690,7 @@
**/
UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
/**
- * Lookup373: up_data_structs::CollectionStats
+ * Lookup372: up_data_structs::CollectionStats
**/
UpDataStructsCollectionStats: {
created: 'u32',
@@ -2925,18 +1698,18 @@
alive: 'u32'
},
/**
- * Lookup374: up_data_structs::TokenChild
+ * Lookup373: up_data_structs::TokenChild
**/
UpDataStructsTokenChild: {
token: 'u32',
collection: 'u32'
},
/**
- * Lookup375: PhantomType::up_data_structs<T>
+ * Lookup374: PhantomType::up_data_structs<T>
**/
PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]',
/**
- * Lookup377: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup376: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
@@ -2944,7 +1717,7 @@
pieces: 'u128'
},
/**
- * Lookup379: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup378: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -2960,7 +1733,7 @@
readOnly: 'bool'
},
/**
- * Lookup380: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
+ * Lookup379: rmrk_traits::collection::CollectionInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
**/
RmrkTraitsCollectionCollectionInfo: {
issuer: 'AccountId32',
@@ -2970,7 +1743,7 @@
nftsCount: 'u32'
},
/**
- * Lookup381: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup380: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsNftNftInfo: {
owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
@@ -2980,14 +1753,14 @@
pending: 'bool'
},
/**
- * Lookup383: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+ * Lookup382: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
**/
RmrkTraitsNftRoyaltyInfo: {
recipient: 'AccountId32',
amount: 'Permill'
},
/**
- * Lookup384: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup383: rmrk_traits::resource::ResourceInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceInfo: {
id: 'u32',
@@ -2996,14 +1769,14 @@
pendingRemoval: 'bool'
},
/**
- * Lookup385: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup384: rmrk_traits::property::PropertyInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPropertyPropertyInfo: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup386: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup385: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, frame_support::storage::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsBaseBaseInfo: {
issuer: 'AccountId32',
@@ -3011,80 +1784,80 @@
symbol: 'Bytes'
},
/**
- * Lookup387: rmrk_traits::nft::NftChild
+ * Lookup386: rmrk_traits::nft::NftChild
**/
RmrkTraitsNftNftChild: {
collectionId: 'u32',
nftId: 'u32'
},
/**
- * Lookup389: pallet_common::pallet::Error<T>
+ * Lookup388: 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', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal']
},
/**
- * Lookup391: pallet_fungible::pallet::Error<T>
+ * Lookup390: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup392: pallet_refungible::ItemData
+ * Lookup391: pallet_refungible::ItemData
**/
PalletRefungibleItemData: {
constData: 'Bytes'
},
/**
- * Lookup397: pallet_refungible::pallet::Error<T>
+ * Lookup394: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup398: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup395: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup400: up_data_structs::PropertyScope
+ * Lookup397: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
_enum: ['None', 'Rmrk', 'Eth']
},
/**
- * Lookup402: pallet_nonfungible::pallet::Error<T>
+ * Lookup399: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup403: pallet_structure::pallet::Error<T>
+ * Lookup400: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound']
},
/**
- * Lookup404: pallet_rmrk_core::pallet::Error<T>
+ * Lookup401: pallet_rmrk_core::pallet::Error<T>
**/
PalletRmrkCoreError: {
_enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId']
},
/**
- * Lookup406: pallet_rmrk_equip::pallet::Error<T>
+ * Lookup403: pallet_rmrk_equip::pallet::Error<T>
**/
PalletRmrkEquipError: {
_enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']
},
/**
- * Lookup409: pallet_evm::pallet::Error<T>
+ * Lookup406: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup412: fp_rpc::TransactionStatus
+ * Lookup409: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3096,11 +1869,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup414: ethbloom::Bloom
+ * Lookup411: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup416: ethereum::receipt::ReceiptV3
+ * Lookup413: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3110,7 +1883,7 @@
}
},
/**
- * Lookup417: ethereum::receipt::EIP658ReceiptData
+ * Lookup414: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3119,7 +1892,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup418: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup415: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3127,7 +1900,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup419: ethereum::header::Header
+ * Lookup416: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3147,41 +1920,41 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup420: ethereum_types::hash::H64
+ * Lookup417: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup425: pallet_ethereum::pallet::Error<T>
+ * Lookup422: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup426: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup423: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup427: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup424: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup429: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup426: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
_enum: ['NoPermission']
},
/**
- * Lookup430: pallet_evm_migration::pallet::Error<T>
+ * Lookup427: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup432: sp_runtime::MultiSignature
+ * Lookup429: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3191,43 +1964,43 @@
}
},
/**
- * Lookup433: sp_core::ed25519::Signature
+ * Lookup430: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup435: sp_core::sr25519::Signature
+ * Lookup434: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup436: sp_core::ecdsa::Signature
+ * Lookup435: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup439: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup438: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup440: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup439: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup443: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup442: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup444: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup443: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup445: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup444: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup446: opal_runtime::Runtime
+ * Lookup445: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup447: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup444: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -1393,28 +1393,7 @@
readonly type: 'StartInflation';
}
- /** @name PalletAppPromotionCall (148) */
- export interface PalletAppPromotionCall extends Enum {
- readonly isSetAdminAddress: boolean;
- readonly asSetAdminAddress: {
- readonly admin: AccountId32;
- } & Struct;
- readonly isStartAppPromotion: boolean;
- readonly asStartAppPromotion: {
- readonly promotionStartRelayBlock: u32;
- } & Struct;
- readonly isStake: boolean;
- readonly asStake: {
- readonly amount: u128;
- } & Struct;
- readonly isUnstake: boolean;
- readonly asUnstake: {
- readonly amount: u128;
- } & Struct;
- readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake';
- }
-
- /** @name PalletUniqueCall (149) */
+ /** @name PalletUniqueCall (148) */
export interface PalletUniqueCall extends Enum {
readonly isCreateCollection: boolean;
readonly asCreateCollection: {
@@ -1629,164 +1608,28 @@
readonly nftId: u32;
readonly resourceId: u32;
} & Struct;
- readonly isResourceRemovalAccepted: boolean;
- readonly asResourceRemovalAccepted: {
- readonly nftId: u32;
- readonly resourceId: u32;
- } & Struct;
- readonly isPrioritySet: boolean;
- readonly asPrioritySet: {
+ readonly isCreateMultipleItemsEx: boolean;
+ readonly asCreateMultipleItemsEx: {
readonly collectionId: u32;
- readonly nftId: u32;
- } & Struct;
- readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';
- }
-
-<<<<<<< HEAD
- /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */
- interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
- readonly isAccountId: boolean;
- readonly asAccountId: AccountId32;
- readonly isCollectionAndNftTuple: boolean;
- readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;
- readonly type: 'AccountId' | 'CollectionAndNftTuple';
- }
-
- /** @name PalletRmrkEquipEvent (102) */
- interface PalletRmrkEquipEvent extends Enum {
- readonly isBaseCreated: boolean;
- readonly asBaseCreated: {
- readonly issuer: AccountId32;
- readonly baseId: u32;
+ readonly data: UpDataStructsCreateItemExData;
} & Struct;
- readonly isEquippablesUpdated: boolean;
- readonly asEquippablesUpdated: {
- readonly baseId: u32;
- readonly slotId: u32;
- } & Struct;
- readonly type: 'BaseCreated' | 'EquippablesUpdated';
- }
-
- /** @name PalletEvmEvent (103) */
- interface PalletEvmEvent extends Enum {
- readonly isLog: boolean;
- readonly asLog: EthereumLog;
- readonly isCreated: boolean;
- readonly asCreated: H160;
- readonly isCreatedFailed: boolean;
- readonly asCreatedFailed: H160;
- readonly isExecuted: boolean;
- readonly asExecuted: H160;
- readonly isExecutedFailed: boolean;
- readonly asExecutedFailed: H160;
- readonly isBalanceDeposit: boolean;
- readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;
- readonly isBalanceWithdraw: boolean;
- readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;
- readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';
- }
-
- /** @name EthereumLog (104) */
- interface EthereumLog extends Struct {
- readonly address: H160;
- readonly topics: Vec<H256>;
- readonly data: Bytes;
- }
-
- /** @name PalletEthereumEvent (108) */
- interface PalletEthereumEvent extends Enum {
- readonly isExecuted: boolean;
- readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;
- readonly type: 'Executed';
- }
-
- /** @name EvmCoreErrorExitReason (109) */
- interface EvmCoreErrorExitReason extends Enum {
- readonly isSucceed: boolean;
- readonly asSucceed: EvmCoreErrorExitSucceed;
- readonly isError: boolean;
- readonly asError: EvmCoreErrorExitError;
- readonly isRevert: boolean;
- readonly asRevert: EvmCoreErrorExitRevert;
- readonly isFatal: boolean;
- readonly asFatal: EvmCoreErrorExitFatal;
- readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';
- }
-
- /** @name EvmCoreErrorExitSucceed (110) */
- interface EvmCoreErrorExitSucceed extends Enum {
- readonly isStopped: boolean;
- readonly isReturned: boolean;
- readonly isSuicided: boolean;
- readonly type: 'Stopped' | 'Returned' | 'Suicided';
- }
-
- /** @name EvmCoreErrorExitError (111) */
- interface EvmCoreErrorExitError extends Enum {
- readonly isStackUnderflow: boolean;
- readonly isStackOverflow: boolean;
- readonly isInvalidJump: boolean;
- readonly isInvalidRange: boolean;
- readonly isDesignatedInvalid: boolean;
- readonly isCallTooDeep: boolean;
- readonly isCreateCollision: boolean;
- readonly isCreateContractLimit: boolean;
- readonly isOutOfOffset: boolean;
- readonly isOutOfGas: boolean;
- readonly isOutOfFund: boolean;
- readonly isPcUnderflow: boolean;
- readonly isCreateEmpty: boolean;
- readonly isOther: boolean;
- readonly asOther: Text;
- readonly isInvalidCode: boolean;
- readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';
- }
-
- /** @name EvmCoreErrorExitRevert (114) */
- interface EvmCoreErrorExitRevert extends Enum {
- readonly isReverted: boolean;
- readonly type: 'Reverted';
- }
-
- /** @name EvmCoreErrorExitFatal (115) */
- interface EvmCoreErrorExitFatal extends Enum {
- readonly isNotSupported: boolean;
- readonly isUnhandledInterrupt: boolean;
- readonly isCallErrorAsFatal: boolean;
- readonly asCallErrorAsFatal: EvmCoreErrorExitError;
- readonly isOther: boolean;
- readonly asOther: Text;
- readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';
- }
-
- /** @name FrameSystemPhase (116) */
- interface FrameSystemPhase extends Enum {
- readonly isApplyExtrinsic: boolean;
- readonly asApplyExtrinsic: u32;
- readonly isFinalization: boolean;
- readonly isInitialization: boolean;
- readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';
- }
-
- /** @name FrameSystemLastRuntimeUpgradeInfo (118) */
- interface FrameSystemLastRuntimeUpgradeInfo extends Struct {
- readonly specVersion: Compact<u32>;
- readonly specName: Text;
- }
-
- /** @name FrameSystemCall (119) */
- interface FrameSystemCall extends Enum {
- readonly isFillBlock: boolean;
- readonly asFillBlock: {
- readonly ratio: Perbill;
+ readonly isSetTransfersEnabledFlag: boolean;
+ readonly asSetTransfersEnabledFlag: {
+ readonly collectionId: u32;
+ readonly value: bool;
} & Struct;
- readonly isRemark: boolean;
- readonly asRemark: {
- readonly remark: Bytes;
+ readonly isBurnItem: boolean;
+ readonly asBurnItem: {
+ readonly collectionId: u32;
+ readonly itemId: u32;
+ readonly value: u128;
} & Struct;
- readonly isSetHeapPages: boolean;
- readonly asSetHeapPages: {
- readonly pages: u64;
+ readonly isBurnFrom: boolean;
+ readonly asBurnFrom: {
+ readonly collectionId: u32;
+ readonly from: PalletEvmAccountBasicCrossAccountIdRepr;
+ readonly itemId: u32;
+ readonly value: u128;
} & Struct;
readonly isSetCode: boolean;
readonly asSetCode: {
@@ -1813,21 +1656,7 @@
readonly asRemarkWithEvent: {
readonly remark: Bytes;
} & Struct;
- readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';
- }
-
- /** @name FrameSystemLimitsBlockWeights (124) */
- interface FrameSystemLimitsBlockWeights extends Struct {
- readonly baseBlock: u64;
- readonly maxBlock: u64;
- readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;
- }
-
- /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */
- interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {
- readonly normal: FrameSystemLimitsWeightsPerClass;
- readonly operational: FrameSystemLimitsWeightsPerClass;
- readonly mandatory: FrameSystemLimitsWeightsPerClass;
+ readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';
}
/** @name UpDataStructsCollectionMode (155) */
@@ -1839,7 +1668,7 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateCollectionData (156) */
+ /** @name UpDataStructsCreateCollectionData (155) */
export interface UpDataStructsCreateCollectionData extends Struct {
readonly mode: UpDataStructsCollectionMode;
readonly access: Option<UpDataStructsAccessMode>;
@@ -1853,14 +1682,14 @@
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsAccessMode (158) */
+ /** @name UpDataStructsAccessMode (157) */
export interface UpDataStructsAccessMode extends Enum {
readonly isNormal: boolean;
readonly isAllowList: boolean;
readonly type: 'Normal' | 'AllowList';
}
- /** @name UpDataStructsCollectionLimits (161) */
+ /** @name UpDataStructsCollectionLimits (160) */
export interface UpDataStructsCollectionLimits extends Struct {
readonly accountTokenOwnershipLimit: Option<u32>;
readonly sponsoredDataSize: Option<u32>;
@@ -1873,7 +1702,7 @@
readonly transfersEnabled: Option<bool>;
}
- /** @name UpDataStructsSponsoringRateLimit (163) */
+ /** @name UpDataStructsSponsoringRateLimit (162) */
export interface UpDataStructsSponsoringRateLimit extends Enum {
readonly isSponsoringDisabled: boolean;
readonly isBlocks: boolean;
@@ -1881,43 +1710,43 @@
readonly type: 'SponsoringDisabled' | 'Blocks';
}
- /** @name UpDataStructsCollectionPermissions (166) */
+ /** @name UpDataStructsCollectionPermissions (165) */
export interface UpDataStructsCollectionPermissions extends Struct {
readonly access: Option<UpDataStructsAccessMode>;
readonly mintMode: Option<bool>;
readonly nesting: Option<UpDataStructsNestingPermissions>;
}
- /** @name UpDataStructsNestingPermissions (168) */
+ /** @name UpDataStructsNestingPermissions (167) */
export interface UpDataStructsNestingPermissions extends Struct {
readonly tokenOwner: bool;
readonly collectionAdmin: bool;
readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;
}
- /** @name UpDataStructsOwnerRestrictedSet (170) */
+ /** @name UpDataStructsOwnerRestrictedSet (169) */
export interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}
- /** @name UpDataStructsPropertyKeyPermission (176) */
+ /** @name UpDataStructsPropertyKeyPermission (175) */
export interface UpDataStructsPropertyKeyPermission extends Struct {
readonly key: Bytes;
readonly permission: UpDataStructsPropertyPermission;
}
- /** @name UpDataStructsPropertyPermission (178) */
+ /** @name UpDataStructsPropertyPermission (177) */
export interface UpDataStructsPropertyPermission extends Struct {
readonly mutable: bool;
readonly collectionAdmin: bool;
readonly tokenOwner: bool;
}
- /** @name UpDataStructsProperty (181) */
+ /** @name UpDataStructsProperty (180) */
export interface UpDataStructsProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name PalletEvmAccountBasicCrossAccountIdRepr (184) */
+ /** @name PalletEvmAccountBasicCrossAccountIdRepr (183) */
export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {
readonly isSubstrate: boolean;
readonly asSubstrate: AccountId32;
@@ -1926,7 +1755,7 @@
readonly type: 'Substrate' | 'Ethereum';
}
- /** @name UpDataStructsCreateItemData (186) */
+ /** @name UpDataStructsCreateItemData (185) */
export interface UpDataStructsCreateItemData extends Enum {
readonly isNft: boolean;
readonly asNft: UpDataStructsCreateNftData;
@@ -1937,17 +1766,17 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateNftData (187) */
+ /** @name UpDataStructsCreateNftData (186) */
export interface UpDataStructsCreateNftData extends Struct {
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 pieces: u128;
readonly properties: Vec<UpDataStructsProperty>;
@@ -2028,7 +1857,7 @@
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name PalletUniqueSchedulerCall (205) */
+ /** @name PalletUniqueSchedulerCall (204) */
export interface PalletUniqueSchedulerCall extends Enum {
readonly isScheduleNamed: boolean;
readonly asScheduleNamed: {
@@ -2053,7 +1882,7 @@
readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';
}
- /** @name FrameSupportScheduleMaybeHashed (207) */
+ /** @name FrameSupportScheduleMaybeHashed (206) */
export interface FrameSupportScheduleMaybeHashed extends Enum {
readonly isValue: boolean;
readonly asValue: Call;
@@ -2062,13 +1891,13 @@
readonly type: 'Value' | 'Hash';
}
- /** @name PalletTemplateTransactionPaymentCall (208) */
+ /** @name PalletTemplateTransactionPaymentCall (207) */
export type PalletTemplateTransactionPaymentCall = Null;
- /** @name PalletStructureCall (209) */
+ /** @name PalletStructureCall (208) */
export type PalletStructureCall = Null;
- /** @name PalletRmrkCoreCall (210) */
+ /** @name PalletRmrkCoreCall (209) */
export interface PalletRmrkCoreCall extends Enum {
readonly isCreateCollection: boolean;
readonly asCreateCollection: {
@@ -2174,7 +2003,7 @@
readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';
}
- /** @name RmrkTraitsResourceResourceTypes (216) */
+ /** @name RmrkTraitsResourceResourceTypes (215) */
export interface RmrkTraitsResourceResourceTypes extends Enum {
readonly isBasic: boolean;
readonly asBasic: RmrkTraitsResourceBasicResource;
@@ -2185,7 +2014,7 @@
readonly type: 'Basic' | 'Composable' | 'Slot';
}
- /** @name RmrkTraitsResourceBasicResource (218) */
+ /** @name RmrkTraitsResourceBasicResource (217) */
export interface RmrkTraitsResourceBasicResource extends Struct {
readonly src: Option<Bytes>;
readonly metadata: Option<Bytes>;
@@ -2193,7 +2022,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsResourceComposableResource (220) */
+ /** @name RmrkTraitsResourceComposableResource (219) */
export interface RmrkTraitsResourceComposableResource extends Struct {
readonly parts: Vec<u32>;
readonly base: u32;
@@ -2203,7 +2032,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsResourceSlotResource (221) */
+ /** @name RmrkTraitsResourceSlotResource (220) */
export interface RmrkTraitsResourceSlotResource extends Struct {
readonly base: u32;
readonly src: Option<Bytes>;
@@ -2213,7 +2042,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (223) */
+ /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */
export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
readonly isAccountId: boolean;
readonly asAccountId: AccountId32;
@@ -2222,7 +2051,7 @@
readonly type: 'AccountId' | 'CollectionAndNftTuple';
}
- /** @name PalletRmrkEquipCall (227) */
+ /** @name PalletRmrkEquipCall (226) */
export interface PalletRmrkEquipCall extends Enum {
readonly isCreateBase: boolean;
readonly asCreateBase: {
@@ -2244,7 +2073,7 @@
readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';
}
- /** @name RmrkTraitsPartPartType (230) */
+ /** @name RmrkTraitsPartPartType (229) */
export interface RmrkTraitsPartPartType extends Enum {
readonly isFixedPart: boolean;
readonly asFixedPart: RmrkTraitsPartFixedPart;
@@ -2253,14 +2082,14 @@
readonly type: 'FixedPart' | 'SlotPart';
}
- /** @name RmrkTraitsPartFixedPart (232) */
+ /** @name RmrkTraitsPartFixedPart (231) */
export interface RmrkTraitsPartFixedPart extends Struct {
readonly id: u32;
readonly z: u32;
readonly src: Bytes;
}
- /** @name RmrkTraitsPartSlotPart (233) */
+ /** @name RmrkTraitsPartSlotPart (232) */
export interface RmrkTraitsPartSlotPart extends Struct {
readonly id: u32;
readonly equippable: RmrkTraitsPartEquippableList;
@@ -2268,25 +2097,46 @@
readonly z: u32;
}
- /** @name RmrkTraitsPartEquippableList (234) */
+ /** @name RmrkTraitsPartEquippableList (233) */
export interface RmrkTraitsPartEquippableList extends Enum {
readonly isAll: boolean;
readonly type: 'Fee' | 'Misc' | 'All';
}
- /** @name RmrkTraitsTheme (236) */
+ /** @name RmrkTraitsTheme (235) */
export interface RmrkTraitsTheme extends Struct {
readonly name: Bytes;
readonly properties: Vec<RmrkTraitsThemeThemeProperty>;
readonly inherit: bool;
}
- /** @name RmrkTraitsThemeThemeProperty (238) */
+ /** @name RmrkTraitsThemeThemeProperty (237) */
export interface RmrkTraitsThemeThemeProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
+ /** @name PalletAppPromotionCall (239) */
+ export interface PalletAppPromotionCall extends Enum {
+ readonly isSetAdminAddress: boolean;
+ readonly asSetAdminAddress: {
+ readonly admin: AccountId32;
+ } & Struct;
+ readonly isStartAppPromotion: boolean;
+ readonly asStartAppPromotion: {
+ readonly promotionStartRelayBlock: u32;
+ } & Struct;
+ readonly isStake: boolean;
+ readonly asStake: {
+ readonly amount: u128;
+ } & Struct;
+ readonly isUnstake: boolean;
+ readonly asUnstake: {
+ readonly amount: u128;
+ } & Struct;
+ readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake';
+ }
+
/** @name PalletEvmCall (240) */
export interface PalletEvmCall extends Enum {
readonly isWithdraw: boolean;
@@ -3213,7 +3063,7 @@
readonly type: 'Unknown' | 'OverLimit';
}
- /** @name PalletUniqueError (346) */
+ /** @name PalletUniqueError (345) */
export interface PalletUniqueError extends Enum {
readonly isCollectionDecimalPointLimitExceeded: boolean;
readonly isConfirmUnsetSponsorFail: boolean;
@@ -3222,7 +3072,7 @@
readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';
}
- /** @name PalletUniqueSchedulerScheduledV3 (349) */
+ /** @name PalletUniqueSchedulerScheduledV3 (348) */
export interface PalletUniqueSchedulerScheduledV3 extends Struct {
readonly maybeId: Option<U8aFixed>;
readonly priority: u8;
@@ -3231,7 +3081,7 @@
readonly origin: OpalRuntimeOriginCaller;
}
- /** @name OpalRuntimeOriginCaller (350) */
+ /** @name OpalRuntimeOriginCaller (349) */
export interface OpalRuntimeOriginCaller extends Enum {
readonly isVoid: boolean;
readonly isSystem: boolean;
@@ -3246,7 +3096,7 @@
readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';
}
- /** @name FrameSupportDispatchRawOrigin (351) */
+ /** @name FrameSupportDispatchRawOrigin (350) */
export interface FrameSupportDispatchRawOrigin extends Enum {
readonly isRoot: boolean;
readonly isSigned: boolean;
@@ -3255,7 +3105,7 @@
readonly type: 'Root' | 'Signed' | 'None';
}
- /** @name PalletXcmOrigin (352) */
+ /** @name PalletXcmOrigin (351) */
export interface PalletXcmOrigin extends Enum {
readonly isXcm: boolean;
readonly asXcm: XcmV1MultiLocation;
@@ -3264,7 +3114,7 @@
readonly type: 'Xcm' | 'Response';
}
- /** @name CumulusPalletXcmOrigin (353) */
+ /** @name CumulusPalletXcmOrigin (352) */
export interface CumulusPalletXcmOrigin extends Enum {
readonly isRelay: boolean;
readonly isSiblingParachain: boolean;
@@ -3272,17 +3122,17 @@
readonly type: 'Relay' | 'SiblingParachain';
}
- /** @name PalletEthereumRawOrigin (354) */
+ /** @name PalletEthereumRawOrigin (353) */
export interface PalletEthereumRawOrigin extends Enum {
readonly isEthereumTransaction: boolean;
readonly asEthereumTransaction: H160;
readonly type: 'EthereumTransaction';
}
- /** @name SpCoreVoid (355) */
+ /** @name SpCoreVoid (354) */
export type SpCoreVoid = Null;
- /** @name PalletUniqueSchedulerError (356) */
+ /** @name PalletUniqueSchedulerError (355) */
export interface PalletUniqueSchedulerError extends Enum {
readonly isFailedToSchedule: boolean;
readonly isNotFound: boolean;
@@ -3291,7 +3141,7 @@
readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';
}
- /** @name UpDataStructsCollection (357) */
+ /** @name UpDataStructsCollection (356) */
export interface UpDataStructsCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3304,7 +3154,7 @@
readonly externalCollection: bool;
}
- /** @name UpDataStructsSponsorshipState (358) */
+ /** @name UpDataStructsSponsorshipState (357) */
export interface UpDataStructsSponsorshipState extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -3314,43 +3164,43 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name UpDataStructsProperties (359) */
+ /** @name UpDataStructsProperties (358) */
export interface UpDataStructsProperties extends Struct {
readonly map: UpDataStructsPropertiesMapBoundedVec;
readonly consumedSpace: u32;
readonly spaceLimit: u32;
}
- /** @name UpDataStructsPropertiesMapBoundedVec (360) */
+ /** @name UpDataStructsPropertiesMapBoundedVec (359) */
export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
- /** @name UpDataStructsPropertiesMapPropertyPermission (365) */
+ /** @name UpDataStructsPropertiesMapPropertyPermission (364) */
export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
- /** @name UpDataStructsCollectionStats (372) */
+ /** @name UpDataStructsCollectionStats (371) */
export interface UpDataStructsCollectionStats extends Struct {
readonly created: u32;
readonly destroyed: u32;
readonly alive: u32;
}
- /** @name UpDataStructsTokenChild (373) */
+ /** @name UpDataStructsTokenChild (372) */
export interface UpDataStructsTokenChild extends Struct {
readonly token: u32;
readonly collection: u32;
}
- /** @name PhantomTypeUpDataStructs (374) */
+ /** @name PhantomTypeUpDataStructs (373) */
export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}
- /** @name UpDataStructsTokenData (376) */
+ /** @name UpDataStructsTokenData (375) */
export interface UpDataStructsTokenData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
readonly pieces: u128;
}
- /** @name UpDataStructsRpcCollection (378) */
+ /** @name UpDataStructsRpcCollection (377) */
export interface UpDataStructsRpcCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3365,7 +3215,7 @@
readonly readOnly: bool;
}
- /** @name RmrkTraitsCollectionCollectionInfo (379) */
+ /** @name RmrkTraitsCollectionCollectionInfo (378) */
export interface RmrkTraitsCollectionCollectionInfo extends Struct {
readonly issuer: AccountId32;
readonly metadata: Bytes;
@@ -3374,7 +3224,7 @@
readonly nftsCount: u32;
}
- /** @name RmrkTraitsNftNftInfo (380) */
+ /** @name RmrkTraitsNftNftInfo (379) */
export interface RmrkTraitsNftNftInfo extends Struct {
readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;
readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;
@@ -3383,13 +3233,13 @@
readonly pending: bool;
}
- /** @name RmrkTraitsNftRoyaltyInfo (382) */
+ /** @name RmrkTraitsNftRoyaltyInfo (381) */
export interface RmrkTraitsNftRoyaltyInfo extends Struct {
readonly recipient: AccountId32;
readonly amount: Permill;
}
- /** @name RmrkTraitsResourceResourceInfo (383) */
+ /** @name RmrkTraitsResourceResourceInfo (382) */
export interface RmrkTraitsResourceResourceInfo extends Struct {
readonly id: u32;
readonly resource: RmrkTraitsResourceResourceTypes;
@@ -3397,26 +3247,26 @@
readonly pendingRemoval: bool;
}
- /** @name RmrkTraitsPropertyPropertyInfo (384) */
+ /** @name RmrkTraitsPropertyPropertyInfo (383) */
export interface RmrkTraitsPropertyPropertyInfo extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name RmrkTraitsBaseBaseInfo (385) */
+ /** @name RmrkTraitsBaseBaseInfo (384) */
export interface RmrkTraitsBaseBaseInfo extends Struct {
readonly issuer: AccountId32;
readonly baseType: Bytes;
readonly symbol: Bytes;
}
- /** @name RmrkTraitsNftNftChild (386) */
+ /** @name RmrkTraitsNftNftChild (385) */
export interface RmrkTraitsNftNftChild extends Struct {
readonly collectionId: u32;
readonly nftId: u32;
}
- /** @name PalletCommonError (388) */
+ /** @name PalletCommonError (387) */
export interface PalletCommonError extends Enum {
readonly isCollectionNotFound: boolean;
readonly isMustBeTokenOwner: boolean;
@@ -3455,7 +3305,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' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';
}
- /** @name PalletFungibleError (390) */
+ /** @name PalletFungibleError (389) */
export interface PalletFungibleError extends Enum {
readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isFungibleItemsHaveNoId: boolean;
@@ -3465,13 +3315,13 @@
readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletRefungibleItemData (391) */
+ /** @name PalletRefungibleItemData (390) */
export interface PalletRefungibleItemData extends Struct {
readonly constData: Bytes;
}
- /** @name PalletRefungibleError (397) */
- interface PalletRefungibleError extends Enum {
+ /** @name PalletRefungibleError (394) */
+ export interface PalletRefungibleError extends Enum {
readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isWrongRefungiblePieces: boolean;
readonly isRepartitionWhileNotOwningAllPieces: boolean;
@@ -3480,29 +3330,29 @@
readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletNonfungibleItemData (398) */
- interface PalletNonfungibleItemData extends Struct {
+ /** @name PalletNonfungibleItemData (395) */
+ export interface PalletNonfungibleItemData extends Struct {
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name UpDataStructsPropertyScope (400) */
- interface UpDataStructsPropertyScope extends Enum {
+ /** @name UpDataStructsPropertyScope (397) */
+ export interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
readonly isEth: boolean;
readonly type: 'None' | 'Rmrk' | 'Eth';
}
- /** @name PalletNonfungibleError (402) */
- interface PalletNonfungibleError extends Enum {
+ /** @name PalletNonfungibleError (399) */
+ export interface PalletNonfungibleError extends Enum {
readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isNonfungibleItemsHaveNoAmount: boolean;
readonly isCantBurnNftWithChildren: boolean;
readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
}
- /** @name PalletStructureError (403) */
- interface PalletStructureError extends Enum {
+ /** @name PalletStructureError (400) */
+ export interface PalletStructureError extends Enum {
readonly isOuroborosDetected: boolean;
readonly isDepthLimit: boolean;
readonly isBreadthLimit: boolean;
@@ -3510,8 +3360,8 @@
readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';
}
- /** @name PalletRmrkCoreError (404) */
- interface PalletRmrkCoreError extends Enum {
+ /** @name PalletRmrkCoreError (401) */
+ export interface PalletRmrkCoreError extends Enum {
readonly isCorruptedCollectionType: boolean;
readonly isRmrkPropertyKeyIsTooLong: boolean;
readonly isRmrkPropertyValueIsTooLong: boolean;
@@ -3534,8 +3384,8 @@
readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';
}
- /** @name PalletRmrkEquipError (406) */
- interface PalletRmrkEquipError extends Enum {
+ /** @name PalletRmrkEquipError (403) */
+ export interface PalletRmrkEquipError extends Enum {
readonly isPermissionError: boolean;
readonly isNoAvailableBaseId: boolean;
readonly isNoAvailablePartId: boolean;
@@ -3546,8 +3396,8 @@
readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';
}
- /** @name PalletEvmError (409) */
- interface PalletEvmError extends Enum {
+ /** @name PalletEvmError (406) */
+ export interface PalletEvmError extends Enum {
readonly isBalanceLow: boolean;
readonly isFeeOverflow: boolean;
readonly isPaymentOverflow: boolean;
@@ -3557,8 +3407,8 @@
readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';
}
- /** @name FpRpcTransactionStatus (412) */
- interface FpRpcTransactionStatus extends Struct {
+ /** @name FpRpcTransactionStatus (409) */
+ export interface FpRpcTransactionStatus extends Struct {
readonly transactionHash: H256;
readonly transactionIndex: u32;
readonly from: H160;
@@ -3568,11 +3418,11 @@
readonly logsBloom: EthbloomBloom;
}
- /** @name EthbloomBloom (414) */
- interface EthbloomBloom extends U8aFixed {}
+ /** @name EthbloomBloom (411) */
+ export interface EthbloomBloom extends U8aFixed {}
- /** @name EthereumReceiptReceiptV3 (416) */
- interface EthereumReceiptReceiptV3 extends Enum {
+ /** @name EthereumReceiptReceiptV3 (413) */
+ export interface EthereumReceiptReceiptV3 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumReceiptEip658ReceiptData;
readonly isEip2930: boolean;
@@ -3582,23 +3432,23 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumReceiptEip658ReceiptData (417) */
- interface EthereumReceiptEip658ReceiptData extends Struct {
+ /** @name EthereumReceiptEip658ReceiptData (414) */
+ export interface EthereumReceiptEip658ReceiptData extends Struct {
readonly statusCode: u8;
readonly usedGas: U256;
readonly logsBloom: EthbloomBloom;
readonly logs: Vec<EthereumLog>;
}
- /** @name EthereumBlock (418) */
- interface EthereumBlock extends Struct {
+ /** @name EthereumBlock (415) */
+ export interface EthereumBlock extends Struct {
readonly header: EthereumHeader;
readonly transactions: Vec<EthereumTransactionTransactionV2>;
readonly ommers: Vec<EthereumHeader>;
}
- /** @name EthereumHeader (419) */
- interface EthereumHeader extends Struct {
+ /** @name EthereumHeader (416) */
+ export interface EthereumHeader extends Struct {
readonly parentHash: H256;
readonly ommersHash: H256;
readonly beneficiary: H160;
@@ -3616,46 +3466,46 @@
readonly nonce: EthereumTypesHashH64;
}
- /** @name EthereumTypesHashH64 (420) */
- interface EthereumTypesHashH64 extends U8aFixed {}
+ /** @name EthereumTypesHashH64 (417) */
+ export interface EthereumTypesHashH64 extends U8aFixed {}
- /** @name PalletEthereumError (425) */
- interface PalletEthereumError extends Enum {
+ /** @name PalletEthereumError (422) */
+ export interface PalletEthereumError extends Enum {
readonly isInvalidSignature: boolean;
readonly isPreLogExists: boolean;
readonly type: 'InvalidSignature' | 'PreLogExists';
}
- /** @name PalletEvmCoderSubstrateError (426) */
- interface PalletEvmCoderSubstrateError extends Enum {
+ /** @name PalletEvmCoderSubstrateError (423) */
+ export interface PalletEvmCoderSubstrateError extends Enum {
readonly isOutOfGas: boolean;
readonly isOutOfFund: boolean;
readonly type: 'OutOfGas' | 'OutOfFund';
}
- /** @name PalletEvmContractHelpersSponsoringModeT (427) */
- interface PalletEvmContractHelpersSponsoringModeT extends Enum {
+ /** @name PalletEvmContractHelpersSponsoringModeT (424) */
+ export interface PalletEvmContractHelpersSponsoringModeT extends Enum {
readonly isDisabled: boolean;
readonly isAllowlisted: boolean;
readonly isGenerous: boolean;
readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
}
- /** @name PalletEvmContractHelpersError (429) */
- interface PalletEvmContractHelpersError extends Enum {
+ /** @name PalletEvmContractHelpersError (426) */
+ export interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly type: 'NoPermission';
}
- /** @name PalletEvmMigrationError (430) */
- interface PalletEvmMigrationError extends Enum {
+ /** @name PalletEvmMigrationError (427) */
+ export interface PalletEvmMigrationError extends Enum {
readonly isAccountNotEmpty: boolean;
readonly isAccountIsNotMigrating: boolean;
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
}
- /** @name SpRuntimeMultiSignature (432) */
- interface SpRuntimeMultiSignature extends Enum {
+ /** @name SpRuntimeMultiSignature (429) */
+ export interface SpRuntimeMultiSignature extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Signature;
readonly isSr25519: boolean;
@@ -3665,34 +3515,34 @@
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
- /** @name SpCoreEd25519Signature (433) */
- interface SpCoreEd25519Signature extends U8aFixed {}
+ /** @name SpCoreEd25519Signature (430) */
+ export interface SpCoreEd25519Signature extends U8aFixed {}
- /** @name SpCoreSr25519Signature (435) */
- interface SpCoreSr25519Signature extends U8aFixed {}
+ /** @name SpCoreSr25519Signature (434) */
+ export interface SpCoreSr25519Signature extends U8aFixed {}
- /** @name SpCoreEcdsaSignature (436) */
- interface SpCoreEcdsaSignature extends U8aFixed {}
+ /** @name SpCoreEcdsaSignature (435) */
+ export interface SpCoreEcdsaSignature extends U8aFixed {}
- /** @name FrameSystemExtensionsCheckSpecVersion (439) */
- type FrameSystemExtensionsCheckSpecVersion = Null;
+ /** @name FrameSystemExtensionsCheckSpecVersion (438) */
+ export type FrameSystemExtensionsCheckSpecVersion = Null;
- /** @name FrameSystemExtensionsCheckGenesis (440) */
- type FrameSystemExtensionsCheckGenesis = Null;
+ /** @name FrameSystemExtensionsCheckGenesis (439) */
+ export type FrameSystemExtensionsCheckGenesis = Null;
- /** @name FrameSystemExtensionsCheckNonce (443) */
- interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
+ /** @name FrameSystemExtensionsCheckNonce (442) */
+ export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
- /** @name FrameSystemExtensionsCheckWeight (444) */
- type FrameSystemExtensionsCheckWeight = Null;
+ /** @name FrameSystemExtensionsCheckWeight (443) */
+ export type FrameSystemExtensionsCheckWeight = Null;
- /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (445) */
- interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
+ /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (444) */
+ export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
- /** @name OpalRuntimeRuntime (446) */
- type OpalRuntimeRuntime = Null;
+ /** @name OpalRuntimeRuntime (445) */
+ export type OpalRuntimeRuntime = Null;
- /** @name PalletEthereumFakeTransactionFinalizer (447) */
- type PalletEthereumFakeTransactionFinalizer = Null;
+ /** @name PalletEthereumFakeTransactionFinalizer (444) */
+ 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
@@ -190,5 +190,10 @@
[crossAccountParam('staker')],
'u128',
),
+ pendingUnstake: fun(
+ 'Returns the total amount of unstaked tokens',
+ [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
},
};
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -68,9 +68,10 @@
const refungible = 'refungible';
const scheduler = 'scheduler';
const rmrkPallets = ['rmrkcore', 'rmrkequip'];
+ const appPromotion = 'promotion';
if (chain.eq('OPAL by UNIQUE')) {
- requiredPallets.push(refungible, scheduler, ...rmrkPallets);
+ requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets);
} else if (chain.eq('QUARTZ by UNIQUE')) {
// Insert Quartz additional pallets here
} else if (chain.eq('UNIQUE')) {
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -48,6 +48,7 @@
Fungible = 'fungible',
NFT = 'nonfungible',
Scheduler = 'scheduler',
+ AppPromotion = 'promotion',
}
export async function isUnique(): Promise<boolean> {
tests/src/util/playgrounds/index.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/index.ts
+++ b/tests/src/util/playgrounds/index.ts
@@ -4,7 +4,10 @@
import {IKeyringPair} from '@polkadot/types/types';
import config from '../../config';
import '../../interfaces/augment-api-events';
-import {DevUniqueHelper} from './unique.dev';
+import * as defs from '../../interfaces/definitions';
+import {ApiPromise, WsProvider} from '@polkadot/api';
+import { UniqueHelper } from './unique';
+
class SilentLogger {
log(msg: any, level: any): void { }
@@ -15,13 +18,53 @@
};
}
-export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
+
+class DevUniqueHelper extends UniqueHelper {
+ async connect(wsEndpoint: string, listeners?: any): Promise<void> {
+ const wsProvider = new WsProvider(wsEndpoint);
+ this.api = new ApiPromise({
+ provider: wsProvider,
+ signedExtensions: {
+ ContractHelpers: {
+ extrinsic: {},
+ payload: {},
+ },
+ FakeTransactionFinalizer: {
+ extrinsic: {},
+ payload: {},
+ },
+ },
+ rpc: {
+ unique: defs.unique.rpc,
+ rmrk: defs.rmrk.rpc,
+ eth: {
+ feeHistory: {
+ description: 'Dummy',
+ params: [],
+ type: 'u8',
+ },
+ maxPriorityFeePerGas: {
+ description: 'Dummy',
+ params: [],
+ type: 'u8',
+ },
+ },
+ },
+ });
+ await this.api.isReadyOrError;
+ this.network = await UniqueHelper.detectNetwork(this.api);
+ }
+}
+
+
+export const usingPlaygrounds = async <T = void> (code: (helper: UniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<T>) => {
// TODO: Remove, this is temporary: Filter unneeded API output
// (Jaco promised it will be removed in the next version)
const consoleErr = console.error;
const consoleLog = console.log;
const consoleWarn = console.warn;
-
+ let result: T = null as unknown as T;
+
const outFn = (printer: any) => (...args: any[]) => {
for (const arg of args) {
if (typeof arg !== 'string')
@@ -41,7 +84,7 @@
await helper.connect(config.substrateUrl);
const ss58Format = helper.chain.getChainProperties().ss58Format;
const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format);
- await code(helper, privateKey);
+ result = await code(helper, privateKey);
}
finally {
await helper.disconnect();
@@ -49,4 +92,5 @@
console.log = consoleLog;
console.warn = consoleWarn;
}
+ return result as T;
};
\ No newline at end of file