difftreelog
merge develop into test/playground-migration
in: master
79 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -113,6 +113,20 @@
checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8"
[[package]]
+name = "app-promotion-rpc"
+version = "0.1.0"
+dependencies = [
+ "pallet-common",
+ "pallet-evm",
+ "parity-scale-codec 3.1.5",
+ "sp-api",
+ "sp-core",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+]
+
+[[package]]
name = "approx"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5127,6 +5141,7 @@
name = "opal-runtime"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -5150,6 +5165,7 @@
"hex-literal",
"log",
"orml-vesting",
+ "pallet-app-promotion",
"pallet-aura",
"pallet-balances",
"pallet-base-fee",
@@ -5296,6 +5312,31 @@
]
[[package]]
+name = "pallet-app-promotion"
+version = "0.1.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-evm",
+ "pallet-evm-contract-helpers",
+ "pallet-evm-migration",
+ "pallet-randomness-collective-flip",
+ "pallet-timestamp",
+ "pallet-unique",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+]
+
+[[package]]
name = "pallet-aura"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05"
@@ -5694,6 +5735,7 @@
name = "pallet-evm-contract-helpers"
version = "0.2.0"
dependencies = [
+ "ethereum",
"evm-coder",
"fp-evm-mapping",
"frame-support",
@@ -6432,7 +6474,7 @@
[[package]]
name = "pallet-unique"
-version = "0.1.3"
+version = "0.1.4"
dependencies = [
"ethereum",
"evm-coder",
@@ -8332,6 +8374,7 @@
name = "quartz-runtime"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -8355,6 +8398,7 @@
"hex-literal",
"log",
"orml-vesting",
+ "pallet-app-promotion",
"pallet-aura",
"pallet-balances",
"pallet-base-fee",
@@ -12103,9 +12147,10 @@
[[package]]
name = "uc-rpc"
-version = "0.1.3"
+version = "0.1.4"
dependencies = [
"anyhow",
+ "app-promotion-rpc",
"jsonrpsee",
"pallet-common",
"pallet-evm",
@@ -12184,6 +12229,7 @@
name = "unique-node"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"clap",
"cumulus-client-cli",
"cumulus-client-collator",
@@ -12272,6 +12318,7 @@
name = "unique-rpc"
version = "0.1.1"
dependencies = [
+ "app-promotion-rpc",
"fc-db",
"fc-mapping-sync",
"fc-rpc",
@@ -12321,6 +12368,7 @@
name = "unique-runtime"
version = "0.9.27"
dependencies = [
+ "app-promotion-rpc",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -12344,6 +12392,7 @@
"hex-literal",
"log",
"orml-vesting",
+ "pallet-app-promotion",
"pallet-aura",
"pallet-balances",
"pallet-base-fee",
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -128,5 +128,9 @@
bench-rmrk-equip:
make _bench PALLET=proxy-rmrk-equip
+.PHONY: bench-app-promotion
+bench-app-promotion:
+ make _bench PALLET=app-promotion PALLET_DIR=app-promotion
+
.PHONY: bench
bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip
client/rpc/CHANGELOG.mddiffbeforeafterboth--- a/client/rpc/CHANGELOG.md
+++ b/client/rpc/CHANGELOG.md
@@ -3,15 +3,21 @@
All notable changes to this project will be documented in this file.
<!-- bureaucrate goes here -->
+
+## [v0.1.4] 2022-09-08
+
+### Added
+- Support RPC for `AppPromotion` pallet.
+
## [v0.1.3] 2022-08-16
### Other changes
-- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
+- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
-- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
+- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
-- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
+- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
## [0.1.2] - 2022-08-12
client/rpc/Cargo.tomldiffbeforeafterboth--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "uc-rpc"
-version = "0.1.3"
+version = "0.1.4"
license = "GPLv3"
edition = "2021"
@@ -8,6 +8,7 @@
pallet-common = { default-features = false, path = '../../pallets/common' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
up-rpc = { path = "../../primitives/rpc" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"}
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
codec = { package = "parity-scale-codec", version = "3.1.2" }
jsonrpsee = { version = "0.14.0", features = ["server", "macros"] }
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -23,6 +23,7 @@
proc_macros::rpc,
};
use anyhow::anyhow;
+use sp_runtime::traits::{AtLeast32BitUnsigned, Member};
use up_data_structs::{
RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property,
PropertyKeyPermission, TokenData, TokenChild,
@@ -30,6 +31,7 @@
use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};
use sp_blockchain::HeaderBackend;
use up_rpc::UniqueApi as UniqueRuntimeApi;
+use app_promotion_rpc::AppPromotionApi as AppPromotionRuntimeApi;
// RMRK
use rmrk_rpc::RmrkApi as RmrkRuntimeApi;
@@ -37,6 +39,7 @@
RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId,
};
+pub use app_promotion_unique_rpc::AppPromotionApiServer;
pub use rmrk_unique_rpc::RmrkApiServer;
#[rpc(server)]
@@ -245,6 +248,46 @@
) -> Result<Option<String>>;
}
+mod app_promotion_unique_rpc {
+ use super::*;
+
+ #[rpc(server)]
+ #[async_trait]
+ pub trait AppPromotionApi<BlockHash, BlockNumber, CrossAccountId, AccountId> {
+ /// Returns the total amount of staked tokens.
+ #[method(name = "appPromotion_totalStaked")]
+ fn total_staked(
+ &self,
+ staker: Option<CrossAccountId>,
+ at: Option<BlockHash>,
+ ) -> Result<String>;
+
+ ///Returns the total amount of staked tokens per block when staked.
+ #[method(name = "appPromotion_totalStakedPerBlock")]
+ fn total_staked_per_block(
+ &self,
+ staker: CrossAccountId,
+ at: Option<BlockHash>,
+ ) -> Result<Vec<(BlockNumber, String)>>;
+
+ /// Returns the total amount of tokens pending withdrawal from staking.
+ #[method(name = "appPromotion_pendingUnstake")]
+ fn pending_unstake(
+ &self,
+ staker: Option<CrossAccountId>,
+ at: Option<BlockHash>,
+ ) -> Result<String>;
+
+ /// Returns the total amount of tokens pending withdrawal from staking per block.
+ #[method(name = "appPromotion_pendingUnstakePerBlock")]
+ fn pending_unstake_per_block(
+ &self,
+ staker: CrossAccountId,
+ at: Option<BlockHash>,
+ ) -> Result<Vec<(BlockNumber, String)>>;
+ }
+}
+
mod rmrk_unique_rpc {
use super::*;
@@ -367,34 +410,28 @@
}
}
-pub struct Unique<C, P> {
- client: Arc<C>,
- _marker: std::marker::PhantomData<P>,
-}
+macro_rules! define_struct_for_server_api {
+ ($name:ident) => {
+ pub struct $name<C, P> {
+ client: Arc<C>,
+ _marker: std::marker::PhantomData<P>,
+ }
-impl<C, P> Unique<C, P> {
- pub fn new(client: Arc<C>) -> Self {
- Self {
- client,
- _marker: Default::default(),
+ impl<C, P> $name<C, P> {
+ pub fn new(client: Arc<C>) -> Self {
+ Self {
+ client,
+ _marker: Default::default(),
+ }
+ }
}
- }
+ };
}
-pub struct Rmrk<C, P> {
- client: Arc<C>,
- _marker: std::marker::PhantomData<P>,
-}
+define_struct_for_server_api!(Unique);
+define_struct_for_server_api!(AppPromotion);
+define_struct_for_server_api!(Rmrk);
-impl<C, P> Rmrk<C, P> {
- pub fn new(client: Arc<C>) -> Self {
- Self {
- client,
- _marker: Default::default(),
- }
- }
-}
-
macro_rules! pass_method {
(
$method_name:ident(
@@ -440,6 +477,12 @@
};
}
+macro_rules! app_promotion_api {
+ () => {
+ dyn AppPromotionRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>
+ };
+}
+
macro_rules! rmrk_api {
() => {
dyn RmrkRuntimeApi<Block, AccountId, CollectionInfo, NftInfo, ResourceInfo, PropertyInfo, BaseInfo, PartType, Theme>
@@ -522,6 +565,35 @@
pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec<CrossAccountId>, unique_api);
}
+impl<C, Block, BlockNumber, CrossAccountId, AccountId>
+ app_promotion_unique_rpc::AppPromotionApiServer<
+ <Block as BlockT>::Hash,
+ BlockNumber,
+ CrossAccountId,
+ AccountId,
+ > for AppPromotion<C, Block>
+where
+ Block: BlockT,
+ BlockNumber: Decode + Member + AtLeast32BitUnsigned,
+ AccountId: Decode,
+ C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
+ C::Api: AppPromotionRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
+{
+ pass_method!(total_staked(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);
+ pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>
+ |v| v
+ .into_iter()
+ .map(|(b, a)| (b, a.to_string()))
+ .collect::<Vec<_>>(), app_promotion_api);
+ pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);
+ pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>
+ |v| v
+ .into_iter()
+ .map(|(b, a)| (b, a.to_string()))
+ .collect::<Vec<_>>(), app_promotion_api);
+}
+
#[allow(deprecated)]
impl<
C,
doc/separate_rpc.mddiffbeforeafterboth--- /dev/null
+++ b/doc/separate_rpc.md
@@ -0,0 +1,123 @@
+1. Create, in the `primitives` folder, a crate with a trait for RPC generation.
+ ```rust
+ sp_api::decl_runtime_apis! {
+ #[api_version(2)]
+ pub trait ModuleNameApi<CrossAccountId>
+ where
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
+ {
+ fn method_name(user: Option<CrossAccountId>) -> Result<u128, DispatchError>;
+ }
+ }
+ ```
+
+2. client/rpc/src/lib.rs
+ * Add a trait with the required methods. Mark it with `#[rpc(server)]` and `#[async_trait]` directives.
+ ```rust
+ #[rpc(server)]
+ #[async_trait]
+ pub trait ModuleNameApi<BlockHash, CrossAccountId> {
+ #[method(name = "moduleName_methodName")]
+ fn method_name(&self, user: Option<CrossAccountId>, at: Option<BlockHash>)
+ -> Result<String>;
+ }
+ ```
+ * Don't forget to write the correct method identifier in the form `moduleName_methodName`.
+ * Add a structure for which the server API interface will be implemented.
+ ```rust
+ define_struct_for_server_api!(ModuleName);
+ ```
+ * Define a macro to be used in the implementation of the server API interface.
+ ```rust
+ macro_rules! module_api {
+ () => {
+ dyn ModuleNameRuntimeApi<BlockHash, CrossAccountId>
+ };
+ }
+ ```
+ * Implement a server API interface.
+ ```rust
+ impl<C, Block, CrossAccountId>
+ ModuleNameApiServer<<Block as BlockT>::Hash, CrossAccountId> for ModuleName<C, Block>
+ where
+ Block: BlockT,
+ C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
+ C::Api: AppPromotionRuntimeApi<Block, BlockNumber, CrossAccountId, AccountId>,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
+ {
+ pass_method!(method_name(user: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);
+ }
+ ```
+
+3. runtime/common/runtime_apis.rs
+ * Implement the `ModuleNameApi` interface for `Runtime`. Optionally, you can mark a feature flag to disable the functionality.
+ ```rust
+ impl MethodApi<Block, BlockNumber, CrossAccountId, AccountId> for Runtime {
+ fn method_name(user: Option<CrossAccountId>) -> Result<u128, DispatchError> {
+ #[cfg(not(feature = "module"))]
+ return unsupported!();
+
+ #[cfg(feature = "module")]
+ return Ok(0);
+ }
+ }
+ ```
+
+4. node/cli/src/service.rs
+ * Set the `MethodApi<Block, Runtime::CrossAccountId>` bound in the `start_node_impl`, `start_node`, `start_dev_node` methods.
+
+5. node/rpc/src/lib.rs
+ * Add `MethodApi<Block, Runtime::CrossAccountId>` bound to `create_full` method.
+ * Enable RPC in the `create_full` method by adding `io.merge(ModuleName::new(client.clone()).into_rpc())?;`
+
+6. Add a new crate (see point 1) into dependencies.
+ * client/rpc/Cargo.toml
+ * node/rpc/Cargo.toml
+ * runtime/opal/Cargo.toml
+ * runtime/quartz/Cargo.toml
+ * runtime/unique/Cargo.toml
+
+7. Create tests/src/interfaces/ModuleName/definitions.ts and describe the necessary methods in it.
+ ```ts
+ type RpcParam = {
+ name: string;
+ type: string;
+ isOptional?: true;
+ };
+
+ const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr';
+
+ const fun = (description: string, params: RpcParam[], type: string) => ({
+ description,
+ params: [...params, atParam],
+ type,
+ });
+
+ export default {
+ types: {},
+ rpc: {
+ methodName: fun(
+ 'Documentation for method',
+ [{name: 'user', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
+ },
+ };
+ ```
+
+8. Describe definitions from paragraph 7 in tests/src/interfaces/definitions.ts.
+ ```ts
+ export {default as ModuleName} from './module/definitions';
+ ```
+
+9. tests/src/substrate/substrate-api.ts
+ * Set the RPC interface in the `defaultApiOptions` function, add an entry in the `rpc` parameter
+ ```ts
+ module: defs.module.rpc,
+ ```
+
+10. tests/src/util/playgrounds/unique.dev.ts
+ * Specify RPC interface in `connect` function, add entry in `rpc` parameter
+ ```ts
+ module: defs.module.rpc,
+ ```
\ No newline at end of file
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -318,6 +318,7 @@
pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
unique-rpc = { default-features = false, path = "../rpc" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
[features]
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -63,7 +63,9 @@
use fc_rpc_core::types::FilterPool;
use fc_mapping_sync::{MappingSyncWorker, SyncStrategy};
-use up_common::types::opaque::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block};
+use up_common::types::opaque::{
+ AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block, BlockNumber,
+};
// RMRK
use up_data_structs::{
@@ -362,6 +364,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>
+ + app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -663,6 +666,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>
+ + app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -807,6 +811,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>
+ + app_promotion_rpc::AppPromotionApi<Block, BlockNumber, Runtime::CrossAccountId, AccountId>
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -53,6 +53,7 @@
pallet-unique = { path = "../../pallets/unique" }
uc-rpc = { path = "../../client/rpc" }
up-rpc = { path = "../../primitives/rpc" }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"}
rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
node/rpc/src/lib.rsdiffbeforeafterboth--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -145,6 +145,12 @@
C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
C::Api: up_rpc::UniqueApi<Block, <R as RuntimeInstance>::CrossAccountId, AccountId>,
+ C::Api: app_promotion_rpc::AppPromotionApi<
+ Block,
+ BlockNumber,
+ <R as RuntimeInstance>::CrossAccountId,
+ AccountId,
+ >,
C::Api: rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -169,6 +175,7 @@
EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,
};
use uc_rpc::{UniqueApiServer, Unique};
+ use uc_rpc::{AppPromotionApiServer, AppPromotion};
#[cfg(not(feature = "unique-runtime"))]
use uc_rpc::{RmrkApiServer, Rmrk};
@@ -227,6 +234,9 @@
io.merge(Unique::new(client.clone()).into_rpc())?;
+ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
+ io.merge(AppPromotion::new(client.clone()).into_rpc())?;
+
#[cfg(not(feature = "unique-runtime"))]
io.merge(Rmrk::new(client.clone()).into_rpc())?;
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/app-promotion/Cargo.toml
@@ -0,0 +1,73 @@
+################################################################################
+# Package
+
+[package]
+authors = ['Unique Network <support@uniquenetwork.io>']
+description = 'Unique App Promotion Pallet'
+edition = '2021'
+homepage = 'https://unique.network'
+license = 'GPLv3'
+name = 'pallet-app-promotion'
+repository = 'https://github.com/UniqueNetwork/unique-chain'
+version = '0.1.0'
+
+[package.metadata.docs.rs]
+targets = ['x86_64-unknown-linux-gnu']
+
+[features]
+default = ['std']
+runtime-benchmarks = [
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system/runtime-benchmarks',
+ # 'pallet-unique/runtime-benchmarks',
+]
+std = [
+ 'codec/std',
+ 'frame-benchmarking/std',
+ 'frame-support/std',
+ 'frame-system/std',
+ 'pallet-balances/std',
+ 'pallet-timestamp/std',
+ 'pallet-randomness-collective-flip/std',
+ 'pallet-evm/std',
+ 'sp-io/std',
+ 'sp-std/std',
+ 'sp-runtime/std',
+ 'sp-core/std',
+ 'serde/std',
+
+]
+[dependencies]
+scale-info = { version = "2.0.1", default-features = false, features = [
+ "derive",
+] }
+################################################################################
+# Substrate Dependencies
+
+codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '3.1.2' }
+frame-benchmarking = {default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+frame-system ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-io ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+serde = { default-features = false, features = ['derive'], version = '1.0.130' }
+
+################################################################################
+# local dependencies
+
+up-data-structs ={ default-features = false, path = "../../primitives/data-structs" }
+pallet-common ={ default-features = false, path = "../common" }
+pallet-unique ={ default-features = false, path = "../unique" }
+pallet-evm-contract-helpers ={ default-features = false, path = "../evm-contract-helpers" }
+
+[dev-dependencies]
+pallet-evm-migration ={ default-features = false, path = "../evm-migration" }
+
+################################################################################
pallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/app-promotion/src/benchmarking.rs
@@ -0,0 +1,162 @@
+// 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/>.
+
+#![cfg(feature = "runtime-benchmarks")]
+
+use super::*;
+use crate::Pallet as PromototionPallet;
+
+use sp_runtime::traits::Bounded;
+use sp_std::vec;
+
+use frame_benchmarking::{benchmarks, account};
+use frame_support::traits::OnInitialize;
+use frame_system::{Origin, RawOrigin};
+use pallet_unique::benchmarking::create_nft_collection;
+use pallet_evm_migration::Pallet as EvmMigrationPallet;
+
+const SEED: u32 = 0;
+
+fn set_admin<T>() -> Result<T::AccountId, sp_runtime::DispatchError>
+where
+ T: Config + pallet_unique::Config + pallet_evm_migration::Config,
+ T::BlockNumber: From<u32> + Into<u32>,
+ <<T as Config>::Currency as Currency<T::AccountId>>::Balance: Sum + From<u128>,
+{
+ let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
+
+ <T as Config>::Currency::make_free_balance_be(
+ &pallet_admin,
+ Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),
+ );
+
+ PromototionPallet::<T>::set_admin_address(
+ RawOrigin::Root.into(),
+ T::CrossAccountId::from_sub(pallet_admin.clone()),
+ )?;
+
+ Ok(pallet_admin)
+}
+
+benchmarks! {
+ where_clause{
+ where T: Config + pallet_unique::Config + pallet_evm_migration::Config ,
+ T::BlockNumber: From<u32> + Into<u32>,
+ <<T as Config>::Currency as Currency<T::AccountId>>::Balance: Sum + From<u128>
+ }
+
+ on_initialize {
+ let b in 0..PENDING_LIMIT_PER_BLOCK;
+ set_admin::<T>()?;
+
+ (0..b).try_for_each(|index| {
+ let staker = account::<T::AccountId>("staker", index, SEED);
+ <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())?;
+ PromototionPallet::<T>::unstake(RawOrigin::Signed(staker.clone()).into()).map_err(|e| e.error)?;
+ Result::<(), sp_runtime::DispatchError>::Ok(())
+ })?;
+ let block_number = <frame_system::Pallet<T>>::current_block_number() + T::PendingInterval::get();
+ }: {PromototionPallet::<T>::on_initialize(block_number)}
+
+ set_admin_address {
+ let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
+ let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ } : _(RawOrigin::Root, T::CrossAccountId::from_sub(pallet_admin))
+
+ payout_stakers{
+ let b in 1..101;
+
+ let pallet_admin = account::<T::AccountId>("admin", 1, SEED);
+ let share = Perbill::from_rational(1u32, 20);
+ PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
+ <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+
+ let staker: T::AccountId = account("caller", 0, SEED);
+ <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let stakers: Vec<T::AccountId> = (0..b).map(|index| account("staker", index, SEED)).collect();
+ stakers.iter().for_each(|staker| {
+ <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ });
+ (0..10).try_for_each(|_| {
+ stakers.iter()
+ .map(|staker| {
+ PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())
+ }).collect::<Result<Vec<_>, _>>()?;
+ <frame_system::Pallet<T>>::finalize();
+ Result::<(), sp_runtime::DispatchError>::Ok(())
+ })?;
+ } : _(RawOrigin::Signed(pallet_admin.clone()), Some(b as u8))
+
+ stake {
+ let caller = account::<T::AccountId>("caller", 0, SEED);
+ let share = Perbill::from_rational(1u32, 10);
+ let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ } : _(RawOrigin::Signed(caller.clone()), share * <T as Config>::Currency::total_balance(&caller))
+
+ unstake {
+ let caller = account::<T::AccountId>("caller", 0, SEED);
+ let share = Perbill::from_rational(1u32, 20);
+ let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ (0..10).map(|_| {
+ <frame_system::Pallet<T>>::finalize();
+ PromototionPallet::<T>::stake(RawOrigin::Signed(caller.clone()).into(), share * <T as Config>::Currency::total_balance(&caller))
+ }).collect::<Result<Vec<_>, _>>()?;
+
+ } : _(RawOrigin::Signed(caller.clone()))
+
+ sponsor_collection {
+ let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
+ PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
+ let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let caller: T::AccountId = account("caller", 0, SEED);
+ let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let collection = create_nft_collection::<T>(caller.clone())?;
+ } : _(RawOrigin::Signed(pallet_admin.clone()), collection)
+
+ stop_sponsoring_collection {
+ let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
+ PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
+ let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let caller: T::AccountId = account("caller", 0, SEED);
+ let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let collection = create_nft_collection::<T>(caller.clone())?;
+ PromototionPallet::<T>::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?;
+ } : _(RawOrigin::Signed(pallet_admin.clone()), collection)
+
+ sponsor_contract {
+ let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
+ PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
+
+ let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let address = H160::from_low_u64_be(SEED as u64);
+ let data: Vec<u8> = (0..20 as u8).collect();
+ <EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;
+ <EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;
+ } : _(RawOrigin::Signed(pallet_admin.clone()), address)
+
+ stop_sponsoring_contract {
+ let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
+ PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
+
+ let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let address = H160::from_low_u64_be(SEED as u64);
+ let data: Vec<u8> = (0..20 as u8).collect();
+ <EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;
+ <EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;
+ PromototionPallet::<T>::sponsor_contract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?;
+ } : _(RawOrigin::Signed(pallet_admin.clone()), address)
+}
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/app-promotion/src/lib.rs
@@ -0,0 +1,758 @@
+// 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/>.
+
+//! # App promotion
+//!
+//! The app promotion pallet is designed to ... .
+//!
+//! ## Interface
+//!
+//! ### Dispatchable Functions
+//!
+
+// #![recursion_limit = "1024"]
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(feature = "runtime-benchmarks")]
+mod benchmarking;
+
+pub mod types;
+pub mod weights;
+
+use sp_std::{
+ vec::{Vec},
+ vec,
+ iter::Sum,
+ borrow::ToOwned,
+ cell::RefCell,
+};
+use sp_core::H160;
+use codec::EncodeLike;
+use pallet_balances::BalanceLock;
+pub use types::*;
+
+use up_data_structs::CollectionId;
+
+use frame_support::{
+ dispatch::{DispatchResult},
+ traits::{
+ Currency, Get, LockableCurrency, WithdrawReasons, tokens::Balance, ExistenceRequirement,
+ },
+ ensure,
+};
+
+use weights::WeightInfo;
+
+pub use pallet::*;
+use pallet_evm::account::CrossAccountId;
+use sp_runtime::{
+ Perbill,
+ traits::{BlockNumberProvider, CheckedAdd, CheckedSub, AccountIdConversion, Zero},
+ ArithmeticError,
+};
+
+pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake";
+
+const PENDING_LIMIT_PER_BLOCK: u32 = 3;
+
+type BalanceOf<T> =
+ <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
+
+#[frame_support::pallet]
+pub mod pallet {
+ use super::*;
+ use frame_support::{
+ Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId,
+ traits::ReservableCurrency,
+ };
+ use frame_system::pallet_prelude::*;
+
+ #[pallet::config]
+ pub trait Config: frame_system::Config + pallet_evm::account::Config {
+ /// Type to interact with the native token
+ type Currency: ExtendedLockableCurrency<Self::AccountId>
+ + ReservableCurrency<Self::AccountId>;
+
+ /// Type for interacting with collections
+ type CollectionHandler: CollectionHandler<
+ AccountId = Self::AccountId,
+ CollectionId = CollectionId,
+ >;
+
+ /// Type for interacting with conrtacts
+ type ContractHandler: ContractHandler<AccountId = Self::CrossAccountId, ContractId = H160>;
+
+ /// ID for treasury
+ type TreasuryAccountId: Get<Self::AccountId>;
+
+ /// The app's pallet id, used for deriving its sovereign account ID.
+ #[pallet::constant]
+ type PalletId: Get<PalletId>;
+
+ /// In relay blocks.
+ #[pallet::constant]
+ type RecalculationInterval: Get<Self::BlockNumber>;
+
+ /// In parachain blocks.
+ #[pallet::constant]
+ type PendingInterval: Get<Self::BlockNumber>;
+
+ /// Rate of return for interval in blocks defined in `RecalculationInterval`.
+ #[pallet::constant]
+ type IntervalIncome: Get<Perbill>;
+
+ /// Decimals for the `Currency`.
+ #[pallet::constant]
+ type Nominal: Get<BalanceOf<Self>>;
+
+ /// Weight information for extrinsics in this pallet.
+ type WeightInfo: WeightInfo;
+
+ // The relay block number provider
+ type RelayBlockNumberProvider: BlockNumberProvider<BlockNumber = Self::BlockNumber>;
+
+ /// Events compatible with [`frame_system::Config::Event`].
+ type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;
+ }
+
+ #[pallet::pallet]
+ #[pallet::generate_store(pub(super) trait Store)]
+ pub struct Pallet<T>(_);
+
+ #[pallet::event]
+ #[pallet::generate_deposit(fn deposit_event)]
+ pub enum Event<T: Config> {
+ /// Staking recalculation was performed
+ ///
+ /// # Arguments
+ /// * AccountId: ID of the staker.
+ /// * Balance : recalculation base
+ /// * Balance : total income
+ StakingRecalculation(
+ /// An recalculated staker
+ T::AccountId,
+ /// Base on which interest is calculated
+ BalanceOf<T>,
+ /// Amount of accrued interest
+ BalanceOf<T>,
+ ),
+
+ /// Staking was performed
+ ///
+ /// # Arguments
+ /// * AccountId: ID of the staker
+ /// * Balance : staking amount
+ Stake(T::AccountId, BalanceOf<T>),
+
+ /// Unstaking was performed
+ ///
+ /// # Arguments
+ /// * AccountId: ID of the staker
+ /// * Balance : unstaking amount
+ Unstake(T::AccountId, BalanceOf<T>),
+
+ /// The admin was set
+ ///
+ /// # Arguments
+ /// * AccountId: ID of the admin
+ SetAdmin(T::AccountId),
+ }
+
+ #[pallet::error]
+ pub enum Error<T> {
+ /// Error due to action requiring admin to be set.
+ AdminNotSet,
+ /// No permission to perform an action.
+ NoPermission,
+ /// Insufficient funds to perform an action.
+ NotSufficientFunds,
+ /// Occurs when a pending unstake cannot be added in this block. PENDING_LIMIT_PER_BLOCK` limits exceeded.
+ PendingForBlockOverflow,
+ /// The error is due to the fact that the collection/contract must already be sponsored in order to perform the action.
+ SponsorNotSet,
+ /// Errors caused by incorrect actions with a locked balance.
+ IncorrectLockedBalanceOperation,
+ }
+
+ #[pallet::storage]
+ pub type TotalStaked<T: Config> = StorageValue<Value = BalanceOf<T>, QueryKind = ValueQuery>;
+
+ #[pallet::storage]
+ pub type Admin<T: Config> = StorageValue<Value = T::AccountId, QueryKind = OptionQuery>;
+
+ /// Amount of tokens staked by account in the blocknumber.
+ #[pallet::storage]
+ pub type Staked<T: Config> = StorageNMap<
+ Key = (
+ Key<Blake2_128Concat, T::AccountId>,
+ Key<Twox64Concat, T::BlockNumber>,
+ ),
+ Value = (BalanceOf<T>, T::BlockNumber),
+ QueryKind = ValueQuery,
+ >;
+ /// Amount of stakes for an Account
+ #[pallet::storage]
+ pub type StakesPerAccount<T: Config> =
+ StorageMap<_, Blake2_128Concat, T::AccountId, u8, ValueQuery>;
+
+ #[pallet::storage]
+ pub type PendingUnstake<T: Config> = StorageMap<
+ _,
+ Twox64Concat,
+ T::BlockNumber,
+ BoundedVec<(T::AccountId, BalanceOf<T>), ConstU32<PENDING_LIMIT_PER_BLOCK>>,
+ ValueQuery,
+ >;
+
+ /// Stores a key for record for which the next revenue recalculation would be performed.
+ /// If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
+ #[pallet::storage]
+ #[pallet::getter(fn get_next_calculated_record)]
+ pub type NextCalculatedRecord<T: Config> =
+ StorageValue<Value = (T::AccountId, T::BlockNumber), QueryKind = OptionQuery>;
+
+ #[pallet::hooks]
+ impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
+ /// Block overflow is impossible due to the fact that the unstake algorithm in on_initialize
+ /// implies the execution of a strictly limited number of relatively lightweight operations.
+ /// A separate benchmark has been implemented to scale the weight depending on the number of pendings.
+ fn on_initialize(current_block_number: T::BlockNumber) -> Weight
+ where
+ <T as frame_system::Config>::BlockNumber: From<u32>,
+ {
+ let block_pending = PendingUnstake::<T>::take(current_block_number);
+ let counter = block_pending.len() as u32;
+
+ if !block_pending.is_empty() {
+ block_pending.into_iter().for_each(|(staker, amount)| {
+ <T::Currency as ReservableCurrency<T::AccountId>>::unreserve(&staker, amount);
+ });
+ }
+
+ T::WeightInfo::on_initialize(counter)
+ }
+ }
+
+ #[pallet::call]
+ impl<T: Config> Pallet<T>
+ where
+ T::BlockNumber: From<u32> + Into<u32>,
+ <<T as Config>::Currency as Currency<T::AccountId>>::Balance: Sum + From<u128>,
+ {
+ #[pallet::weight(T::WeightInfo::set_admin_address())]
+ pub fn set_admin_address(origin: OriginFor<T>, admin: T::CrossAccountId) -> DispatchResult {
+ ensure_root(origin)?;
+
+ <Admin<T>>::set(Some(admin.as_sub().to_owned()));
+
+ Self::deposit_event(Event::SetAdmin(admin.as_sub().to_owned()));
+
+ Ok(())
+ }
+
+ #[pallet::weight(T::WeightInfo::stake())]
+ pub fn stake(staker: OriginFor<T>, amount: BalanceOf<T>) -> DispatchResult {
+ let staker_id = ensure_signed(staker)?;
+
+ ensure!(
+ StakesPerAccount::<T>::get(&staker_id) < 10,
+ Error::<T>::NoPermission
+ );
+
+ ensure!(
+ amount >= <BalanceOf<T>>::from(100u128) * T::Nominal::get(),
+ ArithmeticError::Underflow
+ );
+
+ let balance =
+ <<T as Config>::Currency as Currency<T::AccountId>>::free_balance(&staker_id);
+
+ <<T as Config>::Currency as Currency<T::AccountId>>::ensure_can_withdraw(
+ &staker_id,
+ amount,
+ WithdrawReasons::all(),
+ balance
+ .checked_sub(&amount)
+ .ok_or(ArithmeticError::Underflow)?,
+ )?;
+
+ Self::add_lock_balance(&staker_id, amount)?;
+
+ let block_number = T::RelayBlockNumberProvider::current_block_number();
+
+ let recalculate_after_interval: T::BlockNumber =
+ if block_number % T::RecalculationInterval::get() == 0u32.into() {
+ 1u32.into()
+ } else {
+ 2u32.into()
+ };
+
+ let recalc_block = (block_number / T::RecalculationInterval::get()
+ + recalculate_after_interval)
+ * T::RecalculationInterval::get();
+
+ <Staked<T>>::insert((&staker_id, block_number), {
+ let mut balance_and_recalc_block = <Staked<T>>::get((&staker_id, block_number));
+ balance_and_recalc_block.0 = balance_and_recalc_block
+ .0
+ .checked_add(&amount)
+ .ok_or(ArithmeticError::Overflow)?;
+ balance_and_recalc_block.1 = recalc_block;
+ balance_and_recalc_block
+ });
+
+ <TotalStaked<T>>::set(
+ <TotalStaked<T>>::get()
+ .checked_add(&amount)
+ .ok_or(ArithmeticError::Overflow)?,
+ );
+
+ StakesPerAccount::<T>::mutate(&staker_id, |stakes| *stakes += 1);
+
+ Self::deposit_event(Event::Stake(staker_id, amount));
+
+ Ok(())
+ }
+
+ #[pallet::weight(T::WeightInfo::unstake())]
+ pub fn unstake(staker: OriginFor<T>) -> DispatchResultWithPostInfo {
+ let staker_id = ensure_signed(staker)?;
+ let block = <frame_system::Pallet<T>>::block_number() + T::PendingInterval::get();
+ let mut pendings = <PendingUnstake<T>>::get(block);
+
+ ensure!(!pendings.is_full(), Error::<T>::PendingForBlockOverflow);
+
+ let mut total_stakes = 0u64;
+
+ let total_staked: BalanceOf<T> = Staked::<T>::drain_prefix((&staker_id,))
+ .map(|(_, (amount, _))| {
+ total_stakes += 1;
+ amount
+ })
+ .sum();
+
+ if total_staked.is_zero() {
+ return Ok(None.into()); // TO-DO
+ }
+
+ pendings
+ .try_push((staker_id.clone(), total_staked))
+ .map_err(|_| Error::<T>::PendingForBlockOverflow)?;
+
+ <PendingUnstake<T>>::insert(block, pendings);
+
+ Self::unlock_balance(&staker_id, total_staked)?;
+
+ <T::Currency as ReservableCurrency<T::AccountId>>::reserve(&staker_id, total_staked)?;
+
+ TotalStaked::<T>::set(
+ TotalStaked::<T>::get()
+ .checked_sub(&total_staked)
+ .ok_or(ArithmeticError::Underflow)?,
+ );
+
+ StakesPerAccount::<T>::remove(&staker_id);
+
+ Self::deposit_event(Event::Unstake(staker_id, total_staked));
+
+ Ok(None.into())
+ }
+
+ #[pallet::weight(T::WeightInfo::sponsor_collection())]
+ pub fn sponsor_collection(
+ admin: OriginFor<T>,
+ collection_id: CollectionId,
+ ) -> DispatchResult {
+ let admin_id = ensure_signed(admin)?;
+ ensure!(
+ admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,
+ Error::<T>::NoPermission
+ );
+
+ T::CollectionHandler::set_sponsor(Self::account_id(), collection_id)
+ }
+ #[pallet::weight(T::WeightInfo::stop_sponsoring_collection())]
+ pub fn stop_sponsoring_collection(
+ admin: OriginFor<T>,
+ collection_id: CollectionId,
+ ) -> DispatchResult {
+ let admin_id = ensure_signed(admin)?;
+
+ ensure!(
+ admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,
+ Error::<T>::NoPermission
+ );
+
+ ensure!(
+ T::CollectionHandler::sponsor(collection_id)?.ok_or(<Error<T>>::SponsorNotSet)?
+ == Self::account_id(),
+ <Error<T>>::NoPermission
+ );
+ T::CollectionHandler::remove_collection_sponsor(collection_id)
+ }
+
+ #[pallet::weight(T::WeightInfo::sponsor_contract())]
+ pub fn sponsor_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {
+ let admin_id = ensure_signed(admin)?;
+
+ ensure!(
+ admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,
+ Error::<T>::NoPermission
+ );
+
+ T::ContractHandler::set_sponsor(
+ T::CrossAccountId::from_sub(Self::account_id()),
+ contract_id,
+ )
+ }
+
+ #[pallet::weight(T::WeightInfo::stop_sponsoring_contract())]
+ pub fn stop_sponsoring_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {
+ let admin_id = ensure_signed(admin)?;
+
+ ensure!(
+ admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,
+ Error::<T>::NoPermission
+ );
+
+ ensure!(
+ T::ContractHandler::sponsor(contract_id)?
+ .ok_or(<Error<T>>::SponsorNotSet)?
+ .as_sub() == &Self::account_id(),
+ <Error<T>>::NoPermission
+ );
+ T::ContractHandler::remove_contract_sponsor(contract_id)
+ }
+
+ #[pallet::weight(T::WeightInfo::payout_stakers(stakers_number.unwrap_or(20) as u32))]
+ pub fn payout_stakers(admin: OriginFor<T>, stakers_number: Option<u8>) -> DispatchResult {
+ let admin_id = ensure_signed(admin)?;
+
+ ensure!(
+ admin_id == Admin::<T>::get().ok_or(Error::<T>::AdminNotSet)?,
+ Error::<T>::NoPermission
+ );
+
+ let current_recalc_block =
+ Self::get_current_recalc_block(T::RelayBlockNumberProvider::current_block_number());
+ let next_recalc_block = current_recalc_block + T::RecalculationInterval::get();
+
+ let mut storage_iterator = Self::get_next_calculated_key()
+ .map_or(Staked::<T>::iter(), |key| Staked::<T>::iter_from(key));
+
+ NextCalculatedRecord::<T>::set(None);
+
+ // {
+ // let mut stakers_number = stakers_number.unwrap_or(20);
+ // let mut last_id = admin_id;
+ // let mut income_acc = BalanceOf::<T>::default();
+ // let mut amount_acc = BalanceOf::<T>::default();
+
+ // while let Some((
+ // (current_id, staked_block),
+ // (amount, next_recalc_block_for_stake),
+ // )) = storage_iterator.next()
+ // {
+ // if last_id != current_id {
+ // if income_acc != BalanceOf::<T>::default() {
+ // <T::Currency as Currency<T::AccountId>>::transfer(
+ // &T::TreasuryAccountId::get(),
+ // &last_id,
+ // income_acc,
+ // ExistenceRequirement::KeepAlive,
+ // )
+ // .and_then(|_| Self::add_lock_balance(&last_id, income_acc))?;
+
+ // Self::deposit_event(Event::StakingRecalculation(
+ // last_id, amount, income_acc,
+ // ));
+ // }
+
+ // if stakers_number == 0 {
+ // NextCalculatedRecord::<T>::set(Some((current_id, staked_block)));
+ // break;
+ // }
+ // stakers_number -= 1;
+ // income_acc = BalanceOf::<T>::default();
+ // last_id = current_id;
+ // };
+ // if current_recalc_block >= next_recalc_block_for_stake {
+ // Self::recalculate_and_insert_stake(
+ // &last_id,
+ // staked_block,
+ // next_recalc_block,
+ // amount,
+ // ((current_recalc_block - next_recalc_block_for_stake)
+ // / T::RecalculationInterval::get())
+ // .into() + 1,
+ // &mut income_acc,
+ // );
+ // }
+ // }
+ // }
+
+ {
+ let mut stakers_number = stakers_number.unwrap_or(20);
+ let last_id = RefCell::new(None);
+ let income_acc = RefCell::new(BalanceOf::<T>::default());
+ let amount_acc = RefCell::new(BalanceOf::<T>::default());
+
+ let flush_stake = || -> DispatchResult {
+ if let Some(last_id) = &*last_id.borrow() {
+ if !income_acc.borrow().is_zero() {
+ <T::Currency as Currency<T::AccountId>>::transfer(
+ &T::TreasuryAccountId::get(),
+ last_id,
+ *income_acc.borrow(),
+ ExistenceRequirement::KeepAlive,
+ )
+ .and_then(|_| {
+ Self::add_lock_balance(last_id, *income_acc.borrow())?;
+ <TotalStaked<T>>::try_mutate(|staked| {
+ staked
+ .checked_add(&*income_acc.borrow())
+ .ok_or(ArithmeticError::Overflow.into())
+ })
+ })?;
+
+ Self::deposit_event(Event::StakingRecalculation(
+ last_id.clone(),
+ *amount_acc.borrow(),
+ *income_acc.borrow(),
+ ));
+ }
+
+ *income_acc.borrow_mut() = BalanceOf::<T>::default();
+ *amount_acc.borrow_mut() = BalanceOf::<T>::default();
+ }
+ Ok(())
+ };
+
+ while let Some((
+ (current_id, staked_block),
+ (amount, next_recalc_block_for_stake),
+ )) = storage_iterator.next()
+ {
+ if stakers_number == 0 {
+ NextCalculatedRecord::<T>::set(Some((current_id, staked_block)));
+ break;
+ }
+ if last_id.borrow().as_ref() != Some(¤t_id) {
+ flush_stake()?;
+ *last_id.borrow_mut() = Some(current_id.clone());
+ stakers_number -= 1;
+ };
+ if current_recalc_block >= next_recalc_block_for_stake {
+ *amount_acc.borrow_mut() += amount;
+ Self::recalculate_and_insert_stake(
+ ¤t_id,
+ staked_block,
+ next_recalc_block,
+ amount,
+ ((current_recalc_block - next_recalc_block_for_stake)
+ / T::RecalculationInterval::get())
+ .into() + 1,
+ &mut *income_acc.borrow_mut(),
+ );
+ }
+ }
+ flush_stake()?;
+ }
+
+ Ok(())
+ }
+ }
+}
+
+impl<T: Config> Pallet<T> {
+ pub fn account_id() -> T::AccountId {
+ T::PalletId::get().into_account_truncating()
+ }
+
+ fn unlock_balance(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {
+ let locked_balance = Self::get_locked_balance(staker)
+ .map(|l| l.amount)
+ .ok_or(<Error<T>>::IncorrectLockedBalanceOperation)?;
+
+ // It is understood that we cannot unlock more funds than were locked by staking.
+ // Therefore, if implemented correctly, this error should not occur.
+ Self::set_lock_unchecked(
+ staker,
+ locked_balance
+ .checked_sub(&amount)
+ .ok_or(ArithmeticError::Underflow)?,
+ );
+ Ok(())
+ }
+
+ fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {
+ Self::get_locked_balance(staker)
+ .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())
+ }
+
+ fn set_lock_unchecked(staker: &T::AccountId, amount: BalanceOf<T>) {
+ if amount.is_zero() {
+ <T::Currency as LockableCurrency<T::AccountId>>::remove_lock(LOCK_IDENTIFIER, &staker);
+ } else {
+ <T::Currency as LockableCurrency<T::AccountId>>::set_lock(
+ LOCK_IDENTIFIER,
+ staker,
+ amount,
+ WithdrawReasons::all(),
+ )
+ }
+ }
+
+ pub fn get_locked_balance(
+ staker: impl EncodeLike<T::AccountId>,
+ ) -> Option<BalanceLock<BalanceOf<T>>> {
+ <T::Currency as ExtendedLockableCurrency<T::AccountId>>::locks(staker)
+ .into_iter()
+ .find(|l| l.id == LOCK_IDENTIFIER)
+ }
+
+ pub fn total_staked_by_id(staker: impl EncodeLike<T::AccountId>) -> Option<BalanceOf<T>> {
+ let staked = Staked::<T>::iter_prefix((staker,))
+ .into_iter()
+ .fold(<BalanceOf<T>>::default(), |acc, (_, (amount, _))| {
+ acc + amount
+ });
+ if staked != <BalanceOf<T>>::default() {
+ Some(staked)
+ } else {
+ None
+ }
+ }
+
+ pub fn total_staked_by_id_per_block(
+ staker: impl EncodeLike<T::AccountId>,
+ ) -> Option<Vec<(T::BlockNumber, BalanceOf<T>)>> {
+ 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 {
+ None
+ }
+ }
+
+ pub fn cross_id_total_staked(staker: Option<T::CrossAccountId>) -> Option<BalanceOf<T>> {
+ staker.map_or(Some(<TotalStaked<T>>::get()), |s| {
+ Self::total_staked_by_id(s.as_sub())
+ })
+ }
+
+ // pub fn cross_id_locked_balance(staker: T::CrossAccountId) -> BalanceOf<T> {
+ // Self::get_locked_balance(staker.as_sub())
+ // .map(|l| l.amount)
+ // .unwrap_or_default()
+ // }
+
+ pub fn cross_id_total_staked_per_block(
+ staker: T::CrossAccountId,
+ ) -> Vec<(T::BlockNumber, BalanceOf<T>)> {
+ Self::total_staked_by_id_per_block(staker.as_sub()).unwrap_or_default()
+ }
+
+ fn recalculate_and_insert_stake(
+ staker: &T::AccountId,
+ staked_block: T::BlockNumber,
+ next_recalc_block: T::BlockNumber,
+ base: BalanceOf<T>,
+ iters: u32,
+ income_acc: &mut BalanceOf<T>,
+ ) {
+ let income = Self::calculate_income(base, iters);
+
+ base.checked_add(&income).map(|res| {
+ <Staked<T>>::insert((staker, staked_block), (res, next_recalc_block));
+ *income_acc += income;
+ });
+ }
+
+ fn calculate_income<I>(base: I, iters: u32) -> I
+ where
+ I: EncodeLike<BalanceOf<T>> + Balance,
+ {
+ let mut income = base;
+
+ (0..iters).for_each(|_| income += T::IntervalIncome::get() * income);
+
+ income - base
+ }
+
+ fn get_current_recalc_block(current_relay_block: T::BlockNumber) -> T::BlockNumber {
+ (current_relay_block / T::RecalculationInterval::get()) * T::RecalculationInterval::get()
+ }
+
+ // fn get_next_recalc_block(current_relay_block: T::BlockNumber) -> T::BlockNumber {
+ // Self::get_current_recalc_block(current_relay_block) + T::RecalculationInterval::get()
+ // }
+
+ fn get_next_calculated_key() -> Option<Vec<u8>> {
+ Self::get_next_calculated_record().map(|key| Staked::<T>::hashed_key_for(key))
+ }
+}
+
+impl<T: Config> Pallet<T>
+where
+ <<T as Config>::Currency as Currency<T::AccountId>>::Balance: Sum,
+{
+ /// Since user funds are not transferred anywhere by staking, overflow protection is provided
+ /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow,
+ /// the staker must have more funds on his account than the maximum set for `Balance` type.
+ pub fn cross_id_pending_unstake(staker: Option<T::CrossAccountId>) -> BalanceOf<T> {
+ staker.map_or(
+ PendingUnstake::<T>::iter_values()
+ .flat_map(|pendings| pendings.into_iter().map(|(_, amount)| amount))
+ .sum(),
+ |s| {
+ PendingUnstake::<T>::iter_values()
+ .flatten()
+ .filter_map(|(id, amount)| {
+ if id == *s.as_sub() {
+ Some(amount)
+ } else {
+ None
+ }
+ })
+ .sum()
+ },
+ )
+ }
+
+ pub fn cross_id_pending_unstake_per_block(
+ staker: T::CrossAccountId,
+ ) -> Vec<(T::BlockNumber, BalanceOf<T>)> {
+ let mut unsorted_res = vec![];
+ PendingUnstake::<T>::iter().for_each(|(block, pendings)| {
+ pendings.into_iter().for_each(|(id, amount)| {
+ if id == *staker.as_sub() {
+ unsorted_res.push((block, amount));
+ };
+ })
+ });
+
+ unsorted_res.sort_by_key(|(block, _)| *block);
+ unsorted_res
+ }
+}
pallets/app-promotion/src/types.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/app-promotion/src/types.rs
@@ -0,0 +1,107 @@
+use codec::EncodeLike;
+use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult};
+
+use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances};
+use pallet_common::CollectionHandle;
+
+use sp_runtime::DispatchError;
+use up_data_structs::{CollectionId};
+use sp_std::borrow::ToOwned;
+use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig};
+
+pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {
+ fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>
+ where
+ KArg: EncodeLike<AccountId>;
+}
+
+impl<T: BalancesConfig<I>, I: 'static> ExtendedLockableCurrency<T::AccountId>
+ for PalletBalances<T, I>
+{
+ fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>
+ where
+ KArg: EncodeLike<T::AccountId>,
+ {
+ Self::locks(who)
+ }
+}
+
+pub trait CollectionHandler {
+ type CollectionId;
+ type AccountId;
+
+ fn set_sponsor(
+ sponsor_id: Self::AccountId,
+ collection_id: Self::CollectionId,
+ ) -> DispatchResult;
+
+ fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult;
+
+ fn sponsor(collection_id: Self::CollectionId)
+ -> Result<Option<Self::AccountId>, DispatchError>;
+}
+
+impl<T: pallet_unique::Config> CollectionHandler for pallet_unique::Pallet<T> {
+ type CollectionId = CollectionId;
+
+ type AccountId = T::AccountId;
+
+ fn set_sponsor(
+ sponsor_id: Self::AccountId,
+ collection_id: Self::CollectionId,
+ ) -> DispatchResult {
+ Self::force_set_sponsor(sponsor_id, collection_id)
+ }
+
+ fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult {
+ Self::force_remove_collection_sponsor(collection_id)
+ }
+
+ fn sponsor(
+ collection_id: Self::CollectionId,
+ ) -> Result<Option<Self::AccountId>, DispatchError> {
+ Ok(<CollectionHandle<T>>::try_get(collection_id)?
+ .sponsorship
+ .sponsor()
+ .map(|acc| acc.to_owned()))
+ }
+}
+
+pub trait ContractHandler {
+ type ContractId;
+ type AccountId;
+
+ fn set_sponsor(
+ sponsor_id: Self::AccountId,
+ contract_address: Self::ContractId,
+ ) -> DispatchResult;
+
+ fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult;
+
+ fn sponsor(
+ contract_address: Self::ContractId,
+ ) -> Result<Option<Self::AccountId>, DispatchError>;
+}
+
+impl<T: EvmHelpersConfig> ContractHandler for EvmHelpersPallet<T> {
+ type ContractId = sp_core::H160;
+
+ type AccountId = T::CrossAccountId;
+
+ fn set_sponsor(
+ sponsor_id: Self::AccountId,
+ contract_address: Self::ContractId,
+ ) -> DispatchResult {
+ Self::force_set_sponsor(contract_address, &sponsor_id)
+ }
+
+ fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult {
+ Self::force_remove_sponsor(contract_address)
+ }
+
+ fn sponsor(
+ contract_address: Self::ContractId,
+ ) -> Result<Option<Self::AccountId>, DispatchError> {
+ Ok(Self::get_sponsor(contract_address))
+ }
+}
pallets/app-promotion/src/weights.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/app-promotion/src/weights.rs
@@ -0,0 +1,209 @@
+// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
+
+//! Autogenerated weights for pallet_app_promotion
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2022-09-07, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
+
+// Executed Command:
+// target/release/unique-collator
+// benchmark
+// pallet
+// --pallet
+// pallet-app-promotion
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
+// --steps=50
+// --repeat=80
+// --heap-pages=4096
+// --output=./pallets/app-promotion/src/weights.rs
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+#![allow(clippy::unnecessary_cast)]
+
+use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use sp_std::marker::PhantomData;
+
+/// Weight functions needed for pallet_app_promotion.
+pub trait WeightInfo {
+ fn on_initialize(b: u32, ) -> Weight;
+ fn set_admin_address() -> Weight;
+ fn payout_stakers(b: u32, ) -> Weight;
+ fn stake() -> Weight;
+ fn unstake() -> Weight;
+ fn sponsor_collection() -> Weight;
+ fn stop_sponsoring_collection() -> Weight;
+ fn sponsor_contract() -> Weight;
+ fn stop_sponsoring_contract() -> Weight;
+}
+
+/// Weights for pallet_app_promotion using the Substrate node and recommended hardware.
+pub struct SubstrateWeight<T>(PhantomData<T>);
+impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
+ // Storage: AppPromotion PendingUnstake (r:1 w:0)
+ // Storage: System Account (r:1 w:1)
+ fn on_initialize(b: u32, ) -> Weight {
+ (2_651_000 as Weight)
+ // Standard Error: 103_000
+ .saturating_add((6_024_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))
+ }
+ // Storage: AppPromotion Admin (r:0 w:1)
+ fn set_admin_address() -> Weight {
+ (7_117_000 as Weight)
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: ParachainSystem ValidationData (r:1 w:0)
+ // Storage: AppPromotion NextCalculatedRecord (r:1 w:1)
+ // Storage: AppPromotion Staked (r:2 w:0)
+ fn payout_stakers(b: u32, ) -> Weight {
+ (9_958_000 as Weight)
+ // Standard Error: 8_000
+ .saturating_add((4_406_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(4 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion StakesPerAccount (r:1 w:1)
+ // Storage: System Account (r:1 w:1)
+ // Storage: Balances Locks (r:1 w:1)
+ // Storage: ParachainSystem ValidationData (r:1 w:0)
+ // Storage: AppPromotion Staked (r:1 w:1)
+ // Storage: AppPromotion TotalStaked (r:1 w:1)
+ fn stake() -> Weight {
+ (20_574_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ }
+ // Storage: AppPromotion PendingUnstake (r:1 w:1)
+ // Storage: AppPromotion Staked (r:2 w:1)
+ // Storage: Balances Locks (r:1 w:1)
+ // Storage: System Account (r:1 w:1)
+ // Storage: AppPromotion TotalStaked (r:1 w:1)
+ // Storage: AppPromotion StakesPerAccount (r:0 w:1)
+ fn unstake() -> Weight {
+ (31_703_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(6 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: Common CollectionById (r:1 w:1)
+ fn sponsor_collection() -> Weight {
+ (12_932_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: Common CollectionById (r:1 w:1)
+ fn stop_sponsoring_collection() -> Weight {
+ (12_453_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: EvmContractHelpers Sponsoring (r:0 w:1)
+ fn sponsor_contract() -> Weight {
+ (11_952_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: EvmContractHelpers Sponsoring (r:1 w:1)
+ fn stop_sponsoring_contract() -> Weight {
+ (12_538_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+}
+
+// For backwards compatibility and tests
+impl WeightInfo for () {
+ // Storage: AppPromotion PendingUnstake (r:1 w:0)
+ // Storage: System Account (r:1 w:1)
+ fn on_initialize(b: u32, ) -> Weight {
+ (2_651_000 as Weight)
+ // Standard Error: 103_000
+ .saturating_add((6_024_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(1 as Weight))
+ .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))
+ }
+ // Storage: AppPromotion Admin (r:0 w:1)
+ fn set_admin_address() -> Weight {
+ (7_117_000 as Weight)
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: ParachainSystem ValidationData (r:1 w:0)
+ // Storage: AppPromotion NextCalculatedRecord (r:1 w:1)
+ // Storage: AppPromotion Staked (r:2 w:0)
+ fn payout_stakers(b: u32, ) -> Weight {
+ (9_958_000 as Weight)
+ // Standard Error: 8_000
+ .saturating_add((4_406_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(4 as Weight))
+ .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion StakesPerAccount (r:1 w:1)
+ // Storage: System Account (r:1 w:1)
+ // Storage: Balances Locks (r:1 w:1)
+ // Storage: ParachainSystem ValidationData (r:1 w:0)
+ // Storage: AppPromotion Staked (r:1 w:1)
+ // Storage: AppPromotion TotalStaked (r:1 w:1)
+ fn stake() -> Weight {
+ (20_574_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(6 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(5 as Weight))
+ }
+ // Storage: AppPromotion PendingUnstake (r:1 w:1)
+ // Storage: AppPromotion Staked (r:2 w:1)
+ // Storage: Balances Locks (r:1 w:1)
+ // Storage: System Account (r:1 w:1)
+ // Storage: AppPromotion TotalStaked (r:1 w:1)
+ // Storage: AppPromotion StakesPerAccount (r:0 w:1)
+ fn unstake() -> Weight {
+ (31_703_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(6 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(6 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: Common CollectionById (r:1 w:1)
+ fn sponsor_collection() -> Weight {
+ (12_932_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: Common CollectionById (r:1 w:1)
+ fn stop_sponsoring_collection() -> Weight {
+ (12_453_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: EvmContractHelpers Sponsoring (r:0 w:1)
+ fn sponsor_contract() -> Weight {
+ (11_952_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(1 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+ // Storage: AppPromotion Admin (r:1 w:0)
+ // Storage: EvmContractHelpers Sponsoring (r:1 w:1)
+ fn stop_sponsoring_contract() -> Weight {
+ (12_538_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+}
pallets/common/Cargo.tomldiffbeforeafterboth--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -40,4 +40,7 @@
"up-data-structs/std",
"pallet-evm/std",
]
-runtime-benchmarks = ["frame-benchmarking"]
+runtime-benchmarks = [
+ "frame-benchmarking/runtime-benchmarks",
+ "up-data-structs/runtime-benchmarks",
+]
pallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -9,6 +9,7 @@
"derive",
] }
log = { default-features = false, version = "0.4.14" }
+ethereum = { version = "0.12.0", default-features = false }
# Substrate
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -17,7 +17,9 @@
//! Implementation of magic contract
use core::marker::PhantomData;
-use evm_coder::{abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*};
+use evm_coder::{
+ abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*, ToLog,
+};
use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm};
use pallet_evm::{
ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,
@@ -33,6 +35,35 @@
use up_sponsorship::SponsorshipHandler;
use sp_std::vec::Vec;
+/// Pallet events.
+#[derive(ToLog)]
+pub enum ContractHelpersEvents {
+ /// Contract sponsor was set.
+ ContractSponsorSet {
+ /// Contract address of the affected collection.
+ #[indexed]
+ contract_address: address,
+ /// New sponsor address.
+ sponsor: address,
+ },
+
+ /// New sponsor was confirm.
+ ContractSponsorshipConfirmed {
+ /// Contract address of the affected collection.
+ #[indexed]
+ contract_address: address,
+ /// New sponsor address.
+ sponsor: address,
+ },
+
+ /// Collection sponsor was removed.
+ ContractSponsorRemoved {
+ /// Contract address of the affected collection.
+ #[indexed]
+ contract_address: address,
+ },
+}
+
/// See [`ContractHelpersCall`]
pub struct ContractHelpers<T: Config>(SubstrateRecorder<T>);
impl<T: Config> WithRecorder<T> for ContractHelpers<T> {
@@ -46,7 +77,7 @@
}
/// @title Magic contract, which allows users to reconfigure other contracts
-#[solidity_interface(name = ContractHelpers)]
+#[solidity_interface(name = ContractHelpers, events(ContractHelpersEvents))]
impl<T: Config> ContractHelpers<T>
where
T::AccountId: AsRef<[u8; 32]>,
@@ -91,9 +122,17 @@
self.recorder().consume_sload()?;
self.recorder().consume_sstore()?;
- Pallet::<T>::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address)
+ let caller = T::CrossAccountId::from_eth(caller);
+
+ Pallet::<T>::ensure_owner(contract_address, *caller.as_eth())
.map_err(dispatch_to_evm::<T>)?;
+ Pallet::<T>::force_set_sponsor(
+ contract_address,
+ &T::CrossAccountId::from_eth(contract_address),
+ )
+ .map_err(dispatch_to_evm::<T>)?;
+
Ok(())
}
pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -16,7 +16,7 @@
#![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)]
-#![deny(missing_docs)]
+#![warn(missing_docs)]
use codec::{Decode, Encode, MaxEncodedLen};
pub use pallet::*;
@@ -27,18 +27,24 @@
#[frame_support::pallet]
pub mod pallet {
pub use super::*;
+ use crate::eth::ContractHelpersEvents;
use frame_support::pallet_prelude::*;
use pallet_evm_coder_substrate::DispatchResult;
use sp_core::H160;
- use pallet_evm::account::CrossAccountId;
+ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};
use up_data_structs::SponsorshipState;
+ use evm_coder::ToLog;
#[pallet::config]
pub trait Config:
frame_system::Config + pallet_evm_coder_substrate::Config + pallet_evm::account::Config
{
+ /// Overarching event type.
+ type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;
+
/// Address, under which magic contract will be available
type ContractAddress: Get<H160>;
+
/// In case of enabled sponsoring, but no sponsoring rate limit set,
/// this value will be used implicitly
type DefaultSponsoringRateLimit: Get<Self::BlockNumber>;
@@ -150,6 +156,32 @@
QueryKind = ValueQuery,
>;
+ #[pallet::event]
+ #[pallet::generate_deposit(pub fn deposit_event)]
+ pub enum Event<T: Config> {
+ /// Contract sponsor was set.
+ ContractSponsorSet(
+ /// Contract address of the affected collection.
+ H160,
+ /// New sponsor address.
+ T::AccountId,
+ ),
+
+ /// New sponsor was confirm.
+ ContractSponsorshipConfirmed(
+ /// Contract address of the affected collection.
+ H160,
+ /// New sponsor address.
+ T::AccountId,
+ ),
+
+ /// Collection sponsor was removed.
+ ContractSponsorRemoved(
+ /// Contract address of the affected collection.
+ H160,
+ ),
+ }
+
impl<T: Config> Pallet<T> {
/// Get contract owner.
pub fn contract_owner(contract: H160) -> H160 {
@@ -169,43 +201,118 @@
contract,
SponsorshipState::<T::CrossAccountId>::Unconfirmed(sponsor.clone()),
);
+
+ <Pallet<T>>::deposit_event(Event::<T>::ContractSponsorSet(
+ contract,
+ sponsor.as_sub().clone(),
+ ));
+ <PalletEvm<T>>::deposit_log(
+ ContractHelpersEvents::ContractSponsorSet {
+ contract_address: contract,
+ sponsor: *sponsor.as_eth(),
+ }
+ .to_log(contract),
+ );
Ok(())
}
- /// Set `contract` as self sponsored.
+ /// TO-DO
///
- /// `sender` must be owner of contract.
- pub fn self_sponsored_enable(sender: &T::CrossAccountId, contract: H160) -> DispatchResult {
- Pallet::<T>::ensure_owner(contract, *sender.as_eth())?;
+ ///
+ pub fn force_set_sponsor(
+ contract_address: H160,
+ sponsor: &T::CrossAccountId,
+ ) -> DispatchResult {
Sponsoring::<T>::insert(
- contract,
- SponsorshipState::<T::CrossAccountId>::Confirmed(T::CrossAccountId::from_eth(
- contract,
- )),
+ contract_address,
+ SponsorshipState::<T::CrossAccountId>::Confirmed(sponsor.clone()),
);
+
+ let eth_sponsor = *sponsor.as_eth();
+ let sub_sponsor = sponsor.as_sub().clone();
+
+ <Pallet<T>>::deposit_event(Event::<T>::ContractSponsorSet(
+ contract_address,
+ sub_sponsor.clone(),
+ ));
+ <PalletEvm<T>>::deposit_log(
+ ContractHelpersEvents::ContractSponsorSet {
+ contract_address,
+ sponsor: eth_sponsor,
+ }
+ .to_log(contract_address),
+ );
+
+ <Pallet<T>>::deposit_event(Event::<T>::ContractSponsorshipConfirmed(
+ contract_address,
+ sub_sponsor,
+ ));
+ <PalletEvm<T>>::deposit_log(
+ ContractHelpersEvents::ContractSponsorshipConfirmed {
+ contract_address,
+ sponsor: eth_sponsor,
+ }
+ .to_log(contract_address),
+ );
+
Ok(())
}
/// Remove sponsor for `contract`.
///
/// `sender` must be owner of contract.
- pub fn remove_sponsor(sender: &T::CrossAccountId, contract: H160) -> DispatchResult {
- Pallet::<T>::ensure_owner(contract, *sender.as_eth())?;
- Sponsoring::<T>::remove(contract);
+ pub fn remove_sponsor(
+ sender: &T::CrossAccountId,
+ contract_address: H160,
+ ) -> DispatchResult {
+ Self::ensure_owner(contract_address, *sender.as_eth())?;
+ Self::force_remove_sponsor(contract_address)
+ }
+
+ /// TO-DO
+ ///
+ ///
+ pub fn force_remove_sponsor(contract_address: H160) -> DispatchResult {
+ Sponsoring::<T>::remove(contract_address);
+
+ Self::deposit_event(Event::<T>::ContractSponsorRemoved(contract_address));
+ <PalletEvm<T>>::deposit_log(
+ ContractHelpersEvents::ContractSponsorRemoved { contract_address }
+ .to_log(contract_address),
+ );
+
Ok(())
}
/// Confirm sponsorship.
///
/// `sender` must be same that set via [`set_sponsor`].
- pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract: H160) -> DispatchResult {
- match Sponsoring::<T>::get(contract) {
+ pub fn confirm_sponsorship(
+ sender: &T::CrossAccountId,
+ contract_address: H160,
+ ) -> DispatchResult {
+ match Sponsoring::<T>::get(contract_address) {
SponsorshipState::Unconfirmed(sponsor) => {
ensure!(sponsor == *sender, Error::<T>::NoPermission);
+ let eth_sponsor = *sponsor.as_eth();
+ let sub_sponsor = sponsor.as_sub().clone();
Sponsoring::<T>::insert(
- contract,
+ contract_address,
SponsorshipState::<T::CrossAccountId>::Confirmed(sponsor),
);
+
+ <Pallet<T>>::deposit_event(Event::<T>::ContractSponsorshipConfirmed(
+ contract_address,
+ sub_sponsor,
+ ));
+ <PalletEvm<T>>::deposit_log(
+ ContractHelpersEvents::ContractSponsorshipConfirmed {
+ contract_address,
+ sponsor: eth_sponsor,
+ }
+ .to_log(contract_address),
+ );
+
Ok(())
}
SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => {
pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -21,9 +21,19 @@
}
}
+/// @dev inlined interface
+contract ContractHelpersEvents {
+ event ContractSponsorSet(address indexed contractAddress, address sponsor);
+ event ContractSponsorshipConfirmed(
+ address indexed contractAddress,
+ address sponsor
+ );
+ event ContractSponsorRemoved(address indexed contractAddress);
+}
+
/// @title Magic contract, which allows users to reconfigure other contracts
/// @dev the ERC-165 identifier for this interface is 0xd77fab70
-contract ContractHelpers is Dummy, ERC165 {
+contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
/// using uniquenetwork evm-migration pallet, or using other terms not
pallets/unique/CHANGELOG.mddiffbeforeafterboth--- a/pallets/unique/CHANGELOG.md
+++ b/pallets/unique/CHANGELOG.md
@@ -3,22 +3,29 @@
All notable changes to this project will be documented in this file.
<!-- bureaucrate goes here -->
+
+## [v0.1.4] 2022-09-5
+
+### Added
+
+- Methods `force_set_sponsor` , `force_remove_collection_sponsor` to be able to administer sponsorships with other pallets. Added to implement `AppPromotion` pallet logic.
+
## [v0.1.3] 2022-08-16
### Other changes
-- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
+- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
-- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
+- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
-- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31
+- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31
Every extrinsic now runs in transaction implicitly, and
`#[transactional]` on pallet dispatchable is now meaningless
Upstream-Change: https://github.com/paritytech/substrate/issues/10806
-- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975
+- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975
New methods allows to call `remove_prefix` with limit multiple times
in the same block
@@ -27,10 +34,12 @@
Upstream-Change: https://github.com/paritytech/substrate/pull/11490
-- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
+- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
## [v0.1.1] - 2022-07-25
+
### Added
-- Method for creating `ERC721Metadata` compatible NFT collection.
-- Method for creating `ERC721Metadata` compatible ReFungible collection.
-- Method for creating ReFungible collection.
+
+- Method for creating `ERC721Metadata` compatible NFT collection.
+- Method for creating `ERC721Metadata` compatible ReFungible collection.
+- Method for creating ReFungible collection.
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -9,7 +9,7 @@
license = 'GPLv3'
name = 'pallet-unique'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = "0.1.3"
+version = "0.1.4"
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
pallets/unique/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/unique/src/benchmarking.rs
+++ b/pallets/unique/src/benchmarking.rs
@@ -46,7 +46,9 @@
)?;
Ok(<pallet_common::CreatedCollectionCount<T>>::get())
}
-fn create_nft_collection<T: Config>(owner: T::AccountId) -> Result<CollectionId, DispatchError> {
+pub fn create_nft_collection<T: Config>(
+ owner: T::AccountId,
+) -> Result<CollectionId, DispatchError> {
create_collection_helper::<T>(owner, CollectionMode::NFT)
}
pallets/unique/src/lib.rsdiffbeforeafterboth--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -98,7 +98,7 @@
pub mod eth;
#[cfg(feature = "runtime-benchmarks")]
-mod benchmarking;
+pub mod benchmarking;
pub mod weights;
use weights::WeightInfo;
@@ -277,7 +277,7 @@
{
type Error = Error<T>;
- fn deposit_event() = default;
+ pub fn deposit_event() = default;
fn on_initialize(_now: T::BlockNumber) -> Weight {
0
@@ -1103,3 +1103,35 @@
}
}
}
+
+impl<T: Config> Pallet<T> {
+ pub fn force_set_sponsor(sponsor: T::AccountId, collection_id: CollectionId) -> DispatchResult {
+ let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
+ target_collection.check_is_internal()?;
+ target_collection.set_sponsor(sponsor.clone())?;
+
+ Self::deposit_event(Event::<T>::CollectionSponsorSet(
+ collection_id,
+ sponsor.clone(),
+ ));
+
+ ensure!(
+ target_collection.confirm_sponsorship(&sponsor)?,
+ Error::<T>::ConfirmUnsetSponsorFail
+ );
+
+ Self::deposit_event(Event::<T>::SponsorshipConfirmed(collection_id, sponsor));
+
+ target_collection.save()
+ }
+
+ pub fn force_remove_collection_sponsor(collection_id: CollectionId) -> DispatchResult {
+ let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
+ target_collection.check_is_internal()?;
+ target_collection.sponsorship = SponsorshipState::Disabled;
+
+ Self::deposit_event(Event::<T>::CollectionSponsorRemoved(collection_id));
+
+ target_collection.save()
+ }
+}
primitives/app_promotion_rpc/CHANGELOG.mddiffbeforeafterboth--- /dev/null
+++ b/primitives/app_promotion_rpc/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+
+<!-- bureaucrate goes here -->
primitives/app_promotion_rpc/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/primitives/app_promotion_rpc/Cargo.toml
@@ -0,0 +1,29 @@
+[package]
+name = "app-promotion-rpc"
+version = "0.1.0"
+license = "GPLv3"
+edition = "2021"
+
+[dependencies]
+pallet-common = { default-features = false, path = '../../pallets/common' }
+up-data-structs = { default-features = false, path = '../data-structs' }
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
+ "derive",
+] }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
+
+[features]
+default = ["std"]
+std = [
+ "codec/std",
+ "sp-core/std",
+ "sp-std/std",
+ "sp-api/std",
+ "sp-runtime/std",
+ "pallet-common/std",
+ "up-data-structs/std",
+]
primitives/app_promotion_rpc/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/primitives/app_promotion_rpc/src/lib.rs
@@ -0,0 +1,41 @@
+// 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/>.
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+use sp_std::vec::Vec;
+use codec::Decode;
+use sp_runtime::{
+ DispatchError,
+ traits::{AtLeast32BitUnsigned, Member},
+};
+
+type Result<T> = core::result::Result<T, DispatchError>;
+
+sp_api::decl_runtime_apis! {
+ #[api_version(2)]
+ /// Trait for generate rpc.
+ pub trait AppPromotionApi<BlockNumber ,CrossAccountId, AccountId> where
+ BlockNumber: Decode + Member + AtLeast32BitUnsigned,
+ AccountId: Decode,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
+ {
+ fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;
+ fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;
+ fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;
+ }
+}
primitives/common/src/constants.rsdiffbeforeafterboth--- a/primitives/common/src/constants.rs
+++ b/primitives/common/src/constants.rs
@@ -22,6 +22,7 @@
use crate::types::{BlockNumber, Balance};
pub const MILLISECS_PER_BLOCK: u64 = 12000;
+pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
@@ -30,6 +31,11 @@
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;
+// These time units are defined in number of relay blocks.
+pub const RELAY_MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_RELAY_BLOCK as BlockNumber);
+pub const RELAY_HOURS: BlockNumber = RELAY_MINUTES * 60;
+pub const RELAY_DAYS: BlockNumber = RELAY_HOURS * 24;
+
pub const MICROUNIQUE: Balance = 1_000_000_000_000;
pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;
pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -20,9 +20,13 @@
CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property,
PropertyKeyPermission, TokenData, TokenChild,
};
+
use sp_std::vec::Vec;
use codec::Decode;
-use sp_runtime::DispatchError;
+use sp_runtime::{
+ DispatchError,
+ traits::{AtLeast32BitUnsigned, Member},
+};
type Result<T> = core::result::Result<T, DispatchError>;
@@ -120,6 +124,7 @@
/// Get total pieces of token.
fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result<Option<u128>>;
+
fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec<CrossAccountId>>;
}
}
runtime/common/config/ethereum.rsdiffbeforeafterboth--- a/runtime/common/config/ethereum.rs
+++ b/runtime/common/config/ethereum.rs
@@ -112,6 +112,7 @@
}
impl pallet_evm_contract_helpers::Config for Runtime {
+ type Event = Event;
type ContractAddress = HelpersContractAddress;
type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
}
runtime/common/config/pallets/app_promotion.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/pallets/app_promotion.rs
@@ -0,0 +1,63 @@
+// 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, BlockNumber, Unique, Event, EvmContractHelpers,
+};
+
+use frame_support::{parameter_types, PalletId};
+use sp_arithmetic::Perbill;
+use up_common::{
+ constants::{UNIQUE, RELAY_DAYS},
+ types::Balance,
+};
+
+#[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))]
+parameter_types! {
+ pub const AppPromotionId: PalletId = PalletId(*b"appstake");
+ pub const RecalculationInterval: BlockNumber = 20;
+ pub const PendingInterval: BlockNumber = 10;
+ pub const Nominal: Balance = UNIQUE;
+ // pub const Day: BlockNumber = DAYS;
+ pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), RELAY_DAYS) * Perbill::from_rational(5u32, 10_000);
+}
+
+#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))]
+parameter_types! {
+ pub const AppPromotionId: PalletId = PalletId(*b"appstake");
+ pub const RecalculationInterval: BlockNumber = RELAY_DAYS;
+ pub const PendingInterval: BlockNumber = 7 * RELAY_DAYS;
+ pub const Nominal: Balance = UNIQUE;
+ // pub const Day: BlockNumber = RELAY_DAYS;
+ pub IntervalIncome: Perbill = Perbill::from_rational(5u32, 10_000);
+}
+
+impl pallet_app_promotion::Config for Runtime {
+ type PalletId = AppPromotionId;
+ type CollectionHandler = Unique;
+ type ContractHandler = EvmContractHelpers;
+ type Currency = Balances;
+ type WeightInfo = pallet_app_promotion::weights::SubstrateWeight<Self>;
+ type TreasuryAccountId = TreasuryAccountId;
+ type RelayBlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
+ type RecalculationInterval = RecalculationInterval;
+ type PendingInterval = PendingInterval;
+ // type Day = Day;
+ type Nominal = Nominal;
+ type IntervalIncome = IntervalIncome;
+ type Event = Event;
+}
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,12 +77,15 @@
#[runtimes(opal)]
RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
+ #[runtimes(opal)]
+ AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
+
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
- EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
+ EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage, Event<T>} = 151,
EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
}
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -189,6 +189,40 @@
}
}
+ impl app_promotion_rpc::AppPromotionApi<Block, BlockNumber, CrossAccountId, AccountId> for Runtime {
+ fn total_staked(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked(staker).unwrap_or_default());
+ }
+
+ fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked_per_block(staker));
+ }
+
+ fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake(staker));
+ }
+
+ fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>, DispatchError> {
+ #[cfg(not(feature = "app-promotion"))]
+ return unsupported!();
+
+ #[cfg(feature = "app-promotion")]
+ return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_pending_unstake_per_block(staker))
+ }
+ }
+
impl rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -638,6 +672,7 @@
list_benchmark!(list, extra, pallet_unique, Unique);
list_benchmark!(list, extra, pallet_structure, Structure);
list_benchmark!(list, extra, pallet_inflation, Inflation);
+ list_benchmark!(list, extra, pallet_app_promotion, AppPromotion);
list_benchmark!(list, extra, pallet_fungible, Fungible);
list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);
@@ -693,6 +728,7 @@
add_benchmark!(params, batches, pallet_unique, Unique);
add_benchmark!(params, batches, pallet_structure, Structure);
add_benchmark!(params, batches, pallet_inflation, Inflation);
+ add_benchmark!(params, batches, pallet_app_promotion, AppPromotion);
add_benchmark!(params, batches, pallet_fungible, Fungible);
add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -37,6 +37,7 @@
'pallet-proxy-rmrk-equip/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
+ 'pallet-app-promotion/runtime-benchmarks',
'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
@@ -82,12 +83,14 @@
'pallet-base-fee/std',
'fp-rpc/std',
'up-rpc/std',
+ 'app-promotion-rpc/std',
'fp-evm-mapping/std',
'fp-self-contained/std',
'parachain-info/std',
'serde',
'pallet-inflation/std',
'pallet-configuration/std',
+ 'pallet-app-promotion/std',
'pallet-common/std',
'pallet-structure/std',
'pallet-fungible/std',
@@ -122,11 +125,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
@@ -411,9 +415,11 @@
derivative = "2.2.0"
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
+pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-common = { default-features = false, path = "../../pallets/common" }
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -82,6 +82,7 @@
'pallet-base-fee/std',
'fp-rpc/std',
'up-rpc/std',
+ 'app-promotion-rpc/std',
'fp-evm-mapping/std',
'fp-self-contained/std',
'parachain-info/std',
@@ -416,8 +417,10 @@
derivative = "2.2.0"
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
+pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-common = { default-features = false, path = "../../pallets/common" }
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -83,6 +83,7 @@
'pallet-base-fee/std',
'fp-rpc/std',
'up-rpc/std',
+ 'app-promotion-rpc/std',
'fp-evm-mapping/std',
'fp-self-contained/std',
'parachain-info/std',
@@ -409,8 +410,10 @@
derivative = "2.2.0"
pallet-unique = { path = '../../pallets/unique', default-features = false }
up-rpc = { path = "../../primitives/rpc", default-features = false }
+app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false}
rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
pallet-inflation = { path = '../../pallets/inflation', default-features = false }
+pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }
up-data-structs = { path = '../../primitives/data-structs', default-features = false }
pallet-configuration = { default-features = false, path = "../../pallets/configuration" }
pallet-common = { default-features = false, path = "../../pallets/common" }
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -30,6 +30,7 @@
"testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'",
"testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'",
"testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'",
+ "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'",
"load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'",
"loadTransfer": "ts-node src/transfer.nload.ts",
"testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",
@@ -64,6 +65,7 @@
"testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",
"testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts",
"testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",
+ "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts",
"testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",
"testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts",
"testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts",
@@ -71,7 +73,6 @@
"testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts",
"testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts",
"testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts",
- "testSetVariableMetadataSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetadataSponsoringRateLimit.test.ts",
"testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts",
"testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts",
"testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts",
@@ -80,10 +81,12 @@
"testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",
"testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
"testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",
- "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts",
+ "testEthCreateNFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createNFTCollection.test.ts",
+ "testEthCreateRFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createRFTCollection.test.ts",
"testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts",
"testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts",
"testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts",
+ "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts",
"polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json",
"polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",
"polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .",
tests/src/app-promotion.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/app-promotion.test.ts
@@ -0,0 +1,800 @@
+// 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/>.
+
+import {IKeyringPair} from '@polkadot/types/types';
+import {
+ normalizeAccountId,
+ getModuleNames,
+ Pallets,
+} from './util/helpers';
+
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import {usingPlaygrounds} from './util/playgrounds';
+
+import {encodeAddress} from '@polkadot/util-crypto';
+import {stringToU8a} from '@polkadot/util';
+import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers';
+import {DevUniqueHelper} from './util/playgrounds/unique.dev';
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+let alice: IKeyringPair;
+let palletAdmin: IKeyringPair;
+let nominal: bigint;
+const palletAddress = calculatePalleteAddress('appstake');
+let accounts: IKeyringPair[] = [];
+const LOCKING_PERIOD = 20n; // 20 blocks of relay
+const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain
+const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n);
+
+const beforeEach = async (context: Mocha.Context) => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) context.skip();
+ alice = privateKey('//Alice');
+ palletAdmin = privateKey('//Charlie'); // TODO use custom address
+ await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));
+ nominal = helper.balance.getOneTokenNominal();
+ await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
+ await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
+ accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
+ });
+};
+
+describe('app-promotions.stake extrinsic', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
+ const totalStakedBefore = await helper.staking.getTotalStaked();
+
+ // Minimum stake amount is 100:
+ await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected;
+ await helper.staking.stake(staker, 100n * nominal);
+
+ // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n...
+ // ...so he can not transfer 900
+ expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n});
+ await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected;
+
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal);
+ expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
+ // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo?
+ expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased
+
+
+ await helper.staking.stake(staker, 200n * nominal);
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal);
+ expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]);
+ });
+ });
+
+ it('should allow to create maximum 10 stakes for account', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [staker] = await helper.arrange.createAccounts([2000n], alice);
+ for (let i = 0; i < 10; i++) {
+ await helper.staking.stake(staker, 100n * nominal);
+ }
+
+ // can have 10 stakes
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal);
+ expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10);
+
+ await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected;
+
+ // After unstake can stake again
+ await helper.staking.unstake(staker);
+ await helper.staking.stake(staker, 100n * nominal);
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal);
+ });
+ });
+
+ it('should reject transaction if stake amount is more than total free balance minus frozen', async () => {
+ await usingPlaygrounds(async helper => {
+ const staker = accounts.pop()!;
+
+ // Can't stake full balance because Alice needs to pay some fee
+ await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected;
+ await helper.staking.stake(staker, 500n * nominal);
+
+ // Can't stake 500 tkn because Alice has Less than 500 transferable;
+ await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected;
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal);
+ });
+ });
+
+ it('for different accounts in one block is possible', async () => {
+ await usingPlaygrounds(async helper => {
+ const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!];
+
+ const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal));
+ await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled;
+
+ const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address})));
+ expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]);
+ });
+ });
+});
+
+describe('unstake balance extrinsic', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ it('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => {
+ await usingPlaygrounds(async helper => {
+ const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
+ const totalStakedBefore = await helper.staking.getTotalStaked();
+ await helper.staking.stake(staker, 900n * nominal);
+ await helper.staking.unstake(staker);
+
+ // Right after unstake balance is reserved
+ // Staker can not transfer
+ expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n});
+ await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected;
+ expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal);
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
+ expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore);
+ });
+ });
+
+ it('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const staker = accounts.pop()!;
+ await helper.staking.stake(staker, 100n * nominal);
+ await helper.staking.unstake(staker);
+ const unstakedInBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0];
+
+ // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n
+ await helper.wait.forParachainBlockNumber(unstakedInBlock);
+ expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n});
+ expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
+
+ // staker can transfer:
+ await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal);
+ expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n);
+ });
+ });
+
+ it('should successfully unstake multiple stakes', async () => {
+ await usingPlaygrounds(async helper => {
+ const staker = accounts.pop()!;
+ await helper.staking.stake(staker, 100n * nominal);
+ await helper.staking.stake(staker, 200n * nominal);
+ await helper.staking.stake(staker, 300n * nominal);
+
+ // staked: [100, 200, 300]; unstaked: 0
+ let pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
+ let unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]);
+ let stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]);
+ expect(pendingUnstake).to.be.deep.equal(0n);
+ expect(unstakedPerBlock).to.be.deep.equal([]);
+ expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal, 300n * nominal]);
+
+ // Can unstake multiple stakes
+ await helper.staking.unstake(staker);
+ const unstakingBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0];
+ pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
+ unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]);
+ stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]);
+ expect(pendingUnstake).to.be.equal(600n * nominal);
+ expect(stakedPerBlock).to.be.deep.equal([]);
+ expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]);
+
+ expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n});
+ await helper.wait.forParachainBlockNumber(unstakingBlock);
+ expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n});
+ expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
+ });
+ });
+
+ it('should not have any effects if no active stakes', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const staker = accounts.pop()!;
+
+ // unstake has no effect if no stakes at all
+ await helper.staking.unstake(staker);
+ expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n);
+ expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper
+
+ // TODO stake() unstake() waitUnstaked() unstake();
+
+ // can't unstake if there are only pendingUnstakes
+ await helper.staking.stake(staker, 100n * nominal);
+ await helper.staking.unstake(staker);
+ await helper.staking.unstake(staker);
+
+ expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
+ });
+ });
+
+ it('should keep different unlocking block for each unlocking stake', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const staker = accounts.pop()!;
+ await helper.staking.stake(staker, 100n * nominal);
+ await helper.staking.unstake(staker);
+ await helper.staking.stake(staker, 120n * nominal);
+ await helper.staking.unstake(staker);
+
+ const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+ expect(unstakingPerBlock).has.length(2);
+ expect(unstakingPerBlock[0][1]).to.equal(100n * nominal);
+ expect(unstakingPerBlock[1][1]).to.equal(120n * nominal);
+ });
+ });
+
+ it('should be possible for different accounts in one block', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
+
+ await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
+ await Promise.all(stakers.map(staker => helper.staking.unstake(staker)));
+
+ await Promise.all(stakers.map(async (staker) => {
+ expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
+ expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
+ }));
+ });
+ });
+});
+
+describe('Admin adress', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ it('can be set by sudo only', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const nonAdmin = accounts.pop()!;
+ // nonAdmin can not set admin not from himself nor as a sudo
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected;
+
+ // Alice can
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
+ });
+ });
+
+ it('can be any valid CrossAccountId', async () => {
+ // We are not going to set an eth address as a sponsor,
+ // but we do want to check, it doesn't break anything;
+ await usingPlaygrounds(async (helper) => {
+ const account = accounts.pop()!;
+ const ethAccount = helper.address.substrateToEth(account.address);
+ // Alice sets Ethereum address as a sudo. Then Substrate address back...
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
+
+ // ...It doesn't break anything;
+ const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+ await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ });
+ });
+
+ it('can be reassigned', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
+ });
+ });
+});
+
+describe('App-promotion collection sponsoring', () => {
+ before(async function () {
+ await beforeEach(this);
+ await usingPlaygrounds(async (helper) => {
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}));
+ await helper.signTransaction(alice, tx);
+ });
+ });
+
+ it('should actually sponsor transactions', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}});
+ const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address});
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
+ const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
+
+ await token.transfer(tokenSender, {Substrate: receiver.address});
+ expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address});
+ const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
+
+ // senders balance the same, transaction has sponsored
+ expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal);
+ expect (palletBalanceBefore > palletBalanceAfter).to.be.true;
+ });
+ });
+
+ it('can not be set by non admin', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
+
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled');
+ });
+ });
+
+ it('should set pallet address as confirmed admin', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!];
+
+ // Can set sponsoring for collection without sponsor
+ const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'});
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled;
+ expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
+
+ // Can set sponsoring for collection with unconfirmed sponsor
+ const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
+ expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
+
+ // Can set sponsoring for collection with confirmed sponsor
+ const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
+ await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
+ });
+ });
+
+ it('can be overwritten by collection owner', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!];
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+ const collectionId = collection.collectionId;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled;
+
+ // Collection limits still can be changed by the owner
+ expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true;
+ expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0);
+ expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
+
+ // Collection sponsor can be changed too
+ expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true;
+ expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address});
+ });
+ });
+
+ it('should not overwrite collection limits set by the owner earlier', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0};
+ const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits});
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled;
+ expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits);
+ });
+ });
+
+ it('should reject transaction if collection doesn\'t exist', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const collectionOwner = accounts.pop()!;
+
+ // collection has never existed
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected;
+ // collection has been burned
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+ await collection.burn(collectionOwner);
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ });
+ });
+});
+
+describe('app-promotion stopSponsoringCollection', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ it('can not be called by non-admin', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
+
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+ expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
+ });
+ });
+
+ it('should set sponsoring as disabled', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!];
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}});
+ const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address});
+
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId));
+
+ expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled');
+
+ // Transactions are not sponsored anymore:
+ const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address);
+ await token.transfer(collectionOwner, {Substrate: recepient.address});
+ const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address);
+ expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true);
+ });
+ });
+
+ it('should not affect collection which is not sponsored by pallete', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const collectionOwner = accounts.pop()!;
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});
+ await collection.confirmSponsorship(collectionOwner);
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address});
+ });
+ });
+
+ it('should reject transaction if collection does not exist', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const collectionOwner = accounts.pop()!;
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
+
+ await collection.burn(collectionOwner);
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected;
+ });
+ });
+});
+
+describe('app-promotion contract sponsoring', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ itWeb3('should set palletes address as a sponsor', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ const contractMethods = contractHelpers(web3, contractOwner);
+
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ confirmed: {
+ substrate: palletAddress,
+ },
+ });
+ });
+ });
+
+ itWeb3('should overwrite sponsoring mode and existed sponsor', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ const contractMethods = contractHelpers(web3, contractOwner);
+
+ await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
+
+ // Contract is self sponsored
+ expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({
+ confirmed: {
+ ethereum: flipper.options.address.toLowerCase(),
+ },
+ });
+
+ // set promotion sponsoring
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ // new sponsor is pallet address
+ expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ confirmed: {
+ substrate: palletAddress,
+ },
+ });
+ });
+ });
+
+ itWeb3('can be overwritten by contract owner', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ const contractMethods = contractHelpers(web3, contractOwner);
+
+ // contract sponsored by pallet
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ // owner sets self sponsoring
+ await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
+
+ expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ confirmed: {
+ ethereum: flipper.options.address.toLowerCase(),
+ },
+ });
+ });
+ });
+
+ itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const nonAdmin = accounts.pop()!;
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ const contractMethods = contractHelpers(web3, contractOwner);
+
+ await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
+
+ // nonAdmin calls sponsorContract
+ await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address))).to.be.rejected;
+
+ // contract still self-sponsored
+ expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ confirmed: {
+ ethereum: flipper.options.address.toLowerCase(),
+ },
+ });
+ });
+
+ itWeb3('should be rejected for non-contract address', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+
+ });
+ });
+ });
+
+ itWeb3('should actually sponsor transactions', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ const contractHelper = contractHelpers(web3, contractOwner);
+ await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner});
+ await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
+ await transferBalanceToEth(api, alice, flipper.options.address, 1000n);
+
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+ await flipper.methods.flip().send({from: caller});
+ expect(await flipper.methods.getValue().call()).to.be.true;
+
+ const callerBalance = await helper.balance.getEthereum(caller);
+ const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
+
+ expect(callerBalance).to.be.equal(1000n * nominal);
+ expect(1000n * nominal > contractBalanceAfter).to.be.true;
+ });
+ });
+});
+
+describe('app-promotion stopSponsoringContract', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ itWeb3('should remove pallet address from contract sponsors', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ await transferBalanceToEth(api, alice, flipper.options.address);
+ const contractHelper = contractHelpers(web3, contractOwner);
+ await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address));
+
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false;
+ expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ disabled: null,
+ });
+
+ await flipper.methods.flip().send({from: caller});
+ expect(await flipper.methods.getValue().call()).to.be.true;
+
+ const callerBalance = await helper.balance.getEthereum(caller);
+ const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
+
+ // caller payed for call
+ expect(1000n * nominal > callerBalance).to.be.true;
+ expect(contractBalanceAfter).to.be.equal(1000n * nominal);
+ });
+ });
+
+ itWeb3('can not be called by non-admin', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const nonAdmin = accounts.pop()!;
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+ await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ });
+ });
+
+ itWeb3('should not affect a contract which is not sponsored by pallete', async ({api, web3, privateKeyWrapper}) => {
+ await usingPlaygrounds(async (helper) => {
+ const nonAdmin = accounts.pop()!;
+ const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
+ const flipper = await deployFlipper(web3, contractOwner);
+ const contractHelper = contractHelpers(web3, contractOwner);
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
+
+ await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ });
+ });
+});
+
+describe('app-promotion rewards', () => {
+ before(async function () {
+ await beforeEach(this);
+ });
+
+ it('can not be called by non admin', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const nonAdmin = accounts.pop()!;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected;
+ });
+ });
+
+ it('should credit 0.05% for staking period', async () => {
+ await usingPlaygrounds(async helper => {
+ const staker = accounts.pop()!;
+
+ await waitPromotionPeriodDoesntEnd(helper);
+
+ await helper.staking.stake(staker, 100n * nominal);
+ await helper.staking.stake(staker, 200n * nominal);
+
+ // wait rewards are available:
+ const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[1][0];
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock));
+
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+
+ const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
+ expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]);
+ });
+ });
+
+ it('shoud be paid for more than one period if payments was missed', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const staker = accounts.pop()!;
+
+ await helper.staking.stake(staker, 100n * nominal);
+ // wait for two rewards are available:
+ const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
+
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2);
+ expect(stakedPerBlock[0][1]).to.be.equal(frozenBalanceShouldBe);
+
+ const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address);
+
+ expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe});
+ });
+ });
+
+ it('should not be credited for unstaked (reserved) balance', async () => {
+ await usingPlaygrounds(async helper => {
+ // staker unstakes before rewards has been payed
+ const staker = accounts.pop()!;
+ await helper.staking.stake(staker, 100n * nominal);
+ const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
+ await helper.staking.unstake(staker);
+
+ // so he did not receive any rewards
+ const totalBalanceBefore = await helper.balance.getSubstrate(staker.address);
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ const totalBalanceAfter = await helper.balance.getSubstrate(staker.address);
+
+ expect(totalBalanceBefore).to.be.equal(totalBalanceAfter);
+ });
+ });
+
+ it('should bring compound interest', async () => {
+ await usingPlaygrounds(async helper => {
+ const staker = accounts.pop()!;
+
+ await helper.staking.stake(staker, 100n * nominal);
+
+ const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock));
+
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
+ expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n)]);
+
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
+ expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2)]);
+ });
+ });
+
+ it.skip('can be paid 1000 rewards in a time', async () => {
+ // all other stakes should be unstaked
+ await usingPlaygrounds(async (helper) => {
+ const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice);
+
+ // stakers stakes 10 times each
+ for (let i = 0; i < 10; i++) {
+ await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
+ }
+ await helper.wait.newBlocks(40);
+ const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ });
+ });
+
+ it.skip('can handle 40.000 rewards', async () => {
+ await usingPlaygrounds(async (helper) => {
+ const [donor] = await helper.arrange.createAccounts([7_000_000n], alice);
+ const crowdStakes = async () => {
+ // each account in the crowd stakes 2 times
+ const crowd = await helper.arrange.createCrowd(500, 300n, donor);
+ await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal)));
+ await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal)));
+ //
+ };
+
+ for (let i = 0; i < 40; i++) {
+ await crowdStakes();
+ }
+
+ // TODO pay rewards for some period
+ });
+ });
+});
+
+function calculatePalleteAddress(palletId: any) {
+ const address = stringToU8a(('modl' + palletId).padEnd(32, '\0'));
+ return encodeAddress(address);
+}
+
+function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint {
+ const DAY = 7200n;
+ const ACCURACY = 1_000_000_000n;
+ const income = base + base * (ACCURACY * (calcPeriod * 5n) / (10_000n * DAY)) / ACCURACY ;
+
+ if (iter > 1) {
+ return calculateIncome(income, calcPeriod, iter - 1);
+ } else return income;
+}
+
+// Wait while promotion period less than specified block, to avoid boundary cases
+// 0 if this should be the beginning of the period.
+async function waitPromotionPeriodDoesntEnd(helper: DevUniqueHelper, waitBlockLessThan = LOCKING_PERIOD / 3n) {
+ const relayBlockNumber = (await helper.api!.query.parachainSystem.validationData()).value.relayParentNumber.toNumber(); // await helper.chain.getLatestBlockNumber();
+ const currentPeriodBlock = BigInt(relayBlockNumber) % LOCKING_PERIOD;
+
+ if (currentPeriodBlock > waitBlockLessThan) {
+ await helper.wait.forRelayBlockNumber(BigInt(relayBlockNumber) + LOCKING_PERIOD - currentPeriodBlock);
+ }
+}
tests/src/approve.test.tsdiffbeforeafterboth--- a/tests/src/approve.test.ts
+++ b/tests/src/approve.test.ts
@@ -79,11 +79,12 @@
it('[nft] Remove approval by using 0 amount', async () => {
await usingPlaygrounds(async (helper) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const collectionId = collection.collectionId;
const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address});
expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true;
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n);
+ await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice);
expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false;
});
});
@@ -97,7 +98,7 @@
const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountBefore).to.be.equal(BigInt(1));
- await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n);
+ await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n);
const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountAfter).to.be.equal(BigInt(0));
});
@@ -111,7 +112,7 @@
const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountBefore).to.be.equal(BigInt(100));
- await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n);
+ await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n);
const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountAfter).to.be.equal(BigInt(0));
});
@@ -289,7 +290,7 @@
const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0);
await helper.ft.mintTokens(alice, collectionId, alice.address, 10n);
const tokenId = await helper.ft.getLastTokenId(collectionId);
- await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 10n);
+ await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n);
const charlieBefore = await helper.ft.getBalance(collectionId, {Substrate: charlie.address});
await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}, 2n);
@@ -321,7 +322,7 @@
const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address});
expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true;
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n);
+ await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice);
expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false;
const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address});
await expect(transferTokenFromTx()).to.be.rejected;
@@ -337,7 +338,7 @@
const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountBefore).to.be.equal(BigInt(1));
- await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n);
+ await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n);
const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountAfter).to.be.equal(BigInt(0));
@@ -354,7 +355,7 @@
const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountBefore).to.be.equal(BigInt(100));
- await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n);
+ await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n);
const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address});
expect(amountAfter).to.be.equal(BigInt(0));
@@ -379,8 +380,7 @@
await usingPlaygrounds(async (helper) => {
const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address});
- const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, undefined, 2n);
- await expect(approveTx()).to.be.rejected;
+ await helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2).signAndSend(bob);
expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false;
});
});
@@ -390,7 +390,7 @@
const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0);
await helper.ft.mintTokens(alice, collectionId, alice.address, 10n);
const tokenId = await helper.ft.getLastTokenId(collectionId);
- const approveTx = async () => helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 11n);
+ const approveTx = async () => helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 11n);
await expect(approveTx()).to.be.rejected;
});
});
@@ -399,7 +399,7 @@
await usingPlaygrounds(async (helper) => {
const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n});
- const approveTx = async () => helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 101n);
+ const approveTx = async () => helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 101n);
await expect(approveTx()).to.be.rejected;
});
});
@@ -658,9 +658,9 @@
const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n});
await helper.rft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 100n);
- await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 100n);
+ await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 100n);
- const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 101n);
+ const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 101n);
await expect(approveTx()).to.be.rejected;
});
});
@@ -672,8 +672,8 @@
const tokenId = await helper.ft.getLastTokenId(collectionId);
await helper.ft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n);
- await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 10n);
- const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 11n);
+ await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 10n);
+ const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 11n);
await expect(approveTx()).to.be.rejected;
});
});
tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -12,9 +12,19 @@
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
+/// @dev inlined interface
+interface ContractHelpersEvents {
+ event ContractSponsorSet(address indexed contractAddress, address sponsor);
+ event ContractSponsorshipConfirmed(
+ address indexed contractAddress,
+ address sponsor
+ );
+ event ContractSponsorRemoved(address indexed contractAddress);
+}
+
/// @title Magic contract, which allows users to reconfigure other contracts
/// @dev the ERC-165 identifier for this interface is 0xd77fab70
-interface ContractHelpers is Dummy, ERC165 {
+interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
/// using uniquenetwork evm-migration pallet, or using other terms not
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionAdmin.test.ts
+++ b/tests/src/eth/collectionAdmin.test.ts
@@ -15,7 +15,7 @@
import {expect} from 'chai';
import privateKey from '../substrate/privateKey';
-import { UNIQUE } from '../util/helpers';
+import {UNIQUE} from '../util/helpers';
import {
createEthAccount,
createEthAccountWithBalance,
@@ -24,7 +24,6 @@
getCollectionAddressFromResult,
itWeb3,
recordEthFee,
- subToEth,
} from './util/helpers';
describe('Add collection admins', () => {
@@ -37,7 +36,7 @@
.send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
- const newAdmin = await createEthAccount(web3);
+ const newAdmin = createEthAccount(web3);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdmin(newAdmin).send();
const adminList = await api.rpc.unique.adminlist(collectionId);
@@ -92,7 +91,7 @@
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdmin(admin).send();
- const user = await createEthAccount(web3);
+ const user = createEthAccount(web3);
await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: admin}))
.to.be.rejectedWith('NoPermission');
@@ -114,7 +113,7 @@
const notAdmin = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
- const user = await createEthAccount(web3);
+ const user = createEthAccount(web3);
await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: notAdmin}))
.to.be.rejectedWith('NoPermission');
@@ -175,7 +174,7 @@
.send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
- const newAdmin = await createEthAccount(web3);
+ const newAdmin = createEthAccount(web3);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await collectionEvm.methods.addCollectionAdmin(newAdmin).send();
{
@@ -226,7 +225,7 @@
const admin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
await collectionEvm.methods.addCollectionAdmin(admin0).send();
- const admin1 = await createEthAccount(web3);
+ const admin1 = createEthAccount(web3);
await collectionEvm.methods.addCollectionAdmin(admin1).send();
await expect(collectionEvm.methods.removeCollectionAdmin(admin1).call({from: admin0}))
@@ -253,7 +252,7 @@
const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
await collectionEvm.methods.addCollectionAdmin(admin).send();
- const notAdmin = await createEthAccount(web3);
+ const notAdmin = createEthAccount(web3);
await expect(collectionEvm.methods.removeCollectionAdmin(admin).call({from: notAdmin}))
.to.be.rejectedWith('NoPermission');
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -1,5 +1,5 @@
import {addToAllowListExpectSuccess, bigIntToSub, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers';
-import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub, subToEth} from './util/helpers';
+import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers';
import nonFungibleAbi from './nonFungibleAbi.json';
import {expect} from 'chai';
import {evmToAddress} from '@polkadot/util-crypto';
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -15,6 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {expect} from 'chai';
+import { expectSubstrateEventsAtBlock } from '../util/helpers';
import {
contractHelpers,
createEthAccountWithBalance,
@@ -24,6 +25,7 @@
SponsoringMode,
createEthAccount,
ethBalanceViaSub,
+ normalizeEvents,
} from './util/helpers';
describe('Sponsoring EVM contracts', () => {
@@ -36,6 +38,41 @@
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
});
+ itWeb3('Set self sponsored events', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+
+ const result = await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
+ // console.log(result);
+ const ethEvents = normalizeEvents(result.events);
+ expect(ethEvents).to.be.deep.equal([
+ {
+ address: flipper.options.address,
+ event: 'ContractSponsorSet',
+ args: {
+ contractAddress: flipper.options.address,
+ sponsor: flipper.options.address,
+ },
+ },
+ {
+ address: flipper.options.address,
+ event: 'ContractSponsorshipConfirmed',
+ args: {
+ contractAddress: flipper.options.address,
+ sponsor: flipper.options.address,
+ },
+ },
+ ]);
+
+ await expectSubstrateEventsAtBlock(
+ api,
+ result.blockNumber,
+ 'evmContractHelpers',
+ ['ContractSponsorSet','ContractSponsorshipConfirmed'],
+ );
+ });
+
itWeb3('Self sponsored can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
@@ -75,6 +112,33 @@
expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.true;
});
+ itWeb3('Set sponsor event', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+
+ const result = await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
+ {
+ address: flipper.options.address,
+ event: 'ContractSponsorSet',
+ args: {
+ contractAddress: flipper.options.address,
+ sponsor: sponsor,
+ },
+ },
+ ]);
+
+ await expectSubstrateEventsAtBlock(
+ api,
+ result.blockNumber,
+ 'evmContractHelpers',
+ ['ContractSponsorSet'],
+ );
+ });
+
itWeb3('Sponsor can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
@@ -97,6 +161,33 @@
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true;
});
+ itWeb3('Confirm sponsorship event', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+ await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected;
+ const result = await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
+ {
+ address: flipper.options.address,
+ event: 'ContractSponsorshipConfirmed',
+ args: {
+ contractAddress: flipper.options.address,
+ sponsor: sponsor,
+ },
+ },
+ ]);
+
+ await expectSubstrateEventsAtBlock(
+ api,
+ result.blockNumber,
+ 'evmContractHelpers',
+ ['ContractSponsorshipConfirmed'],
+ );
+ });
+
itWeb3('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
@@ -160,6 +251,35 @@
expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false;
});
+ itWeb3('Remove sponsor event', async ({api, web3, privateKeyWrapper}) => {
+ const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
+ const flipper = await deployFlipper(web3, owner);
+ const helpers = contractHelpers(web3, owner);
+
+ await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
+ await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
+
+ const result = await helpers.methods.removeSponsor(flipper.options.address).send();
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
+ {
+ address: flipper.options.address,
+ event: 'ContractSponsorRemoved',
+ args: {
+ contractAddress: flipper.options.address,
+ },
+ },
+ ]);
+
+ await expectSubstrateEventsAtBlock(
+ api,
+ result.blockNumber,
+ 'evmContractHelpers',
+ ['ContractSponsorRemoved'],
+ );
+ });
+
itWeb3('Sponsor can not be removed by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createNFTCollection.test.ts
+++ b/tests/src/eth/createNFTCollection.test.ts
@@ -181,7 +181,7 @@
});
itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => {
- const owner = await createEthAccount(web3);
+ const owner = createEthAccount(web3);
const helper = evmCollectionHelpers(web3, owner);
const collectionName = 'A';
const description = 'A';
@@ -194,7 +194,7 @@
itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const notOwner = await createEthAccount(web3);
+ const notOwner = createEthAccount(web3);
const collectionHelpers = evmCollectionHelpers(web3, owner);
const result = await collectionHelpers.methods.createNonfungibleCollection('A', 'A', 'A').send();
const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createRFTCollection.test.ts
+++ b/tests/src/eth/createRFTCollection.test.ts
@@ -189,7 +189,7 @@
});
itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => {
- const owner = await createEthAccount(web3);
+ const owner = createEthAccount(web3);
const helper = evmCollectionHelpers(web3, owner);
const collectionName = 'A';
const description = 'A';
@@ -202,7 +202,7 @@
itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const notOwner = await createEthAccount(web3);
+ const notOwner = createEthAccount(web3);
const collectionHelpers = evmCollectionHelpers(web3, owner);
const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send();
const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
tests/src/eth/nesting/nest.test.tsdiffbeforeafterboth--- a/tests/src/eth/nesting/nest.test.ts
+++ b/tests/src/eth/nesting/nest.test.ts
@@ -1,217 +1,220 @@
-import {ApiPromise} from '@polkadot/api';
+import {IKeyringPair} from '@polkadot/types/types';
import {Contract} from 'web3-eth-contract';
-import {expect} from 'chai';
-import Web3 from 'web3';
-import {createEthAccountWithBalance, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, tokenIdToAddress} from '../../eth/util/helpers';
-import nonFungibleAbi from '../nonFungibleAbi.json';
+import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util/playgrounds';
+
const createNestingCollection = async (
- api: ApiPromise,
- web3: Web3,
+ helper: EthUniqueHelper,
owner: string,
): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => {
- const collectionHelper = evmCollectionHelpers(web3, owner);
-
- const result = await collectionHelper.methods
- .createNonfungibleCollection('A', 'B', 'C')
- .send();
- const {collectionIdAddress: collectionAddress, collectionId} = await getCollectionAddressFromResult(api, result);
+ const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C');
- const contract = new web3.eth.Contract(nonFungibleAbi as any, collectionAddress, {from: owner, ...GAS_ARGS});
+ const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
await contract.methods.setCollectionNesting(true).send({from: owner});
return {collectionId, collectionAddress, contract};
};
-describe('Integration Test: EVM Nesting', () => {
- itWeb3('NFT: allows an Owner to nest/unnest their token', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const {collectionId, contract} = await createNestingCollection(api, web3, owner);
- // Create a token to be nested
- const targetNFTTokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- owner,
- targetNFTTokenId,
- ).send({from: owner});
-
- const targetNftTokenAddress = tokenIdToAddress(collectionId, targetNFTTokenId);
-
- // Create a nested token
- const firstTokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- targetNftTokenAddress,
- firstTokenId,
- ).send({from: owner});
+describe('EVM nesting tests group', () => {
+ let donor: IKeyringPair;
- expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress);
-
- // Create a token to be nested and nest
- const secondTokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- owner,
- secondTokenId,
- ).send({from: owner});
-
- await contract.methods.transfer(targetNftTokenAddress, secondTokenId).send({from: owner});
-
- expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(targetNftTokenAddress);
-
- // Unnest token back
- await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner});
- expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);
+ before(async function() {
+ await usingEthPlaygrounds(async (helper, privateKey) => {
+ donor = privateKey('//Alice');
+ });
});
- itWeb3('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
- const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(api, web3, owner);
- const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(api, web3, owner);
- await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});
-
- // Create a token to nest into
- const targetNftTokenId = await contractA.methods.nextTokenId().call();
- await contractA.methods.mint(
- owner,
- targetNftTokenId,
- ).send({from: owner});
- const nftTokenAddressA1 = tokenIdToAddress(collectionIdA, targetNftTokenId);
-
- // Create a token for nesting in the same collection as the target
- const nftTokenIdA = await contractA.methods.nextTokenId().call();
- await contractA.methods.mint(
- owner,
- nftTokenIdA,
- ).send({from: owner});
-
- // Create a token for nesting in a different collection
- const nftTokenIdB = await contractB.methods.nextTokenId().call();
- await contractB.methods.mint(
- owner,
- nftTokenIdB,
- ).send({from: owner});
-
- // Nest
- await contractA.methods.transfer(nftTokenAddressA1, nftTokenIdA).send({from: owner});
- expect(await contractA.methods.ownerOf(nftTokenIdA).call()).to.be.equal(nftTokenAddressA1);
-
- await contractB.methods.transfer(nftTokenAddressA1, nftTokenIdB).send({from: owner});
- expect(await contractB.methods.ownerOf(nftTokenIdB).call()).to.be.equal(nftTokenAddressA1);
- });
-});
-
-describe('Negative Test: EVM Nesting', async() => {
- itWeb3('NFT: disallows to nest token if nesting is disabled', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
- const {collectionId, contract} = await createNestingCollection(api, web3, owner);
- await contract.methods.setCollectionNesting(false).send({from: owner});
-
- // Create a token to nest into
- const targetNftTokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- owner,
- targetNftTokenId,
- ).send({from: owner});
-
- const targetNftTokenAddress = tokenIdToAddress(collectionId, targetNftTokenId);
-
- // Create a token to nest
- const nftTokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- owner,
- nftTokenId,
- ).send({from: owner});
-
- // Try to nest
- await expect(contract.methods
- .transfer(targetNftTokenAddress, nftTokenId)
- .call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest');
- });
-
- itWeb3('NFT: disallows a non-Owner to nest someone else\'s token', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const malignant = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
- const {collectionId, contract} = await createNestingCollection(api, web3, owner);
-
- // Mint a token
- const targetTokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- owner,
- targetTokenId,
- ).send({from: owner});
- const targetTokenAddress = tokenIdToAddress(collectionId, targetTokenId);
-
- // Mint a token belonging to a different account
- const tokenId = await contract.methods.nextTokenId().call();
- await contract.methods.mint(
- malignant,
- tokenId,
- ).send({from: owner});
-
- // Try to nest one token in another as a non-owner account
- await expect(contract.methods
- .transfer(targetTokenAddress, tokenId)
- .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest');
- });
-
- itWeb3('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const malignant = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
- const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(api, web3, owner);
- const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(api, web3, owner);
-
- await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});
-
- // Create a token in one collection
- const nftTokenIdA = await contractA.methods.nextTokenId().call();
- await contractA.methods.mint(
- owner,
- nftTokenIdA,
- ).send({from: owner});
- const nftTokenAddressA = tokenIdToAddress(collectionIdA, nftTokenIdA);
-
- // Create a token in another collection belonging to someone else
- const nftTokenIdB = await contractB.methods.nextTokenId().call();
- await contractB.methods.mint(
- malignant,
- nftTokenIdB,
- ).send({from: owner});
-
- // Try to drag someone else's token into the other collection and nest
- await expect(contractB.methods
- .transfer(nftTokenAddressA, nftTokenIdB)
- .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest');
+ describe('Integration Test: EVM Nesting', () => {
+ itEth('NFT: allows an Owner to nest/unnest their token', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionId, contract} = await createNestingCollection(helper, owner);
+
+ // Create a token to be nested
+ const targetNFTTokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ owner,
+ targetNFTTokenId,
+ ).send({from: owner});
+
+ const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNFTTokenId);
+
+ // Create a nested token
+ const firstTokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ targetNftTokenAddress,
+ firstTokenId,
+ ).send({from: owner});
+
+ expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress);
+
+ // Create a token to be nested and nest
+ const secondTokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ owner,
+ secondTokenId,
+ ).send({from: owner});
+
+ await contract.methods.transfer(targetNftTokenAddress, secondTokenId).send({from: owner});
+
+ expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(targetNftTokenAddress);
+
+ // Unnest token back
+ await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner});
+ expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);
+ });
+
+ itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner);
+ const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner);
+ await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});
+
+ // Create a token to nest into
+ const targetNftTokenId = await contractA.methods.nextTokenId().call();
+ await contractA.methods.mint(
+ owner,
+ targetNftTokenId,
+ ).send({from: owner});
+ const nftTokenAddressA1 = helper.ethAddress.fromTokenId(collectionIdA, targetNftTokenId);
+
+ // Create a token for nesting in the same collection as the target
+ const nftTokenIdA = await contractA.methods.nextTokenId().call();
+ await contractA.methods.mint(
+ owner,
+ nftTokenIdA,
+ ).send({from: owner});
+
+ // Create a token for nesting in a different collection
+ const nftTokenIdB = await contractB.methods.nextTokenId().call();
+ await contractB.methods.mint(
+ owner,
+ nftTokenIdB,
+ ).send({from: owner});
+
+ // Nest
+ await contractA.methods.transfer(nftTokenAddressA1, nftTokenIdA).send({from: owner});
+ expect(await contractA.methods.ownerOf(nftTokenIdA).call()).to.be.equal(nftTokenAddressA1);
+
+ await contractB.methods.transfer(nftTokenAddressA1, nftTokenIdB).send({from: owner});
+ expect(await contractB.methods.ownerOf(nftTokenIdB).call()).to.be.equal(nftTokenAddressA1);
+ });
});
- itWeb3('NFT: disallows to nest token in an unlisted collection', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
-
- const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(api, web3, owner);
- const {contract: contractB} = await createNestingCollection(api, web3, owner);
-
- await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner});
-
- // Create a token in one collection
- const nftTokenIdA = await contractA.methods.nextTokenId().call();
- await contractA.methods.mint(
- owner,
- nftTokenIdA,
- ).send({from: owner});
- const nftTokenAddressA = tokenIdToAddress(collectionIdA, nftTokenIdA);
-
- // Create a token in another collection
- const nftTokenIdB = await contractB.methods.nextTokenId().call();
- await contractB.methods.mint(
- owner,
- nftTokenIdB,
- ).send({from: owner});
-
- // Try to nest into a token in the other collection, disallowed in the first
- await expect(contractB.methods
- .transfer(nftTokenAddressA, nftTokenIdB)
- .call()).to.be.rejectedWith('SourceCollectionIsNotAllowedToNest');
+ describe('Negative Test: EVM Nesting', async() => {
+ itEth('NFT: disallows to nest token if nesting is disabled', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionId, contract} = await createNestingCollection(helper, owner);
+ await contract.methods.setCollectionNesting(false).send({from: owner});
+
+ // Create a token to nest into
+ const targetNftTokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ owner,
+ targetNftTokenId,
+ ).send({from: owner});
+
+ const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNftTokenId);
+
+ // Create a token to nest
+ const nftTokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ owner,
+ nftTokenId,
+ ).send({from: owner});
+
+ // Try to nest
+ await expect(contract.methods
+ .transfer(targetNftTokenAddress, nftTokenId)
+ .call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest');
+ });
+
+ itEth('NFT: disallows a non-Owner to nest someone else\'s token', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const malignant = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionId, contract} = await createNestingCollection(helper, owner);
+
+ // Mint a token
+ const targetTokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ owner,
+ targetTokenId,
+ ).send({from: owner});
+ const targetTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId);
+
+ // Mint a token belonging to a different account
+ const tokenId = await contract.methods.nextTokenId().call();
+ await contract.methods.mint(
+ malignant,
+ tokenId,
+ ).send({from: owner});
+
+ // Try to nest one token in another as a non-owner account
+ await expect(contract.methods
+ .transfer(targetTokenAddress, tokenId)
+ .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest');
+ });
+
+ itEth('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const malignant = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner);
+ const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner);
+
+ await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});
+
+ // Create a token in one collection
+ const nftTokenIdA = await contractA.methods.nextTokenId().call();
+ await contractA.methods.mint(
+ owner,
+ nftTokenIdA,
+ ).send({from: owner});
+ const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA);
+
+ // Create a token in another collection belonging to someone else
+ const nftTokenIdB = await contractB.methods.nextTokenId().call();
+ await contractB.methods.mint(
+ malignant,
+ nftTokenIdB,
+ ).send({from: owner});
+
+ // Try to drag someone else's token into the other collection and nest
+ await expect(contractB.methods
+ .transfer(nftTokenAddressA, nftTokenIdB)
+ .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest');
+ });
+
+ itEth('NFT: disallows to nest token in an unlisted collection', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner);
+ const {contract: contractB} = await createNestingCollection(helper, owner);
+
+ await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner});
+
+ // Create a token in one collection
+ const nftTokenIdA = await contractA.methods.nextTokenId().call();
+ await contractA.methods.mint(
+ owner,
+ nftTokenIdA,
+ ).send({from: owner});
+ const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA);
+
+ // Create a token in another collection
+ const nftTokenIdB = await contractB.methods.nextTokenId().call();
+ await contractB.methods.mint(
+ owner,
+ nftTokenIdB,
+ ).send({from: owner});
+
+ // Try to nest into a token in the other collection, disallowed in the first
+ await expect(contractB.methods
+ .transfer(nftTokenAddressA, nftTokenIdB)
+ .call()).to.be.rejectedWith('SourceCollectionIsNotAllowedToNest');
+ });
});
});
tests/src/eth/payable.test.tsdiffbeforeafterboth--- a/tests/src/eth/payable.test.ts
+++ b/tests/src/eth/payable.test.ts
@@ -14,97 +14,91 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-import {expect} from 'chai';
-import {submitTransactionAsync} from '../substrate/substrate-api';
-import {createEthAccountWithBalance, deployCollector, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';
-import {evmToAddress} from '@polkadot/util-crypto';
-import {getGenericResult, UNIQUE} from '../util/helpers';
-import {getBalanceSingle, transferBalanceExpectSuccess} from '../substrate/get-balance';
+import {IKeyringPair} from '@polkadot/types/types';
+
+import {itEth, expect, usingEthPlaygrounds} from './util/playgrounds';
describe('EVM payable contracts', () => {
- itWeb3('Evm contract can receive wei from eth account', async ({api, web3, privateKeyWrapper}) => {
- const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contract = await deployCollector(web3, deployer);
+ let donor: IKeyringPair;
- await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: '10000', ...GAS_ARGS});
+ before(async function() {
+ await usingEthPlaygrounds(async (helper, privateKey) => {
+ donor = privateKey('//Alice');
+ });
+ });
+
+ itEth('Evm contract can receive wei from eth account', async ({helper}) => {
+ const deployer = await helper.eth.createAccountWithBalance(donor);
+ const contract = await helper.eth.deployCollectorContract(deployer);
+
+ const web3 = helper.getWeb3();
+
+ await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: '10000', gas: helper.eth.DEFAULT_GAS});
expect(await contract.methods.getCollected().call()).to.be.equal('10000');
});
- itWeb3('Evm contract can receive wei from substrate account', async ({api, web3, privateKeyWrapper}) => {
- const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contract = await deployCollector(web3, deployer);
- const alice = privateKeyWrapper('//Alice');
+ itEth('Evm contract can receive wei from substrate account', async ({helper}) => {
+ const deployer = await helper.eth.createAccountWithBalance(donor);
+ const contract = await helper.eth.deployCollectorContract(deployer);
+ const [alice] = await helper.arrange.createAccounts([10n], donor);
+
+ const weiCount = '10000';
// Transaction fee/value will be payed from subToEth(sender) evm balance,
// which is backed by evmToAddress(subToEth(sender)) substrate balance
- await transferBalanceToEth(api, alice, subToEth(alice.address));
+ await helper.eth.transferBalanceFromSubstrate(alice, helper.address.substrateToEth(alice.address), 5n);
+
- {
- const tx = api.tx.evm.call(
- subToEth(alice.address),
- contract.options.address,
- contract.methods.giveMoney().encodeABI(),
- '10000',
- GAS_ARGS.gas,
- await web3.eth.getGasPrice(),
- null,
- null,
- [],
- );
- const events = await submitTransactionAsync(alice, tx);
- const result = getGenericResult(events);
- expect(result.success).to.be.true;
- }
+ await helper.eth.callEVM(alice, contract.options.address, contract.methods.giveMoney().encodeABI(), weiCount);
- expect(await contract.methods.getCollected().call()).to.be.equal('10000');
+ expect(await contract.methods.getCollected().call()).to.be.equal(weiCount);
});
// We can't handle sending balance to backing storage of evm balance, because evmToAddress operation is irreversible
- itWeb3('Wei sent directly to backing storage of evm contract balance is unaccounted', async({api, web3, privateKeyWrapper}) => {
- const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contract = await deployCollector(web3, deployer);
- const alice = privateKeyWrapper('//Alice');
+ itEth('Wei sent directly to backing storage of evm contract balance is unaccounted', async({helper}) => {
+ const deployer = await helper.eth.createAccountWithBalance(donor);
+ const contract = await helper.eth.deployCollectorContract(deployer);
+ const [alice] = await helper.arrange.createAccounts([10n], donor);
+
+ const weiCount = 10_000n;
- await transferBalanceExpectSuccess(api, alice, evmToAddress(contract.options.address), '10000');
+ await helper.eth.transferBalanceFromSubstrate(alice, contract.options.address, weiCount, false);
- expect(await contract.methods.getUnaccounted().call()).to.be.equal('10000');
+ expect(await contract.methods.getUnaccounted().call()).to.be.equal(weiCount.toString());
});
- itWeb3('Balance can be retrieved from evm contract', async({api, web3, privateKeyWrapper}) => {
- const FEE_BALANCE = 1000n * UNIQUE;
- const CONTRACT_BALANCE = 1n * UNIQUE;
+ itEth('Balance can be retrieved from evm contract', async({helper, privateKey}) => {
+ const FEE_BALANCE = 10n * helper.balance.getOneTokenNominal();
+ const CONTRACT_BALANCE = 1n * helper.balance.getOneTokenNominal();
+
+ const deployer = await helper.eth.createAccountWithBalance(donor);
+ const contract = await helper.eth.deployCollectorContract(deployer);
+ const [alice] = await helper.arrange.createAccounts([20n], donor);
- const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contract = await deployCollector(web3, deployer);
- const alice = privateKeyWrapper('//Alice');
+ const web3 = helper.getWeb3();
- await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), ...GAS_ARGS});
+ await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS});
- const receiver = privateKeyWrapper(`//Receiver${Date.now()}`);
+ const receiver = privateKey(`//Receiver${Date.now()}`);
// First receive balance on eth balance of bob
{
- const ethReceiver = subToEth(receiver.address);
+ const ethReceiver = helper.address.substrateToEth(receiver.address);
expect(await web3.eth.getBalance(ethReceiver)).to.be.equal('0');
await contract.methods.withdraw(ethReceiver).send({from: deployer});
expect(await web3.eth.getBalance(ethReceiver)).to.be.equal(CONTRACT_BALANCE.toString());
}
// Some balance is required to pay fee for evm.withdraw call
- await transferBalanceExpectSuccess(api, alice, receiver.address, FEE_BALANCE.toString());
+ await helper.balance.transferToSubstrate(alice, receiver.address, FEE_BALANCE);
+ // await transferBalanceExpectSuccess(api, alice, receiver.address, FEE_BALANCE.toString());
// Withdraw balance from eth to substrate
{
- const initialReceiverBalance = await getBalanceSingle(api, receiver.address);
- const tx = api.tx.evm.withdraw(
- subToEth(receiver.address),
- CONTRACT_BALANCE.toString(),
- );
- const events = await submitTransactionAsync(receiver, tx);
- const result = getGenericResult(events);
- expect(result.success).to.be.true;
- const finalReceiverBalance = await getBalanceSingle(api, receiver.address);
+ const initialReceiverBalance = await helper.balance.getSubstrate(receiver.address);
+ await helper.executeExtrinsic(receiver, 'api.tx.evm.withdraw', [helper.address.substrateToEth(receiver.address), CONTRACT_BALANCE.toString()], true);
+ const finalReceiverBalance = await helper.balance.getSubstrate(receiver.address);
expect(finalReceiverBalance > initialReceiverBalance).to.be.true;
}
tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers';
-import {collectionIdFromAddress, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from './util/helpers';
+import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -1,5 +1,56 @@
[
{
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ }
+ ],
+ "name": "ContractSponsorRemoved",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "sponsor",
+ "type": "address"
+ }
+ ],
+ "name": "ContractSponsorSet",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "contractAddress",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "sponsor",
+ "type": "address"
+ }
+ ],
+ "name": "ContractSponsorshipConfirmed",
+ "type": "event"
+ },
+ {
"inputs": [
{
"internalType": "address",
tests/src/eth/util/playgrounds/index.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/util/playgrounds/index.ts
@@ -0,0 +1,49 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+import {IKeyringPair} from '@polkadot/types/types';
+
+import config from '../../../config';
+
+import {EthUniqueHelper} from './unique.dev';
+import {SilentLogger, SilentConsole} from '../../../util/playgrounds/unique.dev';
+
+export {EthUniqueHelper} from './unique.dev';
+
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+chai.use(chaiAsPromised);
+export const expect = chai.expect;
+
+export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
+ const silentConsole = new SilentConsole();
+ silentConsole.enable();
+
+ const helper = new EthUniqueHelper(new SilentLogger());
+
+ try {
+ await helper.connect(config.substrateUrl);
+ await helper.connectWeb3(config.substrateUrl);
+ const ss58Format = helper.chain.getChainProperties().ss58Format;
+ const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format);
+ await code(helper, privateKey);
+ }
+ finally {
+ await helper.disconnect();
+ await helper.disconnectWeb3();
+ silentConsole.disable();
+ }
+};
+
+export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) {
+ let i: any = it;
+ if (opts.only) i = i.only;
+ else if (opts.skip) i = i.skip;
+ i(name, async () => {
+ await usingEthPlaygrounds(async (helper, privateKey) => {
+ await cb({helper, privateKey});
+ });
+ });
+}
+itEth.only = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {only: true});
+itEth.skip = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {skip: true});
\ No newline at end of file
tests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/util/playgrounds/types.ts
@@ -0,0 +1,9 @@
+export interface ContractImports {
+ solPath: string;
+ fsPath: string;
+}
+
+export interface CompiledContract {
+ abi: any;
+ object: string;
+}
\ No newline at end of file
tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -0,0 +1,268 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+/* eslint-disable function-call-argument-newline */
+
+import {readFile} from 'fs/promises';
+
+import Web3 from 'web3';
+import {WebsocketProvider} from 'web3-core';
+import {Contract} from 'web3-eth-contract';
+
+import * as solc from 'solc';
+
+import {evmToAddress} from '@polkadot/util-crypto';
+import {IKeyringPair} from '@polkadot/types/types';
+
+import {DevUniqueHelper} from '../../../util/playgrounds/unique.dev';
+
+import {ContractImports, CompiledContract} from './types';
+
+// Native contracts ABI
+import collectionHelpersAbi from '../../collectionHelpersAbi.json';
+import fungibleAbi from '../../fungibleAbi.json';
+import nonFungibleAbi from '../../nonFungibleAbi.json';
+import refungibleAbi from '../../reFungibleAbi.json';
+import refungibleTokenAbi from '../../reFungibleTokenAbi.json';
+import contractHelpersAbi from './../contractHelpersAbi.json';
+
+class EthGroupBase {
+ helper: EthUniqueHelper;
+
+ constructor(helper: EthUniqueHelper) {
+ this.helper = helper;
+ }
+}
+
+
+class ContractGroup extends EthGroupBase {
+ async findImports(imports?: ContractImports[]){
+ if(!imports) return function(path: string) {
+ return {error: `File not found: ${path}`};
+ };
+
+ const knownImports = {} as any;
+ for(const imp of imports) {
+ knownImports[imp.solPath] = (await readFile(imp.fsPath)).toString();
+ }
+
+ return function(path: string) {
+ if(knownImports.hasOwnPropertyDescriptor(path)) return {contents: knownImports[path]};
+ return {error: `File not found: ${path}`};
+ };
+ }
+
+ async compile(name: string, src: string, imports?: ContractImports[]): Promise<CompiledContract> {
+ const out = JSON.parse(solc.compile(JSON.stringify({
+ language: 'Solidity',
+ sources: {
+ [`${name}.sol`]: {
+ content: src,
+ },
+ },
+ settings: {
+ outputSelection: {
+ '*': {
+ '*': ['*'],
+ },
+ },
+ },
+ }), {import: await this.findImports(imports)})).contracts[`${name}.sol`][name];
+
+ return {
+ abi: out.abi,
+ object: '0x' + out.evm.bytecode.object,
+ };
+ }
+
+ async deployByCode(signer: string, name: string, src: string, imports?: ContractImports[]): Promise<Contract> {
+ const compiledContract = await this.compile(name, src, imports);
+ return this.deployByAbi(signer, compiledContract.abi, compiledContract.object);
+ }
+
+ async deployByAbi(signer: string, abi: any, object: string): Promise<Contract> {
+ const web3 = this.helper.getWeb3();
+ const contract = new web3.eth.Contract(abi, undefined, {
+ data: object,
+ from: signer,
+ gas: this.helper.eth.DEFAULT_GAS,
+ });
+ return await contract.deploy({data: object}).send({from: signer});
+ }
+
+}
+
+class NativeContractGroup extends EthGroupBase {
+
+ contractHelpers(caller: string): Contract {
+ const web3 = this.helper.getWeb3();
+ return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, gas: this.helper.eth.DEFAULT_GAS});
+ }
+
+ collectionHelpers(caller: string) {
+ const web3 = this.helper.getWeb3();
+ return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, gas: this.helper.eth.DEFAULT_GAS});
+ }
+
+ collection(address: string, mode: 'nft' | 'rft' | 'ft', caller?: string): Contract {
+ const abi = {
+ 'nft': nonFungibleAbi,
+ 'rft': refungibleAbi,
+ 'ft': fungibleAbi,
+ }[mode];
+ const web3 = this.helper.getWeb3();
+ return new web3.eth.Contract(abi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})});
+ }
+
+ rftTokenByAddress(address: string, caller?: string): Contract {
+ const web3 = this.helper.getWeb3();
+ return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})});
+ }
+
+ rftToken(collectionId: number, tokenId: number, caller?: string): Contract {
+ return this.rftTokenByAddress(this.helper.ethAddress.fromTokenId(collectionId, tokenId), caller);
+ }
+}
+
+
+class EthGroup extends EthGroupBase {
+ DEFAULT_GAS = 2_500_000;
+
+ createAccount() {
+ const web3 = this.helper.getWeb3();
+ const account = web3.eth.accounts.create();
+ web3.eth.accounts.wallet.add(account.privateKey);
+ return account.address;
+ }
+
+ async createAccountWithBalance(donor: IKeyringPair, amount=1000n) {
+ const account = this.createAccount();
+ await this.transferBalanceFromSubstrate(donor, account, amount);
+
+ return account;
+ }
+
+ async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n, inTokens=true) {
+ return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n));
+ }
+
+ async callEVM(signer: IKeyringPair, contractAddress: string, abi: any, value: string, gasLimit?: number) {
+ if(!gasLimit) gasLimit = this.DEFAULT_GAS;
+ const web3 = this.helper.getWeb3();
+ const gasPrice = await web3.eth.getGasPrice();
+ // TODO: check execution status
+ await this.helper.executeExtrinsic(
+ signer,
+ 'api.tx.evm.call', [this.helper.address.substrateToEth(signer.address), contractAddress, abi, value, gasLimit, gasPrice, null, null, []],
+ true,
+ );
+ }
+
+ async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> {
+ const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);
+
+ const result = await collectionHelper.methods.createNonfungibleCollection(name, description, tokenPrefix).send();
+
+ const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
+ const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress);
+
+ return {collectionId, collectionAddress};
+ }
+
+ async deployCollectorContract(signer: string): Promise<Contract> {
+ return await this.helper.ethContract.deployByCode(signer, 'Collector', `
+ // SPDX-License-Identifier: UNLICENSED
+ pragma solidity ^0.8.6;
+
+ contract Collector {
+ uint256 collected;
+ fallback() external payable {
+ giveMoney();
+ }
+ function giveMoney() public payable {
+ collected += msg.value;
+ }
+ function getCollected() public view returns (uint256) {
+ return collected;
+ }
+ function getUnaccounted() public view returns (uint256) {
+ return address(this).balance - collected;
+ }
+
+ function withdraw(address payable target) public {
+ target.transfer(collected);
+ collected = 0;
+ }
+ }
+ `);
+ }
+}
+
+
+class EthAddressGroup extends EthGroupBase {
+ extractCollectionId(address: string): number {
+ if (!(address.length === 42 || address.length === 40)) throw new Error('address wrong format');
+ return parseInt(address.substr(address.length - 8), 16);
+ }
+
+ fromCollectionId(collectionId: number): string {
+ if (collectionId >= 0xffffffff || collectionId < 0) throw new Error('collectionId overflow');
+ return Web3.utils.toChecksumAddress(`0x17c4e6453cc49aaaaeaca894e6d9683e${collectionId.toString(16).padStart(8, '0')}`);
+ }
+
+ extractTokenId(address: string): {collectionId: number, tokenId: number} {
+ if (!address.startsWith('0x'))
+ throw 'address not starts with "0x"';
+ if (address.length > 42)
+ throw 'address length is more than 20 bytes';
+ return {
+ collectionId: Number('0x' + address.substring(address.length - 16, address.length - 8)),
+ tokenId: Number('0x' + address.substring(address.length - 8)),
+ };
+ }
+
+ fromTokenId(collectionId: number, tokenId: number): string {
+ return this.helper.util.getNestingTokenAddress(collectionId, tokenId);
+ }
+
+ normalizeAddress(address: string): string {
+ return '0x' + address.substring(address.length - 40);
+ }
+}
+
+
+export class EthUniqueHelper extends DevUniqueHelper {
+ web3: Web3 | null = null;
+ web3Provider: WebsocketProvider | null = null;
+
+ eth: EthGroup;
+ ethAddress: EthAddressGroup;
+ ethNativeContract: NativeContractGroup;
+ ethContract: ContractGroup;
+
+ constructor(logger: { log: (msg: any, level: any) => void, level: any }) {
+ super(logger);
+ this.eth = new EthGroup(this);
+ this.ethAddress = new EthAddressGroup(this);
+ this.ethNativeContract = new NativeContractGroup(this);
+ this.ethContract = new ContractGroup(this);
+ }
+
+ getWeb3(): Web3 {
+ if(this.web3 === null) throw Error('Web3 not connected');
+ return this.web3;
+ }
+
+ async connectWeb3(wsEndpoint: string) {
+ if(this.web3 !== null) return;
+ this.web3Provider = new Web3.providers.WebsocketProvider(wsEndpoint);
+ this.web3 = new Web3(this.web3Provider);
+ }
+
+ async disconnectWeb3() {
+ if(this.web3 === null) return;
+ this.web3Provider?.connection.close();
+ this.web3 = null;
+ }
+}
+
\ No newline at end of file
tests/src/interfaces/appPromotion/definitions.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/appPromotion/definitions.ts
@@ -0,0 +1,58 @@
+// 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/>.
+
+type RpcParam = {
+ name: string;
+ type: string;
+ isOptional?: true;
+};
+
+const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr';
+
+const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE});
+const atParam = {name: 'at', type: 'Hash', isOptional: true};
+
+const fun = (description: string, params: RpcParam[], type: string) => ({
+ description,
+ params: [...params, atParam],
+ type,
+});
+
+export default {
+ types: {},
+ rpc: {
+ totalStaked: fun(
+ 'Returns the total amount of staked tokens',
+ [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
+ totalStakedPerBlock: fun(
+ 'Returns the total amount of staked tokens per block when staked',
+ [crossAccountParam('staker')],
+ 'Vec<(u32, u128)>',
+ ),
+ pendingUnstake: fun(
+ 'Returns the total amount of unstaked tokens',
+ [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],
+ 'u128',
+ ),
+ pendingUnstakePerBlock: fun(
+ 'Returns the total amount of unstaked tokens per block',
+ [crossAccountParam('staker')],
+ 'Vec<(u32, u128)>',
+ ),
+ },
+};
tests/src/interfaces/appPromotion/index.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/appPromotion/index.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './types';
tests/src/interfaces/appPromotion/types.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/appPromotion/types.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export type PHANTOM_APPPROMOTION = 'appPromotion';
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -8,13 +8,39 @@
import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
-import type { Permill } from '@polkadot/types/interfaces/runtime';
+import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
declare module '@polkadot/api-base/types/consts' {
interface AugmentedConsts<ApiType extends ApiTypes> {
+ appPromotion: {
+ /**
+ * Rate of return for interval in blocks defined in `RecalculationInterval`.
+ **/
+ intervalIncome: Perbill & AugmentedConst<ApiType>;
+ /**
+ * Decimals for the `Currency`.
+ **/
+ nominal: u128 & AugmentedConst<ApiType>;
+ /**
+ * The app's pallet id, used for deriving its sovereign account ID.
+ **/
+ palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
+ /**
+ * In parachain blocks.
+ **/
+ pendingInterval: u32 & AugmentedConst<ApiType>;
+ /**
+ * In relay blocks.
+ **/
+ recalculationInterval: u32 & AugmentedConst<ApiType>;
+ /**
+ * Generic const
+ **/
+ [key: string]: Codec;
+ };
balances: {
/**
* The minimum amount required to keep an account open.
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -11,6 +11,36 @@
declare module '@polkadot/api-base/types/errors' {
interface AugmentedErrors<ApiType extends ApiTypes> {
+ appPromotion: {
+ /**
+ * Error due to action requiring admin to be set.
+ **/
+ AdminNotSet: AugmentedError<ApiType>;
+ /**
+ * Errors caused by incorrect actions with a locked balance.
+ **/
+ IncorrectLockedBalanceOperation: AugmentedError<ApiType>;
+ /**
+ * No permission to perform an action.
+ **/
+ NoPermission: AugmentedError<ApiType>;
+ /**
+ * Insufficient funds to perform an action.
+ **/
+ NotSufficientFunds: AugmentedError<ApiType>;
+ /**
+ * Occurs when a pending unstake cannot be added in this block. PENDING_LIMIT_PER_BLOCK` limits exceeded.
+ **/
+ PendingForBlockOverflow: AugmentedError<ApiType>;
+ /**
+ * The error is due to the fact that the collection/contract must already be sponsored in order to perform the action.
+ **/
+ SponsorNotSet: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
balances: {
/**
* Beneficiary account must pre-exist
@@ -265,8 +295,12 @@
};
evmContractHelpers: {
/**
- * This method is only executable by owner
+ * No pending sponsor for contract.
**/
+ NoPendingSponsor: AugmentedError<ApiType>;
+ /**
+ * This method is only executable by contract owner
+ **/
NoPermission: AugmentedError<ApiType>;
/**
* Generic error
@@ -274,7 +308,13 @@
[key: string]: AugmentedError<ApiType>;
};
evmMigration: {
+ /**
+ * Migration of this account is not yet started, or already finished.
+ **/
AccountIsNotMigrating: AugmentedError<ApiType>;
+ /**
+ * Can only migrate to empty address.
+ **/
AccountNotEmpty: AugmentedError<ApiType>;
/**
* Generic error
tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -15,6 +15,44 @@
declare module '@polkadot/api-base/types/events' {
interface AugmentedEvents<ApiType extends ApiTypes> {
+ appPromotion: {
+ /**
+ * The admin was set
+ *
+ * # Arguments
+ * * AccountId: ID of the admin
+ **/
+ SetAdmin: AugmentedEvent<ApiType, [AccountId32]>;
+ /**
+ * Staking was performed
+ *
+ * # Arguments
+ * * AccountId: ID of the staker
+ * * Balance : staking amount
+ **/
+ Stake: AugmentedEvent<ApiType, [AccountId32, u128]>;
+ /**
+ * Staking recalculation was performed
+ *
+ * # Arguments
+ * * AccountId: ID of the staker.
+ * * Balance : recalculation base
+ * * Balance : total income
+ **/
+ StakingRecalculation: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
+ /**
+ * Unstaking was performed
+ *
+ * # Arguments
+ * * AccountId: ID of the staker
+ * * Balance : unstaking amount
+ **/
+ Unstake: AugmentedEvent<ApiType, [AccountId32, u128]>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
balances: {
/**
* A balance was set by root.
@@ -208,6 +246,24 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ evmContractHelpers: {
+ /**
+ * Collection sponsor was removed.
+ **/
+ ContractSponsorRemoved: AugmentedEvent<ApiType, [H160]>;
+ /**
+ * Contract sponsor was set.
+ **/
+ ContractSponsorSet: AugmentedEvent<ApiType, [H160, AccountId32]>;
+ /**
+ * New sponsor was confirm.
+ **/
+ ContractSponsorshipConfirmed: AugmentedEvent<ApiType, [H160, AccountId32]>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
parachainSystem: {
/**
* Downward messages were processed using the given weight.
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -6,10 +6,10 @@
import '@polkadot/api-base/types/storage';
import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types';
-import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
+import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -17,6 +17,28 @@
declare module '@polkadot/api-base/types/storage' {
interface AugmentedQueries<ApiType extends ApiTypes> {
+ appPromotion: {
+ admin: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Stores a key for record for which the next revenue recalculation would be performed.
+ * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
+ **/
+ nextCalculatedRecord: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[AccountId32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ pendingUnstake: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[AccountId32, u128]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ /**
+ * Amount of tokens staked by account in the blocknumber.
+ **/
+ staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, u32]>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
+ /**
+ * Amount of stakes for an Account
+ **/
+ stakesPerAccount: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u8>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
+ totalStaked: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
balances: {
/**
* The Balances pallet example of storing the balance of an account.
@@ -194,12 +216,66 @@
[key: string]: QueryableStorageEntry<ApiType>;
};
evmContractHelpers: {
+ /**
+ * Storage for users that allowed for sponsorship.
+ *
+ * ### Usage
+ * Prefer to delete record from storage if user no more allowed for sponsorship.
+ *
+ * * **Key1** - contract address.
+ * * **Key2** - user that allowed for sponsorship.
+ * * **Value** - allowance for sponsorship.
+ **/
allowlist: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H160 | string | Uint8Array) => Observable<bool>, [H160, H160]> & QueryableStorageEntry<ApiType, [H160, H160]>;
+ /**
+ * Storege for contracts with [`Allowlisted`](SponsoringModeT::Allowlisted) sponsoring mode.
+ *
+ * ### Usage
+ * Prefer to delete collection from storage if mode chaged to non `Allowlisted`, than set **Value** to **false**.
+ *
+ * * **Key** - contract address.
+ * * **Value** - is contract in [`Allowlisted`](SponsoringModeT::Allowlisted) mode.
+ **/
allowlistEnabled: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
+ /**
+ * Store owner for contract.
+ *
+ * * **Key** - contract address.
+ * * **Value** - owner for contract.
+ **/
owner: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<H160>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
selfSponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
+ /**
+ * Storage for last sponsored block.
+ *
+ * * **Key1** - contract address.
+ * * **Key2** - sponsored user address.
+ * * **Value** - last sponsored block number.
+ **/
sponsorBasket: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H160 | string | Uint8Array) => Observable<Option<u32>>, [H160, H160]> & QueryableStorageEntry<ApiType, [H160, H160]>;
+ /**
+ * Store for contract sponsorship state.
+ *
+ * * **Key** - contract address.
+ * * **Value** - sponsorship state.
+ **/
+ sponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<UpDataStructsSponsorshipStateBasicCrossAccountIdRepr>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
+ /**
+ * Store for sponsoring mode.
+ *
+ * ### Usage
+ * Prefer to delete collection from storage if mode chaged to [`Disabled`](SponsoringModeT::Disabled).
+ *
+ * * **Key** - contract address.
+ * * **Value** - [`sponsoring mode`](SponsoringModeT).
+ **/
sponsoringMode: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<Option<PalletEvmContractHelpersSponsoringModeT>>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
+ /**
+ * Storage for sponsoring rate limit in blocks.
+ *
+ * * **Key** - contract address.
+ * * **Value** - amount of sponsored blocks.
+ **/
sponsoringRateLimit: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<u32>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
/**
* Generic query
@@ -281,7 +357,7 @@
*
* Currently used to store RMRK data.
**/
- tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | 'Eth' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;
+ tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;
/**
* Used to enumerate token's children.
**/
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -9,7 +9,7 @@
import type { AugmentedRpc } from '@polkadot/rpc-core/types';
import type { Metadata, StorageKey } from '@polkadot/types';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec';
-import type { AnyNumber, Codec } from '@polkadot/types-codec/types';
+import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
@@ -35,6 +35,24 @@
declare module '@polkadot/rpc-core/types/jsonrpc' {
interface RpcInterface {
+ appPromotion: {
+ /**
+ * Returns the total amount of unstaked tokens
+ **/
+ pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
+ * Returns the total amount of unstaked tokens per block
+ **/
+ pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
+ /**
+ * Returns the total amount of staked tokens
+ **/
+ totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
+ /**
+ * Returns the total amount of staked tokens per block when staked
+ **/
+ totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
+ };
author: {
/**
* Returns true if the keystore has private keys for the given public key and key type.
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -17,6 +17,20 @@
declare module '@polkadot/api-base/types/submittable' {
interface AugmentedSubmittables<ApiType extends ApiTypes> {
+ appPromotion: {
+ payoutStakers: AugmentedSubmittable<(stakersNumber: Option<u8> | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u8>]>;
+ setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr]>;
+ sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ sponsorContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
+ stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ unstake: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
balances: {
/**
* Exactly as `transfer`, except the origin must be root and the source account may be
@@ -181,8 +195,21 @@
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
evmMigration: {
+ /**
+ * Start contract migration, inserts contract stub at target address,
+ * and marks account as pending, allowing to insert storage
+ **/
begin: AugmentedSubmittable<(address: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ /**
+ * Finish contract migration, allows it to be called.
+ * It is not possible to alter contract storage via [`Self::set_data`]
+ * after this call.
+ **/
finish: AugmentedSubmittable<(address: H160 | string | Uint8Array, code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160, Bytes]>;
+ /**
+ * Insert items into contract storage, this method can be called
+ * multiple times
+ **/
setData: AugmentedSubmittable<(address: H160 | string | Uint8Array, data: Vec<ITuple<[H256, H256]>> | ([H256 | string | Uint8Array, H256 | string | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [H160, Vec<ITuple<[H256, H256]>>]>;
/**
* Generic tx
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -5,7 +5,7 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/types/types/registry';
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
import type { Data, StorageKey } from '@polkadot/types';
import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
@@ -804,6 +804,9 @@
Owner: Owner;
PageCounter: PageCounter;
PageIndexData: PageIndexData;
+ PalletAppPromotionCall: PalletAppPromotionCall;
+ PalletAppPromotionError: PalletAppPromotionError;
+ PalletAppPromotionEvent: PalletAppPromotionEvent;
PalletBalancesAccountData: PalletBalancesAccountData;
PalletBalancesBalanceLock: PalletBalancesBalanceLock;
PalletBalancesCall: PalletBalancesCall;
@@ -832,6 +835,7 @@
PalletEvmCall: PalletEvmCall;
PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError;
PalletEvmContractHelpersError: PalletEvmContractHelpersError;
+ PalletEvmContractHelpersEvent: PalletEvmContractHelpersEvent;
PalletEvmContractHelpersSponsoringModeT: PalletEvmContractHelpersSponsoringModeT;
PalletEvmError: PalletEvmError;
PalletEvmEvent: PalletEvmEvent;
@@ -1295,7 +1299,8 @@
UpDataStructsPropertyScope: UpDataStructsPropertyScope;
UpDataStructsRpcCollection: UpDataStructsRpcCollection;
UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
- UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
+ UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32;
+ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr;
UpDataStructsTokenChild: UpDataStructsTokenChild;
UpDataStructsTokenData: UpDataStructsTokenData;
UpgradeGoAhead: UpgradeGoAhead;
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -806,6 +806,64 @@
readonly perPeriod: Compact<u128>;
}
+/** @name PalletAppPromotionCall */
+export interface PalletAppPromotionCall extends Enum {
+ readonly isSetAdminAddress: boolean;
+ readonly asSetAdminAddress: {
+ readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;
+ } & Struct;
+ readonly isStake: boolean;
+ readonly asStake: {
+ readonly amount: u128;
+ } & Struct;
+ readonly isUnstake: boolean;
+ readonly isSponsorCollection: boolean;
+ readonly asSponsorCollection: {
+ readonly collectionId: u32;
+ } & Struct;
+ readonly isStopSponsoringCollection: boolean;
+ readonly asStopSponsoringCollection: {
+ readonly collectionId: u32;
+ } & Struct;
+ readonly isSponsorContract: boolean;
+ readonly asSponsorContract: {
+ readonly contractId: H160;
+ } & Struct;
+ readonly isStopSponsoringContract: boolean;
+ readonly asStopSponsoringContract: {
+ readonly contractId: H160;
+ } & Struct;
+ readonly isPayoutStakers: boolean;
+ readonly asPayoutStakers: {
+ readonly stakersNumber: Option<u8>;
+ } & Struct;
+ readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';
+}
+
+/** @name PalletAppPromotionError */
+export interface PalletAppPromotionError extends Enum {
+ readonly isAdminNotSet: boolean;
+ readonly isNoPermission: boolean;
+ readonly isNotSufficientFunds: boolean;
+ readonly isPendingForBlockOverflow: boolean;
+ readonly isSponsorNotSet: boolean;
+ readonly isIncorrectLockedBalanceOperation: boolean;
+ readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';
+}
+
+/** @name PalletAppPromotionEvent */
+export interface PalletAppPromotionEvent extends Enum {
+ readonly isStakingRecalculation: boolean;
+ readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;
+ readonly isStake: boolean;
+ readonly asStake: ITuple<[AccountId32, u128]>;
+ readonly isUnstake: boolean;
+ readonly asUnstake: ITuple<[AccountId32, u128]>;
+ readonly isSetAdmin: boolean;
+ readonly asSetAdmin: AccountId32;
+ readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';
+}
+
/** @name PalletBalancesAccountData */
export interface PalletBalancesAccountData extends Struct {
readonly free: u128;
@@ -1127,7 +1185,19 @@
/** @name PalletEvmContractHelpersError */
export interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
- readonly type: 'NoPermission';
+ readonly isNoPendingSponsor: boolean;
+ readonly type: 'NoPermission' | 'NoPendingSponsor';
+}
+
+/** @name PalletEvmContractHelpersEvent */
+export interface PalletEvmContractHelpersEvent extends Enum {
+ readonly isContractSponsorSet: boolean;
+ readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;
+ readonly isContractSponsorshipConfirmed: boolean;
+ readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;
+ readonly isContractSponsorRemoved: boolean;
+ readonly asContractSponsorRemoved: H160;
+ readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';
}
/** @name PalletEvmContractHelpersSponsoringModeT */
@@ -2419,7 +2489,7 @@
readonly name: Vec<u16>;
readonly description: Vec<u16>;
readonly tokenPrefix: Bytes;
- readonly sponsorship: UpDataStructsSponsorshipState;
+ readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;
readonly limits: UpDataStructsCollectionLimits;
readonly permissions: UpDataStructsCollectionPermissions;
readonly externalCollection: bool;
@@ -2580,8 +2650,7 @@
export interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
- readonly isEth: boolean;
- readonly type: 'None' | 'Rmrk' | 'Eth';
+ readonly type: 'None' | 'Rmrk';
}
/** @name UpDataStructsRpcCollection */
@@ -2591,7 +2660,7 @@
readonly name: Vec<u16>;
readonly description: Vec<u16>;
readonly tokenPrefix: Bytes;
- readonly sponsorship: UpDataStructsSponsorshipState;
+ readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;
readonly limits: UpDataStructsCollectionLimits;
readonly permissions: UpDataStructsCollectionPermissions;
readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;
@@ -2607,8 +2676,8 @@
readonly type: 'SponsoringDisabled' | 'Blocks';
}
-/** @name UpDataStructsSponsorshipState */
-export interface UpDataStructsSponsorshipState extends Enum {
+/** @name UpDataStructsSponsorshipStateAccountId32 */
+export interface UpDataStructsSponsorshipStateAccountId32 extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
readonly asUnconfirmed: AccountId32;
@@ -2617,6 +2686,16 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
+/** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr */
+export interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {
+ readonly isDisabled: boolean;
+ readonly isUnconfirmed: boolean;
+ readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;
+ readonly isConfirmed: boolean;
+ readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;
+ readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
+}
+
/** @name UpDataStructsTokenChild */
export interface UpDataStructsTokenChild extends Struct {
readonly token: u32;
tests/src/interfaces/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/definitions.ts
+++ b/tests/src/interfaces/definitions.ts
@@ -15,5 +15,6 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
export {default as unique} from './unique/definitions';
+export {default as appPromotion} from './appPromotion/definitions';
export {default as rmrk} from './rmrk/definitions';
export {default as default} from './default/definitions';
\ No newline at end of file
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -1057,7 +1057,18 @@
}
},
/**
- * Lookup103: pallet_evm::pallet::Event<T>
+ * Lookup103: pallet_app_promotion::pallet::Event<T>
+ **/
+ PalletAppPromotionEvent: {
+ _enum: {
+ StakingRecalculation: '(AccountId32,u128,u128)',
+ Stake: '(AccountId32,u128)',
+ Unstake: '(AccountId32,u128)',
+ SetAdmin: 'AccountId32'
+ }
+ },
+ /**
+ * Lookup104: pallet_evm::pallet::Event<T>
**/
PalletEvmEvent: {
_enum: {
@@ -1071,7 +1082,7 @@
}
},
/**
- * Lookup104: ethereum::log::Log
+ * Lookup105: ethereum::log::Log
**/
EthereumLog: {
address: 'H160',
@@ -1079,7 +1090,7 @@
data: 'Bytes'
},
/**
- * Lookup108: pallet_ethereum::pallet::Event
+ * Lookup109: pallet_ethereum::pallet::Event
**/
PalletEthereumEvent: {
_enum: {
@@ -1087,7 +1098,7 @@
}
},
/**
- * Lookup109: evm_core::error::ExitReason
+ * Lookup110: evm_core::error::ExitReason
**/
EvmCoreErrorExitReason: {
_enum: {
@@ -1098,13 +1109,13 @@
}
},
/**
- * Lookup110: evm_core::error::ExitSucceed
+ * Lookup111: evm_core::error::ExitSucceed
**/
EvmCoreErrorExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
/**
- * Lookup111: evm_core::error::ExitError
+ * Lookup112: evm_core::error::ExitError
**/
EvmCoreErrorExitError: {
_enum: {
@@ -1126,13 +1137,13 @@
}
},
/**
- * Lookup114: evm_core::error::ExitRevert
+ * Lookup115: evm_core::error::ExitRevert
**/
EvmCoreErrorExitRevert: {
_enum: ['Reverted']
},
/**
- * Lookup115: evm_core::error::ExitFatal
+ * Lookup116: evm_core::error::ExitFatal
**/
EvmCoreErrorExitFatal: {
_enum: {
@@ -1143,7 +1154,17 @@
}
},
/**
- * Lookup116: frame_system::Phase
+ * Lookup117: pallet_evm_contract_helpers::pallet::Event<T>
+ **/
+ PalletEvmContractHelpersEvent: {
+ _enum: {
+ ContractSponsorSet: '(H160,AccountId32)',
+ ContractSponsorshipConfirmed: '(H160,AccountId32)',
+ ContractSponsorRemoved: 'H160'
+ }
+ },
+ /**
+ * Lookup118: frame_system::Phase
**/
FrameSystemPhase: {
_enum: {
@@ -1153,14 +1174,14 @@
}
},
/**
- * Lookup118: frame_system::LastRuntimeUpgradeInfo
+ * Lookup120: frame_system::LastRuntimeUpgradeInfo
**/
FrameSystemLastRuntimeUpgradeInfo: {
specVersion: 'Compact<u32>',
specName: 'Text'
},
/**
- * Lookup119: frame_system::pallet::Call<T>
+ * Lookup121: frame_system::pallet::Call<T>
**/
FrameSystemCall: {
_enum: {
@@ -1198,7 +1219,7 @@
}
},
/**
- * Lookup124: frame_system::limits::BlockWeights
+ * Lookup126: frame_system::limits::BlockWeights
**/
FrameSystemLimitsBlockWeights: {
baseBlock: 'u64',
@@ -1206,7 +1227,7 @@
perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
},
/**
- * Lookup125: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
+ * Lookup127: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
**/
FrameSupportWeightsPerDispatchClassWeightsPerClass: {
normal: 'FrameSystemLimitsWeightsPerClass',
@@ -1214,7 +1235,7 @@
mandatory: 'FrameSystemLimitsWeightsPerClass'
},
/**
- * Lookup126: frame_system::limits::WeightsPerClass
+ * Lookup128: frame_system::limits::WeightsPerClass
**/
FrameSystemLimitsWeightsPerClass: {
baseExtrinsic: 'u64',
@@ -1223,13 +1244,13 @@
reserved: 'Option<u64>'
},
/**
- * Lookup128: frame_system::limits::BlockLength
+ * Lookup130: frame_system::limits::BlockLength
**/
FrameSystemLimitsBlockLength: {
max: 'FrameSupportWeightsPerDispatchClassU32'
},
/**
- * Lookup129: frame_support::weights::PerDispatchClass<T>
+ * Lookup131: frame_support::weights::PerDispatchClass<T>
**/
FrameSupportWeightsPerDispatchClassU32: {
normal: 'u32',
@@ -1237,14 +1258,14 @@
mandatory: 'u32'
},
/**
- * Lookup130: frame_support::weights::RuntimeDbWeight
+ * Lookup132: frame_support::weights::RuntimeDbWeight
**/
FrameSupportWeightsRuntimeDbWeight: {
read: 'u64',
write: 'u64'
},
/**
- * Lookup131: sp_version::RuntimeVersion
+ * Lookup133: sp_version::RuntimeVersion
**/
SpVersionRuntimeVersion: {
specName: 'Text',
@@ -1257,13 +1278,13 @@
stateVersion: 'u8'
},
/**
- * Lookup136: frame_system::pallet::Error<T>
+ * Lookup138: frame_system::pallet::Error<T>
**/
FrameSystemError: {
_enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
},
/**
- * Lookup137: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
+ * Lookup139: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
**/
PolkadotPrimitivesV2PersistedValidationData: {
parentHead: 'Bytes',
@@ -1272,19 +1293,19 @@
maxPovSize: 'u32'
},
/**
- * Lookup140: polkadot_primitives::v2::UpgradeRestriction
+ * Lookup142: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
- * Lookup141: sp_trie::storage_proof::StorageProof
+ * Lookup143: sp_trie::storage_proof::StorageProof
**/
SpTrieStorageProof: {
trieNodes: 'BTreeSet<Bytes>'
},
/**
- * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
+ * Lookup145: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
**/
CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: {
dmqMqcHead: 'H256',
@@ -1293,7 +1314,7 @@
egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>'
},
/**
- * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel
+ * Lookup148: polkadot_primitives::v2::AbridgedHrmpChannel
**/
PolkadotPrimitivesV2AbridgedHrmpChannel: {
maxCapacity: 'u32',
@@ -1304,7 +1325,7 @@
mqcHead: 'Option<H256>'
},
/**
- * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration
+ * Lookup149: polkadot_primitives::v2::AbridgedHostConfiguration
**/
PolkadotPrimitivesV2AbridgedHostConfiguration: {
maxCodeSize: 'u32',
@@ -1318,14 +1339,14 @@
validationUpgradeDelay: 'u32'
},
/**
- * Lookup153: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
+ * Lookup155: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
**/
PolkadotCorePrimitivesOutboundHrmpMessage: {
recipient: 'u32',
data: 'Bytes'
},
/**
- * Lookup154: cumulus_pallet_parachain_system::pallet::Call<T>
+ * Lookup156: cumulus_pallet_parachain_system::pallet::Call<T>
**/
CumulusPalletParachainSystemCall: {
_enum: {
@@ -1344,7 +1365,7 @@
}
},
/**
- * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData
+ * Lookup157: cumulus_primitives_parachain_inherent::ParachainInherentData
**/
CumulusPrimitivesParachainInherentParachainInherentData: {
validationData: 'PolkadotPrimitivesV2PersistedValidationData',
@@ -1353,27 +1374,27 @@
horizontalMessages: 'BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>'
},
/**
- * Lookup157: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
+ * Lookup159: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
- * Lookup160: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
+ * Lookup162: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
- * Lookup163: cumulus_pallet_parachain_system::pallet::Error<T>
+ * Lookup165: cumulus_pallet_parachain_system::pallet::Error<T>
**/
CumulusPalletParachainSystemError: {
_enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized']
},
/**
- * Lookup165: pallet_balances::BalanceLock<Balance>
+ * Lookup167: pallet_balances::BalanceLock<Balance>
**/
PalletBalancesBalanceLock: {
id: '[u8;8]',
@@ -1381,26 +1402,26 @@
reasons: 'PalletBalancesReasons'
},
/**
- * Lookup166: pallet_balances::Reasons
+ * Lookup168: pallet_balances::Reasons
**/
PalletBalancesReasons: {
_enum: ['Fee', 'Misc', 'All']
},
/**
- * Lookup169: pallet_balances::ReserveData<ReserveIdentifier, Balance>
+ * Lookup171: pallet_balances::ReserveData<ReserveIdentifier, Balance>
**/
PalletBalancesReserveData: {
id: '[u8;16]',
amount: 'u128'
},
/**
- * Lookup171: pallet_balances::Releases
+ * Lookup173: pallet_balances::Releases
**/
PalletBalancesReleases: {
_enum: ['V1_0_0', 'V2_0_0']
},
/**
- * Lookup172: pallet_balances::pallet::Call<T, I>
+ * Lookup174: pallet_balances::pallet::Call<T, I>
**/
PalletBalancesCall: {
_enum: {
@@ -1433,13 +1454,13 @@
}
},
/**
- * Lookup175: pallet_balances::pallet::Error<T, I>
+ * Lookup177: pallet_balances::pallet::Error<T, I>
**/
PalletBalancesError: {
_enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves']
},
/**
- * Lookup177: pallet_timestamp::pallet::Call<T>
+ * Lookup179: pallet_timestamp::pallet::Call<T>
**/
PalletTimestampCall: {
_enum: {
@@ -1449,13 +1470,13 @@
}
},
/**
- * Lookup179: pallet_transaction_payment::Releases
+ * Lookup181: pallet_transaction_payment::Releases
**/
PalletTransactionPaymentReleases: {
_enum: ['V1Ancient', 'V2']
},
/**
- * Lookup180: pallet_treasury::Proposal<sp_core::crypto::AccountId32, Balance>
+ * Lookup182: pallet_treasury::Proposal<sp_core::crypto::AccountId32, Balance>
**/
PalletTreasuryProposal: {
proposer: 'AccountId32',
@@ -1464,7 +1485,7 @@
bond: 'u128'
},
/**
- * Lookup183: pallet_treasury::pallet::Call<T, I>
+ * Lookup185: pallet_treasury::pallet::Call<T, I>
**/
PalletTreasuryCall: {
_enum: {
@@ -1488,17 +1509,17 @@
}
},
/**
- * Lookup186: frame_support::PalletId
+ * Lookup188: frame_support::PalletId
**/
FrameSupportPalletId: '[u8;8]',
/**
- * Lookup187: pallet_treasury::pallet::Error<T, I>
+ * Lookup189: pallet_treasury::pallet::Error<T, I>
**/
PalletTreasuryError: {
_enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved']
},
/**
- * Lookup188: pallet_sudo::pallet::Call<T>
+ * Lookup190: pallet_sudo::pallet::Call<T>
**/
PalletSudoCall: {
_enum: {
@@ -1522,7 +1543,7 @@
}
},
/**
- * Lookup190: orml_vesting::module::Call<T>
+ * Lookup192: orml_vesting::module::Call<T>
**/
OrmlVestingModuleCall: {
_enum: {
@@ -1541,7 +1562,7 @@
}
},
/**
- * Lookup192: cumulus_pallet_xcmp_queue::pallet::Call<T>
+ * Lookup194: cumulus_pallet_xcmp_queue::pallet::Call<T>
**/
CumulusPalletXcmpQueueCall: {
_enum: {
@@ -1590,7 +1611,7 @@
}
},
/**
- * Lookup193: pallet_xcm::pallet::Call<T>
+ * Lookup195: pallet_xcm::pallet::Call<T>
**/
PalletXcmCall: {
_enum: {
@@ -1644,7 +1665,7 @@
}
},
/**
- * Lookup194: xcm::VersionedXcm<Call>
+ * Lookup196: xcm::VersionedXcm<Call>
**/
XcmVersionedXcm: {
_enum: {
@@ -1654,7 +1675,7 @@
}
},
/**
- * Lookup195: xcm::v0::Xcm<Call>
+ * Lookup197: xcm::v0::Xcm<Call>
**/
XcmV0Xcm: {
_enum: {
@@ -1708,7 +1729,7 @@
}
},
/**
- * Lookup197: xcm::v0::order::Order<Call>
+ * Lookup199: xcm::v0::order::Order<Call>
**/
XcmV0Order: {
_enum: {
@@ -1751,7 +1772,7 @@
}
},
/**
- * Lookup199: xcm::v0::Response
+ * Lookup201: xcm::v0::Response
**/
XcmV0Response: {
_enum: {
@@ -1759,7 +1780,7 @@
}
},
/**
- * Lookup200: xcm::v1::Xcm<Call>
+ * Lookup202: xcm::v1::Xcm<Call>
**/
XcmV1Xcm: {
_enum: {
@@ -1818,7 +1839,7 @@
}
},
/**
- * Lookup202: xcm::v1::order::Order<Call>
+ * Lookup204: xcm::v1::order::Order<Call>
**/
XcmV1Order: {
_enum: {
@@ -1863,7 +1884,7 @@
}
},
/**
- * Lookup204: xcm::v1::Response
+ * Lookup206: xcm::v1::Response
**/
XcmV1Response: {
_enum: {
@@ -1872,11 +1893,11 @@
}
},
/**
- * Lookup218: cumulus_pallet_xcm::pallet::Call<T>
+ * Lookup220: cumulus_pallet_xcm::pallet::Call<T>
**/
CumulusPalletXcmCall: 'Null',
/**
- * Lookup219: cumulus_pallet_dmp_queue::pallet::Call<T>
+ * Lookup221: cumulus_pallet_dmp_queue::pallet::Call<T>
**/
CumulusPalletDmpQueueCall: {
_enum: {
@@ -1887,7 +1908,7 @@
}
},
/**
- * Lookup220: pallet_inflation::pallet::Call<T>
+ * Lookup222: pallet_inflation::pallet::Call<T>
**/
PalletInflationCall: {
_enum: {
@@ -1897,7 +1918,7 @@
}
},
/**
- * Lookup221: pallet_unique::Call<T>
+ * Lookup223: pallet_unique::Call<T>
**/
PalletUniqueCall: {
_enum: {
@@ -2029,7 +2050,7 @@
}
},
/**
- * Lookup226: up_data_structs::CollectionMode
+ * Lookup228: up_data_structs::CollectionMode
**/
UpDataStructsCollectionMode: {
_enum: {
@@ -2039,7 +2060,7 @@
}
},
/**
- * Lookup227: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
+ * Lookup229: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
**/
UpDataStructsCreateCollectionData: {
mode: 'UpDataStructsCollectionMode',
@@ -2054,13 +2075,13 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup229: up_data_structs::AccessMode
+ * Lookup231: up_data_structs::AccessMode
**/
UpDataStructsAccessMode: {
_enum: ['Normal', 'AllowList']
},
/**
- * Lookup231: up_data_structs::CollectionLimits
+ * Lookup233: up_data_structs::CollectionLimits
**/
UpDataStructsCollectionLimits: {
accountTokenOwnershipLimit: 'Option<u32>',
@@ -2074,7 +2095,7 @@
transfersEnabled: 'Option<bool>'
},
/**
- * Lookup233: up_data_structs::SponsoringRateLimit
+ * Lookup235: up_data_structs::SponsoringRateLimit
**/
UpDataStructsSponsoringRateLimit: {
_enum: {
@@ -2083,7 +2104,7 @@
}
},
/**
- * Lookup236: up_data_structs::CollectionPermissions
+ * Lookup238: up_data_structs::CollectionPermissions
**/
UpDataStructsCollectionPermissions: {
access: 'Option<UpDataStructsAccessMode>',
@@ -2091,7 +2112,7 @@
nesting: 'Option<UpDataStructsNestingPermissions>'
},
/**
- * Lookup238: up_data_structs::NestingPermissions
+ * Lookup240: up_data_structs::NestingPermissions
**/
UpDataStructsNestingPermissions: {
tokenOwner: 'bool',
@@ -2099,18 +2120,18 @@
restricted: 'Option<UpDataStructsOwnerRestrictedSet>'
},
/**
- * Lookup240: up_data_structs::OwnerRestrictedSet
+ * Lookup242: up_data_structs::OwnerRestrictedSet
**/
UpDataStructsOwnerRestrictedSet: 'BTreeSet<u32>',
/**
- * Lookup245: up_data_structs::PropertyKeyPermission
+ * Lookup247: up_data_structs::PropertyKeyPermission
**/
UpDataStructsPropertyKeyPermission: {
key: 'Bytes',
permission: 'UpDataStructsPropertyPermission'
},
/**
- * Lookup246: up_data_structs::PropertyPermission
+ * Lookup248: up_data_structs::PropertyPermission
**/
UpDataStructsPropertyPermission: {
mutable: 'bool',
@@ -2118,14 +2139,14 @@
tokenOwner: 'bool'
},
/**
- * Lookup249: up_data_structs::Property
+ * Lookup251: up_data_structs::Property
**/
UpDataStructsProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup252: up_data_structs::CreateItemData
+ * Lookup254: up_data_structs::CreateItemData
**/
UpDataStructsCreateItemData: {
_enum: {
@@ -2135,26 +2156,26 @@
}
},
/**
- * Lookup253: up_data_structs::CreateNftData
+ * Lookup255: up_data_structs::CreateNftData
**/
UpDataStructsCreateNftData: {
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup254: up_data_structs::CreateFungibleData
+ * Lookup256: up_data_structs::CreateFungibleData
**/
UpDataStructsCreateFungibleData: {
value: 'u128'
},
/**
- * Lookup255: up_data_structs::CreateReFungibleData
+ * Lookup257: up_data_structs::CreateReFungibleData
**/
UpDataStructsCreateReFungibleData: {
pieces: 'u128',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup258: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup260: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateItemExData: {
_enum: {
@@ -2165,14 +2186,14 @@
}
},
/**
- * Lookup260: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup262: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateNftExData: {
properties: 'Vec<UpDataStructsProperty>',
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup267: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup269: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExSingleOwner: {
user: 'PalletEvmAccountBasicCrossAccountIdRepr',
@@ -2180,14 +2201,14 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup269: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup271: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExMultipleOwners: {
users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup270: pallet_unique_scheduler::pallet::Call<T>
+ * Lookup272: pallet_unique_scheduler::pallet::Call<T>
**/
PalletUniqueSchedulerCall: {
_enum: {
@@ -2211,7 +2232,7 @@
}
},
/**
- * Lookup272: frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>
+ * Lookup274: frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>
**/
FrameSupportScheduleMaybeHashed: {
_enum: {
@@ -2220,7 +2241,7 @@
}
},
/**
- * Lookup273: pallet_configuration::pallet::Call<T>
+ * Lookup275: pallet_configuration::pallet::Call<T>
**/
PalletConfigurationCall: {
_enum: {
@@ -2233,15 +2254,15 @@
}
},
/**
- * Lookup274: pallet_template_transaction_payment::Call<T>
+ * Lookup276: pallet_template_transaction_payment::Call<T>
**/
PalletTemplateTransactionPaymentCall: 'Null',
/**
- * Lookup275: pallet_structure::pallet::Call<T>
+ * Lookup277: pallet_structure::pallet::Call<T>
**/
PalletStructureCall: 'Null',
/**
- * Lookup276: pallet_rmrk_core::pallet::Call<T>
+ * Lookup278: pallet_rmrk_core::pallet::Call<T>
**/
PalletRmrkCoreCall: {
_enum: {
@@ -2332,7 +2353,7 @@
}
},
/**
- * Lookup282: rmrk_traits::resource::ResourceTypes<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup284: rmrk_traits::resource::ResourceTypes<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceTypes: {
_enum: {
@@ -2342,7 +2363,7 @@
}
},
/**
- * Lookup284: rmrk_traits::resource::BasicResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup286: rmrk_traits::resource::BasicResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceBasicResource: {
src: 'Option<Bytes>',
@@ -2351,7 +2372,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup286: rmrk_traits::resource::ComposableResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup288: rmrk_traits::resource::ComposableResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceComposableResource: {
parts: 'Vec<u32>',
@@ -2362,7 +2383,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup287: rmrk_traits::resource::SlotResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup289: rmrk_traits::resource::SlotResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceSlotResource: {
base: 'u32',
@@ -2373,7 +2394,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup290: pallet_rmrk_equip::pallet::Call<T>
+ * Lookup292: pallet_rmrk_equip::pallet::Call<T>
**/
PalletRmrkEquipCall: {
_enum: {
@@ -2394,7 +2415,7 @@
}
},
/**
- * Lookup293: rmrk_traits::part::PartType<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup295: rmrk_traits::part::PartType<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartPartType: {
_enum: {
@@ -2403,7 +2424,7 @@
}
},
/**
- * Lookup295: rmrk_traits::part::FixedPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup297: rmrk_traits::part::FixedPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartFixedPart: {
id: 'u32',
@@ -2411,7 +2432,7 @@
src: 'Bytes'
},
/**
- * Lookup296: rmrk_traits::part::SlotPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup298: rmrk_traits::part::SlotPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartSlotPart: {
id: 'u32',
@@ -2420,7 +2441,7 @@
z: 'u32'
},
/**
- * Lookup297: rmrk_traits::part::EquippableList<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup299: rmrk_traits::part::EquippableList<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartEquippableList: {
_enum: {
@@ -2430,7 +2451,7 @@
}
},
/**
- * Lookup299: rmrk_traits::theme::Theme<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>, S>>
+ * Lookup301: rmrk_traits::theme::Theme<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>, S>>
**/
RmrkTraitsTheme: {
name: 'Bytes',
@@ -2438,14 +2459,43 @@
inherit: 'bool'
},
/**
- * Lookup301: rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup303: rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsThemeThemeProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup303: pallet_evm::pallet::Call<T>
+ * Lookup305: pallet_app_promotion::pallet::Call<T>
+ **/
+ PalletAppPromotionCall: {
+ _enum: {
+ set_admin_address: {
+ admin: 'PalletEvmAccountBasicCrossAccountIdRepr',
+ },
+ stake: {
+ amount: 'u128',
+ },
+ unstake: 'Null',
+ sponsor_collection: {
+ collectionId: 'u32',
+ },
+ stop_sponsoring_collection: {
+ collectionId: 'u32',
+ },
+ sponsor_contract: {
+ contractId: 'H160',
+ },
+ stop_sponsoring_contract: {
+ contractId: 'H160',
+ },
+ payout_stakers: {
+ stakersNumber: 'Option<u8>'
+ }
+ }
+ },
+ /**
+ * Lookup307: pallet_evm::pallet::Call<T>
**/
PalletEvmCall: {
_enum: {
@@ -2488,7 +2538,7 @@
}
},
/**
- * Lookup307: pallet_ethereum::pallet::Call<T>
+ * Lookup311: pallet_ethereum::pallet::Call<T>
**/
PalletEthereumCall: {
_enum: {
@@ -2498,7 +2548,7 @@
}
},
/**
- * Lookup308: ethereum::transaction::TransactionV2
+ * Lookup312: ethereum::transaction::TransactionV2
**/
EthereumTransactionTransactionV2: {
_enum: {
@@ -2508,7 +2558,7 @@
}
},
/**
- * Lookup309: ethereum::transaction::LegacyTransaction
+ * Lookup313: ethereum::transaction::LegacyTransaction
**/
EthereumTransactionLegacyTransaction: {
nonce: 'U256',
@@ -2520,7 +2570,7 @@
signature: 'EthereumTransactionTransactionSignature'
},
/**
- * Lookup310: ethereum::transaction::TransactionAction
+ * Lookup314: ethereum::transaction::TransactionAction
**/
EthereumTransactionTransactionAction: {
_enum: {
@@ -2529,7 +2579,7 @@
}
},
/**
- * Lookup311: ethereum::transaction::TransactionSignature
+ * Lookup315: ethereum::transaction::TransactionSignature
**/
EthereumTransactionTransactionSignature: {
v: 'u64',
@@ -2537,7 +2587,7 @@
s: 'H256'
},
/**
- * Lookup313: ethereum::transaction::EIP2930Transaction
+ * Lookup317: ethereum::transaction::EIP2930Transaction
**/
EthereumTransactionEip2930Transaction: {
chainId: 'u64',
@@ -2553,14 +2603,14 @@
s: 'H256'
},
/**
- * Lookup315: ethereum::transaction::AccessListItem
+ * Lookup319: ethereum::transaction::AccessListItem
**/
EthereumTransactionAccessListItem: {
address: 'H160',
storageKeys: 'Vec<H256>'
},
/**
- * Lookup316: ethereum::transaction::EIP1559Transaction
+ * Lookup320: ethereum::transaction::EIP1559Transaction
**/
EthereumTransactionEip1559Transaction: {
chainId: 'u64',
@@ -2577,7 +2627,7 @@
s: 'H256'
},
/**
- * Lookup317: pallet_evm_migration::pallet::Call<T>
+ * Lookup321: pallet_evm_migration::pallet::Call<T>
**/
PalletEvmMigrationCall: {
_enum: {
@@ -2595,19 +2645,19 @@
}
},
/**
- * Lookup320: pallet_sudo::pallet::Error<T>
+ * Lookup324: pallet_sudo::pallet::Error<T>
**/
PalletSudoError: {
_enum: ['RequireSudo']
},
/**
- * Lookup322: orml_vesting::module::Error<T>
+ * Lookup326: orml_vesting::module::Error<T>
**/
OrmlVestingModuleError: {
_enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
},
/**
- * Lookup324: cumulus_pallet_xcmp_queue::InboundChannelDetails
+ * Lookup328: cumulus_pallet_xcmp_queue::InboundChannelDetails
**/
CumulusPalletXcmpQueueInboundChannelDetails: {
sender: 'u32',
@@ -2615,19 +2665,19 @@
messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
},
/**
- * Lookup325: cumulus_pallet_xcmp_queue::InboundState
+ * Lookup329: cumulus_pallet_xcmp_queue::InboundState
**/
CumulusPalletXcmpQueueInboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup328: polkadot_parachain::primitives::XcmpMessageFormat
+ * Lookup332: polkadot_parachain::primitives::XcmpMessageFormat
**/
PolkadotParachainPrimitivesXcmpMessageFormat: {
_enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
},
/**
- * Lookup331: cumulus_pallet_xcmp_queue::OutboundChannelDetails
+ * Lookup335: cumulus_pallet_xcmp_queue::OutboundChannelDetails
**/
CumulusPalletXcmpQueueOutboundChannelDetails: {
recipient: 'u32',
@@ -2637,13 +2687,13 @@
lastIndex: 'u16'
},
/**
- * Lookup332: cumulus_pallet_xcmp_queue::OutboundState
+ * Lookup336: cumulus_pallet_xcmp_queue::OutboundState
**/
CumulusPalletXcmpQueueOutboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup334: cumulus_pallet_xcmp_queue::QueueConfigData
+ * Lookup338: cumulus_pallet_xcmp_queue::QueueConfigData
**/
CumulusPalletXcmpQueueQueueConfigData: {
suspendThreshold: 'u32',
@@ -2654,29 +2704,29 @@
xcmpMaxIndividualWeight: 'u64'
},
/**
- * Lookup336: cumulus_pallet_xcmp_queue::pallet::Error<T>
+ * Lookup340: cumulus_pallet_xcmp_queue::pallet::Error<T>
**/
CumulusPalletXcmpQueueError: {
_enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
},
/**
- * Lookup337: pallet_xcm::pallet::Error<T>
+ * Lookup341: pallet_xcm::pallet::Error<T>
**/
PalletXcmError: {
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
},
/**
- * Lookup338: cumulus_pallet_xcm::pallet::Error<T>
+ * Lookup342: cumulus_pallet_xcm::pallet::Error<T>
**/
CumulusPalletXcmError: 'Null',
/**
- * Lookup339: cumulus_pallet_dmp_queue::ConfigData
+ * Lookup343: cumulus_pallet_dmp_queue::ConfigData
**/
CumulusPalletDmpQueueConfigData: {
maxIndividual: 'u64'
},
/**
- * Lookup340: cumulus_pallet_dmp_queue::PageIndexData
+ * Lookup344: cumulus_pallet_dmp_queue::PageIndexData
**/
CumulusPalletDmpQueuePageIndexData: {
beginUsed: 'u32',
@@ -2684,19 +2734,19 @@
overweightCount: 'u64'
},
/**
- * Lookup343: cumulus_pallet_dmp_queue::pallet::Error<T>
+ * Lookup347: cumulus_pallet_dmp_queue::pallet::Error<T>
**/
CumulusPalletDmpQueueError: {
_enum: ['Unknown', 'OverLimit']
},
/**
- * Lookup347: pallet_unique::Error<T>
+ * Lookup351: 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>
+ * Lookup354: 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]>',
@@ -2706,7 +2756,7 @@
origin: 'OpalRuntimeOriginCaller'
},
/**
- * Lookup351: opal_runtime::OriginCaller
+ * Lookup355: opal_runtime::OriginCaller
**/
OpalRuntimeOriginCaller: {
_enum: {
@@ -2815,7 +2865,7 @@
}
},
/**
- * Lookup352: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
+ * Lookup356: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
**/
FrameSupportDispatchRawOrigin: {
_enum: {
@@ -2825,7 +2875,7 @@
}
},
/**
- * Lookup353: pallet_xcm::pallet::Origin
+ * Lookup357: pallet_xcm::pallet::Origin
**/
PalletXcmOrigin: {
_enum: {
@@ -2834,7 +2884,7 @@
}
},
/**
- * Lookup354: cumulus_pallet_xcm::pallet::Origin
+ * Lookup358: cumulus_pallet_xcm::pallet::Origin
**/
CumulusPalletXcmOrigin: {
_enum: {
@@ -2843,7 +2893,7 @@
}
},
/**
- * Lookup355: pallet_ethereum::RawOrigin
+ * Lookup359: pallet_ethereum::RawOrigin
**/
PalletEthereumRawOrigin: {
_enum: {
@@ -2851,17 +2901,17 @@
}
},
/**
- * Lookup356: sp_core::Void
+ * Lookup360: sp_core::Void
**/
SpCoreVoid: 'Null',
/**
- * Lookup357: pallet_unique_scheduler::pallet::Error<T>
+ * Lookup361: pallet_unique_scheduler::pallet::Error<T>
**/
PalletUniqueSchedulerError: {
_enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange']
},
/**
- * Lookup358: up_data_structs::Collection<sp_core::crypto::AccountId32>
+ * Lookup362: up_data_structs::Collection<sp_core::crypto::AccountId32>
**/
UpDataStructsCollection: {
owner: 'AccountId32',
@@ -2869,15 +2919,15 @@
name: 'Vec<u16>',
description: 'Vec<u16>',
tokenPrefix: 'Bytes',
- sponsorship: 'UpDataStructsSponsorshipState',
+ sponsorship: 'UpDataStructsSponsorshipStateAccountId32',
limits: 'UpDataStructsCollectionLimits',
permissions: 'UpDataStructsCollectionPermissions',
externalCollection: 'bool'
},
/**
- * Lookup359: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+ * Lookup363: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
**/
- UpDataStructsSponsorshipState: {
+ UpDataStructsSponsorshipStateAccountId32: {
_enum: {
Disabled: 'Null',
Unconfirmed: 'AccountId32',
@@ -2885,7 +2935,7 @@
}
},
/**
- * Lookup360: up_data_structs::Properties
+ * Lookup364: up_data_structs::Properties
**/
UpDataStructsProperties: {
map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2893,15 +2943,15 @@
spaceLimit: 'u32'
},
/**
- * Lookup361: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup365: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
/**
- * Lookup366: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
+ * Lookup370: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
**/
UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
/**
- * Lookup373: up_data_structs::CollectionStats
+ * Lookup377: up_data_structs::CollectionStats
**/
UpDataStructsCollectionStats: {
created: 'u32',
@@ -2909,18 +2959,18 @@
alive: 'u32'
},
/**
- * Lookup374: up_data_structs::TokenChild
+ * Lookup378: up_data_structs::TokenChild
**/
UpDataStructsTokenChild: {
token: 'u32',
collection: 'u32'
},
/**
- * Lookup375: PhantomType::up_data_structs<T>
+ * Lookup379: 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>>
+ * Lookup381: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
@@ -2928,7 +2978,7 @@
pieces: 'u128'
},
/**
- * Lookup379: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup383: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -2936,7 +2986,7 @@
name: 'Vec<u16>',
description: 'Vec<u16>',
tokenPrefix: 'Bytes',
- sponsorship: 'UpDataStructsSponsorshipState',
+ sponsorship: 'UpDataStructsSponsorshipStateAccountId32',
limits: 'UpDataStructsCollectionLimits',
permissions: 'UpDataStructsCollectionPermissions',
tokenPropertyPermissions: 'Vec<UpDataStructsPropertyKeyPermission>',
@@ -2944,7 +2994,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>
+ * Lookup384: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
**/
RmrkTraitsCollectionCollectionInfo: {
issuer: 'AccountId32',
@@ -2954,7 +3004,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>>
+ * Lookup385: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsNftNftInfo: {
owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
@@ -2964,14 +3014,14 @@
pending: 'bool'
},
/**
- * Lookup383: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+ * Lookup387: 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>>
+ * Lookup388: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceInfo: {
id: 'u32',
@@ -2980,14 +3030,14 @@
pendingRemoval: 'bool'
},
/**
- * Lookup385: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup389: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::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>>
+ * Lookup390: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsBaseBaseInfo: {
issuer: 'AccountId32',
@@ -2995,80 +3045,86 @@
symbol: 'Bytes'
},
/**
- * Lookup387: rmrk_traits::nft::NftChild
+ * Lookup391: rmrk_traits::nft::NftChild
**/
RmrkTraitsNftNftChild: {
collectionId: 'u32',
nftId: 'u32'
},
/**
- * Lookup389: pallet_common::pallet::Error<T>
+ * Lookup393: 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>
+ * Lookup395: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup392: pallet_refungible::ItemData
+ * Lookup396: pallet_refungible::ItemData
**/
PalletRefungibleItemData: {
constData: 'Bytes'
},
/**
- * Lookup397: pallet_refungible::pallet::Error<T>
+ * Lookup401: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup398: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup402: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup400: up_data_structs::PropertyScope
+ * Lookup404: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
- _enum: ['None', 'Rmrk', 'Eth']
+ _enum: ['None', 'Rmrk']
},
/**
- * Lookup402: pallet_nonfungible::pallet::Error<T>
+ * Lookup406: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup403: pallet_structure::pallet::Error<T>
+ * Lookup407: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound']
},
/**
- * Lookup404: pallet_rmrk_core::pallet::Error<T>
+ * Lookup408: 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>
+ * Lookup410: pallet_rmrk_equip::pallet::Error<T>
**/
PalletRmrkEquipError: {
_enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']
},
/**
- * Lookup409: pallet_evm::pallet::Error<T>
+ * Lookup416: pallet_app_promotion::pallet::Error<T>
**/
+ PalletAppPromotionError: {
+ _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation']
+ },
+ /**
+ * Lookup419: pallet_evm::pallet::Error<T>
+ **/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup412: fp_rpc::TransactionStatus
+ * Lookup422: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3080,11 +3136,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup414: ethbloom::Bloom
+ * Lookup424: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup416: ethereum::receipt::ReceiptV3
+ * Lookup426: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3094,7 +3150,7 @@
}
},
/**
- * Lookup417: ethereum::receipt::EIP658ReceiptData
+ * Lookup427: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3103,7 +3159,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup418: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup428: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3111,7 +3167,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup419: ethereum::header::Header
+ * Lookup429: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3131,41 +3187,51 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup420: ethereum_types::hash::H64
+ * Lookup430: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup425: pallet_ethereum::pallet::Error<T>
+ * Lookup435: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup426: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup436: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup427: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup437: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
+ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {
+ _enum: {
+ Disabled: 'Null',
+ Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr',
+ Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr'
+ }
+ },
+ /**
+ * Lookup438: pallet_evm_contract_helpers::SponsoringModeT
+ **/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup429: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup440: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
- _enum: ['NoPermission']
+ _enum: ['NoPermission', 'NoPendingSponsor']
},
/**
- * Lookup430: pallet_evm_migration::pallet::Error<T>
+ * Lookup441: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup432: sp_runtime::MultiSignature
+ * Lookup443: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3175,43 +3241,43 @@
}
},
/**
- * Lookup433: sp_core::ed25519::Signature
+ * Lookup444: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup435: sp_core::sr25519::Signature
+ * Lookup446: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup436: sp_core::ecdsa::Signature
+ * Lookup447: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup439: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup450: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup440: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup451: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup443: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup454: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup444: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup455: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup445: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup456: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup446: opal_runtime::Runtime
+ * Lookup457: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup447: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup458: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/registry.tsdiffbeforeafterboth--- a/tests/src/interfaces/registry.ts
+++ b/tests/src/interfaces/registry.ts
@@ -5,7 +5,7 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/types/types/registry';
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
declare module '@polkadot/types/types/registry' {
interface InterfaceTypes {
@@ -83,6 +83,9 @@
OrmlVestingModuleError: OrmlVestingModuleError;
OrmlVestingModuleEvent: OrmlVestingModuleEvent;
OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
+ PalletAppPromotionCall: PalletAppPromotionCall;
+ PalletAppPromotionError: PalletAppPromotionError;
+ PalletAppPromotionEvent: PalletAppPromotionEvent;
PalletBalancesAccountData: PalletBalancesAccountData;
PalletBalancesBalanceLock: PalletBalancesBalanceLock;
PalletBalancesCall: PalletBalancesCall;
@@ -103,6 +106,7 @@
PalletEvmCall: PalletEvmCall;
PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError;
PalletEvmContractHelpersError: PalletEvmContractHelpersError;
+ PalletEvmContractHelpersEvent: PalletEvmContractHelpersEvent;
PalletEvmContractHelpersSponsoringModeT: PalletEvmContractHelpersSponsoringModeT;
PalletEvmError: PalletEvmError;
PalletEvmEvent: PalletEvmEvent;
@@ -213,7 +217,8 @@
UpDataStructsPropertyScope: UpDataStructsPropertyScope;
UpDataStructsRpcCollection: UpDataStructsRpcCollection;
UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
- UpDataStructsSponsorshipState: UpDataStructsSponsorshipState;
+ UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32;
+ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr;
UpDataStructsTokenChild: UpDataStructsTokenChild;
UpDataStructsTokenData: UpDataStructsTokenData;
XcmDoubleEncoded: XcmDoubleEncoded;
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/types/lookup';78import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';9import type { ITuple } from '@polkadot/types-codec/types';10import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';11import type { Event } from '@polkadot/types/interfaces/system';1213declare module '@polkadot/types/lookup' {14 /** @name FrameSystemAccountInfo (3) */15 interface FrameSystemAccountInfo extends Struct {16 readonly nonce: u32;17 readonly consumers: u32;18 readonly providers: u32;19 readonly sufficients: u32;20 readonly data: PalletBalancesAccountData;21 }2223 /** @name PalletBalancesAccountData (5) */24 interface PalletBalancesAccountData extends Struct {25 readonly free: u128;26 readonly reserved: u128;27 readonly miscFrozen: u128;28 readonly feeFrozen: u128;29 }3031 /** @name FrameSupportWeightsPerDispatchClassU64 (7) */32 interface FrameSupportWeightsPerDispatchClassU64 extends Struct {33 readonly normal: u64;34 readonly operational: u64;35 readonly mandatory: u64;36 }3738 /** @name SpRuntimeDigest (11) */39 interface SpRuntimeDigest extends Struct {40 readonly logs: Vec<SpRuntimeDigestDigestItem>;41 }4243 /** @name SpRuntimeDigestDigestItem (13) */44 interface SpRuntimeDigestDigestItem extends Enum {45 readonly isOther: boolean;46 readonly asOther: Bytes;47 readonly isConsensus: boolean;48 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;49 readonly isSeal: boolean;50 readonly asSeal: ITuple<[U8aFixed, Bytes]>;51 readonly isPreRuntime: boolean;52 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;53 readonly isRuntimeEnvironmentUpdated: boolean;54 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';55 }5657 /** @name FrameSystemEventRecord (16) */58 interface FrameSystemEventRecord extends Struct {59 readonly phase: FrameSystemPhase;60 readonly event: Event;61 readonly topics: Vec<H256>;62 }6364 /** @name FrameSystemEvent (18) */65 interface FrameSystemEvent extends Enum {66 readonly isExtrinsicSuccess: boolean;67 readonly asExtrinsicSuccess: {68 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;69 } & Struct;70 readonly isExtrinsicFailed: boolean;71 readonly asExtrinsicFailed: {72 readonly dispatchError: SpRuntimeDispatchError;73 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;74 } & Struct;75 readonly isCodeUpdated: boolean;76 readonly isNewAccount: boolean;77 readonly asNewAccount: {78 readonly account: AccountId32;79 } & Struct;80 readonly isKilledAccount: boolean;81 readonly asKilledAccount: {82 readonly account: AccountId32;83 } & Struct;84 readonly isRemarked: boolean;85 readonly asRemarked: {86 readonly sender: AccountId32;87 readonly hash_: H256;88 } & Struct;89 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';90 }9192 /** @name FrameSupportWeightsDispatchInfo (19) */93 interface FrameSupportWeightsDispatchInfo extends Struct {94 readonly weight: u64;95 readonly class: FrameSupportWeightsDispatchClass;96 readonly paysFee: FrameSupportWeightsPays;97 }9899 /** @name FrameSupportWeightsDispatchClass (20) */100 interface FrameSupportWeightsDispatchClass extends Enum {101 readonly isNormal: boolean;102 readonly isOperational: boolean;103 readonly isMandatory: boolean;104 readonly type: 'Normal' | 'Operational' | 'Mandatory';105 }106107 /** @name FrameSupportWeightsPays (21) */108 interface FrameSupportWeightsPays extends Enum {109 readonly isYes: boolean;110 readonly isNo: boolean;111 readonly type: 'Yes' | 'No';112 }113114 /** @name SpRuntimeDispatchError (22) */115 interface SpRuntimeDispatchError extends Enum {116 readonly isOther: boolean;117 readonly isCannotLookup: boolean;118 readonly isBadOrigin: boolean;119 readonly isModule: boolean;120 readonly asModule: SpRuntimeModuleError;121 readonly isConsumerRemaining: boolean;122 readonly isNoProviders: boolean;123 readonly isTooManyConsumers: boolean;124 readonly isToken: boolean;125 readonly asToken: SpRuntimeTokenError;126 readonly isArithmetic: boolean;127 readonly asArithmetic: SpRuntimeArithmeticError;128 readonly isTransactional: boolean;129 readonly asTransactional: SpRuntimeTransactionalError;130 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';131 }132133 /** @name SpRuntimeModuleError (23) */134 interface SpRuntimeModuleError extends Struct {135 readonly index: u8;136 readonly error: U8aFixed;137 }138139 /** @name SpRuntimeTokenError (24) */140 interface SpRuntimeTokenError extends Enum {141 readonly isNoFunds: boolean;142 readonly isWouldDie: boolean;143 readonly isBelowMinimum: boolean;144 readonly isCannotCreate: boolean;145 readonly isUnknownAsset: boolean;146 readonly isFrozen: boolean;147 readonly isUnsupported: boolean;148 readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';149 }150151 /** @name SpRuntimeArithmeticError (25) */152 interface SpRuntimeArithmeticError extends Enum {153 readonly isUnderflow: boolean;154 readonly isOverflow: boolean;155 readonly isDivisionByZero: boolean;156 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';157 }158159 /** @name SpRuntimeTransactionalError (26) */160 interface SpRuntimeTransactionalError extends Enum {161 readonly isLimitReached: boolean;162 readonly isNoLayer: boolean;163 readonly type: 'LimitReached' | 'NoLayer';164 }165166 /** @name CumulusPalletParachainSystemEvent (27) */167 interface CumulusPalletParachainSystemEvent extends Enum {168 readonly isValidationFunctionStored: boolean;169 readonly isValidationFunctionApplied: boolean;170 readonly asValidationFunctionApplied: {171 readonly relayChainBlockNum: u32;172 } & Struct;173 readonly isValidationFunctionDiscarded: boolean;174 readonly isUpgradeAuthorized: boolean;175 readonly asUpgradeAuthorized: {176 readonly codeHash: H256;177 } & Struct;178 readonly isDownwardMessagesReceived: boolean;179 readonly asDownwardMessagesReceived: {180 readonly count: u32;181 } & Struct;182 readonly isDownwardMessagesProcessed: boolean;183 readonly asDownwardMessagesProcessed: {184 readonly weightUsed: u64;185 readonly dmqHead: H256;186 } & Struct;187 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed';188 }189190 /** @name PalletBalancesEvent (28) */191 interface PalletBalancesEvent extends Enum {192 readonly isEndowed: boolean;193 readonly asEndowed: {194 readonly account: AccountId32;195 readonly freeBalance: u128;196 } & Struct;197 readonly isDustLost: boolean;198 readonly asDustLost: {199 readonly account: AccountId32;200 readonly amount: u128;201 } & Struct;202 readonly isTransfer: boolean;203 readonly asTransfer: {204 readonly from: AccountId32;205 readonly to: AccountId32;206 readonly amount: u128;207 } & Struct;208 readonly isBalanceSet: boolean;209 readonly asBalanceSet: {210 readonly who: AccountId32;211 readonly free: u128;212 readonly reserved: u128;213 } & Struct;214 readonly isReserved: boolean;215 readonly asReserved: {216 readonly who: AccountId32;217 readonly amount: u128;218 } & Struct;219 readonly isUnreserved: boolean;220 readonly asUnreserved: {221 readonly who: AccountId32;222 readonly amount: u128;223 } & Struct;224 readonly isReserveRepatriated: boolean;225 readonly asReserveRepatriated: {226 readonly from: AccountId32;227 readonly to: AccountId32;228 readonly amount: u128;229 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;230 } & Struct;231 readonly isDeposit: boolean;232 readonly asDeposit: {233 readonly who: AccountId32;234 readonly amount: u128;235 } & Struct;236 readonly isWithdraw: boolean;237 readonly asWithdraw: {238 readonly who: AccountId32;239 readonly amount: u128;240 } & Struct;241 readonly isSlashed: boolean;242 readonly asSlashed: {243 readonly who: AccountId32;244 readonly amount: u128;245 } & Struct;246 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed';247 }248249 /** @name FrameSupportTokensMiscBalanceStatus (29) */250 interface FrameSupportTokensMiscBalanceStatus extends Enum {251 readonly isFree: boolean;252 readonly isReserved: boolean;253 readonly type: 'Free' | 'Reserved';254 }255256 /** @name PalletTransactionPaymentEvent (30) */257 interface PalletTransactionPaymentEvent extends Enum {258 readonly isTransactionFeePaid: boolean;259 readonly asTransactionFeePaid: {260 readonly who: AccountId32;261 readonly actualFee: u128;262 readonly tip: u128;263 } & Struct;264 readonly type: 'TransactionFeePaid';265 }266267 /** @name PalletTreasuryEvent (31) */268 interface PalletTreasuryEvent extends Enum {269 readonly isProposed: boolean;270 readonly asProposed: {271 readonly proposalIndex: u32;272 } & Struct;273 readonly isSpending: boolean;274 readonly asSpending: {275 readonly budgetRemaining: u128;276 } & Struct;277 readonly isAwarded: boolean;278 readonly asAwarded: {279 readonly proposalIndex: u32;280 readonly award: u128;281 readonly account: AccountId32;282 } & Struct;283 readonly isRejected: boolean;284 readonly asRejected: {285 readonly proposalIndex: u32;286 readonly slashed: u128;287 } & Struct;288 readonly isBurnt: boolean;289 readonly asBurnt: {290 readonly burntFunds: u128;291 } & Struct;292 readonly isRollover: boolean;293 readonly asRollover: {294 readonly rolloverBalance: u128;295 } & Struct;296 readonly isDeposit: boolean;297 readonly asDeposit: {298 readonly value: u128;299 } & Struct;300 readonly isSpendApproved: boolean;301 readonly asSpendApproved: {302 readonly proposalIndex: u32;303 readonly amount: u128;304 readonly beneficiary: AccountId32;305 } & Struct;306 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved';307 }308309 /** @name PalletSudoEvent (32) */310 interface PalletSudoEvent extends Enum {311 readonly isSudid: boolean;312 readonly asSudid: {313 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;314 } & Struct;315 readonly isKeyChanged: boolean;316 readonly asKeyChanged: {317 readonly oldSudoer: Option<AccountId32>;318 } & Struct;319 readonly isSudoAsDone: boolean;320 readonly asSudoAsDone: {321 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;322 } & Struct;323 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';324 }325326 /** @name OrmlVestingModuleEvent (36) */327 interface OrmlVestingModuleEvent extends Enum {328 readonly isVestingScheduleAdded: boolean;329 readonly asVestingScheduleAdded: {330 readonly from: AccountId32;331 readonly to: AccountId32;332 readonly vestingSchedule: OrmlVestingVestingSchedule;333 } & Struct;334 readonly isClaimed: boolean;335 readonly asClaimed: {336 readonly who: AccountId32;337 readonly amount: u128;338 } & Struct;339 readonly isVestingSchedulesUpdated: boolean;340 readonly asVestingSchedulesUpdated: {341 readonly who: AccountId32;342 } & Struct;343 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';344 }345346 /** @name OrmlVestingVestingSchedule (37) */347 interface OrmlVestingVestingSchedule extends Struct {348 readonly start: u32;349 readonly period: u32;350 readonly periodCount: u32;351 readonly perPeriod: Compact<u128>;352 }353354 /** @name CumulusPalletXcmpQueueEvent (39) */355 interface CumulusPalletXcmpQueueEvent extends Enum {356 readonly isSuccess: boolean;357 readonly asSuccess: {358 readonly messageHash: Option<H256>;359 readonly weight: u64;360 } & Struct;361 readonly isFail: boolean;362 readonly asFail: {363 readonly messageHash: Option<H256>;364 readonly error: XcmV2TraitsError;365 readonly weight: u64;366 } & Struct;367 readonly isBadVersion: boolean;368 readonly asBadVersion: {369 readonly messageHash: Option<H256>;370 } & Struct;371 readonly isBadFormat: boolean;372 readonly asBadFormat: {373 readonly messageHash: Option<H256>;374 } & Struct;375 readonly isUpwardMessageSent: boolean;376 readonly asUpwardMessageSent: {377 readonly messageHash: Option<H256>;378 } & Struct;379 readonly isXcmpMessageSent: boolean;380 readonly asXcmpMessageSent: {381 readonly messageHash: Option<H256>;382 } & Struct;383 readonly isOverweightEnqueued: boolean;384 readonly asOverweightEnqueued: {385 readonly sender: u32;386 readonly sentAt: u32;387 readonly index: u64;388 readonly required: u64;389 } & Struct;390 readonly isOverweightServiced: boolean;391 readonly asOverweightServiced: {392 readonly index: u64;393 readonly used: u64;394 } & Struct;395 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';396 }397398 /** @name XcmV2TraitsError (41) */399 interface XcmV2TraitsError extends Enum {400 readonly isOverflow: boolean;401 readonly isUnimplemented: boolean;402 readonly isUntrustedReserveLocation: boolean;403 readonly isUntrustedTeleportLocation: boolean;404 readonly isMultiLocationFull: boolean;405 readonly isMultiLocationNotInvertible: boolean;406 readonly isBadOrigin: boolean;407 readonly isInvalidLocation: boolean;408 readonly isAssetNotFound: boolean;409 readonly isFailedToTransactAsset: boolean;410 readonly isNotWithdrawable: boolean;411 readonly isLocationCannotHold: boolean;412 readonly isExceedsMaxMessageSize: boolean;413 readonly isDestinationUnsupported: boolean;414 readonly isTransport: boolean;415 readonly isUnroutable: boolean;416 readonly isUnknownClaim: boolean;417 readonly isFailedToDecode: boolean;418 readonly isMaxWeightInvalid: boolean;419 readonly isNotHoldingFees: boolean;420 readonly isTooExpensive: boolean;421 readonly isTrap: boolean;422 readonly asTrap: u64;423 readonly isUnhandledXcmVersion: boolean;424 readonly isWeightLimitReached: boolean;425 readonly asWeightLimitReached: u64;426 readonly isBarrier: boolean;427 readonly isWeightNotComputable: boolean;428 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';429 }430431 /** @name PalletXcmEvent (43) */432 interface PalletXcmEvent extends Enum {433 readonly isAttempted: boolean;434 readonly asAttempted: XcmV2TraitsOutcome;435 readonly isSent: boolean;436 readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>;437 readonly isUnexpectedResponse: boolean;438 readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>;439 readonly isResponseReady: boolean;440 readonly asResponseReady: ITuple<[u64, XcmV2Response]>;441 readonly isNotified: boolean;442 readonly asNotified: ITuple<[u64, u8, u8]>;443 readonly isNotifyOverweight: boolean;444 readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>;445 readonly isNotifyDispatchError: boolean;446 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;447 readonly isNotifyDecodeFailed: boolean;448 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;449 readonly isInvalidResponder: boolean;450 readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;451 readonly isInvalidResponderVersion: boolean;452 readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>;453 readonly isResponseTaken: boolean;454 readonly asResponseTaken: u64;455 readonly isAssetsTrapped: boolean;456 readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>;457 readonly isVersionChangeNotified: boolean;458 readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>;459 readonly isSupportedVersionChanged: boolean;460 readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>;461 readonly isNotifyTargetSendFail: boolean;462 readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>;463 readonly isNotifyTargetMigrationFail: boolean;464 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;465 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';466 }467468 /** @name XcmV2TraitsOutcome (44) */469 interface XcmV2TraitsOutcome extends Enum {470 readonly isComplete: boolean;471 readonly asComplete: u64;472 readonly isIncomplete: boolean;473 readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>;474 readonly isError: boolean;475 readonly asError: XcmV2TraitsError;476 readonly type: 'Complete' | 'Incomplete' | 'Error';477 }478479 /** @name XcmV1MultiLocation (45) */480 interface XcmV1MultiLocation extends Struct {481 readonly parents: u8;482 readonly interior: XcmV1MultilocationJunctions;483 }484485 /** @name XcmV1MultilocationJunctions (46) */486 interface XcmV1MultilocationJunctions extends Enum {487 readonly isHere: boolean;488 readonly isX1: boolean;489 readonly asX1: XcmV1Junction;490 readonly isX2: boolean;491 readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;492 readonly isX3: boolean;493 readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;494 readonly isX4: boolean;495 readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;496 readonly isX5: boolean;497 readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;498 readonly isX6: boolean;499 readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;500 readonly isX7: boolean;501 readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;502 readonly isX8: boolean;503 readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;504 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';505 }506507 /** @name XcmV1Junction (47) */508 interface XcmV1Junction extends Enum {509 readonly isParachain: boolean;510 readonly asParachain: Compact<u32>;511 readonly isAccountId32: boolean;512 readonly asAccountId32: {513 readonly network: XcmV0JunctionNetworkId;514 readonly id: U8aFixed;515 } & Struct;516 readonly isAccountIndex64: boolean;517 readonly asAccountIndex64: {518 readonly network: XcmV0JunctionNetworkId;519 readonly index: Compact<u64>;520 } & Struct;521 readonly isAccountKey20: boolean;522 readonly asAccountKey20: {523 readonly network: XcmV0JunctionNetworkId;524 readonly key: U8aFixed;525 } & Struct;526 readonly isPalletInstance: boolean;527 readonly asPalletInstance: u8;528 readonly isGeneralIndex: boolean;529 readonly asGeneralIndex: Compact<u128>;530 readonly isGeneralKey: boolean;531 readonly asGeneralKey: Bytes;532 readonly isOnlyChild: boolean;533 readonly isPlurality: boolean;534 readonly asPlurality: {535 readonly id: XcmV0JunctionBodyId;536 readonly part: XcmV0JunctionBodyPart;537 } & Struct;538 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';539 }540541 /** @name XcmV0JunctionNetworkId (49) */542 interface XcmV0JunctionNetworkId extends Enum {543 readonly isAny: boolean;544 readonly isNamed: boolean;545 readonly asNamed: Bytes;546 readonly isPolkadot: boolean;547 readonly isKusama: boolean;548 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';549 }550551 /** @name XcmV0JunctionBodyId (53) */552 interface XcmV0JunctionBodyId extends Enum {553 readonly isUnit: boolean;554 readonly isNamed: boolean;555 readonly asNamed: Bytes;556 readonly isIndex: boolean;557 readonly asIndex: Compact<u32>;558 readonly isExecutive: boolean;559 readonly isTechnical: boolean;560 readonly isLegislative: boolean;561 readonly isJudicial: boolean;562 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';563 }564565 /** @name XcmV0JunctionBodyPart (54) */566 interface XcmV0JunctionBodyPart extends Enum {567 readonly isVoice: boolean;568 readonly isMembers: boolean;569 readonly asMembers: {570 readonly count: Compact<u32>;571 } & Struct;572 readonly isFraction: boolean;573 readonly asFraction: {574 readonly nom: Compact<u32>;575 readonly denom: Compact<u32>;576 } & Struct;577 readonly isAtLeastProportion: boolean;578 readonly asAtLeastProportion: {579 readonly nom: Compact<u32>;580 readonly denom: Compact<u32>;581 } & Struct;582 readonly isMoreThanProportion: boolean;583 readonly asMoreThanProportion: {584 readonly nom: Compact<u32>;585 readonly denom: Compact<u32>;586 } & Struct;587 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';588 }589590 /** @name XcmV2Xcm (55) */591 interface XcmV2Xcm extends Vec<XcmV2Instruction> {}592593 /** @name XcmV2Instruction (57) */594 interface XcmV2Instruction extends Enum {595 readonly isWithdrawAsset: boolean;596 readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;597 readonly isReserveAssetDeposited: boolean;598 readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets;599 readonly isReceiveTeleportedAsset: boolean;600 readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets;601 readonly isQueryResponse: boolean;602 readonly asQueryResponse: {603 readonly queryId: Compact<u64>;604 readonly response: XcmV2Response;605 readonly maxWeight: Compact<u64>;606 } & Struct;607 readonly isTransferAsset: boolean;608 readonly asTransferAsset: {609 readonly assets: XcmV1MultiassetMultiAssets;610 readonly beneficiary: XcmV1MultiLocation;611 } & Struct;612 readonly isTransferReserveAsset: boolean;613 readonly asTransferReserveAsset: {614 readonly assets: XcmV1MultiassetMultiAssets;615 readonly dest: XcmV1MultiLocation;616 readonly xcm: XcmV2Xcm;617 } & Struct;618 readonly isTransact: boolean;619 readonly asTransact: {620 readonly originType: XcmV0OriginKind;621 readonly requireWeightAtMost: Compact<u64>;622 readonly call: XcmDoubleEncoded;623 } & Struct;624 readonly isHrmpNewChannelOpenRequest: boolean;625 readonly asHrmpNewChannelOpenRequest: {626 readonly sender: Compact<u32>;627 readonly maxMessageSize: Compact<u32>;628 readonly maxCapacity: Compact<u32>;629 } & Struct;630 readonly isHrmpChannelAccepted: boolean;631 readonly asHrmpChannelAccepted: {632 readonly recipient: Compact<u32>;633 } & Struct;634 readonly isHrmpChannelClosing: boolean;635 readonly asHrmpChannelClosing: {636 readonly initiator: Compact<u32>;637 readonly sender: Compact<u32>;638 readonly recipient: Compact<u32>;639 } & Struct;640 readonly isClearOrigin: boolean;641 readonly isDescendOrigin: boolean;642 readonly asDescendOrigin: XcmV1MultilocationJunctions;643 readonly isReportError: boolean;644 readonly asReportError: {645 readonly queryId: Compact<u64>;646 readonly dest: XcmV1MultiLocation;647 readonly maxResponseWeight: Compact<u64>;648 } & Struct;649 readonly isDepositAsset: boolean;650 readonly asDepositAsset: {651 readonly assets: XcmV1MultiassetMultiAssetFilter;652 readonly maxAssets: Compact<u32>;653 readonly beneficiary: XcmV1MultiLocation;654 } & Struct;655 readonly isDepositReserveAsset: boolean;656 readonly asDepositReserveAsset: {657 readonly assets: XcmV1MultiassetMultiAssetFilter;658 readonly maxAssets: Compact<u32>;659 readonly dest: XcmV1MultiLocation;660 readonly xcm: XcmV2Xcm;661 } & Struct;662 readonly isExchangeAsset: boolean;663 readonly asExchangeAsset: {664 readonly give: XcmV1MultiassetMultiAssetFilter;665 readonly receive: XcmV1MultiassetMultiAssets;666 } & Struct;667 readonly isInitiateReserveWithdraw: boolean;668 readonly asInitiateReserveWithdraw: {669 readonly assets: XcmV1MultiassetMultiAssetFilter;670 readonly reserve: XcmV1MultiLocation;671 readonly xcm: XcmV2Xcm;672 } & Struct;673 readonly isInitiateTeleport: boolean;674 readonly asInitiateTeleport: {675 readonly assets: XcmV1MultiassetMultiAssetFilter;676 readonly dest: XcmV1MultiLocation;677 readonly xcm: XcmV2Xcm;678 } & Struct;679 readonly isQueryHolding: boolean;680 readonly asQueryHolding: {681 readonly queryId: Compact<u64>;682 readonly dest: XcmV1MultiLocation;683 readonly assets: XcmV1MultiassetMultiAssetFilter;684 readonly maxResponseWeight: Compact<u64>;685 } & Struct;686 readonly isBuyExecution: boolean;687 readonly asBuyExecution: {688 readonly fees: XcmV1MultiAsset;689 readonly weightLimit: XcmV2WeightLimit;690 } & Struct;691 readonly isRefundSurplus: boolean;692 readonly isSetErrorHandler: boolean;693 readonly asSetErrorHandler: XcmV2Xcm;694 readonly isSetAppendix: boolean;695 readonly asSetAppendix: XcmV2Xcm;696 readonly isClearError: boolean;697 readonly isClaimAsset: boolean;698 readonly asClaimAsset: {699 readonly assets: XcmV1MultiassetMultiAssets;700 readonly ticket: XcmV1MultiLocation;701 } & Struct;702 readonly isTrap: boolean;703 readonly asTrap: Compact<u64>;704 readonly isSubscribeVersion: boolean;705 readonly asSubscribeVersion: {706 readonly queryId: Compact<u64>;707 readonly maxResponseWeight: Compact<u64>;708 } & Struct;709 readonly isUnsubscribeVersion: boolean;710 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';711 }712713 /** @name XcmV1MultiassetMultiAssets (58) */714 interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}715716 /** @name XcmV1MultiAsset (60) */717 interface XcmV1MultiAsset extends Struct {718 readonly id: XcmV1MultiassetAssetId;719 readonly fun: XcmV1MultiassetFungibility;720 }721722 /** @name XcmV1MultiassetAssetId (61) */723 interface XcmV1MultiassetAssetId extends Enum {724 readonly isConcrete: boolean;725 readonly asConcrete: XcmV1MultiLocation;726 readonly isAbstract: boolean;727 readonly asAbstract: Bytes;728 readonly type: 'Concrete' | 'Abstract';729 }730731 /** @name XcmV1MultiassetFungibility (62) */732 interface XcmV1MultiassetFungibility extends Enum {733 readonly isFungible: boolean;734 readonly asFungible: Compact<u128>;735 readonly isNonFungible: boolean;736 readonly asNonFungible: XcmV1MultiassetAssetInstance;737 readonly type: 'Fungible' | 'NonFungible';738 }739740 /** @name XcmV1MultiassetAssetInstance (63) */741 interface XcmV1MultiassetAssetInstance extends Enum {742 readonly isUndefined: boolean;743 readonly isIndex: boolean;744 readonly asIndex: Compact<u128>;745 readonly isArray4: boolean;746 readonly asArray4: U8aFixed;747 readonly isArray8: boolean;748 readonly asArray8: U8aFixed;749 readonly isArray16: boolean;750 readonly asArray16: U8aFixed;751 readonly isArray32: boolean;752 readonly asArray32: U8aFixed;753 readonly isBlob: boolean;754 readonly asBlob: Bytes;755 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';756 }757758 /** @name XcmV2Response (66) */759 interface XcmV2Response extends Enum {760 readonly isNull: boolean;761 readonly isAssets: boolean;762 readonly asAssets: XcmV1MultiassetMultiAssets;763 readonly isExecutionResult: boolean;764 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;765 readonly isVersion: boolean;766 readonly asVersion: u32;767 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';768 }769770 /** @name XcmV0OriginKind (69) */771 interface XcmV0OriginKind extends Enum {772 readonly isNative: boolean;773 readonly isSovereignAccount: boolean;774 readonly isSuperuser: boolean;775 readonly isXcm: boolean;776 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';777 }778779 /** @name XcmDoubleEncoded (70) */780 interface XcmDoubleEncoded extends Struct {781 readonly encoded: Bytes;782 }783784 /** @name XcmV1MultiassetMultiAssetFilter (71) */785 interface XcmV1MultiassetMultiAssetFilter extends Enum {786 readonly isDefinite: boolean;787 readonly asDefinite: XcmV1MultiassetMultiAssets;788 readonly isWild: boolean;789 readonly asWild: XcmV1MultiassetWildMultiAsset;790 readonly type: 'Definite' | 'Wild';791 }792793 /** @name XcmV1MultiassetWildMultiAsset (72) */794 interface XcmV1MultiassetWildMultiAsset extends Enum {795 readonly isAll: boolean;796 readonly isAllOf: boolean;797 readonly asAllOf: {798 readonly id: XcmV1MultiassetAssetId;799 readonly fun: XcmV1MultiassetWildFungibility;800 } & Struct;801 readonly type: 'All' | 'AllOf';802 }803804 /** @name XcmV1MultiassetWildFungibility (73) */805 interface XcmV1MultiassetWildFungibility extends Enum {806 readonly isFungible: boolean;807 readonly isNonFungible: boolean;808 readonly type: 'Fungible' | 'NonFungible';809 }810811 /** @name XcmV2WeightLimit (74) */812 interface XcmV2WeightLimit extends Enum {813 readonly isUnlimited: boolean;814 readonly isLimited: boolean;815 readonly asLimited: Compact<u64>;816 readonly type: 'Unlimited' | 'Limited';817 }818819 /** @name XcmVersionedMultiAssets (76) */820 interface XcmVersionedMultiAssets extends Enum {821 readonly isV0: boolean;822 readonly asV0: Vec<XcmV0MultiAsset>;823 readonly isV1: boolean;824 readonly asV1: XcmV1MultiassetMultiAssets;825 readonly type: 'V0' | 'V1';826 }827828 /** @name XcmV0MultiAsset (78) */829 interface XcmV0MultiAsset extends Enum {830 readonly isNone: boolean;831 readonly isAll: boolean;832 readonly isAllFungible: boolean;833 readonly isAllNonFungible: boolean;834 readonly isAllAbstractFungible: boolean;835 readonly asAllAbstractFungible: {836 readonly id: Bytes;837 } & Struct;838 readonly isAllAbstractNonFungible: boolean;839 readonly asAllAbstractNonFungible: {840 readonly class: Bytes;841 } & Struct;842 readonly isAllConcreteFungible: boolean;843 readonly asAllConcreteFungible: {844 readonly id: XcmV0MultiLocation;845 } & Struct;846 readonly isAllConcreteNonFungible: boolean;847 readonly asAllConcreteNonFungible: {848 readonly class: XcmV0MultiLocation;849 } & Struct;850 readonly isAbstractFungible: boolean;851 readonly asAbstractFungible: {852 readonly id: Bytes;853 readonly amount: Compact<u128>;854 } & Struct;855 readonly isAbstractNonFungible: boolean;856 readonly asAbstractNonFungible: {857 readonly class: Bytes;858 readonly instance: XcmV1MultiassetAssetInstance;859 } & Struct;860 readonly isConcreteFungible: boolean;861 readonly asConcreteFungible: {862 readonly id: XcmV0MultiLocation;863 readonly amount: Compact<u128>;864 } & Struct;865 readonly isConcreteNonFungible: boolean;866 readonly asConcreteNonFungible: {867 readonly class: XcmV0MultiLocation;868 readonly instance: XcmV1MultiassetAssetInstance;869 } & Struct;870 readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';871 }872873 /** @name XcmV0MultiLocation (79) */874 interface XcmV0MultiLocation extends Enum {875 readonly isNull: boolean;876 readonly isX1: boolean;877 readonly asX1: XcmV0Junction;878 readonly isX2: boolean;879 readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>;880 readonly isX3: boolean;881 readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>;882 readonly isX4: boolean;883 readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;884 readonly isX5: boolean;885 readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;886 readonly isX6: boolean;887 readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;888 readonly isX7: boolean;889 readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;890 readonly isX8: boolean;891 readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;892 readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';893 }894895 /** @name XcmV0Junction (80) */896 interface XcmV0Junction extends Enum {897 readonly isParent: boolean;898 readonly isParachain: boolean;899 readonly asParachain: Compact<u32>;900 readonly isAccountId32: boolean;901 readonly asAccountId32: {902 readonly network: XcmV0JunctionNetworkId;903 readonly id: U8aFixed;904 } & Struct;905 readonly isAccountIndex64: boolean;906 readonly asAccountIndex64: {907 readonly network: XcmV0JunctionNetworkId;908 readonly index: Compact<u64>;909 } & Struct;910 readonly isAccountKey20: boolean;911 readonly asAccountKey20: {912 readonly network: XcmV0JunctionNetworkId;913 readonly key: U8aFixed;914 } & Struct;915 readonly isPalletInstance: boolean;916 readonly asPalletInstance: u8;917 readonly isGeneralIndex: boolean;918 readonly asGeneralIndex: Compact<u128>;919 readonly isGeneralKey: boolean;920 readonly asGeneralKey: Bytes;921 readonly isOnlyChild: boolean;922 readonly isPlurality: boolean;923 readonly asPlurality: {924 readonly id: XcmV0JunctionBodyId;925 readonly part: XcmV0JunctionBodyPart;926 } & Struct;927 readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';928 }929930 /** @name XcmVersionedMultiLocation (81) */931 interface XcmVersionedMultiLocation extends Enum {932 readonly isV0: boolean;933 readonly asV0: XcmV0MultiLocation;934 readonly isV1: boolean;935 readonly asV1: XcmV1MultiLocation;936 readonly type: 'V0' | 'V1';937 }938939 /** @name CumulusPalletXcmEvent (82) */940 interface CumulusPalletXcmEvent extends Enum {941 readonly isInvalidFormat: boolean;942 readonly asInvalidFormat: U8aFixed;943 readonly isUnsupportedVersion: boolean;944 readonly asUnsupportedVersion: U8aFixed;945 readonly isExecutedDownward: boolean;946 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>;947 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';948 }949950 /** @name CumulusPalletDmpQueueEvent (83) */951 interface CumulusPalletDmpQueueEvent extends Enum {952 readonly isInvalidFormat: boolean;953 readonly asInvalidFormat: {954 readonly messageId: U8aFixed;955 } & Struct;956 readonly isUnsupportedVersion: boolean;957 readonly asUnsupportedVersion: {958 readonly messageId: U8aFixed;959 } & Struct;960 readonly isExecutedDownward: boolean;961 readonly asExecutedDownward: {962 readonly messageId: U8aFixed;963 readonly outcome: XcmV2TraitsOutcome;964 } & Struct;965 readonly isWeightExhausted: boolean;966 readonly asWeightExhausted: {967 readonly messageId: U8aFixed;968 readonly remainingWeight: u64;969 readonly requiredWeight: u64;970 } & Struct;971 readonly isOverweightEnqueued: boolean;972 readonly asOverweightEnqueued: {973 readonly messageId: U8aFixed;974 readonly overweightIndex: u64;975 readonly requiredWeight: u64;976 } & Struct;977 readonly isOverweightServiced: boolean;978 readonly asOverweightServiced: {979 readonly overweightIndex: u64;980 readonly weightUsed: u64;981 } & Struct;982 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';983 }984985 /** @name PalletUniqueRawEvent (84) */986 interface PalletUniqueRawEvent extends Enum {987 readonly isCollectionSponsorRemoved: boolean;988 readonly asCollectionSponsorRemoved: u32;989 readonly isCollectionAdminAdded: boolean;990 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;991 readonly isCollectionOwnedChanged: boolean;992 readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>;993 readonly isCollectionSponsorSet: boolean;994 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;995 readonly isSponsorshipConfirmed: boolean;996 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;997 readonly isCollectionAdminRemoved: boolean;998 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;999 readonly isAllowListAddressRemoved: boolean;1000 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1001 readonly isAllowListAddressAdded: boolean;1002 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1003 readonly isCollectionLimitSet: boolean;1004 readonly asCollectionLimitSet: u32;1005 readonly isCollectionPermissionSet: boolean;1006 readonly asCollectionPermissionSet: u32;1007 readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';1008 }10091010 /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */1011 interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1012 readonly isSubstrate: boolean;1013 readonly asSubstrate: AccountId32;1014 readonly isEthereum: boolean;1015 readonly asEthereum: H160;1016 readonly type: 'Substrate' | 'Ethereum';1017 }10181019 /** @name PalletUniqueSchedulerEvent (88) */1020 interface PalletUniqueSchedulerEvent extends Enum {1021 readonly isScheduled: boolean;1022 readonly asScheduled: {1023 readonly when: u32;1024 readonly index: u32;1025 } & Struct;1026 readonly isCanceled: boolean;1027 readonly asCanceled: {1028 readonly when: u32;1029 readonly index: u32;1030 } & Struct;1031 readonly isDispatched: boolean;1032 readonly asDispatched: {1033 readonly task: ITuple<[u32, u32]>;1034 readonly id: Option<U8aFixed>;1035 readonly result: Result<Null, SpRuntimeDispatchError>;1036 } & Struct;1037 readonly isCallLookupFailed: boolean;1038 readonly asCallLookupFailed: {1039 readonly task: ITuple<[u32, u32]>;1040 readonly id: Option<U8aFixed>;1041 readonly error: FrameSupportScheduleLookupError;1042 } & Struct;1043 readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';1044 }10451046 /** @name FrameSupportScheduleLookupError (91) */1047 interface FrameSupportScheduleLookupError extends Enum {1048 readonly isUnknown: boolean;1049 readonly isBadFormat: boolean;1050 readonly type: 'Unknown' | 'BadFormat';1051 }10521053 /** @name PalletCommonEvent (92) */1054 interface PalletCommonEvent extends Enum {1055 readonly isCollectionCreated: boolean;1056 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1057 readonly isCollectionDestroyed: boolean;1058 readonly asCollectionDestroyed: u32;1059 readonly isItemCreated: boolean;1060 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1061 readonly isItemDestroyed: boolean;1062 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1063 readonly isTransfer: boolean;1064 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1065 readonly isApproved: boolean;1066 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1067 readonly isCollectionPropertySet: boolean;1068 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1069 readonly isCollectionPropertyDeleted: boolean;1070 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1071 readonly isTokenPropertySet: boolean;1072 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1073 readonly isTokenPropertyDeleted: boolean;1074 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1075 readonly isPropertyPermissionSet: boolean;1076 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1077 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';1078 }10791080 /** @name PalletStructureEvent (95) */1081 interface PalletStructureEvent extends Enum {1082 readonly isExecuted: boolean;1083 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;1084 readonly type: 'Executed';1085 }10861087 /** @name PalletRmrkCoreEvent (96) */1088 interface PalletRmrkCoreEvent extends Enum {1089 readonly isCollectionCreated: boolean;1090 readonly asCollectionCreated: {1091 readonly issuer: AccountId32;1092 readonly collectionId: u32;1093 } & Struct;1094 readonly isCollectionDestroyed: boolean;1095 readonly asCollectionDestroyed: {1096 readonly issuer: AccountId32;1097 readonly collectionId: u32;1098 } & Struct;1099 readonly isIssuerChanged: boolean;1100 readonly asIssuerChanged: {1101 readonly oldIssuer: AccountId32;1102 readonly newIssuer: AccountId32;1103 readonly collectionId: u32;1104 } & Struct;1105 readonly isCollectionLocked: boolean;1106 readonly asCollectionLocked: {1107 readonly issuer: AccountId32;1108 readonly collectionId: u32;1109 } & Struct;1110 readonly isNftMinted: boolean;1111 readonly asNftMinted: {1112 readonly owner: AccountId32;1113 readonly collectionId: u32;1114 readonly nftId: u32;1115 } & Struct;1116 readonly isNftBurned: boolean;1117 readonly asNftBurned: {1118 readonly owner: AccountId32;1119 readonly nftId: u32;1120 } & Struct;1121 readonly isNftSent: boolean;1122 readonly asNftSent: {1123 readonly sender: AccountId32;1124 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1125 readonly collectionId: u32;1126 readonly nftId: u32;1127 readonly approvalRequired: bool;1128 } & Struct;1129 readonly isNftAccepted: boolean;1130 readonly asNftAccepted: {1131 readonly sender: AccountId32;1132 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1133 readonly collectionId: u32;1134 readonly nftId: u32;1135 } & Struct;1136 readonly isNftRejected: boolean;1137 readonly asNftRejected: {1138 readonly sender: AccountId32;1139 readonly collectionId: u32;1140 readonly nftId: u32;1141 } & Struct;1142 readonly isPropertySet: boolean;1143 readonly asPropertySet: {1144 readonly collectionId: u32;1145 readonly maybeNftId: Option<u32>;1146 readonly key: Bytes;1147 readonly value: Bytes;1148 } & Struct;1149 readonly isResourceAdded: boolean;1150 readonly asResourceAdded: {1151 readonly nftId: u32;1152 readonly resourceId: u32;1153 } & Struct;1154 readonly isResourceRemoval: boolean;1155 readonly asResourceRemoval: {1156 readonly nftId: u32;1157 readonly resourceId: u32;1158 } & Struct;1159 readonly isResourceAccepted: boolean;1160 readonly asResourceAccepted: {1161 readonly nftId: u32;1162 readonly resourceId: u32;1163 } & Struct;1164 readonly isResourceRemovalAccepted: boolean;1165 readonly asResourceRemovalAccepted: {1166 readonly nftId: u32;1167 readonly resourceId: u32;1168 } & Struct;1169 readonly isPrioritySet: boolean;1170 readonly asPrioritySet: {1171 readonly collectionId: u32;1172 readonly nftId: u32;1173 } & Struct;1174 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';1175 }11761177 /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */1178 interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {1179 readonly isAccountId: boolean;1180 readonly asAccountId: AccountId32;1181 readonly isCollectionAndNftTuple: boolean;1182 readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;1183 readonly type: 'AccountId' | 'CollectionAndNftTuple';1184 }11851186 /** @name PalletRmrkEquipEvent (102) */1187 interface PalletRmrkEquipEvent extends Enum {1188 readonly isBaseCreated: boolean;1189 readonly asBaseCreated: {1190 readonly issuer: AccountId32;1191 readonly baseId: u32;1192 } & Struct;1193 readonly isEquippablesUpdated: boolean;1194 readonly asEquippablesUpdated: {1195 readonly baseId: u32;1196 readonly slotId: u32;1197 } & Struct;1198 readonly type: 'BaseCreated' | 'EquippablesUpdated';1199 }12001201 /** @name PalletEvmEvent (103) */1202 interface PalletEvmEvent extends Enum {1203 readonly isLog: boolean;1204 readonly asLog: EthereumLog;1205 readonly isCreated: boolean;1206 readonly asCreated: H160;1207 readonly isCreatedFailed: boolean;1208 readonly asCreatedFailed: H160;1209 readonly isExecuted: boolean;1210 readonly asExecuted: H160;1211 readonly isExecutedFailed: boolean;1212 readonly asExecutedFailed: H160;1213 readonly isBalanceDeposit: boolean;1214 readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;1215 readonly isBalanceWithdraw: boolean;1216 readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;1217 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';1218 }12191220 /** @name EthereumLog (104) */1221 interface EthereumLog extends Struct {1222 readonly address: H160;1223 readonly topics: Vec<H256>;1224 readonly data: Bytes;1225 }12261227 /** @name PalletEthereumEvent (108) */1228 interface PalletEthereumEvent extends Enum {1229 readonly isExecuted: boolean;1230 readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;1231 readonly type: 'Executed';1232 }12331234 /** @name EvmCoreErrorExitReason (109) */1235 interface EvmCoreErrorExitReason extends Enum {1236 readonly isSucceed: boolean;1237 readonly asSucceed: EvmCoreErrorExitSucceed;1238 readonly isError: boolean;1239 readonly asError: EvmCoreErrorExitError;1240 readonly isRevert: boolean;1241 readonly asRevert: EvmCoreErrorExitRevert;1242 readonly isFatal: boolean;1243 readonly asFatal: EvmCoreErrorExitFatal;1244 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';1245 }12461247 /** @name EvmCoreErrorExitSucceed (110) */1248 interface EvmCoreErrorExitSucceed extends Enum {1249 readonly isStopped: boolean;1250 readonly isReturned: boolean;1251 readonly isSuicided: boolean;1252 readonly type: 'Stopped' | 'Returned' | 'Suicided';1253 }12541255 /** @name EvmCoreErrorExitError (111) */1256 interface EvmCoreErrorExitError extends Enum {1257 readonly isStackUnderflow: boolean;1258 readonly isStackOverflow: boolean;1259 readonly isInvalidJump: boolean;1260 readonly isInvalidRange: boolean;1261 readonly isDesignatedInvalid: boolean;1262 readonly isCallTooDeep: boolean;1263 readonly isCreateCollision: boolean;1264 readonly isCreateContractLimit: boolean;1265 readonly isOutOfOffset: boolean;1266 readonly isOutOfGas: boolean;1267 readonly isOutOfFund: boolean;1268 readonly isPcUnderflow: boolean;1269 readonly isCreateEmpty: boolean;1270 readonly isOther: boolean;1271 readonly asOther: Text;1272 readonly isInvalidCode: boolean;1273 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';1274 }12751276 /** @name EvmCoreErrorExitRevert (114) */1277 interface EvmCoreErrorExitRevert extends Enum {1278 readonly isReverted: boolean;1279 readonly type: 'Reverted';1280 }12811282 /** @name EvmCoreErrorExitFatal (115) */1283 interface EvmCoreErrorExitFatal extends Enum {1284 readonly isNotSupported: boolean;1285 readonly isUnhandledInterrupt: boolean;1286 readonly isCallErrorAsFatal: boolean;1287 readonly asCallErrorAsFatal: EvmCoreErrorExitError;1288 readonly isOther: boolean;1289 readonly asOther: Text;1290 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';1291 }12921293 /** @name FrameSystemPhase (116) */1294 interface FrameSystemPhase extends Enum {1295 readonly isApplyExtrinsic: boolean;1296 readonly asApplyExtrinsic: u32;1297 readonly isFinalization: boolean;1298 readonly isInitialization: boolean;1299 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';1300 }13011302 /** @name FrameSystemLastRuntimeUpgradeInfo (118) */1303 interface FrameSystemLastRuntimeUpgradeInfo extends Struct {1304 readonly specVersion: Compact<u32>;1305 readonly specName: Text;1306 }13071308 /** @name FrameSystemCall (119) */1309 interface FrameSystemCall extends Enum {1310 readonly isFillBlock: boolean;1311 readonly asFillBlock: {1312 readonly ratio: Perbill;1313 } & Struct;1314 readonly isRemark: boolean;1315 readonly asRemark: {1316 readonly remark: Bytes;1317 } & Struct;1318 readonly isSetHeapPages: boolean;1319 readonly asSetHeapPages: {1320 readonly pages: u64;1321 } & Struct;1322 readonly isSetCode: boolean;1323 readonly asSetCode: {1324 readonly code: Bytes;1325 } & Struct;1326 readonly isSetCodeWithoutChecks: boolean;1327 readonly asSetCodeWithoutChecks: {1328 readonly code: Bytes;1329 } & Struct;1330 readonly isSetStorage: boolean;1331 readonly asSetStorage: {1332 readonly items: Vec<ITuple<[Bytes, Bytes]>>;1333 } & Struct;1334 readonly isKillStorage: boolean;1335 readonly asKillStorage: {1336 readonly keys_: Vec<Bytes>;1337 } & Struct;1338 readonly isKillPrefix: boolean;1339 readonly asKillPrefix: {1340 readonly prefix: Bytes;1341 readonly subkeys: u32;1342 } & Struct;1343 readonly isRemarkWithEvent: boolean;1344 readonly asRemarkWithEvent: {1345 readonly remark: Bytes;1346 } & Struct;1347 readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';1348 }13491350 /** @name FrameSystemLimitsBlockWeights (124) */1351 interface FrameSystemLimitsBlockWeights extends Struct {1352 readonly baseBlock: u64;1353 readonly maxBlock: u64;1354 readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;1355 }13561357 /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */1358 interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {1359 readonly normal: FrameSystemLimitsWeightsPerClass;1360 readonly operational: FrameSystemLimitsWeightsPerClass;1361 readonly mandatory: FrameSystemLimitsWeightsPerClass;1362 }13631364 /** @name FrameSystemLimitsWeightsPerClass (126) */1365 interface FrameSystemLimitsWeightsPerClass extends Struct {1366 readonly baseExtrinsic: u64;1367 readonly maxExtrinsic: Option<u64>;1368 readonly maxTotal: Option<u64>;1369 readonly reserved: Option<u64>;1370 }13711372 /** @name FrameSystemLimitsBlockLength (128) */1373 interface FrameSystemLimitsBlockLength extends Struct {1374 readonly max: FrameSupportWeightsPerDispatchClassU32;1375 }13761377 /** @name FrameSupportWeightsPerDispatchClassU32 (129) */1378 interface FrameSupportWeightsPerDispatchClassU32 extends Struct {1379 readonly normal: u32;1380 readonly operational: u32;1381 readonly mandatory: u32;1382 }13831384 /** @name FrameSupportWeightsRuntimeDbWeight (130) */1385 interface FrameSupportWeightsRuntimeDbWeight extends Struct {1386 readonly read: u64;1387 readonly write: u64;1388 }13891390 /** @name SpVersionRuntimeVersion (131) */1391 interface SpVersionRuntimeVersion extends Struct {1392 readonly specName: Text;1393 readonly implName: Text;1394 readonly authoringVersion: u32;1395 readonly specVersion: u32;1396 readonly implVersion: u32;1397 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;1398 readonly transactionVersion: u32;1399 readonly stateVersion: u8;1400 }14011402 /** @name FrameSystemError (136) */1403 interface FrameSystemError extends Enum {1404 readonly isInvalidSpecName: boolean;1405 readonly isSpecVersionNeedsToIncrease: boolean;1406 readonly isFailedToExtractRuntimeVersion: boolean;1407 readonly isNonDefaultComposite: boolean;1408 readonly isNonZeroRefCount: boolean;1409 readonly isCallFiltered: boolean;1410 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';1411 }14121413 /** @name PolkadotPrimitivesV2PersistedValidationData (137) */1414 interface PolkadotPrimitivesV2PersistedValidationData extends Struct {1415 readonly parentHead: Bytes;1416 readonly relayParentNumber: u32;1417 readonly relayParentStorageRoot: H256;1418 readonly maxPovSize: u32;1419 }14201421 /** @name PolkadotPrimitivesV2UpgradeRestriction (140) */1422 interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {1423 readonly isPresent: boolean;1424 readonly type: 'Present';1425 }14261427 /** @name SpTrieStorageProof (141) */1428 interface SpTrieStorageProof extends Struct {1429 readonly trieNodes: BTreeSet<Bytes>;1430 }14311432 /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (143) */1433 interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {1434 readonly dmqMqcHead: H256;1435 readonly relayDispatchQueueSize: ITuple<[u32, u32]>;1436 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1437 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1438 }14391440 /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (146) */1441 interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {1442 readonly maxCapacity: u32;1443 readonly maxTotalSize: u32;1444 readonly maxMessageSize: u32;1445 readonly msgCount: u32;1446 readonly totalSize: u32;1447 readonly mqcHead: Option<H256>;1448 }14491450 /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (147) */1451 interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {1452 readonly maxCodeSize: u32;1453 readonly maxHeadDataSize: u32;1454 readonly maxUpwardQueueCount: u32;1455 readonly maxUpwardQueueSize: u32;1456 readonly maxUpwardMessageSize: u32;1457 readonly maxUpwardMessageNumPerCandidate: u32;1458 readonly hrmpMaxMessageNumPerCandidate: u32;1459 readonly validationUpgradeCooldown: u32;1460 readonly validationUpgradeDelay: u32;1461 }14621463 /** @name PolkadotCorePrimitivesOutboundHrmpMessage (153) */1464 interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {1465 readonly recipient: u32;1466 readonly data: Bytes;1467 }14681469 /** @name CumulusPalletParachainSystemCall (154) */1470 interface CumulusPalletParachainSystemCall extends Enum {1471 readonly isSetValidationData: boolean;1472 readonly asSetValidationData: {1473 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;1474 } & Struct;1475 readonly isSudoSendUpwardMessage: boolean;1476 readonly asSudoSendUpwardMessage: {1477 readonly message: Bytes;1478 } & Struct;1479 readonly isAuthorizeUpgrade: boolean;1480 readonly asAuthorizeUpgrade: {1481 readonly codeHash: H256;1482 } & Struct;1483 readonly isEnactAuthorizedUpgrade: boolean;1484 readonly asEnactAuthorizedUpgrade: {1485 readonly code: Bytes;1486 } & Struct;1487 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';1488 }14891490 /** @name CumulusPrimitivesParachainInherentParachainInherentData (155) */1491 interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {1492 readonly validationData: PolkadotPrimitivesV2PersistedValidationData;1493 readonly relayChainState: SpTrieStorageProof;1494 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;1495 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;1496 }14971498 /** @name PolkadotCorePrimitivesInboundDownwardMessage (157) */1499 interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {1500 readonly sentAt: u32;1501 readonly msg: Bytes;1502 }15031504 /** @name PolkadotCorePrimitivesInboundHrmpMessage (160) */1505 interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {1506 readonly sentAt: u32;1507 readonly data: Bytes;1508 }15091510 /** @name CumulusPalletParachainSystemError (163) */1511 interface CumulusPalletParachainSystemError extends Enum {1512 readonly isOverlappingUpgrades: boolean;1513 readonly isProhibitedByPolkadot: boolean;1514 readonly isTooBig: boolean;1515 readonly isValidationDataNotAvailable: boolean;1516 readonly isHostConfigurationNotAvailable: boolean;1517 readonly isNotScheduled: boolean;1518 readonly isNothingAuthorized: boolean;1519 readonly isUnauthorized: boolean;1520 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';1521 }15221523 /** @name PalletBalancesBalanceLock (165) */1524 interface PalletBalancesBalanceLock extends Struct {1525 readonly id: U8aFixed;1526 readonly amount: u128;1527 readonly reasons: PalletBalancesReasons;1528 }15291530 /** @name PalletBalancesReasons (166) */1531 interface PalletBalancesReasons extends Enum {1532 readonly isFee: boolean;1533 readonly isMisc: boolean;1534 readonly isAll: boolean;1535 readonly type: 'Fee' | 'Misc' | 'All';1536 }15371538 /** @name PalletBalancesReserveData (169) */1539 interface PalletBalancesReserveData extends Struct {1540 readonly id: U8aFixed;1541 readonly amount: u128;1542 }15431544 /** @name PalletBalancesReleases (171) */1545 interface PalletBalancesReleases extends Enum {1546 readonly isV100: boolean;1547 readonly isV200: boolean;1548 readonly type: 'V100' | 'V200';1549 }15501551 /** @name PalletBalancesCall (172) */1552 interface PalletBalancesCall extends Enum {1553 readonly isTransfer: boolean;1554 readonly asTransfer: {1555 readonly dest: MultiAddress;1556 readonly value: Compact<u128>;1557 } & Struct;1558 readonly isSetBalance: boolean;1559 readonly asSetBalance: {1560 readonly who: MultiAddress;1561 readonly newFree: Compact<u128>;1562 readonly newReserved: Compact<u128>;1563 } & Struct;1564 readonly isForceTransfer: boolean;1565 readonly asForceTransfer: {1566 readonly source: MultiAddress;1567 readonly dest: MultiAddress;1568 readonly value: Compact<u128>;1569 } & Struct;1570 readonly isTransferKeepAlive: boolean;1571 readonly asTransferKeepAlive: {1572 readonly dest: MultiAddress;1573 readonly value: Compact<u128>;1574 } & Struct;1575 readonly isTransferAll: boolean;1576 readonly asTransferAll: {1577 readonly dest: MultiAddress;1578 readonly keepAlive: bool;1579 } & Struct;1580 readonly isForceUnreserve: boolean;1581 readonly asForceUnreserve: {1582 readonly who: MultiAddress;1583 readonly amount: u128;1584 } & Struct;1585 readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';1586 }15871588 /** @name PalletBalancesError (175) */1589 interface PalletBalancesError extends Enum {1590 readonly isVestingBalance: boolean;1591 readonly isLiquidityRestrictions: boolean;1592 readonly isInsufficientBalance: boolean;1593 readonly isExistentialDeposit: boolean;1594 readonly isKeepAlive: boolean;1595 readonly isExistingVestingSchedule: boolean;1596 readonly isDeadAccount: boolean;1597 readonly isTooManyReserves: boolean;1598 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';1599 }16001601 /** @name PalletTimestampCall (177) */1602 interface PalletTimestampCall extends Enum {1603 readonly isSet: boolean;1604 readonly asSet: {1605 readonly now: Compact<u64>;1606 } & Struct;1607 readonly type: 'Set';1608 }16091610 /** @name PalletTransactionPaymentReleases (179) */1611 interface PalletTransactionPaymentReleases extends Enum {1612 readonly isV1Ancient: boolean;1613 readonly isV2: boolean;1614 readonly type: 'V1Ancient' | 'V2';1615 }16161617 /** @name PalletTreasuryProposal (180) */1618 interface PalletTreasuryProposal extends Struct {1619 readonly proposer: AccountId32;1620 readonly value: u128;1621 readonly beneficiary: AccountId32;1622 readonly bond: u128;1623 }16241625 /** @name PalletTreasuryCall (183) */1626 interface PalletTreasuryCall extends Enum {1627 readonly isProposeSpend: boolean;1628 readonly asProposeSpend: {1629 readonly value: Compact<u128>;1630 readonly beneficiary: MultiAddress;1631 } & Struct;1632 readonly isRejectProposal: boolean;1633 readonly asRejectProposal: {1634 readonly proposalId: Compact<u32>;1635 } & Struct;1636 readonly isApproveProposal: boolean;1637 readonly asApproveProposal: {1638 readonly proposalId: Compact<u32>;1639 } & Struct;1640 readonly isSpend: boolean;1641 readonly asSpend: {1642 readonly amount: Compact<u128>;1643 readonly beneficiary: MultiAddress;1644 } & Struct;1645 readonly isRemoveApproval: boolean;1646 readonly asRemoveApproval: {1647 readonly proposalId: Compact<u32>;1648 } & Struct;1649 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';1650 }16511652 /** @name FrameSupportPalletId (186) */1653 interface FrameSupportPalletId extends U8aFixed {}16541655 /** @name PalletTreasuryError (187) */1656 interface PalletTreasuryError extends Enum {1657 readonly isInsufficientProposersBalance: boolean;1658 readonly isInvalidIndex: boolean;1659 readonly isTooManyApprovals: boolean;1660 readonly isInsufficientPermission: boolean;1661 readonly isProposalNotApproved: boolean;1662 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';1663 }16641665 /** @name PalletSudoCall (188) */1666 interface PalletSudoCall extends Enum {1667 readonly isSudo: boolean;1668 readonly asSudo: {1669 readonly call: Call;1670 } & Struct;1671 readonly isSudoUncheckedWeight: boolean;1672 readonly asSudoUncheckedWeight: {1673 readonly call: Call;1674 readonly weight: u64;1675 } & Struct;1676 readonly isSetKey: boolean;1677 readonly asSetKey: {1678 readonly new_: MultiAddress;1679 } & Struct;1680 readonly isSudoAs: boolean;1681 readonly asSudoAs: {1682 readonly who: MultiAddress;1683 readonly call: Call;1684 } & Struct;1685 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';1686 }16871688 /** @name OrmlVestingModuleCall (190) */1689 interface OrmlVestingModuleCall extends Enum {1690 readonly isClaim: boolean;1691 readonly isVestedTransfer: boolean;1692 readonly asVestedTransfer: {1693 readonly dest: MultiAddress;1694 readonly schedule: OrmlVestingVestingSchedule;1695 } & Struct;1696 readonly isUpdateVestingSchedules: boolean;1697 readonly asUpdateVestingSchedules: {1698 readonly who: MultiAddress;1699 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;1700 } & Struct;1701 readonly isClaimFor: boolean;1702 readonly asClaimFor: {1703 readonly dest: MultiAddress;1704 } & Struct;1705 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';1706 }17071708 /** @name CumulusPalletXcmpQueueCall (192) */1709 interface CumulusPalletXcmpQueueCall extends Enum {1710 readonly isServiceOverweight: boolean;1711 readonly asServiceOverweight: {1712 readonly index: u64;1713 readonly weightLimit: u64;1714 } & Struct;1715 readonly isSuspendXcmExecution: boolean;1716 readonly isResumeXcmExecution: boolean;1717 readonly isUpdateSuspendThreshold: boolean;1718 readonly asUpdateSuspendThreshold: {1719 readonly new_: u32;1720 } & Struct;1721 readonly isUpdateDropThreshold: boolean;1722 readonly asUpdateDropThreshold: {1723 readonly new_: u32;1724 } & Struct;1725 readonly isUpdateResumeThreshold: boolean;1726 readonly asUpdateResumeThreshold: {1727 readonly new_: u32;1728 } & Struct;1729 readonly isUpdateThresholdWeight: boolean;1730 readonly asUpdateThresholdWeight: {1731 readonly new_: u64;1732 } & Struct;1733 readonly isUpdateWeightRestrictDecay: boolean;1734 readonly asUpdateWeightRestrictDecay: {1735 readonly new_: u64;1736 } & Struct;1737 readonly isUpdateXcmpMaxIndividualWeight: boolean;1738 readonly asUpdateXcmpMaxIndividualWeight: {1739 readonly new_: u64;1740 } & Struct;1741 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';1742 }17431744 /** @name PalletXcmCall (193) */1745 interface PalletXcmCall extends Enum {1746 readonly isSend: boolean;1747 readonly asSend: {1748 readonly dest: XcmVersionedMultiLocation;1749 readonly message: XcmVersionedXcm;1750 } & Struct;1751 readonly isTeleportAssets: boolean;1752 readonly asTeleportAssets: {1753 readonly dest: XcmVersionedMultiLocation;1754 readonly beneficiary: XcmVersionedMultiLocation;1755 readonly assets: XcmVersionedMultiAssets;1756 readonly feeAssetItem: u32;1757 } & Struct;1758 readonly isReserveTransferAssets: boolean;1759 readonly asReserveTransferAssets: {1760 readonly dest: XcmVersionedMultiLocation;1761 readonly beneficiary: XcmVersionedMultiLocation;1762 readonly assets: XcmVersionedMultiAssets;1763 readonly feeAssetItem: u32;1764 } & Struct;1765 readonly isExecute: boolean;1766 readonly asExecute: {1767 readonly message: XcmVersionedXcm;1768 readonly maxWeight: u64;1769 } & Struct;1770 readonly isForceXcmVersion: boolean;1771 readonly asForceXcmVersion: {1772 readonly location: XcmV1MultiLocation;1773 readonly xcmVersion: u32;1774 } & Struct;1775 readonly isForceDefaultXcmVersion: boolean;1776 readonly asForceDefaultXcmVersion: {1777 readonly maybeXcmVersion: Option<u32>;1778 } & Struct;1779 readonly isForceSubscribeVersionNotify: boolean;1780 readonly asForceSubscribeVersionNotify: {1781 readonly location: XcmVersionedMultiLocation;1782 } & Struct;1783 readonly isForceUnsubscribeVersionNotify: boolean;1784 readonly asForceUnsubscribeVersionNotify: {1785 readonly location: XcmVersionedMultiLocation;1786 } & Struct;1787 readonly isLimitedReserveTransferAssets: boolean;1788 readonly asLimitedReserveTransferAssets: {1789 readonly dest: XcmVersionedMultiLocation;1790 readonly beneficiary: XcmVersionedMultiLocation;1791 readonly assets: XcmVersionedMultiAssets;1792 readonly feeAssetItem: u32;1793 readonly weightLimit: XcmV2WeightLimit;1794 } & Struct;1795 readonly isLimitedTeleportAssets: boolean;1796 readonly asLimitedTeleportAssets: {1797 readonly dest: XcmVersionedMultiLocation;1798 readonly beneficiary: XcmVersionedMultiLocation;1799 readonly assets: XcmVersionedMultiAssets;1800 readonly feeAssetItem: u32;1801 readonly weightLimit: XcmV2WeightLimit;1802 } & Struct;1803 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';1804 }18051806 /** @name XcmVersionedXcm (194) */1807 interface XcmVersionedXcm extends Enum {1808 readonly isV0: boolean;1809 readonly asV0: XcmV0Xcm;1810 readonly isV1: boolean;1811 readonly asV1: XcmV1Xcm;1812 readonly isV2: boolean;1813 readonly asV2: XcmV2Xcm;1814 readonly type: 'V0' | 'V1' | 'V2';1815 }18161817 /** @name XcmV0Xcm (195) */1818 interface XcmV0Xcm extends Enum {1819 readonly isWithdrawAsset: boolean;1820 readonly asWithdrawAsset: {1821 readonly assets: Vec<XcmV0MultiAsset>;1822 readonly effects: Vec<XcmV0Order>;1823 } & Struct;1824 readonly isReserveAssetDeposit: boolean;1825 readonly asReserveAssetDeposit: {1826 readonly assets: Vec<XcmV0MultiAsset>;1827 readonly effects: Vec<XcmV0Order>;1828 } & Struct;1829 readonly isTeleportAsset: boolean;1830 readonly asTeleportAsset: {1831 readonly assets: Vec<XcmV0MultiAsset>;1832 readonly effects: Vec<XcmV0Order>;1833 } & Struct;1834 readonly isQueryResponse: boolean;1835 readonly asQueryResponse: {1836 readonly queryId: Compact<u64>;1837 readonly response: XcmV0Response;1838 } & Struct;1839 readonly isTransferAsset: boolean;1840 readonly asTransferAsset: {1841 readonly assets: Vec<XcmV0MultiAsset>;1842 readonly dest: XcmV0MultiLocation;1843 } & Struct;1844 readonly isTransferReserveAsset: boolean;1845 readonly asTransferReserveAsset: {1846 readonly assets: Vec<XcmV0MultiAsset>;1847 readonly dest: XcmV0MultiLocation;1848 readonly effects: Vec<XcmV0Order>;1849 } & Struct;1850 readonly isTransact: boolean;1851 readonly asTransact: {1852 readonly originType: XcmV0OriginKind;1853 readonly requireWeightAtMost: u64;1854 readonly call: XcmDoubleEncoded;1855 } & Struct;1856 readonly isHrmpNewChannelOpenRequest: boolean;1857 readonly asHrmpNewChannelOpenRequest: {1858 readonly sender: Compact<u32>;1859 readonly maxMessageSize: Compact<u32>;1860 readonly maxCapacity: Compact<u32>;1861 } & Struct;1862 readonly isHrmpChannelAccepted: boolean;1863 readonly asHrmpChannelAccepted: {1864 readonly recipient: Compact<u32>;1865 } & Struct;1866 readonly isHrmpChannelClosing: boolean;1867 readonly asHrmpChannelClosing: {1868 readonly initiator: Compact<u32>;1869 readonly sender: Compact<u32>;1870 readonly recipient: Compact<u32>;1871 } & Struct;1872 readonly isRelayedFrom: boolean;1873 readonly asRelayedFrom: {1874 readonly who: XcmV0MultiLocation;1875 readonly message: XcmV0Xcm;1876 } & Struct;1877 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';1878 }18791880 /** @name XcmV0Order (197) */1881 interface XcmV0Order extends Enum {1882 readonly isNull: boolean;1883 readonly isDepositAsset: boolean;1884 readonly asDepositAsset: {1885 readonly assets: Vec<XcmV0MultiAsset>;1886 readonly dest: XcmV0MultiLocation;1887 } & Struct;1888 readonly isDepositReserveAsset: boolean;1889 readonly asDepositReserveAsset: {1890 readonly assets: Vec<XcmV0MultiAsset>;1891 readonly dest: XcmV0MultiLocation;1892 readonly effects: Vec<XcmV0Order>;1893 } & Struct;1894 readonly isExchangeAsset: boolean;1895 readonly asExchangeAsset: {1896 readonly give: Vec<XcmV0MultiAsset>;1897 readonly receive: Vec<XcmV0MultiAsset>;1898 } & Struct;1899 readonly isInitiateReserveWithdraw: boolean;1900 readonly asInitiateReserveWithdraw: {1901 readonly assets: Vec<XcmV0MultiAsset>;1902 readonly reserve: XcmV0MultiLocation;1903 readonly effects: Vec<XcmV0Order>;1904 } & Struct;1905 readonly isInitiateTeleport: boolean;1906 readonly asInitiateTeleport: {1907 readonly assets: Vec<XcmV0MultiAsset>;1908 readonly dest: XcmV0MultiLocation;1909 readonly effects: Vec<XcmV0Order>;1910 } & Struct;1911 readonly isQueryHolding: boolean;1912 readonly asQueryHolding: {1913 readonly queryId: Compact<u64>;1914 readonly dest: XcmV0MultiLocation;1915 readonly assets: Vec<XcmV0MultiAsset>;1916 } & Struct;1917 readonly isBuyExecution: boolean;1918 readonly asBuyExecution: {1919 readonly fees: XcmV0MultiAsset;1920 readonly weight: u64;1921 readonly debt: u64;1922 readonly haltOnError: bool;1923 readonly xcm: Vec<XcmV0Xcm>;1924 } & Struct;1925 readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';1926 }19271928 /** @name XcmV0Response (199) */1929 interface XcmV0Response extends Enum {1930 readonly isAssets: boolean;1931 readonly asAssets: Vec<XcmV0MultiAsset>;1932 readonly type: 'Assets';1933 }19341935 /** @name XcmV1Xcm (200) */1936 interface XcmV1Xcm extends Enum {1937 readonly isWithdrawAsset: boolean;1938 readonly asWithdrawAsset: {1939 readonly assets: XcmV1MultiassetMultiAssets;1940 readonly effects: Vec<XcmV1Order>;1941 } & Struct;1942 readonly isReserveAssetDeposited: boolean;1943 readonly asReserveAssetDeposited: {1944 readonly assets: XcmV1MultiassetMultiAssets;1945 readonly effects: Vec<XcmV1Order>;1946 } & Struct;1947 readonly isReceiveTeleportedAsset: boolean;1948 readonly asReceiveTeleportedAsset: {1949 readonly assets: XcmV1MultiassetMultiAssets;1950 readonly effects: Vec<XcmV1Order>;1951 } & Struct;1952 readonly isQueryResponse: boolean;1953 readonly asQueryResponse: {1954 readonly queryId: Compact<u64>;1955 readonly response: XcmV1Response;1956 } & Struct;1957 readonly isTransferAsset: boolean;1958 readonly asTransferAsset: {1959 readonly assets: XcmV1MultiassetMultiAssets;1960 readonly beneficiary: XcmV1MultiLocation;1961 } & Struct;1962 readonly isTransferReserveAsset: boolean;1963 readonly asTransferReserveAsset: {1964 readonly assets: XcmV1MultiassetMultiAssets;1965 readonly dest: XcmV1MultiLocation;1966 readonly effects: Vec<XcmV1Order>;1967 } & Struct;1968 readonly isTransact: boolean;1969 readonly asTransact: {1970 readonly originType: XcmV0OriginKind;1971 readonly requireWeightAtMost: u64;1972 readonly call: XcmDoubleEncoded;1973 } & Struct;1974 readonly isHrmpNewChannelOpenRequest: boolean;1975 readonly asHrmpNewChannelOpenRequest: {1976 readonly sender: Compact<u32>;1977 readonly maxMessageSize: Compact<u32>;1978 readonly maxCapacity: Compact<u32>;1979 } & Struct;1980 readonly isHrmpChannelAccepted: boolean;1981 readonly asHrmpChannelAccepted: {1982 readonly recipient: Compact<u32>;1983 } & Struct;1984 readonly isHrmpChannelClosing: boolean;1985 readonly asHrmpChannelClosing: {1986 readonly initiator: Compact<u32>;1987 readonly sender: Compact<u32>;1988 readonly recipient: Compact<u32>;1989 } & Struct;1990 readonly isRelayedFrom: boolean;1991 readonly asRelayedFrom: {1992 readonly who: XcmV1MultilocationJunctions;1993 readonly message: XcmV1Xcm;1994 } & Struct;1995 readonly isSubscribeVersion: boolean;1996 readonly asSubscribeVersion: {1997 readonly queryId: Compact<u64>;1998 readonly maxResponseWeight: Compact<u64>;1999 } & Struct;2000 readonly isUnsubscribeVersion: boolean;2001 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';2002 }20032004 /** @name XcmV1Order (202) */2005 interface XcmV1Order extends Enum {2006 readonly isNoop: boolean;2007 readonly isDepositAsset: boolean;2008 readonly asDepositAsset: {2009 readonly assets: XcmV1MultiassetMultiAssetFilter;2010 readonly maxAssets: u32;2011 readonly beneficiary: XcmV1MultiLocation;2012 } & Struct;2013 readonly isDepositReserveAsset: boolean;2014 readonly asDepositReserveAsset: {2015 readonly assets: XcmV1MultiassetMultiAssetFilter;2016 readonly maxAssets: u32;2017 readonly dest: XcmV1MultiLocation;2018 readonly effects: Vec<XcmV1Order>;2019 } & Struct;2020 readonly isExchangeAsset: boolean;2021 readonly asExchangeAsset: {2022 readonly give: XcmV1MultiassetMultiAssetFilter;2023 readonly receive: XcmV1MultiassetMultiAssets;2024 } & Struct;2025 readonly isInitiateReserveWithdraw: boolean;2026 readonly asInitiateReserveWithdraw: {2027 readonly assets: XcmV1MultiassetMultiAssetFilter;2028 readonly reserve: XcmV1MultiLocation;2029 readonly effects: Vec<XcmV1Order>;2030 } & Struct;2031 readonly isInitiateTeleport: boolean;2032 readonly asInitiateTeleport: {2033 readonly assets: XcmV1MultiassetMultiAssetFilter;2034 readonly dest: XcmV1MultiLocation;2035 readonly effects: Vec<XcmV1Order>;2036 } & Struct;2037 readonly isQueryHolding: boolean;2038 readonly asQueryHolding: {2039 readonly queryId: Compact<u64>;2040 readonly dest: XcmV1MultiLocation;2041 readonly assets: XcmV1MultiassetMultiAssetFilter;2042 } & Struct;2043 readonly isBuyExecution: boolean;2044 readonly asBuyExecution: {2045 readonly fees: XcmV1MultiAsset;2046 readonly weight: u64;2047 readonly debt: u64;2048 readonly haltOnError: bool;2049 readonly instructions: Vec<XcmV1Xcm>;2050 } & Struct;2051 readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';2052 }20532054 /** @name XcmV1Response (204) */2055 interface XcmV1Response extends Enum {2056 readonly isAssets: boolean;2057 readonly asAssets: XcmV1MultiassetMultiAssets;2058 readonly isVersion: boolean;2059 readonly asVersion: u32;2060 readonly type: 'Assets' | 'Version';2061 }20622063 /** @name CumulusPalletXcmCall (218) */2064 type CumulusPalletXcmCall = Null;20652066 /** @name CumulusPalletDmpQueueCall (219) */2067 interface CumulusPalletDmpQueueCall extends Enum {2068 readonly isServiceOverweight: boolean;2069 readonly asServiceOverweight: {2070 readonly index: u64;2071 readonly weightLimit: u64;2072 } & Struct;2073 readonly type: 'ServiceOverweight';2074 }20752076 /** @name PalletInflationCall (220) */2077 interface PalletInflationCall extends Enum {2078 readonly isStartInflation: boolean;2079 readonly asStartInflation: {2080 readonly inflationStartRelayBlock: u32;2081 } & Struct;2082 readonly type: 'StartInflation';2083 }20842085 /** @name PalletUniqueCall (221) */2086 interface PalletUniqueCall extends Enum {2087 readonly isCreateCollection: boolean;2088 readonly asCreateCollection: {2089 readonly collectionName: Vec<u16>;2090 readonly collectionDescription: Vec<u16>;2091 readonly tokenPrefix: Bytes;2092 readonly mode: UpDataStructsCollectionMode;2093 } & Struct;2094 readonly isCreateCollectionEx: boolean;2095 readonly asCreateCollectionEx: {2096 readonly data: UpDataStructsCreateCollectionData;2097 } & Struct;2098 readonly isDestroyCollection: boolean;2099 readonly asDestroyCollection: {2100 readonly collectionId: u32;2101 } & Struct;2102 readonly isAddToAllowList: boolean;2103 readonly asAddToAllowList: {2104 readonly collectionId: u32;2105 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2106 } & Struct;2107 readonly isRemoveFromAllowList: boolean;2108 readonly asRemoveFromAllowList: {2109 readonly collectionId: u32;2110 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2111 } & Struct;2112 readonly isChangeCollectionOwner: boolean;2113 readonly asChangeCollectionOwner: {2114 readonly collectionId: u32;2115 readonly newOwner: AccountId32;2116 } & Struct;2117 readonly isAddCollectionAdmin: boolean;2118 readonly asAddCollectionAdmin: {2119 readonly collectionId: u32;2120 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;2121 } & Struct;2122 readonly isRemoveCollectionAdmin: boolean;2123 readonly asRemoveCollectionAdmin: {2124 readonly collectionId: u32;2125 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;2126 } & Struct;2127 readonly isSetCollectionSponsor: boolean;2128 readonly asSetCollectionSponsor: {2129 readonly collectionId: u32;2130 readonly newSponsor: AccountId32;2131 } & Struct;2132 readonly isConfirmSponsorship: boolean;2133 readonly asConfirmSponsorship: {2134 readonly collectionId: u32;2135 } & Struct;2136 readonly isRemoveCollectionSponsor: boolean;2137 readonly asRemoveCollectionSponsor: {2138 readonly collectionId: u32;2139 } & Struct;2140 readonly isCreateItem: boolean;2141 readonly asCreateItem: {2142 readonly collectionId: u32;2143 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2144 readonly data: UpDataStructsCreateItemData;2145 } & Struct;2146 readonly isCreateMultipleItems: boolean;2147 readonly asCreateMultipleItems: {2148 readonly collectionId: u32;2149 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2150 readonly itemsData: Vec<UpDataStructsCreateItemData>;2151 } & Struct;2152 readonly isSetCollectionProperties: boolean;2153 readonly asSetCollectionProperties: {2154 readonly collectionId: u32;2155 readonly properties: Vec<UpDataStructsProperty>;2156 } & Struct;2157 readonly isDeleteCollectionProperties: boolean;2158 readonly asDeleteCollectionProperties: {2159 readonly collectionId: u32;2160 readonly propertyKeys: Vec<Bytes>;2161 } & Struct;2162 readonly isSetTokenProperties: boolean;2163 readonly asSetTokenProperties: {2164 readonly collectionId: u32;2165 readonly tokenId: u32;2166 readonly properties: Vec<UpDataStructsProperty>;2167 } & Struct;2168 readonly isDeleteTokenProperties: boolean;2169 readonly asDeleteTokenProperties: {2170 readonly collectionId: u32;2171 readonly tokenId: u32;2172 readonly propertyKeys: Vec<Bytes>;2173 } & Struct;2174 readonly isSetTokenPropertyPermissions: boolean;2175 readonly asSetTokenPropertyPermissions: {2176 readonly collectionId: u32;2177 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2178 } & Struct;2179 readonly isCreateMultipleItemsEx: boolean;2180 readonly asCreateMultipleItemsEx: {2181 readonly collectionId: u32;2182 readonly data: UpDataStructsCreateItemExData;2183 } & Struct;2184 readonly isSetTransfersEnabledFlag: boolean;2185 readonly asSetTransfersEnabledFlag: {2186 readonly collectionId: u32;2187 readonly value: bool;2188 } & Struct;2189 readonly isBurnItem: boolean;2190 readonly asBurnItem: {2191 readonly collectionId: u32;2192 readonly itemId: u32;2193 readonly value: u128;2194 } & Struct;2195 readonly isBurnFrom: boolean;2196 readonly asBurnFrom: {2197 readonly collectionId: u32;2198 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2199 readonly itemId: u32;2200 readonly value: u128;2201 } & Struct;2202 readonly isTransfer: boolean;2203 readonly asTransfer: {2204 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2205 readonly collectionId: u32;2206 readonly itemId: u32;2207 readonly value: u128;2208 } & Struct;2209 readonly isApprove: boolean;2210 readonly asApprove: {2211 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;2212 readonly collectionId: u32;2213 readonly itemId: u32;2214 readonly amount: u128;2215 } & Struct;2216 readonly isTransferFrom: boolean;2217 readonly asTransferFrom: {2218 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2219 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2220 readonly collectionId: u32;2221 readonly itemId: u32;2222 readonly value: u128;2223 } & Struct;2224 readonly isSetCollectionLimits: boolean;2225 readonly asSetCollectionLimits: {2226 readonly collectionId: u32;2227 readonly newLimit: UpDataStructsCollectionLimits;2228 } & Struct;2229 readonly isSetCollectionPermissions: boolean;2230 readonly asSetCollectionPermissions: {2231 readonly collectionId: u32;2232 readonly newPermission: UpDataStructsCollectionPermissions;2233 } & Struct;2234 readonly isRepartition: boolean;2235 readonly asRepartition: {2236 readonly collectionId: u32;2237 readonly tokenId: u32;2238 readonly amount: u128;2239 } & Struct;2240 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';2241 }22422243 /** @name UpDataStructsCollectionMode (226) */2244 interface UpDataStructsCollectionMode extends Enum {2245 readonly isNft: boolean;2246 readonly isFungible: boolean;2247 readonly asFungible: u8;2248 readonly isReFungible: boolean;2249 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2250 }22512252 /** @name UpDataStructsCreateCollectionData (227) */2253 interface UpDataStructsCreateCollectionData extends Struct {2254 readonly mode: UpDataStructsCollectionMode;2255 readonly access: Option<UpDataStructsAccessMode>;2256 readonly name: Vec<u16>;2257 readonly description: Vec<u16>;2258 readonly tokenPrefix: Bytes;2259 readonly pendingSponsor: Option<AccountId32>;2260 readonly limits: Option<UpDataStructsCollectionLimits>;2261 readonly permissions: Option<UpDataStructsCollectionPermissions>;2262 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2263 readonly properties: Vec<UpDataStructsProperty>;2264 }22652266 /** @name UpDataStructsAccessMode (229) */2267 interface UpDataStructsAccessMode extends Enum {2268 readonly isNormal: boolean;2269 readonly isAllowList: boolean;2270 readonly type: 'Normal' | 'AllowList';2271 }22722273 /** @name UpDataStructsCollectionLimits (231) */2274 interface UpDataStructsCollectionLimits extends Struct {2275 readonly accountTokenOwnershipLimit: Option<u32>;2276 readonly sponsoredDataSize: Option<u32>;2277 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;2278 readonly tokenLimit: Option<u32>;2279 readonly sponsorTransferTimeout: Option<u32>;2280 readonly sponsorApproveTimeout: Option<u32>;2281 readonly ownerCanTransfer: Option<bool>;2282 readonly ownerCanDestroy: Option<bool>;2283 readonly transfersEnabled: Option<bool>;2284 }22852286 /** @name UpDataStructsSponsoringRateLimit (233) */2287 interface UpDataStructsSponsoringRateLimit extends Enum {2288 readonly isSponsoringDisabled: boolean;2289 readonly isBlocks: boolean;2290 readonly asBlocks: u32;2291 readonly type: 'SponsoringDisabled' | 'Blocks';2292 }22932294 /** @name UpDataStructsCollectionPermissions (236) */2295 interface UpDataStructsCollectionPermissions extends Struct {2296 readonly access: Option<UpDataStructsAccessMode>;2297 readonly mintMode: Option<bool>;2298 readonly nesting: Option<UpDataStructsNestingPermissions>;2299 }23002301 /** @name UpDataStructsNestingPermissions (238) */2302 interface UpDataStructsNestingPermissions extends Struct {2303 readonly tokenOwner: bool;2304 readonly collectionAdmin: bool;2305 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;2306 }23072308 /** @name UpDataStructsOwnerRestrictedSet (240) */2309 interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}23102311 /** @name UpDataStructsPropertyKeyPermission (245) */2312 interface UpDataStructsPropertyKeyPermission extends Struct {2313 readonly key: Bytes;2314 readonly permission: UpDataStructsPropertyPermission;2315 }23162317 /** @name UpDataStructsPropertyPermission (246) */2318 interface UpDataStructsPropertyPermission extends Struct {2319 readonly mutable: bool;2320 readonly collectionAdmin: bool;2321 readonly tokenOwner: bool;2322 }23232324 /** @name UpDataStructsProperty (249) */2325 interface UpDataStructsProperty extends Struct {2326 readonly key: Bytes;2327 readonly value: Bytes;2328 }23292330 /** @name UpDataStructsCreateItemData (252) */2331 interface UpDataStructsCreateItemData extends Enum {2332 readonly isNft: boolean;2333 readonly asNft: UpDataStructsCreateNftData;2334 readonly isFungible: boolean;2335 readonly asFungible: UpDataStructsCreateFungibleData;2336 readonly isReFungible: boolean;2337 readonly asReFungible: UpDataStructsCreateReFungibleData;2338 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2339 }23402341 /** @name UpDataStructsCreateNftData (253) */2342 interface UpDataStructsCreateNftData extends Struct {2343 readonly properties: Vec<UpDataStructsProperty>;2344 }23452346 /** @name UpDataStructsCreateFungibleData (254) */2347 interface UpDataStructsCreateFungibleData extends Struct {2348 readonly value: u128;2349 }23502351 /** @name UpDataStructsCreateReFungibleData (255) */2352 interface UpDataStructsCreateReFungibleData extends Struct {2353 readonly pieces: u128;2354 readonly properties: Vec<UpDataStructsProperty>;2355 }23562357 /** @name UpDataStructsCreateItemExData (258) */2358 interface UpDataStructsCreateItemExData extends Enum {2359 readonly isNft: boolean;2360 readonly asNft: Vec<UpDataStructsCreateNftExData>;2361 readonly isFungible: boolean;2362 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2363 readonly isRefungibleMultipleItems: boolean;2364 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;2365 readonly isRefungibleMultipleOwners: boolean;2366 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;2367 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';2368 }23692370 /** @name UpDataStructsCreateNftExData (260) */2371 interface UpDataStructsCreateNftExData extends Struct {2372 readonly properties: Vec<UpDataStructsProperty>;2373 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2374 }23752376 /** @name UpDataStructsCreateRefungibleExSingleOwner (267) */2377 interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {2378 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;2379 readonly pieces: u128;2380 readonly properties: Vec<UpDataStructsProperty>;2381 }23822383 /** @name UpDataStructsCreateRefungibleExMultipleOwners (269) */2384 interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {2385 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2386 readonly properties: Vec<UpDataStructsProperty>;2387 }23882389 /** @name PalletUniqueSchedulerCall (270) */2390 interface PalletUniqueSchedulerCall extends Enum {2391 readonly isScheduleNamed: boolean;2392 readonly asScheduleNamed: {2393 readonly id: U8aFixed;2394 readonly when: u32;2395 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2396 readonly priority: u8;2397 readonly call: FrameSupportScheduleMaybeHashed;2398 } & Struct;2399 readonly isCancelNamed: boolean;2400 readonly asCancelNamed: {2401 readonly id: U8aFixed;2402 } & Struct;2403 readonly isScheduleNamedAfter: boolean;2404 readonly asScheduleNamedAfter: {2405 readonly id: U8aFixed;2406 readonly after: u32;2407 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2408 readonly priority: u8;2409 readonly call: FrameSupportScheduleMaybeHashed;2410 } & Struct;2411 readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';2412 }24132414 /** @name FrameSupportScheduleMaybeHashed (272) */2415 interface FrameSupportScheduleMaybeHashed extends Enum {2416 readonly isValue: boolean;2417 readonly asValue: Call;2418 readonly isHash: boolean;2419 readonly asHash: H256;2420 readonly type: 'Value' | 'Hash';2421 }24222423 /** @name PalletConfigurationCall (273) */2424 interface PalletConfigurationCall extends Enum {2425 readonly isSetWeightToFeeCoefficientOverride: boolean;2426 readonly asSetWeightToFeeCoefficientOverride: {2427 readonly coeff: Option<u32>;2428 } & Struct;2429 readonly isSetMinGasPriceOverride: boolean;2430 readonly asSetMinGasPriceOverride: {2431 readonly coeff: Option<u64>;2432 } & Struct;2433 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';2434 }24352436 /** @name PalletTemplateTransactionPaymentCall (274) */2437 type PalletTemplateTransactionPaymentCall = Null;24382439 /** @name PalletStructureCall (275) */2440 type PalletStructureCall = Null;24412442 /** @name PalletRmrkCoreCall (276) */2443 interface PalletRmrkCoreCall extends Enum {2444 readonly isCreateCollection: boolean;2445 readonly asCreateCollection: {2446 readonly metadata: Bytes;2447 readonly max: Option<u32>;2448 readonly symbol: Bytes;2449 } & Struct;2450 readonly isDestroyCollection: boolean;2451 readonly asDestroyCollection: {2452 readonly collectionId: u32;2453 } & Struct;2454 readonly isChangeCollectionIssuer: boolean;2455 readonly asChangeCollectionIssuer: {2456 readonly collectionId: u32;2457 readonly newIssuer: MultiAddress;2458 } & Struct;2459 readonly isLockCollection: boolean;2460 readonly asLockCollection: {2461 readonly collectionId: u32;2462 } & Struct;2463 readonly isMintNft: boolean;2464 readonly asMintNft: {2465 readonly owner: Option<AccountId32>;2466 readonly collectionId: u32;2467 readonly recipient: Option<AccountId32>;2468 readonly royaltyAmount: Option<Permill>;2469 readonly metadata: Bytes;2470 readonly transferable: bool;2471 readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;2472 } & Struct;2473 readonly isBurnNft: boolean;2474 readonly asBurnNft: {2475 readonly collectionId: u32;2476 readonly nftId: u32;2477 readonly maxBurns: u32;2478 } & Struct;2479 readonly isSend: boolean;2480 readonly asSend: {2481 readonly rmrkCollectionId: u32;2482 readonly rmrkNftId: u32;2483 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2484 } & Struct;2485 readonly isAcceptNft: boolean;2486 readonly asAcceptNft: {2487 readonly rmrkCollectionId: u32;2488 readonly rmrkNftId: u32;2489 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2490 } & Struct;2491 readonly isRejectNft: boolean;2492 readonly asRejectNft: {2493 readonly rmrkCollectionId: u32;2494 readonly rmrkNftId: u32;2495 } & Struct;2496 readonly isAcceptResource: boolean;2497 readonly asAcceptResource: {2498 readonly rmrkCollectionId: u32;2499 readonly rmrkNftId: u32;2500 readonly resourceId: u32;2501 } & Struct;2502 readonly isAcceptResourceRemoval: boolean;2503 readonly asAcceptResourceRemoval: {2504 readonly rmrkCollectionId: u32;2505 readonly rmrkNftId: u32;2506 readonly resourceId: u32;2507 } & Struct;2508 readonly isSetProperty: boolean;2509 readonly asSetProperty: {2510 readonly rmrkCollectionId: Compact<u32>;2511 readonly maybeNftId: Option<u32>;2512 readonly key: Bytes;2513 readonly value: Bytes;2514 } & Struct;2515 readonly isSetPriority: boolean;2516 readonly asSetPriority: {2517 readonly rmrkCollectionId: u32;2518 readonly rmrkNftId: u32;2519 readonly priorities: Vec<u32>;2520 } & Struct;2521 readonly isAddBasicResource: boolean;2522 readonly asAddBasicResource: {2523 readonly rmrkCollectionId: u32;2524 readonly nftId: u32;2525 readonly resource: RmrkTraitsResourceBasicResource;2526 } & Struct;2527 readonly isAddComposableResource: boolean;2528 readonly asAddComposableResource: {2529 readonly rmrkCollectionId: u32;2530 readonly nftId: u32;2531 readonly resource: RmrkTraitsResourceComposableResource;2532 } & Struct;2533 readonly isAddSlotResource: boolean;2534 readonly asAddSlotResource: {2535 readonly rmrkCollectionId: u32;2536 readonly nftId: u32;2537 readonly resource: RmrkTraitsResourceSlotResource;2538 } & Struct;2539 readonly isRemoveResource: boolean;2540 readonly asRemoveResource: {2541 readonly rmrkCollectionId: u32;2542 readonly nftId: u32;2543 readonly resourceId: u32;2544 } & Struct;2545 readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';2546 }25472548 /** @name RmrkTraitsResourceResourceTypes (282) */2549 interface RmrkTraitsResourceResourceTypes extends Enum {2550 readonly isBasic: boolean;2551 readonly asBasic: RmrkTraitsResourceBasicResource;2552 readonly isComposable: boolean;2553 readonly asComposable: RmrkTraitsResourceComposableResource;2554 readonly isSlot: boolean;2555 readonly asSlot: RmrkTraitsResourceSlotResource;2556 readonly type: 'Basic' | 'Composable' | 'Slot';2557 }25582559 /** @name RmrkTraitsResourceBasicResource (284) */2560 interface RmrkTraitsResourceBasicResource extends Struct {2561 readonly src: Option<Bytes>;2562 readonly metadata: Option<Bytes>;2563 readonly license: Option<Bytes>;2564 readonly thumb: Option<Bytes>;2565 }25662567 /** @name RmrkTraitsResourceComposableResource (286) */2568 interface RmrkTraitsResourceComposableResource extends Struct {2569 readonly parts: Vec<u32>;2570 readonly base: u32;2571 readonly src: Option<Bytes>;2572 readonly metadata: Option<Bytes>;2573 readonly license: Option<Bytes>;2574 readonly thumb: Option<Bytes>;2575 }25762577 /** @name RmrkTraitsResourceSlotResource (287) */2578 interface RmrkTraitsResourceSlotResource extends Struct {2579 readonly base: u32;2580 readonly src: Option<Bytes>;2581 readonly metadata: Option<Bytes>;2582 readonly slot: u32;2583 readonly license: Option<Bytes>;2584 readonly thumb: Option<Bytes>;2585 }25862587 /** @name PalletRmrkEquipCall (290) */2588 interface PalletRmrkEquipCall extends Enum {2589 readonly isCreateBase: boolean;2590 readonly asCreateBase: {2591 readonly baseType: Bytes;2592 readonly symbol: Bytes;2593 readonly parts: Vec<RmrkTraitsPartPartType>;2594 } & Struct;2595 readonly isThemeAdd: boolean;2596 readonly asThemeAdd: {2597 readonly baseId: u32;2598 readonly theme: RmrkTraitsTheme;2599 } & Struct;2600 readonly isEquippable: boolean;2601 readonly asEquippable: {2602 readonly baseId: u32;2603 readonly slotId: u32;2604 readonly equippables: RmrkTraitsPartEquippableList;2605 } & Struct;2606 readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';2607 }26082609 /** @name RmrkTraitsPartPartType (293) */2610 interface RmrkTraitsPartPartType extends Enum {2611 readonly isFixedPart: boolean;2612 readonly asFixedPart: RmrkTraitsPartFixedPart;2613 readonly isSlotPart: boolean;2614 readonly asSlotPart: RmrkTraitsPartSlotPart;2615 readonly type: 'FixedPart' | 'SlotPart';2616 }26172618 /** @name RmrkTraitsPartFixedPart (295) */2619 interface RmrkTraitsPartFixedPart extends Struct {2620 readonly id: u32;2621 readonly z: u32;2622 readonly src: Bytes;2623 }26242625 /** @name RmrkTraitsPartSlotPart (296) */2626 interface RmrkTraitsPartSlotPart extends Struct {2627 readonly id: u32;2628 readonly equippable: RmrkTraitsPartEquippableList;2629 readonly src: Bytes;2630 readonly z: u32;2631 }26322633 /** @name RmrkTraitsPartEquippableList (297) */2634 interface RmrkTraitsPartEquippableList extends Enum {2635 readonly isAll: boolean;2636 readonly isEmpty: boolean;2637 readonly isCustom: boolean;2638 readonly asCustom: Vec<u32>;2639 readonly type: 'All' | 'Empty' | 'Custom';2640 }26412642 /** @name RmrkTraitsTheme (299) */2643 interface RmrkTraitsTheme extends Struct {2644 readonly name: Bytes;2645 readonly properties: Vec<RmrkTraitsThemeThemeProperty>;2646 readonly inherit: bool;2647 }26482649 /** @name RmrkTraitsThemeThemeProperty (301) */2650 interface RmrkTraitsThemeThemeProperty extends Struct {2651 readonly key: Bytes;2652 readonly value: Bytes;2653 }26542655 /** @name PalletEvmCall (303) */2656 interface PalletEvmCall extends Enum {2657 readonly isWithdraw: boolean;2658 readonly asWithdraw: {2659 readonly address: H160;2660 readonly value: u128;2661 } & Struct;2662 readonly isCall: boolean;2663 readonly asCall: {2664 readonly source: H160;2665 readonly target: H160;2666 readonly input: Bytes;2667 readonly value: U256;2668 readonly gasLimit: u64;2669 readonly maxFeePerGas: U256;2670 readonly maxPriorityFeePerGas: Option<U256>;2671 readonly nonce: Option<U256>;2672 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2673 } & Struct;2674 readonly isCreate: boolean;2675 readonly asCreate: {2676 readonly source: H160;2677 readonly init: Bytes;2678 readonly value: U256;2679 readonly gasLimit: u64;2680 readonly maxFeePerGas: U256;2681 readonly maxPriorityFeePerGas: Option<U256>;2682 readonly nonce: Option<U256>;2683 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2684 } & Struct;2685 readonly isCreate2: boolean;2686 readonly asCreate2: {2687 readonly source: H160;2688 readonly init: Bytes;2689 readonly salt: H256;2690 readonly value: U256;2691 readonly gasLimit: u64;2692 readonly maxFeePerGas: U256;2693 readonly maxPriorityFeePerGas: Option<U256>;2694 readonly nonce: Option<U256>;2695 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2696 } & Struct;2697 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';2698 }26992700 /** @name PalletEthereumCall (307) */2701 interface PalletEthereumCall extends Enum {2702 readonly isTransact: boolean;2703 readonly asTransact: {2704 readonly transaction: EthereumTransactionTransactionV2;2705 } & Struct;2706 readonly type: 'Transact';2707 }27082709 /** @name EthereumTransactionTransactionV2 (308) */2710 interface EthereumTransactionTransactionV2 extends Enum {2711 readonly isLegacy: boolean;2712 readonly asLegacy: EthereumTransactionLegacyTransaction;2713 readonly isEip2930: boolean;2714 readonly asEip2930: EthereumTransactionEip2930Transaction;2715 readonly isEip1559: boolean;2716 readonly asEip1559: EthereumTransactionEip1559Transaction;2717 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';2718 }27192720 /** @name EthereumTransactionLegacyTransaction (309) */2721 interface EthereumTransactionLegacyTransaction extends Struct {2722 readonly nonce: U256;2723 readonly gasPrice: U256;2724 readonly gasLimit: U256;2725 readonly action: EthereumTransactionTransactionAction;2726 readonly value: U256;2727 readonly input: Bytes;2728 readonly signature: EthereumTransactionTransactionSignature;2729 }27302731 /** @name EthereumTransactionTransactionAction (310) */2732 interface EthereumTransactionTransactionAction extends Enum {2733 readonly isCall: boolean;2734 readonly asCall: H160;2735 readonly isCreate: boolean;2736 readonly type: 'Call' | 'Create';2737 }27382739 /** @name EthereumTransactionTransactionSignature (311) */2740 interface EthereumTransactionTransactionSignature extends Struct {2741 readonly v: u64;2742 readonly r: H256;2743 readonly s: H256;2744 }27452746 /** @name EthereumTransactionEip2930Transaction (313) */2747 interface EthereumTransactionEip2930Transaction extends Struct {2748 readonly chainId: u64;2749 readonly nonce: U256;2750 readonly gasPrice: U256;2751 readonly gasLimit: U256;2752 readonly action: EthereumTransactionTransactionAction;2753 readonly value: U256;2754 readonly input: Bytes;2755 readonly accessList: Vec<EthereumTransactionAccessListItem>;2756 readonly oddYParity: bool;2757 readonly r: H256;2758 readonly s: H256;2759 }27602761 /** @name EthereumTransactionAccessListItem (315) */2762 interface EthereumTransactionAccessListItem extends Struct {2763 readonly address: H160;2764 readonly storageKeys: Vec<H256>;2765 }27662767 /** @name EthereumTransactionEip1559Transaction (316) */2768 interface EthereumTransactionEip1559Transaction extends Struct {2769 readonly chainId: u64;2770 readonly nonce: U256;2771 readonly maxPriorityFeePerGas: U256;2772 readonly maxFeePerGas: U256;2773 readonly gasLimit: U256;2774 readonly action: EthereumTransactionTransactionAction;2775 readonly value: U256;2776 readonly input: Bytes;2777 readonly accessList: Vec<EthereumTransactionAccessListItem>;2778 readonly oddYParity: bool;2779 readonly r: H256;2780 readonly s: H256;2781 }27822783 /** @name PalletEvmMigrationCall (317) */2784 interface PalletEvmMigrationCall extends Enum {2785 readonly isBegin: boolean;2786 readonly asBegin: {2787 readonly address: H160;2788 } & Struct;2789 readonly isSetData: boolean;2790 readonly asSetData: {2791 readonly address: H160;2792 readonly data: Vec<ITuple<[H256, H256]>>;2793 } & Struct;2794 readonly isFinish: boolean;2795 readonly asFinish: {2796 readonly address: H160;2797 readonly code: Bytes;2798 } & Struct;2799 readonly type: 'Begin' | 'SetData' | 'Finish';2800 }28012802 /** @name PalletSudoError (320) */2803 interface PalletSudoError extends Enum {2804 readonly isRequireSudo: boolean;2805 readonly type: 'RequireSudo';2806 }28072808 /** @name OrmlVestingModuleError (322) */2809 interface OrmlVestingModuleError extends Enum {2810 readonly isZeroVestingPeriod: boolean;2811 readonly isZeroVestingPeriodCount: boolean;2812 readonly isInsufficientBalanceToLock: boolean;2813 readonly isTooManyVestingSchedules: boolean;2814 readonly isAmountLow: boolean;2815 readonly isMaxVestingSchedulesExceeded: boolean;2816 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';2817 }28182819 /** @name CumulusPalletXcmpQueueInboundChannelDetails (324) */2820 interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {2821 readonly sender: u32;2822 readonly state: CumulusPalletXcmpQueueInboundState;2823 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;2824 }28252826 /** @name CumulusPalletXcmpQueueInboundState (325) */2827 interface CumulusPalletXcmpQueueInboundState extends Enum {2828 readonly isOk: boolean;2829 readonly isSuspended: boolean;2830 readonly type: 'Ok' | 'Suspended';2831 }28322833 /** @name PolkadotParachainPrimitivesXcmpMessageFormat (328) */2834 interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {2835 readonly isConcatenatedVersionedXcm: boolean;2836 readonly isConcatenatedEncodedBlob: boolean;2837 readonly isSignals: boolean;2838 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';2839 }28402841 /** @name CumulusPalletXcmpQueueOutboundChannelDetails (331) */2842 interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {2843 readonly recipient: u32;2844 readonly state: CumulusPalletXcmpQueueOutboundState;2845 readonly signalsExist: bool;2846 readonly firstIndex: u16;2847 readonly lastIndex: u16;2848 }28492850 /** @name CumulusPalletXcmpQueueOutboundState (332) */2851 interface CumulusPalletXcmpQueueOutboundState extends Enum {2852 readonly isOk: boolean;2853 readonly isSuspended: boolean;2854 readonly type: 'Ok' | 'Suspended';2855 }28562857 /** @name CumulusPalletXcmpQueueQueueConfigData (334) */2858 interface CumulusPalletXcmpQueueQueueConfigData extends Struct {2859 readonly suspendThreshold: u32;2860 readonly dropThreshold: u32;2861 readonly resumeThreshold: u32;2862 readonly thresholdWeight: u64;2863 readonly weightRestrictDecay: u64;2864 readonly xcmpMaxIndividualWeight: u64;2865 }28662867 /** @name CumulusPalletXcmpQueueError (336) */2868 interface CumulusPalletXcmpQueueError extends Enum {2869 readonly isFailedToSend: boolean;2870 readonly isBadXcmOrigin: boolean;2871 readonly isBadXcm: boolean;2872 readonly isBadOverweightIndex: boolean;2873 readonly isWeightOverLimit: boolean;2874 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';2875 }28762877 /** @name PalletXcmError (337) */2878 interface PalletXcmError extends Enum {2879 readonly isUnreachable: boolean;2880 readonly isSendFailure: boolean;2881 readonly isFiltered: boolean;2882 readonly isUnweighableMessage: boolean;2883 readonly isDestinationNotInvertible: boolean;2884 readonly isEmpty: boolean;2885 readonly isCannotReanchor: boolean;2886 readonly isTooManyAssets: boolean;2887 readonly isInvalidOrigin: boolean;2888 readonly isBadVersion: boolean;2889 readonly isBadLocation: boolean;2890 readonly isNoSubscription: boolean;2891 readonly isAlreadySubscribed: boolean;2892 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';2893 }28942895 /** @name CumulusPalletXcmError (338) */2896 type CumulusPalletXcmError = Null;28972898 /** @name CumulusPalletDmpQueueConfigData (339) */2899 interface CumulusPalletDmpQueueConfigData extends Struct {2900 readonly maxIndividual: u64;2901 }29022903 /** @name CumulusPalletDmpQueuePageIndexData (340) */2904 interface CumulusPalletDmpQueuePageIndexData extends Struct {2905 readonly beginUsed: u32;2906 readonly endUsed: u32;2907 readonly overweightCount: u64;2908 }29092910 /** @name CumulusPalletDmpQueueError (343) */2911 interface CumulusPalletDmpQueueError extends Enum {2912 readonly isUnknown: boolean;2913 readonly isOverLimit: boolean;2914 readonly type: 'Unknown' | 'OverLimit';2915 }29162917 /** @name PalletUniqueError (347) */2918 interface PalletUniqueError extends Enum {2919 readonly isCollectionDecimalPointLimitExceeded: boolean;2920 readonly isConfirmUnsetSponsorFail: boolean;2921 readonly isEmptyArgument: boolean;2922 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;2923 readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';2924 }29252926 /** @name PalletUniqueSchedulerScheduledV3 (350) */2927 interface PalletUniqueSchedulerScheduledV3 extends Struct {2928 readonly maybeId: Option<U8aFixed>;2929 readonly priority: u8;2930 readonly call: FrameSupportScheduleMaybeHashed;2931 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2932 readonly origin: OpalRuntimeOriginCaller;2933 }29342935 /** @name OpalRuntimeOriginCaller (351) */2936 interface OpalRuntimeOriginCaller extends Enum {2937 readonly isSystem: boolean;2938 readonly asSystem: FrameSupportDispatchRawOrigin;2939 readonly isVoid: boolean;2940 readonly isPolkadotXcm: boolean;2941 readonly asPolkadotXcm: PalletXcmOrigin;2942 readonly isCumulusXcm: boolean;2943 readonly asCumulusXcm: CumulusPalletXcmOrigin;2944 readonly isEthereum: boolean;2945 readonly asEthereum: PalletEthereumRawOrigin;2946 readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';2947 }29482949 /** @name FrameSupportDispatchRawOrigin (352) */2950 interface FrameSupportDispatchRawOrigin extends Enum {2951 readonly isRoot: boolean;2952 readonly isSigned: boolean;2953 readonly asSigned: AccountId32;2954 readonly isNone: boolean;2955 readonly type: 'Root' | 'Signed' | 'None';2956 }29572958 /** @name PalletXcmOrigin (353) */2959 interface PalletXcmOrigin extends Enum {2960 readonly isXcm: boolean;2961 readonly asXcm: XcmV1MultiLocation;2962 readonly isResponse: boolean;2963 readonly asResponse: XcmV1MultiLocation;2964 readonly type: 'Xcm' | 'Response';2965 }29662967 /** @name CumulusPalletXcmOrigin (354) */2968 interface CumulusPalletXcmOrigin extends Enum {2969 readonly isRelay: boolean;2970 readonly isSiblingParachain: boolean;2971 readonly asSiblingParachain: u32;2972 readonly type: 'Relay' | 'SiblingParachain';2973 }29742975 /** @name PalletEthereumRawOrigin (355) */2976 interface PalletEthereumRawOrigin extends Enum {2977 readonly isEthereumTransaction: boolean;2978 readonly asEthereumTransaction: H160;2979 readonly type: 'EthereumTransaction';2980 }29812982 /** @name SpCoreVoid (356) */2983 type SpCoreVoid = Null;29842985 /** @name PalletUniqueSchedulerError (357) */2986 interface PalletUniqueSchedulerError extends Enum {2987 readonly isFailedToSchedule: boolean;2988 readonly isNotFound: boolean;2989 readonly isTargetBlockNumberInPast: boolean;2990 readonly isRescheduleNoChange: boolean;2991 readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';2992 }29932994 /** @name UpDataStructsCollection (358) */2995 interface UpDataStructsCollection extends Struct {2996 readonly owner: AccountId32;2997 readonly mode: UpDataStructsCollectionMode;2998 readonly name: Vec<u16>;2999 readonly description: Vec<u16>;3000 readonly tokenPrefix: Bytes;3001 readonly sponsorship: UpDataStructsSponsorshipState;3002 readonly limits: UpDataStructsCollectionLimits;3003 readonly permissions: UpDataStructsCollectionPermissions;3004 readonly externalCollection: bool;3005 }30063007 /** @name UpDataStructsSponsorshipState (359) */3008 interface UpDataStructsSponsorshipState extends Enum {3009 readonly isDisabled: boolean;3010 readonly isUnconfirmed: boolean;3011 readonly asUnconfirmed: AccountId32;3012 readonly isConfirmed: boolean;3013 readonly asConfirmed: AccountId32;3014 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3015 }30163017 /** @name UpDataStructsProperties (360) */3018 interface UpDataStructsProperties extends Struct {3019 readonly map: UpDataStructsPropertiesMapBoundedVec;3020 readonly consumedSpace: u32;3021 readonly spaceLimit: u32;3022 }30233024 /** @name UpDataStructsPropertiesMapBoundedVec (361) */3025 interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}30263027 /** @name UpDataStructsPropertiesMapPropertyPermission (366) */3028 interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}30293030 /** @name UpDataStructsCollectionStats (373) */3031 interface UpDataStructsCollectionStats extends Struct {3032 readonly created: u32;3033 readonly destroyed: u32;3034 readonly alive: u32;3035 }30363037 /** @name UpDataStructsTokenChild (374) */3038 interface UpDataStructsTokenChild extends Struct {3039 readonly token: u32;3040 readonly collection: u32;3041 }30423043 /** @name PhantomTypeUpDataStructs (375) */3044 interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}30453046 /** @name UpDataStructsTokenData (377) */3047 interface UpDataStructsTokenData extends Struct {3048 readonly properties: Vec<UpDataStructsProperty>;3049 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3050 readonly pieces: u128;3051 }30523053 /** @name UpDataStructsRpcCollection (379) */3054 interface UpDataStructsRpcCollection extends Struct {3055 readonly owner: AccountId32;3056 readonly mode: UpDataStructsCollectionMode;3057 readonly name: Vec<u16>;3058 readonly description: Vec<u16>;3059 readonly tokenPrefix: Bytes;3060 readonly sponsorship: UpDataStructsSponsorshipState;3061 readonly limits: UpDataStructsCollectionLimits;3062 readonly permissions: UpDataStructsCollectionPermissions;3063 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3064 readonly properties: Vec<UpDataStructsProperty>;3065 readonly readOnly: bool;3066 }30673068 /** @name RmrkTraitsCollectionCollectionInfo (380) */3069 interface RmrkTraitsCollectionCollectionInfo extends Struct {3070 readonly issuer: AccountId32;3071 readonly metadata: Bytes;3072 readonly max: Option<u32>;3073 readonly symbol: Bytes;3074 readonly nftsCount: u32;3075 }30763077 /** @name RmrkTraitsNftNftInfo (381) */3078 interface RmrkTraitsNftNftInfo extends Struct {3079 readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;3080 readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;3081 readonly metadata: Bytes;3082 readonly equipped: bool;3083 readonly pending: bool;3084 }30853086 /** @name RmrkTraitsNftRoyaltyInfo (383) */3087 interface RmrkTraitsNftRoyaltyInfo extends Struct {3088 readonly recipient: AccountId32;3089 readonly amount: Permill;3090 }30913092 /** @name RmrkTraitsResourceResourceInfo (384) */3093 interface RmrkTraitsResourceResourceInfo extends Struct {3094 readonly id: u32;3095 readonly resource: RmrkTraitsResourceResourceTypes;3096 readonly pending: bool;3097 readonly pendingRemoval: bool;3098 }30993100 /** @name RmrkTraitsPropertyPropertyInfo (385) */3101 interface RmrkTraitsPropertyPropertyInfo extends Struct {3102 readonly key: Bytes;3103 readonly value: Bytes;3104 }31053106 /** @name RmrkTraitsBaseBaseInfo (386) */3107 interface RmrkTraitsBaseBaseInfo extends Struct {3108 readonly issuer: AccountId32;3109 readonly baseType: Bytes;3110 readonly symbol: Bytes;3111 }31123113 /** @name RmrkTraitsNftNftChild (387) */3114 interface RmrkTraitsNftNftChild extends Struct {3115 readonly collectionId: u32;3116 readonly nftId: u32;3117 }31183119 /** @name PalletCommonError (389) */3120 interface PalletCommonError extends Enum {3121 readonly isCollectionNotFound: boolean;3122 readonly isMustBeTokenOwner: boolean;3123 readonly isNoPermission: boolean;3124 readonly isCantDestroyNotEmptyCollection: boolean;3125 readonly isPublicMintingNotAllowed: boolean;3126 readonly isAddressNotInAllowlist: boolean;3127 readonly isCollectionNameLimitExceeded: boolean;3128 readonly isCollectionDescriptionLimitExceeded: boolean;3129 readonly isCollectionTokenPrefixLimitExceeded: boolean;3130 readonly isTotalCollectionsLimitExceeded: boolean;3131 readonly isCollectionAdminCountExceeded: boolean;3132 readonly isCollectionLimitBoundsExceeded: boolean;3133 readonly isOwnerPermissionsCantBeReverted: boolean;3134 readonly isTransferNotAllowed: boolean;3135 readonly isAccountTokenLimitExceeded: boolean;3136 readonly isCollectionTokenLimitExceeded: boolean;3137 readonly isMetadataFlagFrozen: boolean;3138 readonly isTokenNotFound: boolean;3139 readonly isTokenValueTooLow: boolean;3140 readonly isApprovedValueTooLow: boolean;3141 readonly isCantApproveMoreThanOwned: boolean;3142 readonly isAddressIsZero: boolean;3143 readonly isUnsupportedOperation: boolean;3144 readonly isNotSufficientFounds: boolean;3145 readonly isUserIsNotAllowedToNest: boolean;3146 readonly isSourceCollectionIsNotAllowedToNest: boolean;3147 readonly isCollectionFieldSizeExceeded: boolean;3148 readonly isNoSpaceForProperty: boolean;3149 readonly isPropertyLimitReached: boolean;3150 readonly isPropertyKeyIsTooLong: boolean;3151 readonly isInvalidCharacterInPropertyKey: boolean;3152 readonly isEmptyPropertyKey: boolean;3153 readonly isCollectionIsExternal: boolean;3154 readonly isCollectionIsInternal: boolean;3155 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';3156 }31573158 /** @name PalletFungibleError (391) */3159 interface PalletFungibleError extends Enum {3160 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;3161 readonly isFungibleItemsHaveNoId: boolean;3162 readonly isFungibleItemsDontHaveData: boolean;3163 readonly isFungibleDisallowsNesting: boolean;3164 readonly isSettingPropertiesNotAllowed: boolean;3165 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3166 }31673168 /** @name PalletRefungibleItemData (392) */3169 interface PalletRefungibleItemData extends Struct {3170 readonly constData: Bytes;3171 }31723173 /** @name PalletRefungibleError (397) */3174 interface PalletRefungibleError extends Enum {3175 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;3176 readonly isWrongRefungiblePieces: boolean;3177 readonly isRepartitionWhileNotOwningAllPieces: boolean;3178 readonly isRefungibleDisallowsNesting: boolean;3179 readonly isSettingPropertiesNotAllowed: boolean;3180 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3181 }31823183 /** @name PalletNonfungibleItemData (398) */3184 interface PalletNonfungibleItemData extends Struct {3185 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;3186 }31873188 /** @name UpDataStructsPropertyScope (400) */3189 interface UpDataStructsPropertyScope extends Enum {3190 readonly isNone: boolean;3191 readonly isRmrk: boolean;3192 readonly isEth: boolean;3193 readonly type: 'None' | 'Rmrk' | 'Eth';3194 }31953196 /** @name PalletNonfungibleError (402) */3197 interface PalletNonfungibleError extends Enum {3198 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;3199 readonly isNonfungibleItemsHaveNoAmount: boolean;3200 readonly isCantBurnNftWithChildren: boolean;3201 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';3202 }32033204 /** @name PalletStructureError (403) */3205 interface PalletStructureError extends Enum {3206 readonly isOuroborosDetected: boolean;3207 readonly isDepthLimit: boolean;3208 readonly isBreadthLimit: boolean;3209 readonly isTokenNotFound: boolean;3210 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';3211 }32123213 /** @name PalletRmrkCoreError (404) */3214 interface PalletRmrkCoreError extends Enum {3215 readonly isCorruptedCollectionType: boolean;3216 readonly isRmrkPropertyKeyIsTooLong: boolean;3217 readonly isRmrkPropertyValueIsTooLong: boolean;3218 readonly isRmrkPropertyIsNotFound: boolean;3219 readonly isUnableToDecodeRmrkData: boolean;3220 readonly isCollectionNotEmpty: boolean;3221 readonly isNoAvailableCollectionId: boolean;3222 readonly isNoAvailableNftId: boolean;3223 readonly isCollectionUnknown: boolean;3224 readonly isNoPermission: boolean;3225 readonly isNonTransferable: boolean;3226 readonly isCollectionFullOrLocked: boolean;3227 readonly isResourceDoesntExist: boolean;3228 readonly isCannotSendToDescendentOrSelf: boolean;3229 readonly isCannotAcceptNonOwnedNft: boolean;3230 readonly isCannotRejectNonOwnedNft: boolean;3231 readonly isCannotRejectNonPendingNft: boolean;3232 readonly isResourceNotPending: boolean;3233 readonly isNoAvailableResourceId: boolean;3234 readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';3235 }32363237 /** @name PalletRmrkEquipError (406) */3238 interface PalletRmrkEquipError extends Enum {3239 readonly isPermissionError: boolean;3240 readonly isNoAvailableBaseId: boolean;3241 readonly isNoAvailablePartId: boolean;3242 readonly isBaseDoesntExist: boolean;3243 readonly isNeedsDefaultThemeFirst: boolean;3244 readonly isPartDoesntExist: boolean;3245 readonly isNoEquippableOnFixedPart: boolean;3246 readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';3247 }32483249 /** @name PalletEvmError (409) */3250 interface PalletEvmError extends Enum {3251 readonly isBalanceLow: boolean;3252 readonly isFeeOverflow: boolean;3253 readonly isPaymentOverflow: boolean;3254 readonly isWithdrawFailed: boolean;3255 readonly isGasPriceTooLow: boolean;3256 readonly isInvalidNonce: boolean;3257 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';3258 }32593260 /** @name FpRpcTransactionStatus (412) */3261 interface FpRpcTransactionStatus extends Struct {3262 readonly transactionHash: H256;3263 readonly transactionIndex: u32;3264 readonly from: H160;3265 readonly to: Option<H160>;3266 readonly contractAddress: Option<H160>;3267 readonly logs: Vec<EthereumLog>;3268 readonly logsBloom: EthbloomBloom;3269 }32703271 /** @name EthbloomBloom (414) */3272 interface EthbloomBloom extends U8aFixed {}32733274 /** @name EthereumReceiptReceiptV3 (416) */3275 interface EthereumReceiptReceiptV3 extends Enum {3276 readonly isLegacy: boolean;3277 readonly asLegacy: EthereumReceiptEip658ReceiptData;3278 readonly isEip2930: boolean;3279 readonly asEip2930: EthereumReceiptEip658ReceiptData;3280 readonly isEip1559: boolean;3281 readonly asEip1559: EthereumReceiptEip658ReceiptData;3282 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';3283 }32843285 /** @name EthereumReceiptEip658ReceiptData (417) */3286 interface EthereumReceiptEip658ReceiptData extends Struct {3287 readonly statusCode: u8;3288 readonly usedGas: U256;3289 readonly logsBloom: EthbloomBloom;3290 readonly logs: Vec<EthereumLog>;3291 }32923293 /** @name EthereumBlock (418) */3294 interface EthereumBlock extends Struct {3295 readonly header: EthereumHeader;3296 readonly transactions: Vec<EthereumTransactionTransactionV2>;3297 readonly ommers: Vec<EthereumHeader>;3298 }32993300 /** @name EthereumHeader (419) */3301 interface EthereumHeader extends Struct {3302 readonly parentHash: H256;3303 readonly ommersHash: H256;3304 readonly beneficiary: H160;3305 readonly stateRoot: H256;3306 readonly transactionsRoot: H256;3307 readonly receiptsRoot: H256;3308 readonly logsBloom: EthbloomBloom;3309 readonly difficulty: U256;3310 readonly number: U256;3311 readonly gasLimit: U256;3312 readonly gasUsed: U256;3313 readonly timestamp: u64;3314 readonly extraData: Bytes;3315 readonly mixHash: H256;3316 readonly nonce: EthereumTypesHashH64;3317 }33183319 /** @name EthereumTypesHashH64 (420) */3320 interface EthereumTypesHashH64 extends U8aFixed {}33213322 /** @name PalletEthereumError (425) */3323 interface PalletEthereumError extends Enum {3324 readonly isInvalidSignature: boolean;3325 readonly isPreLogExists: boolean;3326 readonly type: 'InvalidSignature' | 'PreLogExists';3327 }33283329 /** @name PalletEvmCoderSubstrateError (426) */3330 interface PalletEvmCoderSubstrateError extends Enum {3331 readonly isOutOfGas: boolean;3332 readonly isOutOfFund: boolean;3333 readonly type: 'OutOfGas' | 'OutOfFund';3334 }33353336 /** @name PalletEvmContractHelpersSponsoringModeT (427) */3337 interface PalletEvmContractHelpersSponsoringModeT extends Enum {3338 readonly isDisabled: boolean;3339 readonly isAllowlisted: boolean;3340 readonly isGenerous: boolean;3341 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';3342 }33433344 /** @name PalletEvmContractHelpersError (429) */3345 interface PalletEvmContractHelpersError extends Enum {3346 readonly isNoPermission: boolean;3347 readonly type: 'NoPermission';3348 }33493350 /** @name PalletEvmMigrationError (430) */3351 interface PalletEvmMigrationError extends Enum {3352 readonly isAccountNotEmpty: boolean;3353 readonly isAccountIsNotMigrating: boolean;3354 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';3355 }33563357 /** @name SpRuntimeMultiSignature (432) */3358 interface SpRuntimeMultiSignature extends Enum {3359 readonly isEd25519: boolean;3360 readonly asEd25519: SpCoreEd25519Signature;3361 readonly isSr25519: boolean;3362 readonly asSr25519: SpCoreSr25519Signature;3363 readonly isEcdsa: boolean;3364 readonly asEcdsa: SpCoreEcdsaSignature;3365 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';3366 }33673368 /** @name SpCoreEd25519Signature (433) */3369 interface SpCoreEd25519Signature extends U8aFixed {}33703371 /** @name SpCoreSr25519Signature (435) */3372 interface SpCoreSr25519Signature extends U8aFixed {}33733374 /** @name SpCoreEcdsaSignature (436) */3375 interface SpCoreEcdsaSignature extends U8aFixed {}33763377 /** @name FrameSystemExtensionsCheckSpecVersion (439) */3378 type FrameSystemExtensionsCheckSpecVersion = Null;33793380 /** @name FrameSystemExtensionsCheckGenesis (440) */3381 type FrameSystemExtensionsCheckGenesis = Null;33823383 /** @name FrameSystemExtensionsCheckNonce (443) */3384 interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}33853386 /** @name FrameSystemExtensionsCheckWeight (444) */3387 type FrameSystemExtensionsCheckWeight = Null;33883389 /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (445) */3390 interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}33913392 /** @name OpalRuntimeRuntime (446) */3393 type OpalRuntimeRuntime = Null;33943395 /** @name PalletEthereumFakeTransactionFinalizer (447) */3396 type PalletEthereumFakeTransactionFinalizer = Null;33973398} // declare module1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/types/lookup';78import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';9import type { ITuple } from '@polkadot/types-codec/types';10import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';11import type { Event } from '@polkadot/types/interfaces/system';1213declare module '@polkadot/types/lookup' {14 /** @name FrameSystemAccountInfo (3) */15 interface FrameSystemAccountInfo extends Struct {16 readonly nonce: u32;17 readonly consumers: u32;18 readonly providers: u32;19 readonly sufficients: u32;20 readonly data: PalletBalancesAccountData;21 }2223 /** @name PalletBalancesAccountData (5) */24 interface PalletBalancesAccountData extends Struct {25 readonly free: u128;26 readonly reserved: u128;27 readonly miscFrozen: u128;28 readonly feeFrozen: u128;29 }3031 /** @name FrameSupportWeightsPerDispatchClassU64 (7) */32 interface FrameSupportWeightsPerDispatchClassU64 extends Struct {33 readonly normal: u64;34 readonly operational: u64;35 readonly mandatory: u64;36 }3738 /** @name SpRuntimeDigest (11) */39 interface SpRuntimeDigest extends Struct {40 readonly logs: Vec<SpRuntimeDigestDigestItem>;41 }4243 /** @name SpRuntimeDigestDigestItem (13) */44 interface SpRuntimeDigestDigestItem extends Enum {45 readonly isOther: boolean;46 readonly asOther: Bytes;47 readonly isConsensus: boolean;48 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;49 readonly isSeal: boolean;50 readonly asSeal: ITuple<[U8aFixed, Bytes]>;51 readonly isPreRuntime: boolean;52 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;53 readonly isRuntimeEnvironmentUpdated: boolean;54 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';55 }5657 /** @name FrameSystemEventRecord (16) */58 interface FrameSystemEventRecord extends Struct {59 readonly phase: FrameSystemPhase;60 readonly event: Event;61 readonly topics: Vec<H256>;62 }6364 /** @name FrameSystemEvent (18) */65 interface FrameSystemEvent extends Enum {66 readonly isExtrinsicSuccess: boolean;67 readonly asExtrinsicSuccess: {68 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;69 } & Struct;70 readonly isExtrinsicFailed: boolean;71 readonly asExtrinsicFailed: {72 readonly dispatchError: SpRuntimeDispatchError;73 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;74 } & Struct;75 readonly isCodeUpdated: boolean;76 readonly isNewAccount: boolean;77 readonly asNewAccount: {78 readonly account: AccountId32;79 } & Struct;80 readonly isKilledAccount: boolean;81 readonly asKilledAccount: {82 readonly account: AccountId32;83 } & Struct;84 readonly isRemarked: boolean;85 readonly asRemarked: {86 readonly sender: AccountId32;87 readonly hash_: H256;88 } & Struct;89 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';90 }9192 /** @name FrameSupportWeightsDispatchInfo (19) */93 interface FrameSupportWeightsDispatchInfo extends Struct {94 readonly weight: u64;95 readonly class: FrameSupportWeightsDispatchClass;96 readonly paysFee: FrameSupportWeightsPays;97 }9899 /** @name FrameSupportWeightsDispatchClass (20) */100 interface FrameSupportWeightsDispatchClass extends Enum {101 readonly isNormal: boolean;102 readonly isOperational: boolean;103 readonly isMandatory: boolean;104 readonly type: 'Normal' | 'Operational' | 'Mandatory';105 }106107 /** @name FrameSupportWeightsPays (21) */108 interface FrameSupportWeightsPays extends Enum {109 readonly isYes: boolean;110 readonly isNo: boolean;111 readonly type: 'Yes' | 'No';112 }113114 /** @name SpRuntimeDispatchError (22) */115 interface SpRuntimeDispatchError extends Enum {116 readonly isOther: boolean;117 readonly isCannotLookup: boolean;118 readonly isBadOrigin: boolean;119 readonly isModule: boolean;120 readonly asModule: SpRuntimeModuleError;121 readonly isConsumerRemaining: boolean;122 readonly isNoProviders: boolean;123 readonly isTooManyConsumers: boolean;124 readonly isToken: boolean;125 readonly asToken: SpRuntimeTokenError;126 readonly isArithmetic: boolean;127 readonly asArithmetic: SpRuntimeArithmeticError;128 readonly isTransactional: boolean;129 readonly asTransactional: SpRuntimeTransactionalError;130 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';131 }132133 /** @name SpRuntimeModuleError (23) */134 interface SpRuntimeModuleError extends Struct {135 readonly index: u8;136 readonly error: U8aFixed;137 }138139 /** @name SpRuntimeTokenError (24) */140 interface SpRuntimeTokenError extends Enum {141 readonly isNoFunds: boolean;142 readonly isWouldDie: boolean;143 readonly isBelowMinimum: boolean;144 readonly isCannotCreate: boolean;145 readonly isUnknownAsset: boolean;146 readonly isFrozen: boolean;147 readonly isUnsupported: boolean;148 readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';149 }150151 /** @name SpRuntimeArithmeticError (25) */152 interface SpRuntimeArithmeticError extends Enum {153 readonly isUnderflow: boolean;154 readonly isOverflow: boolean;155 readonly isDivisionByZero: boolean;156 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';157 }158159 /** @name SpRuntimeTransactionalError (26) */160 interface SpRuntimeTransactionalError extends Enum {161 readonly isLimitReached: boolean;162 readonly isNoLayer: boolean;163 readonly type: 'LimitReached' | 'NoLayer';164 }165166 /** @name CumulusPalletParachainSystemEvent (27) */167 interface CumulusPalletParachainSystemEvent extends Enum {168 readonly isValidationFunctionStored: boolean;169 readonly isValidationFunctionApplied: boolean;170 readonly asValidationFunctionApplied: {171 readonly relayChainBlockNum: u32;172 } & Struct;173 readonly isValidationFunctionDiscarded: boolean;174 readonly isUpgradeAuthorized: boolean;175 readonly asUpgradeAuthorized: {176 readonly codeHash: H256;177 } & Struct;178 readonly isDownwardMessagesReceived: boolean;179 readonly asDownwardMessagesReceived: {180 readonly count: u32;181 } & Struct;182 readonly isDownwardMessagesProcessed: boolean;183 readonly asDownwardMessagesProcessed: {184 readonly weightUsed: u64;185 readonly dmqHead: H256;186 } & Struct;187 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed';188 }189190 /** @name PalletBalancesEvent (28) */191 interface PalletBalancesEvent extends Enum {192 readonly isEndowed: boolean;193 readonly asEndowed: {194 readonly account: AccountId32;195 readonly freeBalance: u128;196 } & Struct;197 readonly isDustLost: boolean;198 readonly asDustLost: {199 readonly account: AccountId32;200 readonly amount: u128;201 } & Struct;202 readonly isTransfer: boolean;203 readonly asTransfer: {204 readonly from: AccountId32;205 readonly to: AccountId32;206 readonly amount: u128;207 } & Struct;208 readonly isBalanceSet: boolean;209 readonly asBalanceSet: {210 readonly who: AccountId32;211 readonly free: u128;212 readonly reserved: u128;213 } & Struct;214 readonly isReserved: boolean;215 readonly asReserved: {216 readonly who: AccountId32;217 readonly amount: u128;218 } & Struct;219 readonly isUnreserved: boolean;220 readonly asUnreserved: {221 readonly who: AccountId32;222 readonly amount: u128;223 } & Struct;224 readonly isReserveRepatriated: boolean;225 readonly asReserveRepatriated: {226 readonly from: AccountId32;227 readonly to: AccountId32;228 readonly amount: u128;229 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;230 } & Struct;231 readonly isDeposit: boolean;232 readonly asDeposit: {233 readonly who: AccountId32;234 readonly amount: u128;235 } & Struct;236 readonly isWithdraw: boolean;237 readonly asWithdraw: {238 readonly who: AccountId32;239 readonly amount: u128;240 } & Struct;241 readonly isSlashed: boolean;242 readonly asSlashed: {243 readonly who: AccountId32;244 readonly amount: u128;245 } & Struct;246 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed';247 }248249 /** @name FrameSupportTokensMiscBalanceStatus (29) */250 interface FrameSupportTokensMiscBalanceStatus extends Enum {251 readonly isFree: boolean;252 readonly isReserved: boolean;253 readonly type: 'Free' | 'Reserved';254 }255256 /** @name PalletTransactionPaymentEvent (30) */257 interface PalletTransactionPaymentEvent extends Enum {258 readonly isTransactionFeePaid: boolean;259 readonly asTransactionFeePaid: {260 readonly who: AccountId32;261 readonly actualFee: u128;262 readonly tip: u128;263 } & Struct;264 readonly type: 'TransactionFeePaid';265 }266267 /** @name PalletTreasuryEvent (31) */268 interface PalletTreasuryEvent extends Enum {269 readonly isProposed: boolean;270 readonly asProposed: {271 readonly proposalIndex: u32;272 } & Struct;273 readonly isSpending: boolean;274 readonly asSpending: {275 readonly budgetRemaining: u128;276 } & Struct;277 readonly isAwarded: boolean;278 readonly asAwarded: {279 readonly proposalIndex: u32;280 readonly award: u128;281 readonly account: AccountId32;282 } & Struct;283 readonly isRejected: boolean;284 readonly asRejected: {285 readonly proposalIndex: u32;286 readonly slashed: u128;287 } & Struct;288 readonly isBurnt: boolean;289 readonly asBurnt: {290 readonly burntFunds: u128;291 } & Struct;292 readonly isRollover: boolean;293 readonly asRollover: {294 readonly rolloverBalance: u128;295 } & Struct;296 readonly isDeposit: boolean;297 readonly asDeposit: {298 readonly value: u128;299 } & Struct;300 readonly isSpendApproved: boolean;301 readonly asSpendApproved: {302 readonly proposalIndex: u32;303 readonly amount: u128;304 readonly beneficiary: AccountId32;305 } & Struct;306 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved';307 }308309 /** @name PalletSudoEvent (32) */310 interface PalletSudoEvent extends Enum {311 readonly isSudid: boolean;312 readonly asSudid: {313 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;314 } & Struct;315 readonly isKeyChanged: boolean;316 readonly asKeyChanged: {317 readonly oldSudoer: Option<AccountId32>;318 } & Struct;319 readonly isSudoAsDone: boolean;320 readonly asSudoAsDone: {321 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;322 } & Struct;323 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';324 }325326 /** @name OrmlVestingModuleEvent (36) */327 interface OrmlVestingModuleEvent extends Enum {328 readonly isVestingScheduleAdded: boolean;329 readonly asVestingScheduleAdded: {330 readonly from: AccountId32;331 readonly to: AccountId32;332 readonly vestingSchedule: OrmlVestingVestingSchedule;333 } & Struct;334 readonly isClaimed: boolean;335 readonly asClaimed: {336 readonly who: AccountId32;337 readonly amount: u128;338 } & Struct;339 readonly isVestingSchedulesUpdated: boolean;340 readonly asVestingSchedulesUpdated: {341 readonly who: AccountId32;342 } & Struct;343 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';344 }345346 /** @name OrmlVestingVestingSchedule (37) */347 interface OrmlVestingVestingSchedule extends Struct {348 readonly start: u32;349 readonly period: u32;350 readonly periodCount: u32;351 readonly perPeriod: Compact<u128>;352 }353354 /** @name CumulusPalletXcmpQueueEvent (39) */355 interface CumulusPalletXcmpQueueEvent extends Enum {356 readonly isSuccess: boolean;357 readonly asSuccess: {358 readonly messageHash: Option<H256>;359 readonly weight: u64;360 } & Struct;361 readonly isFail: boolean;362 readonly asFail: {363 readonly messageHash: Option<H256>;364 readonly error: XcmV2TraitsError;365 readonly weight: u64;366 } & Struct;367 readonly isBadVersion: boolean;368 readonly asBadVersion: {369 readonly messageHash: Option<H256>;370 } & Struct;371 readonly isBadFormat: boolean;372 readonly asBadFormat: {373 readonly messageHash: Option<H256>;374 } & Struct;375 readonly isUpwardMessageSent: boolean;376 readonly asUpwardMessageSent: {377 readonly messageHash: Option<H256>;378 } & Struct;379 readonly isXcmpMessageSent: boolean;380 readonly asXcmpMessageSent: {381 readonly messageHash: Option<H256>;382 } & Struct;383 readonly isOverweightEnqueued: boolean;384 readonly asOverweightEnqueued: {385 readonly sender: u32;386 readonly sentAt: u32;387 readonly index: u64;388 readonly required: u64;389 } & Struct;390 readonly isOverweightServiced: boolean;391 readonly asOverweightServiced: {392 readonly index: u64;393 readonly used: u64;394 } & Struct;395 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';396 }397398 /** @name XcmV2TraitsError (41) */399 interface XcmV2TraitsError extends Enum {400 readonly isOverflow: boolean;401 readonly isUnimplemented: boolean;402 readonly isUntrustedReserveLocation: boolean;403 readonly isUntrustedTeleportLocation: boolean;404 readonly isMultiLocationFull: boolean;405 readonly isMultiLocationNotInvertible: boolean;406 readonly isBadOrigin: boolean;407 readonly isInvalidLocation: boolean;408 readonly isAssetNotFound: boolean;409 readonly isFailedToTransactAsset: boolean;410 readonly isNotWithdrawable: boolean;411 readonly isLocationCannotHold: boolean;412 readonly isExceedsMaxMessageSize: boolean;413 readonly isDestinationUnsupported: boolean;414 readonly isTransport: boolean;415 readonly isUnroutable: boolean;416 readonly isUnknownClaim: boolean;417 readonly isFailedToDecode: boolean;418 readonly isMaxWeightInvalid: boolean;419 readonly isNotHoldingFees: boolean;420 readonly isTooExpensive: boolean;421 readonly isTrap: boolean;422 readonly asTrap: u64;423 readonly isUnhandledXcmVersion: boolean;424 readonly isWeightLimitReached: boolean;425 readonly asWeightLimitReached: u64;426 readonly isBarrier: boolean;427 readonly isWeightNotComputable: boolean;428 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';429 }430431 /** @name PalletXcmEvent (43) */432 interface PalletXcmEvent extends Enum {433 readonly isAttempted: boolean;434 readonly asAttempted: XcmV2TraitsOutcome;435 readonly isSent: boolean;436 readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>;437 readonly isUnexpectedResponse: boolean;438 readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>;439 readonly isResponseReady: boolean;440 readonly asResponseReady: ITuple<[u64, XcmV2Response]>;441 readonly isNotified: boolean;442 readonly asNotified: ITuple<[u64, u8, u8]>;443 readonly isNotifyOverweight: boolean;444 readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>;445 readonly isNotifyDispatchError: boolean;446 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;447 readonly isNotifyDecodeFailed: boolean;448 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;449 readonly isInvalidResponder: boolean;450 readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;451 readonly isInvalidResponderVersion: boolean;452 readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>;453 readonly isResponseTaken: boolean;454 readonly asResponseTaken: u64;455 readonly isAssetsTrapped: boolean;456 readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>;457 readonly isVersionChangeNotified: boolean;458 readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>;459 readonly isSupportedVersionChanged: boolean;460 readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>;461 readonly isNotifyTargetSendFail: boolean;462 readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>;463 readonly isNotifyTargetMigrationFail: boolean;464 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;465 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';466 }467468 /** @name XcmV2TraitsOutcome (44) */469 interface XcmV2TraitsOutcome extends Enum {470 readonly isComplete: boolean;471 readonly asComplete: u64;472 readonly isIncomplete: boolean;473 readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>;474 readonly isError: boolean;475 readonly asError: XcmV2TraitsError;476 readonly type: 'Complete' | 'Incomplete' | 'Error';477 }478479 /** @name XcmV1MultiLocation (45) */480 interface XcmV1MultiLocation extends Struct {481 readonly parents: u8;482 readonly interior: XcmV1MultilocationJunctions;483 }484485 /** @name XcmV1MultilocationJunctions (46) */486 interface XcmV1MultilocationJunctions extends Enum {487 readonly isHere: boolean;488 readonly isX1: boolean;489 readonly asX1: XcmV1Junction;490 readonly isX2: boolean;491 readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;492 readonly isX3: boolean;493 readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;494 readonly isX4: boolean;495 readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;496 readonly isX5: boolean;497 readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;498 readonly isX6: boolean;499 readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;500 readonly isX7: boolean;501 readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;502 readonly isX8: boolean;503 readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;504 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';505 }506507 /** @name XcmV1Junction (47) */508 interface XcmV1Junction extends Enum {509 readonly isParachain: boolean;510 readonly asParachain: Compact<u32>;511 readonly isAccountId32: boolean;512 readonly asAccountId32: {513 readonly network: XcmV0JunctionNetworkId;514 readonly id: U8aFixed;515 } & Struct;516 readonly isAccountIndex64: boolean;517 readonly asAccountIndex64: {518 readonly network: XcmV0JunctionNetworkId;519 readonly index: Compact<u64>;520 } & Struct;521 readonly isAccountKey20: boolean;522 readonly asAccountKey20: {523 readonly network: XcmV0JunctionNetworkId;524 readonly key: U8aFixed;525 } & Struct;526 readonly isPalletInstance: boolean;527 readonly asPalletInstance: u8;528 readonly isGeneralIndex: boolean;529 readonly asGeneralIndex: Compact<u128>;530 readonly isGeneralKey: boolean;531 readonly asGeneralKey: Bytes;532 readonly isOnlyChild: boolean;533 readonly isPlurality: boolean;534 readonly asPlurality: {535 readonly id: XcmV0JunctionBodyId;536 readonly part: XcmV0JunctionBodyPart;537 } & Struct;538 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';539 }540541 /** @name XcmV0JunctionNetworkId (49) */542 interface XcmV0JunctionNetworkId extends Enum {543 readonly isAny: boolean;544 readonly isNamed: boolean;545 readonly asNamed: Bytes;546 readonly isPolkadot: boolean;547 readonly isKusama: boolean;548 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';549 }550551 /** @name XcmV0JunctionBodyId (53) */552 interface XcmV0JunctionBodyId extends Enum {553 readonly isUnit: boolean;554 readonly isNamed: boolean;555 readonly asNamed: Bytes;556 readonly isIndex: boolean;557 readonly asIndex: Compact<u32>;558 readonly isExecutive: boolean;559 readonly isTechnical: boolean;560 readonly isLegislative: boolean;561 readonly isJudicial: boolean;562 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';563 }564565 /** @name XcmV0JunctionBodyPart (54) */566 interface XcmV0JunctionBodyPart extends Enum {567 readonly isVoice: boolean;568 readonly isMembers: boolean;569 readonly asMembers: {570 readonly count: Compact<u32>;571 } & Struct;572 readonly isFraction: boolean;573 readonly asFraction: {574 readonly nom: Compact<u32>;575 readonly denom: Compact<u32>;576 } & Struct;577 readonly isAtLeastProportion: boolean;578 readonly asAtLeastProportion: {579 readonly nom: Compact<u32>;580 readonly denom: Compact<u32>;581 } & Struct;582 readonly isMoreThanProportion: boolean;583 readonly asMoreThanProportion: {584 readonly nom: Compact<u32>;585 readonly denom: Compact<u32>;586 } & Struct;587 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';588 }589590 /** @name XcmV2Xcm (55) */591 interface XcmV2Xcm extends Vec<XcmV2Instruction> {}592593 /** @name XcmV2Instruction (57) */594 interface XcmV2Instruction extends Enum {595 readonly isWithdrawAsset: boolean;596 readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;597 readonly isReserveAssetDeposited: boolean;598 readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets;599 readonly isReceiveTeleportedAsset: boolean;600 readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets;601 readonly isQueryResponse: boolean;602 readonly asQueryResponse: {603 readonly queryId: Compact<u64>;604 readonly response: XcmV2Response;605 readonly maxWeight: Compact<u64>;606 } & Struct;607 readonly isTransferAsset: boolean;608 readonly asTransferAsset: {609 readonly assets: XcmV1MultiassetMultiAssets;610 readonly beneficiary: XcmV1MultiLocation;611 } & Struct;612 readonly isTransferReserveAsset: boolean;613 readonly asTransferReserveAsset: {614 readonly assets: XcmV1MultiassetMultiAssets;615 readonly dest: XcmV1MultiLocation;616 readonly xcm: XcmV2Xcm;617 } & Struct;618 readonly isTransact: boolean;619 readonly asTransact: {620 readonly originType: XcmV0OriginKind;621 readonly requireWeightAtMost: Compact<u64>;622 readonly call: XcmDoubleEncoded;623 } & Struct;624 readonly isHrmpNewChannelOpenRequest: boolean;625 readonly asHrmpNewChannelOpenRequest: {626 readonly sender: Compact<u32>;627 readonly maxMessageSize: Compact<u32>;628 readonly maxCapacity: Compact<u32>;629 } & Struct;630 readonly isHrmpChannelAccepted: boolean;631 readonly asHrmpChannelAccepted: {632 readonly recipient: Compact<u32>;633 } & Struct;634 readonly isHrmpChannelClosing: boolean;635 readonly asHrmpChannelClosing: {636 readonly initiator: Compact<u32>;637 readonly sender: Compact<u32>;638 readonly recipient: Compact<u32>;639 } & Struct;640 readonly isClearOrigin: boolean;641 readonly isDescendOrigin: boolean;642 readonly asDescendOrigin: XcmV1MultilocationJunctions;643 readonly isReportError: boolean;644 readonly asReportError: {645 readonly queryId: Compact<u64>;646 readonly dest: XcmV1MultiLocation;647 readonly maxResponseWeight: Compact<u64>;648 } & Struct;649 readonly isDepositAsset: boolean;650 readonly asDepositAsset: {651 readonly assets: XcmV1MultiassetMultiAssetFilter;652 readonly maxAssets: Compact<u32>;653 readonly beneficiary: XcmV1MultiLocation;654 } & Struct;655 readonly isDepositReserveAsset: boolean;656 readonly asDepositReserveAsset: {657 readonly assets: XcmV1MultiassetMultiAssetFilter;658 readonly maxAssets: Compact<u32>;659 readonly dest: XcmV1MultiLocation;660 readonly xcm: XcmV2Xcm;661 } & Struct;662 readonly isExchangeAsset: boolean;663 readonly asExchangeAsset: {664 readonly give: XcmV1MultiassetMultiAssetFilter;665 readonly receive: XcmV1MultiassetMultiAssets;666 } & Struct;667 readonly isInitiateReserveWithdraw: boolean;668 readonly asInitiateReserveWithdraw: {669 readonly assets: XcmV1MultiassetMultiAssetFilter;670 readonly reserve: XcmV1MultiLocation;671 readonly xcm: XcmV2Xcm;672 } & Struct;673 readonly isInitiateTeleport: boolean;674 readonly asInitiateTeleport: {675 readonly assets: XcmV1MultiassetMultiAssetFilter;676 readonly dest: XcmV1MultiLocation;677 readonly xcm: XcmV2Xcm;678 } & Struct;679 readonly isQueryHolding: boolean;680 readonly asQueryHolding: {681 readonly queryId: Compact<u64>;682 readonly dest: XcmV1MultiLocation;683 readonly assets: XcmV1MultiassetMultiAssetFilter;684 readonly maxResponseWeight: Compact<u64>;685 } & Struct;686 readonly isBuyExecution: boolean;687 readonly asBuyExecution: {688 readonly fees: XcmV1MultiAsset;689 readonly weightLimit: XcmV2WeightLimit;690 } & Struct;691 readonly isRefundSurplus: boolean;692 readonly isSetErrorHandler: boolean;693 readonly asSetErrorHandler: XcmV2Xcm;694 readonly isSetAppendix: boolean;695 readonly asSetAppendix: XcmV2Xcm;696 readonly isClearError: boolean;697 readonly isClaimAsset: boolean;698 readonly asClaimAsset: {699 readonly assets: XcmV1MultiassetMultiAssets;700 readonly ticket: XcmV1MultiLocation;701 } & Struct;702 readonly isTrap: boolean;703 readonly asTrap: Compact<u64>;704 readonly isSubscribeVersion: boolean;705 readonly asSubscribeVersion: {706 readonly queryId: Compact<u64>;707 readonly maxResponseWeight: Compact<u64>;708 } & Struct;709 readonly isUnsubscribeVersion: boolean;710 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';711 }712713 /** @name XcmV1MultiassetMultiAssets (58) */714 interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}715716 /** @name XcmV1MultiAsset (60) */717 interface XcmV1MultiAsset extends Struct {718 readonly id: XcmV1MultiassetAssetId;719 readonly fun: XcmV1MultiassetFungibility;720 }721722 /** @name XcmV1MultiassetAssetId (61) */723 interface XcmV1MultiassetAssetId extends Enum {724 readonly isConcrete: boolean;725 readonly asConcrete: XcmV1MultiLocation;726 readonly isAbstract: boolean;727 readonly asAbstract: Bytes;728 readonly type: 'Concrete' | 'Abstract';729 }730731 /** @name XcmV1MultiassetFungibility (62) */732 interface XcmV1MultiassetFungibility extends Enum {733 readonly isFungible: boolean;734 readonly asFungible: Compact<u128>;735 readonly isNonFungible: boolean;736 readonly asNonFungible: XcmV1MultiassetAssetInstance;737 readonly type: 'Fungible' | 'NonFungible';738 }739740 /** @name XcmV1MultiassetAssetInstance (63) */741 interface XcmV1MultiassetAssetInstance extends Enum {742 readonly isUndefined: boolean;743 readonly isIndex: boolean;744 readonly asIndex: Compact<u128>;745 readonly isArray4: boolean;746 readonly asArray4: U8aFixed;747 readonly isArray8: boolean;748 readonly asArray8: U8aFixed;749 readonly isArray16: boolean;750 readonly asArray16: U8aFixed;751 readonly isArray32: boolean;752 readonly asArray32: U8aFixed;753 readonly isBlob: boolean;754 readonly asBlob: Bytes;755 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';756 }757758 /** @name XcmV2Response (66) */759 interface XcmV2Response extends Enum {760 readonly isNull: boolean;761 readonly isAssets: boolean;762 readonly asAssets: XcmV1MultiassetMultiAssets;763 readonly isExecutionResult: boolean;764 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;765 readonly isVersion: boolean;766 readonly asVersion: u32;767 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';768 }769770 /** @name XcmV0OriginKind (69) */771 interface XcmV0OriginKind extends Enum {772 readonly isNative: boolean;773 readonly isSovereignAccount: boolean;774 readonly isSuperuser: boolean;775 readonly isXcm: boolean;776 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';777 }778779 /** @name XcmDoubleEncoded (70) */780 interface XcmDoubleEncoded extends Struct {781 readonly encoded: Bytes;782 }783784 /** @name XcmV1MultiassetMultiAssetFilter (71) */785 interface XcmV1MultiassetMultiAssetFilter extends Enum {786 readonly isDefinite: boolean;787 readonly asDefinite: XcmV1MultiassetMultiAssets;788 readonly isWild: boolean;789 readonly asWild: XcmV1MultiassetWildMultiAsset;790 readonly type: 'Definite' | 'Wild';791 }792793 /** @name XcmV1MultiassetWildMultiAsset (72) */794 interface XcmV1MultiassetWildMultiAsset extends Enum {795 readonly isAll: boolean;796 readonly isAllOf: boolean;797 readonly asAllOf: {798 readonly id: XcmV1MultiassetAssetId;799 readonly fun: XcmV1MultiassetWildFungibility;800 } & Struct;801 readonly type: 'All' | 'AllOf';802 }803804 /** @name XcmV1MultiassetWildFungibility (73) */805 interface XcmV1MultiassetWildFungibility extends Enum {806 readonly isFungible: boolean;807 readonly isNonFungible: boolean;808 readonly type: 'Fungible' | 'NonFungible';809 }810811 /** @name XcmV2WeightLimit (74) */812 interface XcmV2WeightLimit extends Enum {813 readonly isUnlimited: boolean;814 readonly isLimited: boolean;815 readonly asLimited: Compact<u64>;816 readonly type: 'Unlimited' | 'Limited';817 }818819 /** @name XcmVersionedMultiAssets (76) */820 interface XcmVersionedMultiAssets extends Enum {821 readonly isV0: boolean;822 readonly asV0: Vec<XcmV0MultiAsset>;823 readonly isV1: boolean;824 readonly asV1: XcmV1MultiassetMultiAssets;825 readonly type: 'V0' | 'V1';826 }827828 /** @name XcmV0MultiAsset (78) */829 interface XcmV0MultiAsset extends Enum {830 readonly isNone: boolean;831 readonly isAll: boolean;832 readonly isAllFungible: boolean;833 readonly isAllNonFungible: boolean;834 readonly isAllAbstractFungible: boolean;835 readonly asAllAbstractFungible: {836 readonly id: Bytes;837 } & Struct;838 readonly isAllAbstractNonFungible: boolean;839 readonly asAllAbstractNonFungible: {840 readonly class: Bytes;841 } & Struct;842 readonly isAllConcreteFungible: boolean;843 readonly asAllConcreteFungible: {844 readonly id: XcmV0MultiLocation;845 } & Struct;846 readonly isAllConcreteNonFungible: boolean;847 readonly asAllConcreteNonFungible: {848 readonly class: XcmV0MultiLocation;849 } & Struct;850 readonly isAbstractFungible: boolean;851 readonly asAbstractFungible: {852 readonly id: Bytes;853 readonly amount: Compact<u128>;854 } & Struct;855 readonly isAbstractNonFungible: boolean;856 readonly asAbstractNonFungible: {857 readonly class: Bytes;858 readonly instance: XcmV1MultiassetAssetInstance;859 } & Struct;860 readonly isConcreteFungible: boolean;861 readonly asConcreteFungible: {862 readonly id: XcmV0MultiLocation;863 readonly amount: Compact<u128>;864 } & Struct;865 readonly isConcreteNonFungible: boolean;866 readonly asConcreteNonFungible: {867 readonly class: XcmV0MultiLocation;868 readonly instance: XcmV1MultiassetAssetInstance;869 } & Struct;870 readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';871 }872873 /** @name XcmV0MultiLocation (79) */874 interface XcmV0MultiLocation extends Enum {875 readonly isNull: boolean;876 readonly isX1: boolean;877 readonly asX1: XcmV0Junction;878 readonly isX2: boolean;879 readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>;880 readonly isX3: boolean;881 readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>;882 readonly isX4: boolean;883 readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;884 readonly isX5: boolean;885 readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;886 readonly isX6: boolean;887 readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;888 readonly isX7: boolean;889 readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;890 readonly isX8: boolean;891 readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;892 readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';893 }894895 /** @name XcmV0Junction (80) */896 interface XcmV0Junction extends Enum {897 readonly isParent: boolean;898 readonly isParachain: boolean;899 readonly asParachain: Compact<u32>;900 readonly isAccountId32: boolean;901 readonly asAccountId32: {902 readonly network: XcmV0JunctionNetworkId;903 readonly id: U8aFixed;904 } & Struct;905 readonly isAccountIndex64: boolean;906 readonly asAccountIndex64: {907 readonly network: XcmV0JunctionNetworkId;908 readonly index: Compact<u64>;909 } & Struct;910 readonly isAccountKey20: boolean;911 readonly asAccountKey20: {912 readonly network: XcmV0JunctionNetworkId;913 readonly key: U8aFixed;914 } & Struct;915 readonly isPalletInstance: boolean;916 readonly asPalletInstance: u8;917 readonly isGeneralIndex: boolean;918 readonly asGeneralIndex: Compact<u128>;919 readonly isGeneralKey: boolean;920 readonly asGeneralKey: Bytes;921 readonly isOnlyChild: boolean;922 readonly isPlurality: boolean;923 readonly asPlurality: {924 readonly id: XcmV0JunctionBodyId;925 readonly part: XcmV0JunctionBodyPart;926 } & Struct;927 readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';928 }929930 /** @name XcmVersionedMultiLocation (81) */931 interface XcmVersionedMultiLocation extends Enum {932 readonly isV0: boolean;933 readonly asV0: XcmV0MultiLocation;934 readonly isV1: boolean;935 readonly asV1: XcmV1MultiLocation;936 readonly type: 'V0' | 'V1';937 }938939 /** @name CumulusPalletXcmEvent (82) */940 interface CumulusPalletXcmEvent extends Enum {941 readonly isInvalidFormat: boolean;942 readonly asInvalidFormat: U8aFixed;943 readonly isUnsupportedVersion: boolean;944 readonly asUnsupportedVersion: U8aFixed;945 readonly isExecutedDownward: boolean;946 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>;947 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';948 }949950 /** @name CumulusPalletDmpQueueEvent (83) */951 interface CumulusPalletDmpQueueEvent extends Enum {952 readonly isInvalidFormat: boolean;953 readonly asInvalidFormat: {954 readonly messageId: U8aFixed;955 } & Struct;956 readonly isUnsupportedVersion: boolean;957 readonly asUnsupportedVersion: {958 readonly messageId: U8aFixed;959 } & Struct;960 readonly isExecutedDownward: boolean;961 readonly asExecutedDownward: {962 readonly messageId: U8aFixed;963 readonly outcome: XcmV2TraitsOutcome;964 } & Struct;965 readonly isWeightExhausted: boolean;966 readonly asWeightExhausted: {967 readonly messageId: U8aFixed;968 readonly remainingWeight: u64;969 readonly requiredWeight: u64;970 } & Struct;971 readonly isOverweightEnqueued: boolean;972 readonly asOverweightEnqueued: {973 readonly messageId: U8aFixed;974 readonly overweightIndex: u64;975 readonly requiredWeight: u64;976 } & Struct;977 readonly isOverweightServiced: boolean;978 readonly asOverweightServiced: {979 readonly overweightIndex: u64;980 readonly weightUsed: u64;981 } & Struct;982 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';983 }984985 /** @name PalletUniqueRawEvent (84) */986 interface PalletUniqueRawEvent extends Enum {987 readonly isCollectionSponsorRemoved: boolean;988 readonly asCollectionSponsorRemoved: u32;989 readonly isCollectionAdminAdded: boolean;990 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;991 readonly isCollectionOwnedChanged: boolean;992 readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>;993 readonly isCollectionSponsorSet: boolean;994 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;995 readonly isSponsorshipConfirmed: boolean;996 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;997 readonly isCollectionAdminRemoved: boolean;998 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;999 readonly isAllowListAddressRemoved: boolean;1000 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1001 readonly isAllowListAddressAdded: boolean;1002 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1003 readonly isCollectionLimitSet: boolean;1004 readonly asCollectionLimitSet: u32;1005 readonly isCollectionPermissionSet: boolean;1006 readonly asCollectionPermissionSet: u32;1007 readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';1008 }10091010 /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */1011 interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1012 readonly isSubstrate: boolean;1013 readonly asSubstrate: AccountId32;1014 readonly isEthereum: boolean;1015 readonly asEthereum: H160;1016 readonly type: 'Substrate' | 'Ethereum';1017 }10181019 /** @name PalletUniqueSchedulerEvent (88) */1020 interface PalletUniqueSchedulerEvent extends Enum {1021 readonly isScheduled: boolean;1022 readonly asScheduled: {1023 readonly when: u32;1024 readonly index: u32;1025 } & Struct;1026 readonly isCanceled: boolean;1027 readonly asCanceled: {1028 readonly when: u32;1029 readonly index: u32;1030 } & Struct;1031 readonly isDispatched: boolean;1032 readonly asDispatched: {1033 readonly task: ITuple<[u32, u32]>;1034 readonly id: Option<U8aFixed>;1035 readonly result: Result<Null, SpRuntimeDispatchError>;1036 } & Struct;1037 readonly isCallLookupFailed: boolean;1038 readonly asCallLookupFailed: {1039 readonly task: ITuple<[u32, u32]>;1040 readonly id: Option<U8aFixed>;1041 readonly error: FrameSupportScheduleLookupError;1042 } & Struct;1043 readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';1044 }10451046 /** @name FrameSupportScheduleLookupError (91) */1047 interface FrameSupportScheduleLookupError extends Enum {1048 readonly isUnknown: boolean;1049 readonly isBadFormat: boolean;1050 readonly type: 'Unknown' | 'BadFormat';1051 }10521053 /** @name PalletCommonEvent (92) */1054 interface PalletCommonEvent extends Enum {1055 readonly isCollectionCreated: boolean;1056 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1057 readonly isCollectionDestroyed: boolean;1058 readonly asCollectionDestroyed: u32;1059 readonly isItemCreated: boolean;1060 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1061 readonly isItemDestroyed: boolean;1062 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1063 readonly isTransfer: boolean;1064 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1065 readonly isApproved: boolean;1066 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1067 readonly isCollectionPropertySet: boolean;1068 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1069 readonly isCollectionPropertyDeleted: boolean;1070 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1071 readonly isTokenPropertySet: boolean;1072 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1073 readonly isTokenPropertyDeleted: boolean;1074 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1075 readonly isPropertyPermissionSet: boolean;1076 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1077 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';1078 }10791080 /** @name PalletStructureEvent (95) */1081 interface PalletStructureEvent extends Enum {1082 readonly isExecuted: boolean;1083 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;1084 readonly type: 'Executed';1085 }10861087 /** @name PalletRmrkCoreEvent (96) */1088 interface PalletRmrkCoreEvent extends Enum {1089 readonly isCollectionCreated: boolean;1090 readonly asCollectionCreated: {1091 readonly issuer: AccountId32;1092 readonly collectionId: u32;1093 } & Struct;1094 readonly isCollectionDestroyed: boolean;1095 readonly asCollectionDestroyed: {1096 readonly issuer: AccountId32;1097 readonly collectionId: u32;1098 } & Struct;1099 readonly isIssuerChanged: boolean;1100 readonly asIssuerChanged: {1101 readonly oldIssuer: AccountId32;1102 readonly newIssuer: AccountId32;1103 readonly collectionId: u32;1104 } & Struct;1105 readonly isCollectionLocked: boolean;1106 readonly asCollectionLocked: {1107 readonly issuer: AccountId32;1108 readonly collectionId: u32;1109 } & Struct;1110 readonly isNftMinted: boolean;1111 readonly asNftMinted: {1112 readonly owner: AccountId32;1113 readonly collectionId: u32;1114 readonly nftId: u32;1115 } & Struct;1116 readonly isNftBurned: boolean;1117 readonly asNftBurned: {1118 readonly owner: AccountId32;1119 readonly nftId: u32;1120 } & Struct;1121 readonly isNftSent: boolean;1122 readonly asNftSent: {1123 readonly sender: AccountId32;1124 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1125 readonly collectionId: u32;1126 readonly nftId: u32;1127 readonly approvalRequired: bool;1128 } & Struct;1129 readonly isNftAccepted: boolean;1130 readonly asNftAccepted: {1131 readonly sender: AccountId32;1132 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1133 readonly collectionId: u32;1134 readonly nftId: u32;1135 } & Struct;1136 readonly isNftRejected: boolean;1137 readonly asNftRejected: {1138 readonly sender: AccountId32;1139 readonly collectionId: u32;1140 readonly nftId: u32;1141 } & Struct;1142 readonly isPropertySet: boolean;1143 readonly asPropertySet: {1144 readonly collectionId: u32;1145 readonly maybeNftId: Option<u32>;1146 readonly key: Bytes;1147 readonly value: Bytes;1148 } & Struct;1149 readonly isResourceAdded: boolean;1150 readonly asResourceAdded: {1151 readonly nftId: u32;1152 readonly resourceId: u32;1153 } & Struct;1154 readonly isResourceRemoval: boolean;1155 readonly asResourceRemoval: {1156 readonly nftId: u32;1157 readonly resourceId: u32;1158 } & Struct;1159 readonly isResourceAccepted: boolean;1160 readonly asResourceAccepted: {1161 readonly nftId: u32;1162 readonly resourceId: u32;1163 } & Struct;1164 readonly isResourceRemovalAccepted: boolean;1165 readonly asResourceRemovalAccepted: {1166 readonly nftId: u32;1167 readonly resourceId: u32;1168 } & Struct;1169 readonly isPrioritySet: boolean;1170 readonly asPrioritySet: {1171 readonly collectionId: u32;1172 readonly nftId: u32;1173 } & Struct;1174 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';1175 }11761177 /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */1178 interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {1179 readonly isAccountId: boolean;1180 readonly asAccountId: AccountId32;1181 readonly isCollectionAndNftTuple: boolean;1182 readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;1183 readonly type: 'AccountId' | 'CollectionAndNftTuple';1184 }11851186 /** @name PalletRmrkEquipEvent (102) */1187 interface PalletRmrkEquipEvent extends Enum {1188 readonly isBaseCreated: boolean;1189 readonly asBaseCreated: {1190 readonly issuer: AccountId32;1191 readonly baseId: u32;1192 } & Struct;1193 readonly isEquippablesUpdated: boolean;1194 readonly asEquippablesUpdated: {1195 readonly baseId: u32;1196 readonly slotId: u32;1197 } & Struct;1198 readonly type: 'BaseCreated' | 'EquippablesUpdated';1199 }12001201 /** @name PalletAppPromotionEvent (103) */1202 interface PalletAppPromotionEvent extends Enum {1203 readonly isStakingRecalculation: boolean;1204 readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;1205 readonly isStake: boolean;1206 readonly asStake: ITuple<[AccountId32, u128]>;1207 readonly isUnstake: boolean;1208 readonly asUnstake: ITuple<[AccountId32, u128]>;1209 readonly isSetAdmin: boolean;1210 readonly asSetAdmin: AccountId32;1211 readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';1212 }12131214 /** @name PalletEvmEvent (104) */1215 interface PalletEvmEvent extends Enum {1216 readonly isLog: boolean;1217 readonly asLog: EthereumLog;1218 readonly isCreated: boolean;1219 readonly asCreated: H160;1220 readonly isCreatedFailed: boolean;1221 readonly asCreatedFailed: H160;1222 readonly isExecuted: boolean;1223 readonly asExecuted: H160;1224 readonly isExecutedFailed: boolean;1225 readonly asExecutedFailed: H160;1226 readonly isBalanceDeposit: boolean;1227 readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;1228 readonly isBalanceWithdraw: boolean;1229 readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;1230 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';1231 }12321233 /** @name EthereumLog (105) */1234 interface EthereumLog extends Struct {1235 readonly address: H160;1236 readonly topics: Vec<H256>;1237 readonly data: Bytes;1238 }12391240 /** @name PalletEthereumEvent (109) */1241 interface PalletEthereumEvent extends Enum {1242 readonly isExecuted: boolean;1243 readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;1244 readonly type: 'Executed';1245 }12461247 /** @name EvmCoreErrorExitReason (110) */1248 interface EvmCoreErrorExitReason extends Enum {1249 readonly isSucceed: boolean;1250 readonly asSucceed: EvmCoreErrorExitSucceed;1251 readonly isError: boolean;1252 readonly asError: EvmCoreErrorExitError;1253 readonly isRevert: boolean;1254 readonly asRevert: EvmCoreErrorExitRevert;1255 readonly isFatal: boolean;1256 readonly asFatal: EvmCoreErrorExitFatal;1257 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';1258 }12591260 /** @name EvmCoreErrorExitSucceed (111) */1261 interface EvmCoreErrorExitSucceed extends Enum {1262 readonly isStopped: boolean;1263 readonly isReturned: boolean;1264 readonly isSuicided: boolean;1265 readonly type: 'Stopped' | 'Returned' | 'Suicided';1266 }12671268 /** @name EvmCoreErrorExitError (112) */1269 interface EvmCoreErrorExitError extends Enum {1270 readonly isStackUnderflow: boolean;1271 readonly isStackOverflow: boolean;1272 readonly isInvalidJump: boolean;1273 readonly isInvalidRange: boolean;1274 readonly isDesignatedInvalid: boolean;1275 readonly isCallTooDeep: boolean;1276 readonly isCreateCollision: boolean;1277 readonly isCreateContractLimit: boolean;1278 readonly isOutOfOffset: boolean;1279 readonly isOutOfGas: boolean;1280 readonly isOutOfFund: boolean;1281 readonly isPcUnderflow: boolean;1282 readonly isCreateEmpty: boolean;1283 readonly isOther: boolean;1284 readonly asOther: Text;1285 readonly isInvalidCode: boolean;1286 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';1287 }12881289 /** @name EvmCoreErrorExitRevert (115) */1290 interface EvmCoreErrorExitRevert extends Enum {1291 readonly isReverted: boolean;1292 readonly type: 'Reverted';1293 }12941295 /** @name EvmCoreErrorExitFatal (116) */1296 interface EvmCoreErrorExitFatal extends Enum {1297 readonly isNotSupported: boolean;1298 readonly isUnhandledInterrupt: boolean;1299 readonly isCallErrorAsFatal: boolean;1300 readonly asCallErrorAsFatal: EvmCoreErrorExitError;1301 readonly isOther: boolean;1302 readonly asOther: Text;1303 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';1304 }13051306 /** @name PalletEvmContractHelpersEvent (117) */1307 interface PalletEvmContractHelpersEvent extends Enum {1308 readonly isContractSponsorSet: boolean;1309 readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;1310 readonly isContractSponsorshipConfirmed: boolean;1311 readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;1312 readonly isContractSponsorRemoved: boolean;1313 readonly asContractSponsorRemoved: H160;1314 readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';1315 }13161317 /** @name FrameSystemPhase (118) */1318 interface FrameSystemPhase extends Enum {1319 readonly isApplyExtrinsic: boolean;1320 readonly asApplyExtrinsic: u32;1321 readonly isFinalization: boolean;1322 readonly isInitialization: boolean;1323 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';1324 }13251326 /** @name FrameSystemLastRuntimeUpgradeInfo (120) */1327 interface FrameSystemLastRuntimeUpgradeInfo extends Struct {1328 readonly specVersion: Compact<u32>;1329 readonly specName: Text;1330 }13311332 /** @name FrameSystemCall (121) */1333 interface FrameSystemCall extends Enum {1334 readonly isFillBlock: boolean;1335 readonly asFillBlock: {1336 readonly ratio: Perbill;1337 } & Struct;1338 readonly isRemark: boolean;1339 readonly asRemark: {1340 readonly remark: Bytes;1341 } & Struct;1342 readonly isSetHeapPages: boolean;1343 readonly asSetHeapPages: {1344 readonly pages: u64;1345 } & Struct;1346 readonly isSetCode: boolean;1347 readonly asSetCode: {1348 readonly code: Bytes;1349 } & Struct;1350 readonly isSetCodeWithoutChecks: boolean;1351 readonly asSetCodeWithoutChecks: {1352 readonly code: Bytes;1353 } & Struct;1354 readonly isSetStorage: boolean;1355 readonly asSetStorage: {1356 readonly items: Vec<ITuple<[Bytes, Bytes]>>;1357 } & Struct;1358 readonly isKillStorage: boolean;1359 readonly asKillStorage: {1360 readonly keys_: Vec<Bytes>;1361 } & Struct;1362 readonly isKillPrefix: boolean;1363 readonly asKillPrefix: {1364 readonly prefix: Bytes;1365 readonly subkeys: u32;1366 } & Struct;1367 readonly isRemarkWithEvent: boolean;1368 readonly asRemarkWithEvent: {1369 readonly remark: Bytes;1370 } & Struct;1371 readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';1372 }13731374 /** @name FrameSystemLimitsBlockWeights (126) */1375 interface FrameSystemLimitsBlockWeights extends Struct {1376 readonly baseBlock: u64;1377 readonly maxBlock: u64;1378 readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;1379 }13801381 /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (127) */1382 interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {1383 readonly normal: FrameSystemLimitsWeightsPerClass;1384 readonly operational: FrameSystemLimitsWeightsPerClass;1385 readonly mandatory: FrameSystemLimitsWeightsPerClass;1386 }13871388 /** @name FrameSystemLimitsWeightsPerClass (128) */1389 interface FrameSystemLimitsWeightsPerClass extends Struct {1390 readonly baseExtrinsic: u64;1391 readonly maxExtrinsic: Option<u64>;1392 readonly maxTotal: Option<u64>;1393 readonly reserved: Option<u64>;1394 }13951396 /** @name FrameSystemLimitsBlockLength (130) */1397 interface FrameSystemLimitsBlockLength extends Struct {1398 readonly max: FrameSupportWeightsPerDispatchClassU32;1399 }14001401 /** @name FrameSupportWeightsPerDispatchClassU32 (131) */1402 interface FrameSupportWeightsPerDispatchClassU32 extends Struct {1403 readonly normal: u32;1404 readonly operational: u32;1405 readonly mandatory: u32;1406 }14071408 /** @name FrameSupportWeightsRuntimeDbWeight (132) */1409 interface FrameSupportWeightsRuntimeDbWeight extends Struct {1410 readonly read: u64;1411 readonly write: u64;1412 }14131414 /** @name SpVersionRuntimeVersion (133) */1415 interface SpVersionRuntimeVersion extends Struct {1416 readonly specName: Text;1417 readonly implName: Text;1418 readonly authoringVersion: u32;1419 readonly specVersion: u32;1420 readonly implVersion: u32;1421 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;1422 readonly transactionVersion: u32;1423 readonly stateVersion: u8;1424 }14251426 /** @name FrameSystemError (138) */1427 interface FrameSystemError extends Enum {1428 readonly isInvalidSpecName: boolean;1429 readonly isSpecVersionNeedsToIncrease: boolean;1430 readonly isFailedToExtractRuntimeVersion: boolean;1431 readonly isNonDefaultComposite: boolean;1432 readonly isNonZeroRefCount: boolean;1433 readonly isCallFiltered: boolean;1434 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';1435 }14361437 /** @name PolkadotPrimitivesV2PersistedValidationData (139) */1438 interface PolkadotPrimitivesV2PersistedValidationData extends Struct {1439 readonly parentHead: Bytes;1440 readonly relayParentNumber: u32;1441 readonly relayParentStorageRoot: H256;1442 readonly maxPovSize: u32;1443 }14441445 /** @name PolkadotPrimitivesV2UpgradeRestriction (142) */1446 interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {1447 readonly isPresent: boolean;1448 readonly type: 'Present';1449 }14501451 /** @name SpTrieStorageProof (143) */1452 interface SpTrieStorageProof extends Struct {1453 readonly trieNodes: BTreeSet<Bytes>;1454 }14551456 /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (145) */1457 interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {1458 readonly dmqMqcHead: H256;1459 readonly relayDispatchQueueSize: ITuple<[u32, u32]>;1460 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1461 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;1462 }14631464 /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (148) */1465 interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {1466 readonly maxCapacity: u32;1467 readonly maxTotalSize: u32;1468 readonly maxMessageSize: u32;1469 readonly msgCount: u32;1470 readonly totalSize: u32;1471 readonly mqcHead: Option<H256>;1472 }14731474 /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (149) */1475 interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {1476 readonly maxCodeSize: u32;1477 readonly maxHeadDataSize: u32;1478 readonly maxUpwardQueueCount: u32;1479 readonly maxUpwardQueueSize: u32;1480 readonly maxUpwardMessageSize: u32;1481 readonly maxUpwardMessageNumPerCandidate: u32;1482 readonly hrmpMaxMessageNumPerCandidate: u32;1483 readonly validationUpgradeCooldown: u32;1484 readonly validationUpgradeDelay: u32;1485 }14861487 /** @name PolkadotCorePrimitivesOutboundHrmpMessage (155) */1488 interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {1489 readonly recipient: u32;1490 readonly data: Bytes;1491 }14921493 /** @name CumulusPalletParachainSystemCall (156) */1494 interface CumulusPalletParachainSystemCall extends Enum {1495 readonly isSetValidationData: boolean;1496 readonly asSetValidationData: {1497 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;1498 } & Struct;1499 readonly isSudoSendUpwardMessage: boolean;1500 readonly asSudoSendUpwardMessage: {1501 readonly message: Bytes;1502 } & Struct;1503 readonly isAuthorizeUpgrade: boolean;1504 readonly asAuthorizeUpgrade: {1505 readonly codeHash: H256;1506 } & Struct;1507 readonly isEnactAuthorizedUpgrade: boolean;1508 readonly asEnactAuthorizedUpgrade: {1509 readonly code: Bytes;1510 } & Struct;1511 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';1512 }15131514 /** @name CumulusPrimitivesParachainInherentParachainInherentData (157) */1515 interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {1516 readonly validationData: PolkadotPrimitivesV2PersistedValidationData;1517 readonly relayChainState: SpTrieStorageProof;1518 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;1519 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;1520 }15211522 /** @name PolkadotCorePrimitivesInboundDownwardMessage (159) */1523 interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {1524 readonly sentAt: u32;1525 readonly msg: Bytes;1526 }15271528 /** @name PolkadotCorePrimitivesInboundHrmpMessage (162) */1529 interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {1530 readonly sentAt: u32;1531 readonly data: Bytes;1532 }15331534 /** @name CumulusPalletParachainSystemError (165) */1535 interface CumulusPalletParachainSystemError extends Enum {1536 readonly isOverlappingUpgrades: boolean;1537 readonly isProhibitedByPolkadot: boolean;1538 readonly isTooBig: boolean;1539 readonly isValidationDataNotAvailable: boolean;1540 readonly isHostConfigurationNotAvailable: boolean;1541 readonly isNotScheduled: boolean;1542 readonly isNothingAuthorized: boolean;1543 readonly isUnauthorized: boolean;1544 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';1545 }15461547 /** @name PalletBalancesBalanceLock (167) */1548 interface PalletBalancesBalanceLock extends Struct {1549 readonly id: U8aFixed;1550 readonly amount: u128;1551 readonly reasons: PalletBalancesReasons;1552 }15531554 /** @name PalletBalancesReasons (168) */1555 interface PalletBalancesReasons extends Enum {1556 readonly isFee: boolean;1557 readonly isMisc: boolean;1558 readonly isAll: boolean;1559 readonly type: 'Fee' | 'Misc' | 'All';1560 }15611562 /** @name PalletBalancesReserveData (171) */1563 interface PalletBalancesReserveData extends Struct {1564 readonly id: U8aFixed;1565 readonly amount: u128;1566 }15671568 /** @name PalletBalancesReleases (173) */1569 interface PalletBalancesReleases extends Enum {1570 readonly isV100: boolean;1571 readonly isV200: boolean;1572 readonly type: 'V100' | 'V200';1573 }15741575 /** @name PalletBalancesCall (174) */1576 interface PalletBalancesCall extends Enum {1577 readonly isTransfer: boolean;1578 readonly asTransfer: {1579 readonly dest: MultiAddress;1580 readonly value: Compact<u128>;1581 } & Struct;1582 readonly isSetBalance: boolean;1583 readonly asSetBalance: {1584 readonly who: MultiAddress;1585 readonly newFree: Compact<u128>;1586 readonly newReserved: Compact<u128>;1587 } & Struct;1588 readonly isForceTransfer: boolean;1589 readonly asForceTransfer: {1590 readonly source: MultiAddress;1591 readonly dest: MultiAddress;1592 readonly value: Compact<u128>;1593 } & Struct;1594 readonly isTransferKeepAlive: boolean;1595 readonly asTransferKeepAlive: {1596 readonly dest: MultiAddress;1597 readonly value: Compact<u128>;1598 } & Struct;1599 readonly isTransferAll: boolean;1600 readonly asTransferAll: {1601 readonly dest: MultiAddress;1602 readonly keepAlive: bool;1603 } & Struct;1604 readonly isForceUnreserve: boolean;1605 readonly asForceUnreserve: {1606 readonly who: MultiAddress;1607 readonly amount: u128;1608 } & Struct;1609 readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';1610 }16111612 /** @name PalletBalancesError (177) */1613 interface PalletBalancesError extends Enum {1614 readonly isVestingBalance: boolean;1615 readonly isLiquidityRestrictions: boolean;1616 readonly isInsufficientBalance: boolean;1617 readonly isExistentialDeposit: boolean;1618 readonly isKeepAlive: boolean;1619 readonly isExistingVestingSchedule: boolean;1620 readonly isDeadAccount: boolean;1621 readonly isTooManyReserves: boolean;1622 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';1623 }16241625 /** @name PalletTimestampCall (179) */1626 interface PalletTimestampCall extends Enum {1627 readonly isSet: boolean;1628 readonly asSet: {1629 readonly now: Compact<u64>;1630 } & Struct;1631 readonly type: 'Set';1632 }16331634 /** @name PalletTransactionPaymentReleases (181) */1635 interface PalletTransactionPaymentReleases extends Enum {1636 readonly isV1Ancient: boolean;1637 readonly isV2: boolean;1638 readonly type: 'V1Ancient' | 'V2';1639 }16401641 /** @name PalletTreasuryProposal (182) */1642 interface PalletTreasuryProposal extends Struct {1643 readonly proposer: AccountId32;1644 readonly value: u128;1645 readonly beneficiary: AccountId32;1646 readonly bond: u128;1647 }16481649 /** @name PalletTreasuryCall (185) */1650 interface PalletTreasuryCall extends Enum {1651 readonly isProposeSpend: boolean;1652 readonly asProposeSpend: {1653 readonly value: Compact<u128>;1654 readonly beneficiary: MultiAddress;1655 } & Struct;1656 readonly isRejectProposal: boolean;1657 readonly asRejectProposal: {1658 readonly proposalId: Compact<u32>;1659 } & Struct;1660 readonly isApproveProposal: boolean;1661 readonly asApproveProposal: {1662 readonly proposalId: Compact<u32>;1663 } & Struct;1664 readonly isSpend: boolean;1665 readonly asSpend: {1666 readonly amount: Compact<u128>;1667 readonly beneficiary: MultiAddress;1668 } & Struct;1669 readonly isRemoveApproval: boolean;1670 readonly asRemoveApproval: {1671 readonly proposalId: Compact<u32>;1672 } & Struct;1673 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';1674 }16751676 /** @name FrameSupportPalletId (188) */1677 interface FrameSupportPalletId extends U8aFixed {}16781679 /** @name PalletTreasuryError (189) */1680 interface PalletTreasuryError extends Enum {1681 readonly isInsufficientProposersBalance: boolean;1682 readonly isInvalidIndex: boolean;1683 readonly isTooManyApprovals: boolean;1684 readonly isInsufficientPermission: boolean;1685 readonly isProposalNotApproved: boolean;1686 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';1687 }16881689 /** @name PalletSudoCall (190) */1690 interface PalletSudoCall extends Enum {1691 readonly isSudo: boolean;1692 readonly asSudo: {1693 readonly call: Call;1694 } & Struct;1695 readonly isSudoUncheckedWeight: boolean;1696 readonly asSudoUncheckedWeight: {1697 readonly call: Call;1698 readonly weight: u64;1699 } & Struct;1700 readonly isSetKey: boolean;1701 readonly asSetKey: {1702 readonly new_: MultiAddress;1703 } & Struct;1704 readonly isSudoAs: boolean;1705 readonly asSudoAs: {1706 readonly who: MultiAddress;1707 readonly call: Call;1708 } & Struct;1709 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';1710 }17111712 /** @name OrmlVestingModuleCall (192) */1713 interface OrmlVestingModuleCall extends Enum {1714 readonly isClaim: boolean;1715 readonly isVestedTransfer: boolean;1716 readonly asVestedTransfer: {1717 readonly dest: MultiAddress;1718 readonly schedule: OrmlVestingVestingSchedule;1719 } & Struct;1720 readonly isUpdateVestingSchedules: boolean;1721 readonly asUpdateVestingSchedules: {1722 readonly who: MultiAddress;1723 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;1724 } & Struct;1725 readonly isClaimFor: boolean;1726 readonly asClaimFor: {1727 readonly dest: MultiAddress;1728 } & Struct;1729 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';1730 }17311732 /** @name CumulusPalletXcmpQueueCall (194) */1733 interface CumulusPalletXcmpQueueCall extends Enum {1734 readonly isServiceOverweight: boolean;1735 readonly asServiceOverweight: {1736 readonly index: u64;1737 readonly weightLimit: u64;1738 } & Struct;1739 readonly isSuspendXcmExecution: boolean;1740 readonly isResumeXcmExecution: boolean;1741 readonly isUpdateSuspendThreshold: boolean;1742 readonly asUpdateSuspendThreshold: {1743 readonly new_: u32;1744 } & Struct;1745 readonly isUpdateDropThreshold: boolean;1746 readonly asUpdateDropThreshold: {1747 readonly new_: u32;1748 } & Struct;1749 readonly isUpdateResumeThreshold: boolean;1750 readonly asUpdateResumeThreshold: {1751 readonly new_: u32;1752 } & Struct;1753 readonly isUpdateThresholdWeight: boolean;1754 readonly asUpdateThresholdWeight: {1755 readonly new_: u64;1756 } & Struct;1757 readonly isUpdateWeightRestrictDecay: boolean;1758 readonly asUpdateWeightRestrictDecay: {1759 readonly new_: u64;1760 } & Struct;1761 readonly isUpdateXcmpMaxIndividualWeight: boolean;1762 readonly asUpdateXcmpMaxIndividualWeight: {1763 readonly new_: u64;1764 } & Struct;1765 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';1766 }17671768 /** @name PalletXcmCall (195) */1769 interface PalletXcmCall extends Enum {1770 readonly isSend: boolean;1771 readonly asSend: {1772 readonly dest: XcmVersionedMultiLocation;1773 readonly message: XcmVersionedXcm;1774 } & Struct;1775 readonly isTeleportAssets: boolean;1776 readonly asTeleportAssets: {1777 readonly dest: XcmVersionedMultiLocation;1778 readonly beneficiary: XcmVersionedMultiLocation;1779 readonly assets: XcmVersionedMultiAssets;1780 readonly feeAssetItem: u32;1781 } & Struct;1782 readonly isReserveTransferAssets: boolean;1783 readonly asReserveTransferAssets: {1784 readonly dest: XcmVersionedMultiLocation;1785 readonly beneficiary: XcmVersionedMultiLocation;1786 readonly assets: XcmVersionedMultiAssets;1787 readonly feeAssetItem: u32;1788 } & Struct;1789 readonly isExecute: boolean;1790 readonly asExecute: {1791 readonly message: XcmVersionedXcm;1792 readonly maxWeight: u64;1793 } & Struct;1794 readonly isForceXcmVersion: boolean;1795 readonly asForceXcmVersion: {1796 readonly location: XcmV1MultiLocation;1797 readonly xcmVersion: u32;1798 } & Struct;1799 readonly isForceDefaultXcmVersion: boolean;1800 readonly asForceDefaultXcmVersion: {1801 readonly maybeXcmVersion: Option<u32>;1802 } & Struct;1803 readonly isForceSubscribeVersionNotify: boolean;1804 readonly asForceSubscribeVersionNotify: {1805 readonly location: XcmVersionedMultiLocation;1806 } & Struct;1807 readonly isForceUnsubscribeVersionNotify: boolean;1808 readonly asForceUnsubscribeVersionNotify: {1809 readonly location: XcmVersionedMultiLocation;1810 } & Struct;1811 readonly isLimitedReserveTransferAssets: boolean;1812 readonly asLimitedReserveTransferAssets: {1813 readonly dest: XcmVersionedMultiLocation;1814 readonly beneficiary: XcmVersionedMultiLocation;1815 readonly assets: XcmVersionedMultiAssets;1816 readonly feeAssetItem: u32;1817 readonly weightLimit: XcmV2WeightLimit;1818 } & Struct;1819 readonly isLimitedTeleportAssets: boolean;1820 readonly asLimitedTeleportAssets: {1821 readonly dest: XcmVersionedMultiLocation;1822 readonly beneficiary: XcmVersionedMultiLocation;1823 readonly assets: XcmVersionedMultiAssets;1824 readonly feeAssetItem: u32;1825 readonly weightLimit: XcmV2WeightLimit;1826 } & Struct;1827 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';1828 }18291830 /** @name XcmVersionedXcm (196) */1831 interface XcmVersionedXcm extends Enum {1832 readonly isV0: boolean;1833 readonly asV0: XcmV0Xcm;1834 readonly isV1: boolean;1835 readonly asV1: XcmV1Xcm;1836 readonly isV2: boolean;1837 readonly asV2: XcmV2Xcm;1838 readonly type: 'V0' | 'V1' | 'V2';1839 }18401841 /** @name XcmV0Xcm (197) */1842 interface XcmV0Xcm extends Enum {1843 readonly isWithdrawAsset: boolean;1844 readonly asWithdrawAsset: {1845 readonly assets: Vec<XcmV0MultiAsset>;1846 readonly effects: Vec<XcmV0Order>;1847 } & Struct;1848 readonly isReserveAssetDeposit: boolean;1849 readonly asReserveAssetDeposit: {1850 readonly assets: Vec<XcmV0MultiAsset>;1851 readonly effects: Vec<XcmV0Order>;1852 } & Struct;1853 readonly isTeleportAsset: boolean;1854 readonly asTeleportAsset: {1855 readonly assets: Vec<XcmV0MultiAsset>;1856 readonly effects: Vec<XcmV0Order>;1857 } & Struct;1858 readonly isQueryResponse: boolean;1859 readonly asQueryResponse: {1860 readonly queryId: Compact<u64>;1861 readonly response: XcmV0Response;1862 } & Struct;1863 readonly isTransferAsset: boolean;1864 readonly asTransferAsset: {1865 readonly assets: Vec<XcmV0MultiAsset>;1866 readonly dest: XcmV0MultiLocation;1867 } & Struct;1868 readonly isTransferReserveAsset: boolean;1869 readonly asTransferReserveAsset: {1870 readonly assets: Vec<XcmV0MultiAsset>;1871 readonly dest: XcmV0MultiLocation;1872 readonly effects: Vec<XcmV0Order>;1873 } & Struct;1874 readonly isTransact: boolean;1875 readonly asTransact: {1876 readonly originType: XcmV0OriginKind;1877 readonly requireWeightAtMost: u64;1878 readonly call: XcmDoubleEncoded;1879 } & Struct;1880 readonly isHrmpNewChannelOpenRequest: boolean;1881 readonly asHrmpNewChannelOpenRequest: {1882 readonly sender: Compact<u32>;1883 readonly maxMessageSize: Compact<u32>;1884 readonly maxCapacity: Compact<u32>;1885 } & Struct;1886 readonly isHrmpChannelAccepted: boolean;1887 readonly asHrmpChannelAccepted: {1888 readonly recipient: Compact<u32>;1889 } & Struct;1890 readonly isHrmpChannelClosing: boolean;1891 readonly asHrmpChannelClosing: {1892 readonly initiator: Compact<u32>;1893 readonly sender: Compact<u32>;1894 readonly recipient: Compact<u32>;1895 } & Struct;1896 readonly isRelayedFrom: boolean;1897 readonly asRelayedFrom: {1898 readonly who: XcmV0MultiLocation;1899 readonly message: XcmV0Xcm;1900 } & Struct;1901 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';1902 }19031904 /** @name XcmV0Order (199) */1905 interface XcmV0Order extends Enum {1906 readonly isNull: boolean;1907 readonly isDepositAsset: boolean;1908 readonly asDepositAsset: {1909 readonly assets: Vec<XcmV0MultiAsset>;1910 readonly dest: XcmV0MultiLocation;1911 } & Struct;1912 readonly isDepositReserveAsset: boolean;1913 readonly asDepositReserveAsset: {1914 readonly assets: Vec<XcmV0MultiAsset>;1915 readonly dest: XcmV0MultiLocation;1916 readonly effects: Vec<XcmV0Order>;1917 } & Struct;1918 readonly isExchangeAsset: boolean;1919 readonly asExchangeAsset: {1920 readonly give: Vec<XcmV0MultiAsset>;1921 readonly receive: Vec<XcmV0MultiAsset>;1922 } & Struct;1923 readonly isInitiateReserveWithdraw: boolean;1924 readonly asInitiateReserveWithdraw: {1925 readonly assets: Vec<XcmV0MultiAsset>;1926 readonly reserve: XcmV0MultiLocation;1927 readonly effects: Vec<XcmV0Order>;1928 } & Struct;1929 readonly isInitiateTeleport: boolean;1930 readonly asInitiateTeleport: {1931 readonly assets: Vec<XcmV0MultiAsset>;1932 readonly dest: XcmV0MultiLocation;1933 readonly effects: Vec<XcmV0Order>;1934 } & Struct;1935 readonly isQueryHolding: boolean;1936 readonly asQueryHolding: {1937 readonly queryId: Compact<u64>;1938 readonly dest: XcmV0MultiLocation;1939 readonly assets: Vec<XcmV0MultiAsset>;1940 } & Struct;1941 readonly isBuyExecution: boolean;1942 readonly asBuyExecution: {1943 readonly fees: XcmV0MultiAsset;1944 readonly weight: u64;1945 readonly debt: u64;1946 readonly haltOnError: bool;1947 readonly xcm: Vec<XcmV0Xcm>;1948 } & Struct;1949 readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';1950 }19511952 /** @name XcmV0Response (201) */1953 interface XcmV0Response extends Enum {1954 readonly isAssets: boolean;1955 readonly asAssets: Vec<XcmV0MultiAsset>;1956 readonly type: 'Assets';1957 }19581959 /** @name XcmV1Xcm (202) */1960 interface XcmV1Xcm extends Enum {1961 readonly isWithdrawAsset: boolean;1962 readonly asWithdrawAsset: {1963 readonly assets: XcmV1MultiassetMultiAssets;1964 readonly effects: Vec<XcmV1Order>;1965 } & Struct;1966 readonly isReserveAssetDeposited: boolean;1967 readonly asReserveAssetDeposited: {1968 readonly assets: XcmV1MultiassetMultiAssets;1969 readonly effects: Vec<XcmV1Order>;1970 } & Struct;1971 readonly isReceiveTeleportedAsset: boolean;1972 readonly asReceiveTeleportedAsset: {1973 readonly assets: XcmV1MultiassetMultiAssets;1974 readonly effects: Vec<XcmV1Order>;1975 } & Struct;1976 readonly isQueryResponse: boolean;1977 readonly asQueryResponse: {1978 readonly queryId: Compact<u64>;1979 readonly response: XcmV1Response;1980 } & Struct;1981 readonly isTransferAsset: boolean;1982 readonly asTransferAsset: {1983 readonly assets: XcmV1MultiassetMultiAssets;1984 readonly beneficiary: XcmV1MultiLocation;1985 } & Struct;1986 readonly isTransferReserveAsset: boolean;1987 readonly asTransferReserveAsset: {1988 readonly assets: XcmV1MultiassetMultiAssets;1989 readonly dest: XcmV1MultiLocation;1990 readonly effects: Vec<XcmV1Order>;1991 } & Struct;1992 readonly isTransact: boolean;1993 readonly asTransact: {1994 readonly originType: XcmV0OriginKind;1995 readonly requireWeightAtMost: u64;1996 readonly call: XcmDoubleEncoded;1997 } & Struct;1998 readonly isHrmpNewChannelOpenRequest: boolean;1999 readonly asHrmpNewChannelOpenRequest: {2000 readonly sender: Compact<u32>;2001 readonly maxMessageSize: Compact<u32>;2002 readonly maxCapacity: Compact<u32>;2003 } & Struct;2004 readonly isHrmpChannelAccepted: boolean;2005 readonly asHrmpChannelAccepted: {2006 readonly recipient: Compact<u32>;2007 } & Struct;2008 readonly isHrmpChannelClosing: boolean;2009 readonly asHrmpChannelClosing: {2010 readonly initiator: Compact<u32>;2011 readonly sender: Compact<u32>;2012 readonly recipient: Compact<u32>;2013 } & Struct;2014 readonly isRelayedFrom: boolean;2015 readonly asRelayedFrom: {2016 readonly who: XcmV1MultilocationJunctions;2017 readonly message: XcmV1Xcm;2018 } & Struct;2019 readonly isSubscribeVersion: boolean;2020 readonly asSubscribeVersion: {2021 readonly queryId: Compact<u64>;2022 readonly maxResponseWeight: Compact<u64>;2023 } & Struct;2024 readonly isUnsubscribeVersion: boolean;2025 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';2026 }20272028 /** @name XcmV1Order (204) */2029 interface XcmV1Order extends Enum {2030 readonly isNoop: boolean;2031 readonly isDepositAsset: boolean;2032 readonly asDepositAsset: {2033 readonly assets: XcmV1MultiassetMultiAssetFilter;2034 readonly maxAssets: u32;2035 readonly beneficiary: XcmV1MultiLocation;2036 } & Struct;2037 readonly isDepositReserveAsset: boolean;2038 readonly asDepositReserveAsset: {2039 readonly assets: XcmV1MultiassetMultiAssetFilter;2040 readonly maxAssets: u32;2041 readonly dest: XcmV1MultiLocation;2042 readonly effects: Vec<XcmV1Order>;2043 } & Struct;2044 readonly isExchangeAsset: boolean;2045 readonly asExchangeAsset: {2046 readonly give: XcmV1MultiassetMultiAssetFilter;2047 readonly receive: XcmV1MultiassetMultiAssets;2048 } & Struct;2049 readonly isInitiateReserveWithdraw: boolean;2050 readonly asInitiateReserveWithdraw: {2051 readonly assets: XcmV1MultiassetMultiAssetFilter;2052 readonly reserve: XcmV1MultiLocation;2053 readonly effects: Vec<XcmV1Order>;2054 } & Struct;2055 readonly isInitiateTeleport: boolean;2056 readonly asInitiateTeleport: {2057 readonly assets: XcmV1MultiassetMultiAssetFilter;2058 readonly dest: XcmV1MultiLocation;2059 readonly effects: Vec<XcmV1Order>;2060 } & Struct;2061 readonly isQueryHolding: boolean;2062 readonly asQueryHolding: {2063 readonly queryId: Compact<u64>;2064 readonly dest: XcmV1MultiLocation;2065 readonly assets: XcmV1MultiassetMultiAssetFilter;2066 } & Struct;2067 readonly isBuyExecution: boolean;2068 readonly asBuyExecution: {2069 readonly fees: XcmV1MultiAsset;2070 readonly weight: u64;2071 readonly debt: u64;2072 readonly haltOnError: bool;2073 readonly instructions: Vec<XcmV1Xcm>;2074 } & Struct;2075 readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';2076 }20772078 /** @name XcmV1Response (206) */2079 interface XcmV1Response extends Enum {2080 readonly isAssets: boolean;2081 readonly asAssets: XcmV1MultiassetMultiAssets;2082 readonly isVersion: boolean;2083 readonly asVersion: u32;2084 readonly type: 'Assets' | 'Version';2085 }20862087 /** @name CumulusPalletXcmCall (220) */2088 type CumulusPalletXcmCall = Null;20892090 /** @name CumulusPalletDmpQueueCall (221) */2091 interface CumulusPalletDmpQueueCall extends Enum {2092 readonly isServiceOverweight: boolean;2093 readonly asServiceOverweight: {2094 readonly index: u64;2095 readonly weightLimit: u64;2096 } & Struct;2097 readonly type: 'ServiceOverweight';2098 }20992100 /** @name PalletInflationCall (222) */2101 interface PalletInflationCall extends Enum {2102 readonly isStartInflation: boolean;2103 readonly asStartInflation: {2104 readonly inflationStartRelayBlock: u32;2105 } & Struct;2106 readonly type: 'StartInflation';2107 }21082109 /** @name PalletUniqueCall (223) */2110 interface PalletUniqueCall extends Enum {2111 readonly isCreateCollection: boolean;2112 readonly asCreateCollection: {2113 readonly collectionName: Vec<u16>;2114 readonly collectionDescription: Vec<u16>;2115 readonly tokenPrefix: Bytes;2116 readonly mode: UpDataStructsCollectionMode;2117 } & Struct;2118 readonly isCreateCollectionEx: boolean;2119 readonly asCreateCollectionEx: {2120 readonly data: UpDataStructsCreateCollectionData;2121 } & Struct;2122 readonly isDestroyCollection: boolean;2123 readonly asDestroyCollection: {2124 readonly collectionId: u32;2125 } & Struct;2126 readonly isAddToAllowList: boolean;2127 readonly asAddToAllowList: {2128 readonly collectionId: u32;2129 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2130 } & Struct;2131 readonly isRemoveFromAllowList: boolean;2132 readonly asRemoveFromAllowList: {2133 readonly collectionId: u32;2134 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2135 } & Struct;2136 readonly isChangeCollectionOwner: boolean;2137 readonly asChangeCollectionOwner: {2138 readonly collectionId: u32;2139 readonly newOwner: AccountId32;2140 } & Struct;2141 readonly isAddCollectionAdmin: boolean;2142 readonly asAddCollectionAdmin: {2143 readonly collectionId: u32;2144 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;2145 } & Struct;2146 readonly isRemoveCollectionAdmin: boolean;2147 readonly asRemoveCollectionAdmin: {2148 readonly collectionId: u32;2149 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;2150 } & Struct;2151 readonly isSetCollectionSponsor: boolean;2152 readonly asSetCollectionSponsor: {2153 readonly collectionId: u32;2154 readonly newSponsor: AccountId32;2155 } & Struct;2156 readonly isConfirmSponsorship: boolean;2157 readonly asConfirmSponsorship: {2158 readonly collectionId: u32;2159 } & Struct;2160 readonly isRemoveCollectionSponsor: boolean;2161 readonly asRemoveCollectionSponsor: {2162 readonly collectionId: u32;2163 } & Struct;2164 readonly isCreateItem: boolean;2165 readonly asCreateItem: {2166 readonly collectionId: u32;2167 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2168 readonly data: UpDataStructsCreateItemData;2169 } & Struct;2170 readonly isCreateMultipleItems: boolean;2171 readonly asCreateMultipleItems: {2172 readonly collectionId: u32;2173 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2174 readonly itemsData: Vec<UpDataStructsCreateItemData>;2175 } & Struct;2176 readonly isSetCollectionProperties: boolean;2177 readonly asSetCollectionProperties: {2178 readonly collectionId: u32;2179 readonly properties: Vec<UpDataStructsProperty>;2180 } & Struct;2181 readonly isDeleteCollectionProperties: boolean;2182 readonly asDeleteCollectionProperties: {2183 readonly collectionId: u32;2184 readonly propertyKeys: Vec<Bytes>;2185 } & Struct;2186 readonly isSetTokenProperties: boolean;2187 readonly asSetTokenProperties: {2188 readonly collectionId: u32;2189 readonly tokenId: u32;2190 readonly properties: Vec<UpDataStructsProperty>;2191 } & Struct;2192 readonly isDeleteTokenProperties: boolean;2193 readonly asDeleteTokenProperties: {2194 readonly collectionId: u32;2195 readonly tokenId: u32;2196 readonly propertyKeys: Vec<Bytes>;2197 } & Struct;2198 readonly isSetTokenPropertyPermissions: boolean;2199 readonly asSetTokenPropertyPermissions: {2200 readonly collectionId: u32;2201 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2202 } & Struct;2203 readonly isCreateMultipleItemsEx: boolean;2204 readonly asCreateMultipleItemsEx: {2205 readonly collectionId: u32;2206 readonly data: UpDataStructsCreateItemExData;2207 } & Struct;2208 readonly isSetTransfersEnabledFlag: boolean;2209 readonly asSetTransfersEnabledFlag: {2210 readonly collectionId: u32;2211 readonly value: bool;2212 } & Struct;2213 readonly isBurnItem: boolean;2214 readonly asBurnItem: {2215 readonly collectionId: u32;2216 readonly itemId: u32;2217 readonly value: u128;2218 } & Struct;2219 readonly isBurnFrom: boolean;2220 readonly asBurnFrom: {2221 readonly collectionId: u32;2222 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2223 readonly itemId: u32;2224 readonly value: u128;2225 } & Struct;2226 readonly isTransfer: boolean;2227 readonly asTransfer: {2228 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2229 readonly collectionId: u32;2230 readonly itemId: u32;2231 readonly value: u128;2232 } & Struct;2233 readonly isApprove: boolean;2234 readonly asApprove: {2235 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;2236 readonly collectionId: u32;2237 readonly itemId: u32;2238 readonly amount: u128;2239 } & Struct;2240 readonly isTransferFrom: boolean;2241 readonly asTransferFrom: {2242 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2243 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2244 readonly collectionId: u32;2245 readonly itemId: u32;2246 readonly value: u128;2247 } & Struct;2248 readonly isSetCollectionLimits: boolean;2249 readonly asSetCollectionLimits: {2250 readonly collectionId: u32;2251 readonly newLimit: UpDataStructsCollectionLimits;2252 } & Struct;2253 readonly isSetCollectionPermissions: boolean;2254 readonly asSetCollectionPermissions: {2255 readonly collectionId: u32;2256 readonly newPermission: UpDataStructsCollectionPermissions;2257 } & Struct;2258 readonly isRepartition: boolean;2259 readonly asRepartition: {2260 readonly collectionId: u32;2261 readonly tokenId: u32;2262 readonly amount: u128;2263 } & Struct;2264 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';2265 }22662267 /** @name UpDataStructsCollectionMode (228) */2268 interface UpDataStructsCollectionMode extends Enum {2269 readonly isNft: boolean;2270 readonly isFungible: boolean;2271 readonly asFungible: u8;2272 readonly isReFungible: boolean;2273 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2274 }22752276 /** @name UpDataStructsCreateCollectionData (229) */2277 interface UpDataStructsCreateCollectionData extends Struct {2278 readonly mode: UpDataStructsCollectionMode;2279 readonly access: Option<UpDataStructsAccessMode>;2280 readonly name: Vec<u16>;2281 readonly description: Vec<u16>;2282 readonly tokenPrefix: Bytes;2283 readonly pendingSponsor: Option<AccountId32>;2284 readonly limits: Option<UpDataStructsCollectionLimits>;2285 readonly permissions: Option<UpDataStructsCollectionPermissions>;2286 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2287 readonly properties: Vec<UpDataStructsProperty>;2288 }22892290 /** @name UpDataStructsAccessMode (231) */2291 interface UpDataStructsAccessMode extends Enum {2292 readonly isNormal: boolean;2293 readonly isAllowList: boolean;2294 readonly type: 'Normal' | 'AllowList';2295 }22962297 /** @name UpDataStructsCollectionLimits (233) */2298 interface UpDataStructsCollectionLimits extends Struct {2299 readonly accountTokenOwnershipLimit: Option<u32>;2300 readonly sponsoredDataSize: Option<u32>;2301 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;2302 readonly tokenLimit: Option<u32>;2303 readonly sponsorTransferTimeout: Option<u32>;2304 readonly sponsorApproveTimeout: Option<u32>;2305 readonly ownerCanTransfer: Option<bool>;2306 readonly ownerCanDestroy: Option<bool>;2307 readonly transfersEnabled: Option<bool>;2308 }23092310 /** @name UpDataStructsSponsoringRateLimit (235) */2311 interface UpDataStructsSponsoringRateLimit extends Enum {2312 readonly isSponsoringDisabled: boolean;2313 readonly isBlocks: boolean;2314 readonly asBlocks: u32;2315 readonly type: 'SponsoringDisabled' | 'Blocks';2316 }23172318 /** @name UpDataStructsCollectionPermissions (238) */2319 interface UpDataStructsCollectionPermissions extends Struct {2320 readonly access: Option<UpDataStructsAccessMode>;2321 readonly mintMode: Option<bool>;2322 readonly nesting: Option<UpDataStructsNestingPermissions>;2323 }23242325 /** @name UpDataStructsNestingPermissions (240) */2326 interface UpDataStructsNestingPermissions extends Struct {2327 readonly tokenOwner: bool;2328 readonly collectionAdmin: bool;2329 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;2330 }23312332 /** @name UpDataStructsOwnerRestrictedSet (242) */2333 interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}23342335 /** @name UpDataStructsPropertyKeyPermission (247) */2336 interface UpDataStructsPropertyKeyPermission extends Struct {2337 readonly key: Bytes;2338 readonly permission: UpDataStructsPropertyPermission;2339 }23402341 /** @name UpDataStructsPropertyPermission (248) */2342 interface UpDataStructsPropertyPermission extends Struct {2343 readonly mutable: bool;2344 readonly collectionAdmin: bool;2345 readonly tokenOwner: bool;2346 }23472348 /** @name UpDataStructsProperty (251) */2349 interface UpDataStructsProperty extends Struct {2350 readonly key: Bytes;2351 readonly value: Bytes;2352 }23532354 /** @name UpDataStructsCreateItemData (254) */2355 interface UpDataStructsCreateItemData extends Enum {2356 readonly isNft: boolean;2357 readonly asNft: UpDataStructsCreateNftData;2358 readonly isFungible: boolean;2359 readonly asFungible: UpDataStructsCreateFungibleData;2360 readonly isReFungible: boolean;2361 readonly asReFungible: UpDataStructsCreateReFungibleData;2362 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2363 }23642365 /** @name UpDataStructsCreateNftData (255) */2366 interface UpDataStructsCreateNftData extends Struct {2367 readonly properties: Vec<UpDataStructsProperty>;2368 }23692370 /** @name UpDataStructsCreateFungibleData (256) */2371 interface UpDataStructsCreateFungibleData extends Struct {2372 readonly value: u128;2373 }23742375 /** @name UpDataStructsCreateReFungibleData (257) */2376 interface UpDataStructsCreateReFungibleData extends Struct {2377 readonly pieces: u128;2378 readonly properties: Vec<UpDataStructsProperty>;2379 }23802381 /** @name UpDataStructsCreateItemExData (260) */2382 interface UpDataStructsCreateItemExData extends Enum {2383 readonly isNft: boolean;2384 readonly asNft: Vec<UpDataStructsCreateNftExData>;2385 readonly isFungible: boolean;2386 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2387 readonly isRefungibleMultipleItems: boolean;2388 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;2389 readonly isRefungibleMultipleOwners: boolean;2390 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;2391 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';2392 }23932394 /** @name UpDataStructsCreateNftExData (262) */2395 interface UpDataStructsCreateNftExData extends Struct {2396 readonly properties: Vec<UpDataStructsProperty>;2397 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2398 }23992400 /** @name UpDataStructsCreateRefungibleExSingleOwner (269) */2401 interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {2402 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;2403 readonly pieces: u128;2404 readonly properties: Vec<UpDataStructsProperty>;2405 }24062407 /** @name UpDataStructsCreateRefungibleExMultipleOwners (271) */2408 interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {2409 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2410 readonly properties: Vec<UpDataStructsProperty>;2411 }24122413 /** @name PalletUniqueSchedulerCall (272) */2414 interface PalletUniqueSchedulerCall extends Enum {2415 readonly isScheduleNamed: boolean;2416 readonly asScheduleNamed: {2417 readonly id: U8aFixed;2418 readonly when: u32;2419 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2420 readonly priority: u8;2421 readonly call: FrameSupportScheduleMaybeHashed;2422 } & Struct;2423 readonly isCancelNamed: boolean;2424 readonly asCancelNamed: {2425 readonly id: U8aFixed;2426 } & Struct;2427 readonly isScheduleNamedAfter: boolean;2428 readonly asScheduleNamedAfter: {2429 readonly id: U8aFixed;2430 readonly after: u32;2431 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2432 readonly priority: u8;2433 readonly call: FrameSupportScheduleMaybeHashed;2434 } & Struct;2435 readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';2436 }24372438 /** @name FrameSupportScheduleMaybeHashed (274) */2439 interface FrameSupportScheduleMaybeHashed extends Enum {2440 readonly isValue: boolean;2441 readonly asValue: Call;2442 readonly isHash: boolean;2443 readonly asHash: H256;2444 readonly type: 'Value' | 'Hash';2445 }24462447 /** @name PalletConfigurationCall (275) */2448 interface PalletConfigurationCall extends Enum {2449 readonly isSetWeightToFeeCoefficientOverride: boolean;2450 readonly asSetWeightToFeeCoefficientOverride: {2451 readonly coeff: Option<u32>;2452 } & Struct;2453 readonly isSetMinGasPriceOverride: boolean;2454 readonly asSetMinGasPriceOverride: {2455 readonly coeff: Option<u64>;2456 } & Struct;2457 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';2458 }24592460 /** @name PalletTemplateTransactionPaymentCall (276) */2461 type PalletTemplateTransactionPaymentCall = Null;24622463 /** @name PalletStructureCall (277) */2464 type PalletStructureCall = Null;24652466 /** @name PalletRmrkCoreCall (278) */2467 interface PalletRmrkCoreCall extends Enum {2468 readonly isCreateCollection: boolean;2469 readonly asCreateCollection: {2470 readonly metadata: Bytes;2471 readonly max: Option<u32>;2472 readonly symbol: Bytes;2473 } & Struct;2474 readonly isDestroyCollection: boolean;2475 readonly asDestroyCollection: {2476 readonly collectionId: u32;2477 } & Struct;2478 readonly isChangeCollectionIssuer: boolean;2479 readonly asChangeCollectionIssuer: {2480 readonly collectionId: u32;2481 readonly newIssuer: MultiAddress;2482 } & Struct;2483 readonly isLockCollection: boolean;2484 readonly asLockCollection: {2485 readonly collectionId: u32;2486 } & Struct;2487 readonly isMintNft: boolean;2488 readonly asMintNft: {2489 readonly owner: Option<AccountId32>;2490 readonly collectionId: u32;2491 readonly recipient: Option<AccountId32>;2492 readonly royaltyAmount: Option<Permill>;2493 readonly metadata: Bytes;2494 readonly transferable: bool;2495 readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;2496 } & Struct;2497 readonly isBurnNft: boolean;2498 readonly asBurnNft: {2499 readonly collectionId: u32;2500 readonly nftId: u32;2501 readonly maxBurns: u32;2502 } & Struct;2503 readonly isSend: boolean;2504 readonly asSend: {2505 readonly rmrkCollectionId: u32;2506 readonly rmrkNftId: u32;2507 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2508 } & Struct;2509 readonly isAcceptNft: boolean;2510 readonly asAcceptNft: {2511 readonly rmrkCollectionId: u32;2512 readonly rmrkNftId: u32;2513 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2514 } & Struct;2515 readonly isRejectNft: boolean;2516 readonly asRejectNft: {2517 readonly rmrkCollectionId: u32;2518 readonly rmrkNftId: u32;2519 } & Struct;2520 readonly isAcceptResource: boolean;2521 readonly asAcceptResource: {2522 readonly rmrkCollectionId: u32;2523 readonly rmrkNftId: u32;2524 readonly resourceId: u32;2525 } & Struct;2526 readonly isAcceptResourceRemoval: boolean;2527 readonly asAcceptResourceRemoval: {2528 readonly rmrkCollectionId: u32;2529 readonly rmrkNftId: u32;2530 readonly resourceId: u32;2531 } & Struct;2532 readonly isSetProperty: boolean;2533 readonly asSetProperty: {2534 readonly rmrkCollectionId: Compact<u32>;2535 readonly maybeNftId: Option<u32>;2536 readonly key: Bytes;2537 readonly value: Bytes;2538 } & Struct;2539 readonly isSetPriority: boolean;2540 readonly asSetPriority: {2541 readonly rmrkCollectionId: u32;2542 readonly rmrkNftId: u32;2543 readonly priorities: Vec<u32>;2544 } & Struct;2545 readonly isAddBasicResource: boolean;2546 readonly asAddBasicResource: {2547 readonly rmrkCollectionId: u32;2548 readonly nftId: u32;2549 readonly resource: RmrkTraitsResourceBasicResource;2550 } & Struct;2551 readonly isAddComposableResource: boolean;2552 readonly asAddComposableResource: {2553 readonly rmrkCollectionId: u32;2554 readonly nftId: u32;2555 readonly resource: RmrkTraitsResourceComposableResource;2556 } & Struct;2557 readonly isAddSlotResource: boolean;2558 readonly asAddSlotResource: {2559 readonly rmrkCollectionId: u32;2560 readonly nftId: u32;2561 readonly resource: RmrkTraitsResourceSlotResource;2562 } & Struct;2563 readonly isRemoveResource: boolean;2564 readonly asRemoveResource: {2565 readonly rmrkCollectionId: u32;2566 readonly nftId: u32;2567 readonly resourceId: u32;2568 } & Struct;2569 readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';2570 }25712572 /** @name RmrkTraitsResourceResourceTypes (284) */2573 interface RmrkTraitsResourceResourceTypes extends Enum {2574 readonly isBasic: boolean;2575 readonly asBasic: RmrkTraitsResourceBasicResource;2576 readonly isComposable: boolean;2577 readonly asComposable: RmrkTraitsResourceComposableResource;2578 readonly isSlot: boolean;2579 readonly asSlot: RmrkTraitsResourceSlotResource;2580 readonly type: 'Basic' | 'Composable' | 'Slot';2581 }25822583 /** @name RmrkTraitsResourceBasicResource (286) */2584 interface RmrkTraitsResourceBasicResource extends Struct {2585 readonly src: Option<Bytes>;2586 readonly metadata: Option<Bytes>;2587 readonly license: Option<Bytes>;2588 readonly thumb: Option<Bytes>;2589 }25902591 /** @name RmrkTraitsResourceComposableResource (288) */2592 interface RmrkTraitsResourceComposableResource extends Struct {2593 readonly parts: Vec<u32>;2594 readonly base: u32;2595 readonly src: Option<Bytes>;2596 readonly metadata: Option<Bytes>;2597 readonly license: Option<Bytes>;2598 readonly thumb: Option<Bytes>;2599 }26002601 /** @name RmrkTraitsResourceSlotResource (289) */2602 interface RmrkTraitsResourceSlotResource extends Struct {2603 readonly base: u32;2604 readonly src: Option<Bytes>;2605 readonly metadata: Option<Bytes>;2606 readonly slot: u32;2607 readonly license: Option<Bytes>;2608 readonly thumb: Option<Bytes>;2609 }26102611 /** @name PalletRmrkEquipCall (292) */2612 interface PalletRmrkEquipCall extends Enum {2613 readonly isCreateBase: boolean;2614 readonly asCreateBase: {2615 readonly baseType: Bytes;2616 readonly symbol: Bytes;2617 readonly parts: Vec<RmrkTraitsPartPartType>;2618 } & Struct;2619 readonly isThemeAdd: boolean;2620 readonly asThemeAdd: {2621 readonly baseId: u32;2622 readonly theme: RmrkTraitsTheme;2623 } & Struct;2624 readonly isEquippable: boolean;2625 readonly asEquippable: {2626 readonly baseId: u32;2627 readonly slotId: u32;2628 readonly equippables: RmrkTraitsPartEquippableList;2629 } & Struct;2630 readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';2631 }26322633 /** @name RmrkTraitsPartPartType (295) */2634 interface RmrkTraitsPartPartType extends Enum {2635 readonly isFixedPart: boolean;2636 readonly asFixedPart: RmrkTraitsPartFixedPart;2637 readonly isSlotPart: boolean;2638 readonly asSlotPart: RmrkTraitsPartSlotPart;2639 readonly type: 'FixedPart' | 'SlotPart';2640 }26412642 /** @name RmrkTraitsPartFixedPart (297) */2643 interface RmrkTraitsPartFixedPart extends Struct {2644 readonly id: u32;2645 readonly z: u32;2646 readonly src: Bytes;2647 }26482649 /** @name RmrkTraitsPartSlotPart (298) */2650 interface RmrkTraitsPartSlotPart extends Struct {2651 readonly id: u32;2652 readonly equippable: RmrkTraitsPartEquippableList;2653 readonly src: Bytes;2654 readonly z: u32;2655 }26562657 /** @name RmrkTraitsPartEquippableList (299) */2658 interface RmrkTraitsPartEquippableList extends Enum {2659 readonly isAll: boolean;2660 readonly isEmpty: boolean;2661 readonly isCustom: boolean;2662 readonly asCustom: Vec<u32>;2663 readonly type: 'All' | 'Empty' | 'Custom';2664 }26652666 /** @name RmrkTraitsTheme (301) */2667 interface RmrkTraitsTheme extends Struct {2668 readonly name: Bytes;2669 readonly properties: Vec<RmrkTraitsThemeThemeProperty>;2670 readonly inherit: bool;2671 }26722673 /** @name RmrkTraitsThemeThemeProperty (303) */2674 interface RmrkTraitsThemeThemeProperty extends Struct {2675 readonly key: Bytes;2676 readonly value: Bytes;2677 }26782679 /** @name PalletAppPromotionCall (305) */2680 interface PalletAppPromotionCall extends Enum {2681 readonly isSetAdminAddress: boolean;2682 readonly asSetAdminAddress: {2683 readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;2684 } & Struct;2685 readonly isStake: boolean;2686 readonly asStake: {2687 readonly amount: u128;2688 } & Struct;2689 readonly isUnstake: boolean;2690 readonly isSponsorCollection: boolean;2691 readonly asSponsorCollection: {2692 readonly collectionId: u32;2693 } & Struct;2694 readonly isStopSponsoringCollection: boolean;2695 readonly asStopSponsoringCollection: {2696 readonly collectionId: u32;2697 } & Struct;2698 readonly isSponsorContract: boolean;2699 readonly asSponsorContract: {2700 readonly contractId: H160;2701 } & Struct;2702 readonly isStopSponsoringContract: boolean;2703 readonly asStopSponsoringContract: {2704 readonly contractId: H160;2705 } & Struct;2706 readonly isPayoutStakers: boolean;2707 readonly asPayoutStakers: {2708 readonly stakersNumber: Option<u8>;2709 } & Struct;2710 readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';2711 }27122713 /** @name PalletEvmCall (307) */2714 interface PalletEvmCall extends Enum {2715 readonly isWithdraw: boolean;2716 readonly asWithdraw: {2717 readonly address: H160;2718 readonly value: u128;2719 } & Struct;2720 readonly isCall: boolean;2721 readonly asCall: {2722 readonly source: H160;2723 readonly target: H160;2724 readonly input: Bytes;2725 readonly value: U256;2726 readonly gasLimit: u64;2727 readonly maxFeePerGas: U256;2728 readonly maxPriorityFeePerGas: Option<U256>;2729 readonly nonce: Option<U256>;2730 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2731 } & Struct;2732 readonly isCreate: boolean;2733 readonly asCreate: {2734 readonly source: H160;2735 readonly init: Bytes;2736 readonly value: U256;2737 readonly gasLimit: u64;2738 readonly maxFeePerGas: U256;2739 readonly maxPriorityFeePerGas: Option<U256>;2740 readonly nonce: Option<U256>;2741 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2742 } & Struct;2743 readonly isCreate2: boolean;2744 readonly asCreate2: {2745 readonly source: H160;2746 readonly init: Bytes;2747 readonly salt: H256;2748 readonly value: U256;2749 readonly gasLimit: u64;2750 readonly maxFeePerGas: U256;2751 readonly maxPriorityFeePerGas: Option<U256>;2752 readonly nonce: Option<U256>;2753 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;2754 } & Struct;2755 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';2756 }27572758 /** @name PalletEthereumCall (311) */2759 interface PalletEthereumCall extends Enum {2760 readonly isTransact: boolean;2761 readonly asTransact: {2762 readonly transaction: EthereumTransactionTransactionV2;2763 } & Struct;2764 readonly type: 'Transact';2765 }27662767 /** @name EthereumTransactionTransactionV2 (312) */2768 interface EthereumTransactionTransactionV2 extends Enum {2769 readonly isLegacy: boolean;2770 readonly asLegacy: EthereumTransactionLegacyTransaction;2771 readonly isEip2930: boolean;2772 readonly asEip2930: EthereumTransactionEip2930Transaction;2773 readonly isEip1559: boolean;2774 readonly asEip1559: EthereumTransactionEip1559Transaction;2775 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';2776 }27772778 /** @name EthereumTransactionLegacyTransaction (313) */2779 interface EthereumTransactionLegacyTransaction extends Struct {2780 readonly nonce: U256;2781 readonly gasPrice: U256;2782 readonly gasLimit: U256;2783 readonly action: EthereumTransactionTransactionAction;2784 readonly value: U256;2785 readonly input: Bytes;2786 readonly signature: EthereumTransactionTransactionSignature;2787 }27882789 /** @name EthereumTransactionTransactionAction (314) */2790 interface EthereumTransactionTransactionAction extends Enum {2791 readonly isCall: boolean;2792 readonly asCall: H160;2793 readonly isCreate: boolean;2794 readonly type: 'Call' | 'Create';2795 }27962797 /** @name EthereumTransactionTransactionSignature (315) */2798 interface EthereumTransactionTransactionSignature extends Struct {2799 readonly v: u64;2800 readonly r: H256;2801 readonly s: H256;2802 }28032804 /** @name EthereumTransactionEip2930Transaction (317) */2805 interface EthereumTransactionEip2930Transaction extends Struct {2806 readonly chainId: u64;2807 readonly nonce: U256;2808 readonly gasPrice: U256;2809 readonly gasLimit: U256;2810 readonly action: EthereumTransactionTransactionAction;2811 readonly value: U256;2812 readonly input: Bytes;2813 readonly accessList: Vec<EthereumTransactionAccessListItem>;2814 readonly oddYParity: bool;2815 readonly r: H256;2816 readonly s: H256;2817 }28182819 /** @name EthereumTransactionAccessListItem (319) */2820 interface EthereumTransactionAccessListItem extends Struct {2821 readonly address: H160;2822 readonly storageKeys: Vec<H256>;2823 }28242825 /** @name EthereumTransactionEip1559Transaction (320) */2826 interface EthereumTransactionEip1559Transaction extends Struct {2827 readonly chainId: u64;2828 readonly nonce: U256;2829 readonly maxPriorityFeePerGas: U256;2830 readonly maxFeePerGas: U256;2831 readonly gasLimit: U256;2832 readonly action: EthereumTransactionTransactionAction;2833 readonly value: U256;2834 readonly input: Bytes;2835 readonly accessList: Vec<EthereumTransactionAccessListItem>;2836 readonly oddYParity: bool;2837 readonly r: H256;2838 readonly s: H256;2839 }28402841 /** @name PalletEvmMigrationCall (321) */2842 interface PalletEvmMigrationCall extends Enum {2843 readonly isBegin: boolean;2844 readonly asBegin: {2845 readonly address: H160;2846 } & Struct;2847 readonly isSetData: boolean;2848 readonly asSetData: {2849 readonly address: H160;2850 readonly data: Vec<ITuple<[H256, H256]>>;2851 } & Struct;2852 readonly isFinish: boolean;2853 readonly asFinish: {2854 readonly address: H160;2855 readonly code: Bytes;2856 } & Struct;2857 readonly type: 'Begin' | 'SetData' | 'Finish';2858 }28592860 /** @name PalletSudoError (324) */2861 interface PalletSudoError extends Enum {2862 readonly isRequireSudo: boolean;2863 readonly type: 'RequireSudo';2864 }28652866 /** @name OrmlVestingModuleError (326) */2867 interface OrmlVestingModuleError extends Enum {2868 readonly isZeroVestingPeriod: boolean;2869 readonly isZeroVestingPeriodCount: boolean;2870 readonly isInsufficientBalanceToLock: boolean;2871 readonly isTooManyVestingSchedules: boolean;2872 readonly isAmountLow: boolean;2873 readonly isMaxVestingSchedulesExceeded: boolean;2874 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';2875 }28762877 /** @name CumulusPalletXcmpQueueInboundChannelDetails (328) */2878 interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {2879 readonly sender: u32;2880 readonly state: CumulusPalletXcmpQueueInboundState;2881 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;2882 }28832884 /** @name CumulusPalletXcmpQueueInboundState (329) */2885 interface CumulusPalletXcmpQueueInboundState extends Enum {2886 readonly isOk: boolean;2887 readonly isSuspended: boolean;2888 readonly type: 'Ok' | 'Suspended';2889 }28902891 /** @name PolkadotParachainPrimitivesXcmpMessageFormat (332) */2892 interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {2893 readonly isConcatenatedVersionedXcm: boolean;2894 readonly isConcatenatedEncodedBlob: boolean;2895 readonly isSignals: boolean;2896 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';2897 }28982899 /** @name CumulusPalletXcmpQueueOutboundChannelDetails (335) */2900 interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {2901 readonly recipient: u32;2902 readonly state: CumulusPalletXcmpQueueOutboundState;2903 readonly signalsExist: bool;2904 readonly firstIndex: u16;2905 readonly lastIndex: u16;2906 }29072908 /** @name CumulusPalletXcmpQueueOutboundState (336) */2909 interface CumulusPalletXcmpQueueOutboundState extends Enum {2910 readonly isOk: boolean;2911 readonly isSuspended: boolean;2912 readonly type: 'Ok' | 'Suspended';2913 }29142915 /** @name CumulusPalletXcmpQueueQueueConfigData (338) */2916 interface CumulusPalletXcmpQueueQueueConfigData extends Struct {2917 readonly suspendThreshold: u32;2918 readonly dropThreshold: u32;2919 readonly resumeThreshold: u32;2920 readonly thresholdWeight: u64;2921 readonly weightRestrictDecay: u64;2922 readonly xcmpMaxIndividualWeight: u64;2923 }29242925 /** @name CumulusPalletXcmpQueueError (340) */2926 interface CumulusPalletXcmpQueueError extends Enum {2927 readonly isFailedToSend: boolean;2928 readonly isBadXcmOrigin: boolean;2929 readonly isBadXcm: boolean;2930 readonly isBadOverweightIndex: boolean;2931 readonly isWeightOverLimit: boolean;2932 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';2933 }29342935 /** @name PalletXcmError (341) */2936 interface PalletXcmError extends Enum {2937 readonly isUnreachable: boolean;2938 readonly isSendFailure: boolean;2939 readonly isFiltered: boolean;2940 readonly isUnweighableMessage: boolean;2941 readonly isDestinationNotInvertible: boolean;2942 readonly isEmpty: boolean;2943 readonly isCannotReanchor: boolean;2944 readonly isTooManyAssets: boolean;2945 readonly isInvalidOrigin: boolean;2946 readonly isBadVersion: boolean;2947 readonly isBadLocation: boolean;2948 readonly isNoSubscription: boolean;2949 readonly isAlreadySubscribed: boolean;2950 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';2951 }29522953 /** @name CumulusPalletXcmError (342) */2954 type CumulusPalletXcmError = Null;29552956 /** @name CumulusPalletDmpQueueConfigData (343) */2957 interface CumulusPalletDmpQueueConfigData extends Struct {2958 readonly maxIndividual: u64;2959 }29602961 /** @name CumulusPalletDmpQueuePageIndexData (344) */2962 interface CumulusPalletDmpQueuePageIndexData extends Struct {2963 readonly beginUsed: u32;2964 readonly endUsed: u32;2965 readonly overweightCount: u64;2966 }29672968 /** @name CumulusPalletDmpQueueError (347) */2969 interface CumulusPalletDmpQueueError extends Enum {2970 readonly isUnknown: boolean;2971 readonly isOverLimit: boolean;2972 readonly type: 'Unknown' | 'OverLimit';2973 }29742975 /** @name PalletUniqueError (351) */2976 interface PalletUniqueError extends Enum {2977 readonly isCollectionDecimalPointLimitExceeded: boolean;2978 readonly isConfirmUnsetSponsorFail: boolean;2979 readonly isEmptyArgument: boolean;2980 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;2981 readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';2982 }29832984 /** @name PalletUniqueSchedulerScheduledV3 (354) */2985 interface PalletUniqueSchedulerScheduledV3 extends Struct {2986 readonly maybeId: Option<U8aFixed>;2987 readonly priority: u8;2988 readonly call: FrameSupportScheduleMaybeHashed;2989 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2990 readonly origin: OpalRuntimeOriginCaller;2991 }29922993 /** @name OpalRuntimeOriginCaller (355) */2994 interface OpalRuntimeOriginCaller extends Enum {2995 readonly isSystem: boolean;2996 readonly asSystem: FrameSupportDispatchRawOrigin;2997 readonly isVoid: boolean;2998 readonly isPolkadotXcm: boolean;2999 readonly asPolkadotXcm: PalletXcmOrigin;3000 readonly isCumulusXcm: boolean;3001 readonly asCumulusXcm: CumulusPalletXcmOrigin;3002 readonly isEthereum: boolean;3003 readonly asEthereum: PalletEthereumRawOrigin;3004 readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';3005 }30063007 /** @name FrameSupportDispatchRawOrigin (356) */3008 interface FrameSupportDispatchRawOrigin extends Enum {3009 readonly isRoot: boolean;3010 readonly isSigned: boolean;3011 readonly asSigned: AccountId32;3012 readonly isNone: boolean;3013 readonly type: 'Root' | 'Signed' | 'None';3014 }30153016 /** @name PalletXcmOrigin (357) */3017 interface PalletXcmOrigin extends Enum {3018 readonly isXcm: boolean;3019 readonly asXcm: XcmV1MultiLocation;3020 readonly isResponse: boolean;3021 readonly asResponse: XcmV1MultiLocation;3022 readonly type: 'Xcm' | 'Response';3023 }30243025 /** @name CumulusPalletXcmOrigin (358) */3026 interface CumulusPalletXcmOrigin extends Enum {3027 readonly isRelay: boolean;3028 readonly isSiblingParachain: boolean;3029 readonly asSiblingParachain: u32;3030 readonly type: 'Relay' | 'SiblingParachain';3031 }30323033 /** @name PalletEthereumRawOrigin (359) */3034 interface PalletEthereumRawOrigin extends Enum {3035 readonly isEthereumTransaction: boolean;3036 readonly asEthereumTransaction: H160;3037 readonly type: 'EthereumTransaction';3038 }30393040 /** @name SpCoreVoid (360) */3041 type SpCoreVoid = Null;30423043 /** @name PalletUniqueSchedulerError (361) */3044 interface PalletUniqueSchedulerError extends Enum {3045 readonly isFailedToSchedule: boolean;3046 readonly isNotFound: boolean;3047 readonly isTargetBlockNumberInPast: boolean;3048 readonly isRescheduleNoChange: boolean;3049 readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';3050 }30513052 /** @name UpDataStructsCollection (362) */3053 interface UpDataStructsCollection extends Struct {3054 readonly owner: AccountId32;3055 readonly mode: UpDataStructsCollectionMode;3056 readonly name: Vec<u16>;3057 readonly description: Vec<u16>;3058 readonly tokenPrefix: Bytes;3059 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3060 readonly limits: UpDataStructsCollectionLimits;3061 readonly permissions: UpDataStructsCollectionPermissions;3062 readonly externalCollection: bool;3063 }30643065 /** @name UpDataStructsSponsorshipStateAccountId32 (363) */3066 interface UpDataStructsSponsorshipStateAccountId32 extends Enum {3067 readonly isDisabled: boolean;3068 readonly isUnconfirmed: boolean;3069 readonly asUnconfirmed: AccountId32;3070 readonly isConfirmed: boolean;3071 readonly asConfirmed: AccountId32;3072 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3073 }30743075 /** @name UpDataStructsProperties (364) */3076 interface UpDataStructsProperties extends Struct {3077 readonly map: UpDataStructsPropertiesMapBoundedVec;3078 readonly consumedSpace: u32;3079 readonly spaceLimit: u32;3080 }30813082 /** @name UpDataStructsPropertiesMapBoundedVec (365) */3083 interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}30843085 /** @name UpDataStructsPropertiesMapPropertyPermission (370) */3086 interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}30873088 /** @name UpDataStructsCollectionStats (377) */3089 interface UpDataStructsCollectionStats extends Struct {3090 readonly created: u32;3091 readonly destroyed: u32;3092 readonly alive: u32;3093 }30943095 /** @name UpDataStructsTokenChild (378) */3096 interface UpDataStructsTokenChild extends Struct {3097 readonly token: u32;3098 readonly collection: u32;3099 }31003101 /** @name PhantomTypeUpDataStructs (379) */3102 interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}31033104 /** @name UpDataStructsTokenData (381) */3105 interface UpDataStructsTokenData extends Struct {3106 readonly properties: Vec<UpDataStructsProperty>;3107 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3108 readonly pieces: u128;3109 }31103111 /** @name UpDataStructsRpcCollection (383) */3112 interface UpDataStructsRpcCollection extends Struct {3113 readonly owner: AccountId32;3114 readonly mode: UpDataStructsCollectionMode;3115 readonly name: Vec<u16>;3116 readonly description: Vec<u16>;3117 readonly tokenPrefix: Bytes;3118 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3119 readonly limits: UpDataStructsCollectionLimits;3120 readonly permissions: UpDataStructsCollectionPermissions;3121 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3122 readonly properties: Vec<UpDataStructsProperty>;3123 readonly readOnly: bool;3124 }31253126 /** @name RmrkTraitsCollectionCollectionInfo (384) */3127 interface RmrkTraitsCollectionCollectionInfo extends Struct {3128 readonly issuer: AccountId32;3129 readonly metadata: Bytes;3130 readonly max: Option<u32>;3131 readonly symbol: Bytes;3132 readonly nftsCount: u32;3133 }31343135 /** @name RmrkTraitsNftNftInfo (385) */3136 interface RmrkTraitsNftNftInfo extends Struct {3137 readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;3138 readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;3139 readonly metadata: Bytes;3140 readonly equipped: bool;3141 readonly pending: bool;3142 }31433144 /** @name RmrkTraitsNftRoyaltyInfo (387) */3145 interface RmrkTraitsNftRoyaltyInfo extends Struct {3146 readonly recipient: AccountId32;3147 readonly amount: Permill;3148 }31493150 /** @name RmrkTraitsResourceResourceInfo (388) */3151 interface RmrkTraitsResourceResourceInfo extends Struct {3152 readonly id: u32;3153 readonly resource: RmrkTraitsResourceResourceTypes;3154 readonly pending: bool;3155 readonly pendingRemoval: bool;3156 }31573158 /** @name RmrkTraitsPropertyPropertyInfo (389) */3159 interface RmrkTraitsPropertyPropertyInfo extends Struct {3160 readonly key: Bytes;3161 readonly value: Bytes;3162 }31633164 /** @name RmrkTraitsBaseBaseInfo (390) */3165 interface RmrkTraitsBaseBaseInfo extends Struct {3166 readonly issuer: AccountId32;3167 readonly baseType: Bytes;3168 readonly symbol: Bytes;3169 }31703171 /** @name RmrkTraitsNftNftChild (391) */3172 interface RmrkTraitsNftNftChild extends Struct {3173 readonly collectionId: u32;3174 readonly nftId: u32;3175 }31763177 /** @name PalletCommonError (393) */3178 interface PalletCommonError extends Enum {3179 readonly isCollectionNotFound: boolean;3180 readonly isMustBeTokenOwner: boolean;3181 readonly isNoPermission: boolean;3182 readonly isCantDestroyNotEmptyCollection: boolean;3183 readonly isPublicMintingNotAllowed: boolean;3184 readonly isAddressNotInAllowlist: boolean;3185 readonly isCollectionNameLimitExceeded: boolean;3186 readonly isCollectionDescriptionLimitExceeded: boolean;3187 readonly isCollectionTokenPrefixLimitExceeded: boolean;3188 readonly isTotalCollectionsLimitExceeded: boolean;3189 readonly isCollectionAdminCountExceeded: boolean;3190 readonly isCollectionLimitBoundsExceeded: boolean;3191 readonly isOwnerPermissionsCantBeReverted: boolean;3192 readonly isTransferNotAllowed: boolean;3193 readonly isAccountTokenLimitExceeded: boolean;3194 readonly isCollectionTokenLimitExceeded: boolean;3195 readonly isMetadataFlagFrozen: boolean;3196 readonly isTokenNotFound: boolean;3197 readonly isTokenValueTooLow: boolean;3198 readonly isApprovedValueTooLow: boolean;3199 readonly isCantApproveMoreThanOwned: boolean;3200 readonly isAddressIsZero: boolean;3201 readonly isUnsupportedOperation: boolean;3202 readonly isNotSufficientFounds: boolean;3203 readonly isUserIsNotAllowedToNest: boolean;3204 readonly isSourceCollectionIsNotAllowedToNest: boolean;3205 readonly isCollectionFieldSizeExceeded: boolean;3206 readonly isNoSpaceForProperty: boolean;3207 readonly isPropertyLimitReached: boolean;3208 readonly isPropertyKeyIsTooLong: boolean;3209 readonly isInvalidCharacterInPropertyKey: boolean;3210 readonly isEmptyPropertyKey: boolean;3211 readonly isCollectionIsExternal: boolean;3212 readonly isCollectionIsInternal: boolean;3213 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';3214 }32153216 /** @name PalletFungibleError (395) */3217 interface PalletFungibleError extends Enum {3218 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;3219 readonly isFungibleItemsHaveNoId: boolean;3220 readonly isFungibleItemsDontHaveData: boolean;3221 readonly isFungibleDisallowsNesting: boolean;3222 readonly isSettingPropertiesNotAllowed: boolean;3223 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3224 }32253226 /** @name PalletRefungibleItemData (396) */3227 interface PalletRefungibleItemData extends Struct {3228 readonly constData: Bytes;3229 }32303231 /** @name PalletRefungibleError (401) */3232 interface PalletRefungibleError extends Enum {3233 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;3234 readonly isWrongRefungiblePieces: boolean;3235 readonly isRepartitionWhileNotOwningAllPieces: boolean;3236 readonly isRefungibleDisallowsNesting: boolean;3237 readonly isSettingPropertiesNotAllowed: boolean;3238 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';3239 }32403241 /** @name PalletNonfungibleItemData (402) */3242 interface PalletNonfungibleItemData extends Struct {3243 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;3244 }32453246 /** @name UpDataStructsPropertyScope (404) */3247 interface UpDataStructsPropertyScope extends Enum {3248 readonly isNone: boolean;3249 readonly isRmrk: boolean;3250 readonly type: 'None' | 'Rmrk';3251 }32523253 /** @name PalletNonfungibleError (406) */3254 interface PalletNonfungibleError extends Enum {3255 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;3256 readonly isNonfungibleItemsHaveNoAmount: boolean;3257 readonly isCantBurnNftWithChildren: boolean;3258 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';3259 }32603261 /** @name PalletStructureError (407) */3262 interface PalletStructureError extends Enum {3263 readonly isOuroborosDetected: boolean;3264 readonly isDepthLimit: boolean;3265 readonly isBreadthLimit: boolean;3266 readonly isTokenNotFound: boolean;3267 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';3268 }32693270 /** @name PalletRmrkCoreError (408) */3271 interface PalletRmrkCoreError extends Enum {3272 readonly isCorruptedCollectionType: boolean;3273 readonly isRmrkPropertyKeyIsTooLong: boolean;3274 readonly isRmrkPropertyValueIsTooLong: boolean;3275 readonly isRmrkPropertyIsNotFound: boolean;3276 readonly isUnableToDecodeRmrkData: boolean;3277 readonly isCollectionNotEmpty: boolean;3278 readonly isNoAvailableCollectionId: boolean;3279 readonly isNoAvailableNftId: boolean;3280 readonly isCollectionUnknown: boolean;3281 readonly isNoPermission: boolean;3282 readonly isNonTransferable: boolean;3283 readonly isCollectionFullOrLocked: boolean;3284 readonly isResourceDoesntExist: boolean;3285 readonly isCannotSendToDescendentOrSelf: boolean;3286 readonly isCannotAcceptNonOwnedNft: boolean;3287 readonly isCannotRejectNonOwnedNft: boolean;3288 readonly isCannotRejectNonPendingNft: boolean;3289 readonly isResourceNotPending: boolean;3290 readonly isNoAvailableResourceId: boolean;3291 readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';3292 }32933294 /** @name PalletRmrkEquipError (410) */3295 interface PalletRmrkEquipError extends Enum {3296 readonly isPermissionError: boolean;3297 readonly isNoAvailableBaseId: boolean;3298 readonly isNoAvailablePartId: boolean;3299 readonly isBaseDoesntExist: boolean;3300 readonly isNeedsDefaultThemeFirst: boolean;3301 readonly isPartDoesntExist: boolean;3302 readonly isNoEquippableOnFixedPart: boolean;3303 readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';3304 }33053306 /** @name PalletAppPromotionError (416) */3307 interface PalletAppPromotionError extends Enum {3308 readonly isAdminNotSet: boolean;3309 readonly isNoPermission: boolean;3310 readonly isNotSufficientFunds: boolean;3311 readonly isPendingForBlockOverflow: boolean;3312 readonly isSponsorNotSet: boolean;3313 readonly isIncorrectLockedBalanceOperation: boolean;3314 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';3315 }33163317 /** @name PalletEvmError (419) */3318 interface PalletEvmError extends Enum {3319 readonly isBalanceLow: boolean;3320 readonly isFeeOverflow: boolean;3321 readonly isPaymentOverflow: boolean;3322 readonly isWithdrawFailed: boolean;3323 readonly isGasPriceTooLow: boolean;3324 readonly isInvalidNonce: boolean;3325 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';3326 }33273328 /** @name FpRpcTransactionStatus (422) */3329 interface FpRpcTransactionStatus extends Struct {3330 readonly transactionHash: H256;3331 readonly transactionIndex: u32;3332 readonly from: H160;3333 readonly to: Option<H160>;3334 readonly contractAddress: Option<H160>;3335 readonly logs: Vec<EthereumLog>;3336 readonly logsBloom: EthbloomBloom;3337 }33383339 /** @name EthbloomBloom (424) */3340 interface EthbloomBloom extends U8aFixed {}33413342 /** @name EthereumReceiptReceiptV3 (426) */3343 interface EthereumReceiptReceiptV3 extends Enum {3344 readonly isLegacy: boolean;3345 readonly asLegacy: EthereumReceiptEip658ReceiptData;3346 readonly isEip2930: boolean;3347 readonly asEip2930: EthereumReceiptEip658ReceiptData;3348 readonly isEip1559: boolean;3349 readonly asEip1559: EthereumReceiptEip658ReceiptData;3350 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';3351 }33523353 /** @name EthereumReceiptEip658ReceiptData (427) */3354 interface EthereumReceiptEip658ReceiptData extends Struct {3355 readonly statusCode: u8;3356 readonly usedGas: U256;3357 readonly logsBloom: EthbloomBloom;3358 readonly logs: Vec<EthereumLog>;3359 }33603361 /** @name EthereumBlock (428) */3362 interface EthereumBlock extends Struct {3363 readonly header: EthereumHeader;3364 readonly transactions: Vec<EthereumTransactionTransactionV2>;3365 readonly ommers: Vec<EthereumHeader>;3366 }33673368 /** @name EthereumHeader (429) */3369 interface EthereumHeader extends Struct {3370 readonly parentHash: H256;3371 readonly ommersHash: H256;3372 readonly beneficiary: H160;3373 readonly stateRoot: H256;3374 readonly transactionsRoot: H256;3375 readonly receiptsRoot: H256;3376 readonly logsBloom: EthbloomBloom;3377 readonly difficulty: U256;3378 readonly number: U256;3379 readonly gasLimit: U256;3380 readonly gasUsed: U256;3381 readonly timestamp: u64;3382 readonly extraData: Bytes;3383 readonly mixHash: H256;3384 readonly nonce: EthereumTypesHashH64;3385 }33863387 /** @name EthereumTypesHashH64 (430) */3388 interface EthereumTypesHashH64 extends U8aFixed {}33893390 /** @name PalletEthereumError (435) */3391 interface PalletEthereumError extends Enum {3392 readonly isInvalidSignature: boolean;3393 readonly isPreLogExists: boolean;3394 readonly type: 'InvalidSignature' | 'PreLogExists';3395 }33963397 /** @name PalletEvmCoderSubstrateError (436) */3398 interface PalletEvmCoderSubstrateError extends Enum {3399 readonly isOutOfGas: boolean;3400 readonly isOutOfFund: boolean;3401 readonly type: 'OutOfGas' | 'OutOfFund';3402 }34033404 /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (437) */3405 interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {3406 readonly isDisabled: boolean;3407 readonly isUnconfirmed: boolean;3408 readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3409 readonly isConfirmed: boolean;3410 readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3411 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3412 }34133414 /** @name PalletEvmContractHelpersSponsoringModeT (438) */3415 interface PalletEvmContractHelpersSponsoringModeT extends Enum {3416 readonly isDisabled: boolean;3417 readonly isAllowlisted: boolean;3418 readonly isGenerous: boolean;3419 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';3420 }34213422 /** @name PalletEvmContractHelpersError (440) */3423 interface PalletEvmContractHelpersError extends Enum {3424 readonly isNoPermission: boolean;3425 readonly isNoPendingSponsor: boolean;3426 readonly type: 'NoPermission' | 'NoPendingSponsor';3427 }34283429 /** @name PalletEvmMigrationError (441) */3430 interface PalletEvmMigrationError extends Enum {3431 readonly isAccountNotEmpty: boolean;3432 readonly isAccountIsNotMigrating: boolean;3433 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';3434 }34353436 /** @name SpRuntimeMultiSignature (443) */3437 interface SpRuntimeMultiSignature extends Enum {3438 readonly isEd25519: boolean;3439 readonly asEd25519: SpCoreEd25519Signature;3440 readonly isSr25519: boolean;3441 readonly asSr25519: SpCoreSr25519Signature;3442 readonly isEcdsa: boolean;3443 readonly asEcdsa: SpCoreEcdsaSignature;3444 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';3445 }34463447 /** @name SpCoreEd25519Signature (444) */3448 interface SpCoreEd25519Signature extends U8aFixed {}34493450 /** @name SpCoreSr25519Signature (446) */3451 interface SpCoreSr25519Signature extends U8aFixed {}34523453 /** @name SpCoreEcdsaSignature (447) */3454 interface SpCoreEcdsaSignature extends U8aFixed {}34553456 /** @name FrameSystemExtensionsCheckSpecVersion (450) */3457 type FrameSystemExtensionsCheckSpecVersion = Null;34583459 /** @name FrameSystemExtensionsCheckGenesis (451) */3460 type FrameSystemExtensionsCheckGenesis = Null;34613462 /** @name FrameSystemExtensionsCheckNonce (454) */3463 interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}34643465 /** @name FrameSystemExtensionsCheckWeight (455) */3466 type FrameSystemExtensionsCheckWeight = Null;34673468 /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (456) */3469 interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}34703471 /** @name OpalRuntimeRuntime (457) */3472 type OpalRuntimeRuntime = Null;34733474 /** @name PalletEthereumFakeTransactionFinalizer (458) */3475 type PalletEthereumFakeTransactionFinalizer = Null;34763477} // declare moduletests/src/interfaces/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/types.ts
+++ b/tests/src/interfaces/types.ts
@@ -2,5 +2,6 @@
/* eslint-disable */
export * from './unique/types';
+export * from './appPromotion/types';
export * from './rmrk/types';
export * from './default/types';
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 = 'apppromotion';
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/refungible.test.tsdiffbeforeafterboth--- a/tests/src/refungible.test.ts
+++ b/tests/src/refungible.test.ts
@@ -245,8 +245,8 @@
section: 'common',
index: '0x4202',
data: [
- collection.collectionId.toString(),
- token.tokenId.toString(),
+ helper.api!.createType('u32', collection.collectionId).toHuman(),
+ helper.api!.createType('u32', token.tokenId).toHuman(),
{Substrate: alice.address},
'100',
],
@@ -265,8 +265,8 @@
section: 'common',
index: '0x4203',
data: [
- collection.collectionId.toString(),
- token.tokenId.toString(),
+ helper.api!.createType('u32', collection.collectionId).toHuman(),
+ helper.api!.createType('u32', token.tokenId).toHuman(),
{Substrate: alice.address},
'50',
],
tests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/removeCollectionAdmin.test.ts
+++ b/tests/src/removeCollectionAdmin.test.ts
@@ -27,6 +27,7 @@
const alice = privateKey('//Alice');
const bob = privateKey('//Bob');
const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'});
+
const collectionInfo = await collection.getData();
expect(collectionInfo?.raw.owner.toString()).to.be.deep.eq(alice.address);
// first - add collection admin Bob
tests/src/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -25,6 +25,8 @@
import privateKey from './privateKey';
import promisifySubstrate from './promisify-substrate';
+import {SilentConsole} from '../util/playgrounds/unique.dev';
+
function defaultApiOptions(): ApiOptions {
@@ -42,6 +44,7 @@
},
rpc: {
unique: defs.unique.rpc,
+ appPromotion: defs.appPromotion.rpc,
rmrk: defs.rmrk.rpc,
eth: {
feeHistory: {
@@ -75,25 +78,8 @@
const api: ApiPromise = new ApiPromise(settings);
let result: T = null as unknown as 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;
-
- const outFn = (printer: any) => (...args: any[]) => {
- for (const arg of args) {
- if (typeof arg !== 'string')
- continue;
- if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis:') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure')
- return;
- }
- printer(...args);
- };
-
- console.error = outFn(consoleErr.bind(console));
- console.log = outFn(consoleLog.bind(console));
- console.warn = outFn(consoleWarn.bind(console));
+ const silentConsole = new SilentConsole();
+ silentConsole.enable();
try {
await promisifySubstrate(api, async () => {
@@ -106,9 +92,7 @@
})();
} finally {
await api.disconnect();
- console.error = consoleErr;
- console.log = consoleLog;
- console.warn = consoleWarn;
+ silentConsole.disable();
}
return result as T;
}
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -17,10 +17,11 @@
import '../interfaces/augment-api-rpc';
import '../interfaces/augment-api-query';
import {ApiPromise} from '@polkadot/api';
-import type {AccountId, EventRecord, Event} from '@polkadot/types/interfaces';
+import type {AccountId, EventRecord, Event, BlockNumber} from '@polkadot/types/interfaces';
import type {GenericEventData} from '@polkadot/types';
import {AnyTuple, IEvent, IKeyringPair} from '@polkadot/types/types';
import {evmToAddress} from '@polkadot/util-crypto';
+import {AnyNumber} from '@polkadot/types-codec/types';
import BN from 'bn.js';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
@@ -48,6 +49,7 @@
Fungible = 'fungible',
NFT = 'nonfungible',
Scheduler = 'scheduler',
+ AppPromotion = 'apppromotion',
}
export async function isUnique(): Promise<boolean> {
@@ -1779,3 +1781,23 @@
itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true});
itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true});
+
+
+export async function expectSubstrateEventsAtBlock(api: ApiPromise, blockNumber: AnyNumber | BlockNumber, section: string, methods: string[], dryRun = false) {
+ const blockHash = await api.rpc.chain.getBlockHash(blockNumber);
+ const subEvents = (await api.query.system.events.at(blockHash))
+ .filter(x => x.event.section === section)
+ .map((x) => x.toHuman());
+ const events = methods.map((m) => {
+ return {
+ event: {
+ method: m,
+ section,
+ },
+ };
+ });
+ if (!dryRun) {
+ expect(subEvents).to.be.like(events);
+ }
+ return subEvents;
+}
\ No newline at end of file
tests/src/util/playgrounds/index.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/index.ts
+++ b/tests/src/util/playgrounds/index.ts
@@ -2,39 +2,16 @@
// SPDX-License-Identifier: Apache-2.0
import {IKeyringPair} from '@polkadot/types/types';
+import {Context} from 'mocha';
import config from '../../config';
import '../../interfaces/augment-api-events';
-import {DevUniqueHelper} from './unique.dev';
+import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev';
-class SilentLogger {
- log(msg: any, level: any): void { }
- level = {
- ERROR: 'ERROR' as const,
- WARNING: 'WARNING' as const,
- INFO: 'INFO' as const,
- };
-}
export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
- // 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;
+ const silentConsole = new SilentConsole();
+ silentConsole.enable();
- const outFn = (printer: any) => (...args: any[]) => {
- for (const arg of args) {
- if (typeof arg !== 'string')
- continue;
- if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis:') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure')
- return;
- }
- printer(...args);
- };
-
- console.error = outFn(consoleErr.bind(console));
- console.log = outFn(consoleLog.bind(console));
- console.warn = outFn(consoleWarn.bind(console));
const helper = new DevUniqueHelper(new SilentLogger());
try {
@@ -45,8 +22,42 @@
}
finally {
await helper.disconnect();
- console.error = consoleErr;
- console.log = consoleLog;
- console.warn = consoleWarn;
+ silentConsole.disable();
}
};
+
+export enum Pallets {
+ Inflation = 'inflation',
+ RmrkCore = 'rmrkcore',
+ RmrkEquip = 'rmrkequip',
+ ReFungible = 'refungible',
+ Fungible = 'fungible',
+ NFT = 'nonfungible',
+ Scheduler = 'scheduler',
+}
+
+export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) {
+ const missingPallets = helper.fetchMissingPalletNames(requiredPallets);
+
+ if (missingPallets.length > 0) {
+ const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`;
+ console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg);
+ test.skip();
+ }
+}
+
+export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) {
+ (opts.only ? it.only :
+ opts.skip ? it.skip : it)(name, async function () {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ if (opts.requiredPallets) {
+ requirePalletsOrSkip(this, helper, opts.requiredPallets);
+ }
+
+ await cb({helper, privateKey});
+ });
+ });
+}
+itSub.only = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {only: true});
+itSub.skip = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {skip: true});
+itSub.ifWithPallets = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {requiredPallets: required});
tests/src/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -101,10 +101,27 @@
tokenId: number;
}
+export interface IBlock {
+ extrinsics: IExtrinsic[]
+ header: {
+ parentHash: string,
+ number: number,
+ };
+}
+
+export interface IExtrinsic {
+ isSigned: boolean,
+ method: {
+ method: string,
+ section: string,
+ args: any[]
+ }
+}
+
export interface ICollectionCreationOptions {
- name: string | number[];
- description: string | number[];
- tokenPrefix: string | number[];
+ name?: string | number[];
+ description?: string | number[];
+ tokenPrefix?: string | number[];
mode?: {
nft?: null;
refungible?: null;
@@ -123,8 +140,15 @@
tokenSymbol: string[]
}
+export interface ISubstrateBalance {
+ free: bigint,
+ reserved: bigint,
+ miscFrozen: bigint,
+ feeFrozen: bigint
+}
+
export type TSubstrateAccount = string;
export type TEthereumAccount = string;
export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';
export type TUniqueNetworks = 'opal' | 'quartz' | 'unique';
-export type TSigner = IKeyringPair; // | 'string'
\ No newline at end of file
+export type TSigner = IKeyringPair; // | 'string'
tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -5,22 +5,69 @@
import {UniqueHelper} from './unique';
import {ApiPromise, WsProvider} from '@polkadot/api';
import * as defs from '../../interfaces/definitions';
-import {TSigner} from './types';
import {IKeyringPair} from '@polkadot/types/types';
+export class SilentLogger {
+ log(_msg: any, _level: any): void { }
+ level = {
+ ERROR: 'ERROR' as const,
+ WARNING: 'WARNING' as const,
+ INFO: 'INFO' as const,
+ };
+}
+
+export class SilentConsole {
+ // TODO: Remove, this is temporary: Filter unneeded API output
+ // (Jaco promised it will be removed in the next version)
+ consoleErr: any;
+ consoleLog: any;
+ consoleWarn: any;
+
+ constructor() {
+ this.consoleErr = console.error;
+ this.consoleLog = console.log;
+ this.consoleWarn = console.warn;
+ }
+
+ enable() {
+ const outFn = (printer: any) => (...args: any[]) => {
+ for (const arg of args) {
+ if (typeof arg !== 'string')
+ continue;
+ if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis:') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure')
+ return;
+ }
+ printer(...args);
+ };
+
+ console.error = outFn(this.consoleErr.bind(console));
+ console.log = outFn(this.consoleLog.bind(console));
+ console.warn = outFn(this.consoleWarn.bind(console));
+ }
+
+ disable() {
+ console.error = this.consoleErr;
+ console.log = this.consoleLog;
+ console.warn = this.consoleWarn;
+ }
+}
+
+
export class DevUniqueHelper extends UniqueHelper {
/**
* Arrange methods for tests
*/
arrange: ArrangeGroup;
+ wait: WaitGroup;
constructor(logger: { log: (msg: any, level: any) => void, level: any }) {
super(logger);
this.arrange = new ArrangeGroup(this);
+ this.wait = new WaitGroup(this);
}
- async connect(wsEndpoint: string, listeners?: any): Promise<void> {
+ async connect(wsEndpoint: string, _listeners?: any): Promise<void> {
const wsProvider = new WsProvider(wsEndpoint);
this.api = new ApiPromise({
provider: wsProvider,
@@ -36,6 +83,7 @@
},
rpc: {
unique: defs.unique.rpc,
+ appPromotion: defs.appPromotion.rpc,
rmrk: defs.rmrk.rpc,
eth: {
feeHistory: {
@@ -72,20 +120,21 @@
*/
createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {
let nonce = await this.helper.chain.getNonce(donor.address);
+ const ss58Format = this.helper.chain.getChainProperties().ss58Format;
const tokenNominal = this.helper.balance.getOneTokenNominal();
const transactions = [];
const accounts: IKeyringPair[] = [];
for (const balance of balances) {
- const recepient = this.helper.util.fromSeed(mnemonicGenerate());
- accounts.push(recepient);
+ const recipient = this.helper.util.fromSeed(mnemonicGenerate(), ss58Format);
+ accounts.push(recipient);
if (balance !== 0n) {
- const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]);
+ const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]);
transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce}));
nonce++;
}
}
- await Promise.all(transactions).catch(e => {});
+ await Promise.all(transactions).catch(_e => {});
//#region TODO remove this region, when nonce problem will be solved
const checkBalances = async () => {
@@ -105,7 +154,7 @@
for (let index = 0; index < 5; index++) {
accountsCreated = await checkBalances();
if(accountsCreated) break;
- await this.waitNewBlocks(1);
+
}
if (!accountsCreated) throw Error('Accounts generation failed');
@@ -114,12 +163,86 @@
return accounts;
};
+ // TODO combine this method and createAccounts into one
+ createCrowd = async (accountsToCreate: number, withBalance: bigint, donor: IKeyringPair): Promise<IKeyringPair[]> => {
+ const createAsManyAsCan = async () => {
+ let transactions: any = [];
+ const accounts: IKeyringPair[] = [];
+ let nonce = await this.helper.chain.getNonce(donor.address);
+ const tokenNominal = this.helper.balance.getOneTokenNominal();
+ for (let i = 0; i < accountsToCreate; i++) {
+ if (i === 500) { // if there are too many accounts to create
+ await Promise.allSettled(transactions); // wait while first 500 (should be 100 for devnode) tx will be settled
+ transactions = []; //
+ nonce = await this.helper.chain.getNonce(donor.address); // update nonce
+ }
+ const recepient = this.helper.util.fromSeed(mnemonicGenerate());
+ accounts.push(recepient);
+ if (withBalance !== 0n) {
+ const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, withBalance * tokenNominal]);
+ transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ nonce++;
+ }
+ }
+
+ const fullfilledAccounts = [];
+ await Promise.allSettled(transactions);
+ for (const account of accounts) {
+ const accountBalance = await this.helper.balance.getSubstrate(account.address);
+ if (accountBalance === withBalance * tokenNominal) {
+ fullfilledAccounts.push(account);
+ }
+ }
+ return fullfilledAccounts;
+ };
+
+
+ const crowd: IKeyringPair[] = [];
+ // do up to 5 retries
+ for (let index = 0; index < 5 && accountsToCreate !== 0; index++) {
+ const asManyAsCan = await createAsManyAsCan();
+ crowd.push(...asManyAsCan);
+ accountsToCreate -= asManyAsCan.length;
+ }
+
+ if (accountsToCreate !== 0) throw Error(`Crowd generation failed: ${accountsToCreate} accounts left`);
+
+ return crowd;
+ };
+
+ isDevNode = async () => {
+ const block1 = await this.helper.api?.rpc.chain.getBlock(await this.helper.api?.rpc.chain.getBlockHash(1));
+ const block2 = await this.helper.api?.rpc.chain.getBlock(await this.helper.api?.rpc.chain.getBlockHash(2));
+ const findCreationDate = async (block: any) => {
+ const humanBlock = block.toHuman();
+ let date;
+ humanBlock.block.extrinsics.forEach((ext: any) => {
+ if(ext.method.section === 'timestamp') {
+ date = Number(ext.method.args.now.replaceAll(',', ''));
+ }
+ });
+ return date;
+ };
+ const block1date = await findCreationDate(block1);
+ const block2date = await findCreationDate(block2);
+ if(block2date! - block1date! < 9000) return true;
+ };
+}
+
+class WaitGroup {
+ helper: UniqueHelper;
+
+ constructor(helper: UniqueHelper) {
+ this.helper = helper;
+ }
+
/**
* Wait for specified bnumber of blocks
* @param blocksCount number of blocks to wait
* @returns
*/
- async waitNewBlocks(blocksCount = 1): Promise<void> {
+ async newBlocks(blocksCount = 1): Promise<void> {
+ // eslint-disable-next-line no-async-promise-executor
const promise = new Promise<void>(async (resolve) => {
const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => {
if (blocksCount > 0) {
@@ -132,4 +255,27 @@
});
return promise;
}
-}
\ No newline at end of file
+
+ async forParachainBlockNumber(blockNumber: bigint) {
+ return new Promise<void>(async (resolve) => {
+ const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(async (data: any) => {
+ if (data.number.toNumber() >= blockNumber) {
+ unsubscribe();
+ resolve();
+ }
+ });
+ });
+ }
+
+ async forRelayBlockNumber(blockNumber: bigint) {
+ return new Promise<void>(async (resolve) => {
+ const unsubscribe = await this.helper.api!.query.parachainSystem.validationData(async (data: any) => {
+ if (data.value.relayParentNumber.toNumber() >= blockNumber) {
+ // @ts-ignore
+ unsubscribe();
+ resolve();
+ }
+ });
+ });
+ }
+}
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -9,15 +9,14 @@
import {ApiInterfaceEvents} from '@polkadot/api/types';
import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';
import {IKeyringPair} from '@polkadot/types/types';
-import {IApiListeners, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';
+import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';
-const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => {
+export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => {
const address = {} as ICrossAccountId;
if(lowerAddress.substrate) address.Substrate = lowerAddress.substrate;
if(lowerAddress.ethereum) address.Ethereum = lowerAddress.ethereum;
return address;
};
-
const nesting = {
toChecksumAddress(address: string): string {
@@ -91,9 +90,9 @@
return encodeAddress(decodeAddress(address), ss58Format);
}
- static extractCollectionIdFromCreationResult(creationResult: ITransactionResult, label = 'new collection') {
+ static extractCollectionIdFromCreationResult(creationResult: ITransactionResult) {
if (creationResult.status !== this.transactionStatus.SUCCESS) {
- throw Error(`Unable to create collection for ${label}`);
+ throw Error('Unable to create collection!');
}
let collectionId = null;
@@ -104,15 +103,15 @@
});
if (collectionId === null) {
- throw Error(`No CollectionCreated event for ${label}`);
+ throw Error('No CollectionCreated event was found!');
}
return collectionId;
}
- static extractTokensFromCreationResult(creationResult: ITransactionResult, label = 'new tokens') {
+ static extractTokensFromCreationResult(creationResult: ITransactionResult) {
if (creationResult.status !== this.transactionStatus.SUCCESS) {
- throw Error(`Unable to create tokens for ${label}`);
+ throw Error('Unable to create tokens!');
}
let success = false;
const tokens = [] as any;
@@ -130,9 +129,9 @@
return {success, tokens};
}
- static extractTokensFromBurnResult(burnResult: ITransactionResult, label = 'burned tokens') {
+ static extractTokensFromBurnResult(burnResult: ITransactionResult) {
if (burnResult.status !== this.transactionStatus.SUCCESS) {
- throw Error(`Unable to burn tokens for ${label}`);
+ throw Error('Unable to burn tokens!');
}
let success = false;
const tokens = [] as any;
@@ -150,7 +149,7 @@
return {success, tokens};
}
- static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string, label?: string) {
+ static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) {
let eventId = null;
events.forEach(({event: {data, method, section}}) => {
if ((section === expectedSection) && (method === expectedMethod)) {
@@ -159,7 +158,7 @@
});
if (eventId === null) {
- throw Error(`No ${expectedMethod} event for ${label}`);
+ throw Error(`No ${expectedMethod} event was found!`);
}
return eventId === collectionId;
}
@@ -317,6 +316,7 @@
if(options !== null) return transaction.signAndSend(sender, options, callback);
return transaction.signAndSend(sender, callback);
};
+ // eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => {
try {
const unsub = await sign((result: any) => {
@@ -364,7 +364,7 @@
return call(...params);
}
- async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false, failureMessage='expected success') {
+ async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false/*, failureMessage='expected success'*/) {
if(this.api === null) throw Error('API not initialized');
if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`);
@@ -388,6 +388,7 @@
type: this.chainLogType.EXTRINSIC,
status: result.status,
call: extrinsic,
+ signer: this.getSignerAddress(sender),
params,
} as IUniqueHelperLog;
@@ -396,7 +397,7 @@
this.chainLog.push(log);
- if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(failureMessage);
+ if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(`${result.moduleError}`);
return result;
}
@@ -438,6 +439,16 @@
if(typeof signer === 'string') return signer;
return signer.address;
}
+
+ fetchAllPalletNames(): string[] {
+ if(this.api === null) throw Error('API not initialized');
+ return this.api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase());
+ }
+
+ fetchMissingPalletNames(requiredPallets: string[]): string[] {
+ const palletNames = this.fetchAllPalletNames();
+ return requiredPallets.filter(p => !palletNames.includes(p));
+ }
}
@@ -474,7 +485,9 @@
}
/**
- * Get information about the collection with additional data, including the number of tokens it contains, its administrators, the normalized address of the collection's owner, and decoded name and description.
+ * Get information about the collection with additional data,
+ * including the number of tokens it contains, its administrators,
+ * the normalized address of the collection's owner, and decoded name and description.
*
* @param collectionId ID of collection
* @example await getData(2)
@@ -502,42 +515,50 @@
collectionData[key] = this.helper.util.vec2str(humanCollection[key]);
}
- collectionData.tokensCount = (['RFT', 'NFT'].includes(humanCollection.mode)) ? await this.helper[humanCollection.mode.toLocaleLowerCase() as 'nft' | 'rft'].getLastTokenId(collectionId) : 0;
+ collectionData.tokensCount = (['RFT', 'NFT'].includes(humanCollection.mode))
+ ? await this.helper[humanCollection.mode.toLocaleLowerCase() as 'nft' | 'rft'].getLastTokenId(collectionId)
+ : 0;
collectionData.admins = await this.getAdmins(collectionId);
return collectionData;
}
/**
- * Get the normalized addresses of the collection's administrators.
+ * Get the addresses of the collection's administrators, optionally normalized.
*
* @param collectionId ID of collection
+ * @param normalize whether to normalize the addresses to the default ss58 format
* @example await getAdmins(1)
* @returns array of administrators
*/
- async getAdmins(collectionId: number): Promise<ICrossAccountId[]> {
- const normalized = [];
- for(const admin of (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman()) {
- if(admin.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(admin.Substrate)});
- else normalized.push(admin);
- }
- return normalized;
+ async getAdmins(collectionId: number, normalize = false): Promise<ICrossAccountId[]> {
+ const admins = (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman();
+
+ return normalize
+ ? admins.map((address: any) => {
+ return address.Substrate
+ ? {Substrate: this.helper.address.normalizeSubstrate(address.Substrate)}
+ : address;
+ })
+ : admins;
}
/**
- * Get the normalized addresses added to the collection allow-list.
+ * Get the addresses added to the collection allow-list, optionally normalized.
* @param collectionId ID of collection
+ * @param normalize whether to normalize the addresses to the default ss58 format
* @example await getAllowList(1)
* @returns array of allow-listed addresses
*/
- async getAllowList(collectionId: number): Promise<ICrossAccountId[]> {
- const normalized = [];
+ async getAllowList(collectionId: number, normalize = false): Promise<ICrossAccountId[]> {
const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman();
- for (const address of allowListed) {
- if (address.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(address.Substrate)});
- else normalized.push(address);
- }
- return normalized;
+ return normalize
+ ? allowListed.map((address: any) => {
+ return address.Substrate
+ ? {Substrate: this.helper.address.normalizeSubstrate(address.Substrate)}
+ : address;
+ })
+ : allowListed;
}
/**
@@ -556,40 +577,36 @@
*
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param label extra label for log
* @example await helper.collection.burn(aliceKeyring, 3);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async burn(signer: TSigner, collectionId: number, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async burn(signer: TSigner, collectionId: number): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.destroyCollection', [collectionId],
- true, `Unable to burn collection for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionDestroyed', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionDestroyed');
}
/**
- * Sets the sponsor for the collection (Requires the Substrate address).
+ * Sets the sponsor for the collection (Requires the Substrate address). Needs confirmation by the sponsor.
*
* @param signer keyring of signer
* @param collectionId ID of collection
* @param sponsorAddress Sponsor substrate address
- * @param label extra label for log
* @example setSponsor(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...")
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.setCollectionSponsor', [collectionId, sponsorAddress],
- true, `Unable to set collection sponsor for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorSet', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorSet');
}
/**
@@ -597,19 +614,35 @@
*
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param label extra label for log
* @example confirmSponsorship(aliceKeyring, 10)
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async confirmSponsorship(signer: TSigner, collectionId: number, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async confirmSponsorship(signer: TSigner, collectionId: number): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.confirmSponsorship', [collectionId],
- true, `Unable to confirm collection sponsorship for ${label}`,
+ true,
+ );
+
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed');
+ }
+
+ /**
+ * Removes the sponsor of a collection, regardless if it consented or not.
+ *
+ * @param signer keyring of signer
+ * @param collectionId ID of collection
+ * @example removeSponsor(aliceKeyring, 10)
+ * @returns ```true``` if extrinsic success, otherwise ```false```
+ */
+ async removeSponsor(signer: TSigner, collectionId: number): Promise<boolean> {
+ const result = await this.helper.executeExtrinsic(
+ signer,
+ 'api.tx.unique.removeCollectionSponsor', [collectionId],
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorRemoved');
}
/**
@@ -618,7 +651,6 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param limits collection limits object
- * @param label extra label for log
* @example
* await setLimits(
* aliceKeyring,
@@ -630,15 +662,14 @@
* )
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.setCollectionLimits', [collectionId, limits],
- true, `Unable to set collection limits for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionLimitSet', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionLimitSet');
}
/**
@@ -647,19 +678,17 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param ownerAddress substrate address of new owner
- * @param label extra label for log
* @example changeOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...")
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.changeCollectionOwner', [collectionId, ownerAddress],
- true, `Unable to change collection owner for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionOwnedChanged', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionOwnedChanged');
}
/**
@@ -668,80 +697,71 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param adminAddressObj Administrator address (substrate or ethereum)
- * @param label extra label for log
* @example addAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."})
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.addCollectionAdmin', [collectionId, adminAddressObj],
- true, `Unable to add collection admin for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded');
}
/**
- * Adds an address to allow list
+ * Removes a collection administrator.
+ *
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param addressObj address to add to the allow list
- * @param label extra label for log
+ * @param adminAddressObj Administrator address (substrate or ethereum)
+ * @example removeAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."})
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async addToAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
- 'api.tx.unique.addToAllowList', [collectionId, addressObj],
- true, `Unable to add address to allow list for ${label}`,
+ 'api.tx.unique.removeCollectionAdmin', [collectionId, adminAddressObj],
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressAdded');
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved');
}
/**
- * Removes an address from allow list.
- *
+ * Adds an address to allow list
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param addressObj address to be removed from allow list (substrate or ethereum)
- * @param label extra label for log
- * @example removeFromAllowList(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."})
+ * @param addressObj address to add to the allow list
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async removeFromAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async addToAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
- 'api.tx.unique.removeFromAllowList', [collectionId, addressObj],
- true, `Unable to remove address from allow list for ${label}`,
+ 'api.tx.unique.addToAllowList', [collectionId, addressObj],
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressRemoved', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressAdded');
}
/**
- * Removes a collection administrator.
+ * Removes an address from allow list
*
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param adminAddressObj Administrator address (substrate or ethereum)
- * @param label extra label for log
- * @example removeAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."})
+ * @param addressObj address to remove from the allow list
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async removeFromAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
- 'api.tx.unique.removeCollectionAdmin', [collectionId, adminAddressObj],
- true, `Unable to remove collection admin for ${label}`,
+ 'api.tx.unique.removeFromAllowList', [collectionId, addressObj],
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressRemoved');
}
/**
@@ -750,19 +770,17 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param permissions collection permissions object
- * @param label extra label for log
* @example setPermissions(aliceKeyring, 10, {access:'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true}});
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.setCollectionPermissions', [collectionId, permissions],
- true, `Unable to set collection permissions for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionPermissionSet', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionPermissionSet');
}
/**
@@ -771,12 +789,11 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param permissions nesting permissions object
- * @param label extra label for log
* @example enableNesting(aliceKeyring, 10, {collectionAdmin: true, tokenOwner: true});
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions, label?: string): Promise<boolean> {
- return await this.setPermissions(signer, collectionId, {nesting: permissions}, label);
+ async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions): Promise<boolean> {
+ return await this.setPermissions(signer, collectionId, {nesting: permissions});
}
/**
@@ -784,12 +801,11 @@
*
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param label extra label for log
* @example disableNesting(aliceKeyring, 10);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async disableNesting(signer: TSigner, collectionId: number, label?: string): Promise<boolean> {
- return await this.setPermissions(signer, collectionId, {nesting: {tokenOwner: false, collectionAdmin: false}}, label);
+ async disableNesting(signer: TSigner, collectionId: number): Promise<boolean> {
+ return await this.setPermissions(signer, collectionId, {nesting: {tokenOwner: false, collectionAdmin: false}});
}
/**
@@ -798,19 +814,17 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param properties array of property objects
- * @param label extra label for log
* @example setProperties(aliceKeyring, 10, [{key: "gender", value: "male"}]);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async setProperties(signer: TSigner, collectionId: number, properties: IProperty[], label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async setProperties(signer: TSigner, collectionId: number, properties: IProperty[]): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.setCollectionProperties', [collectionId, properties],
- true, `Unable to set collection properties for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet');
}
/**
@@ -819,19 +833,17 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param propertyKeys array of property keys to delete
- * @param label
* @example deleteProperties(aliceKeyring, 10, ["gender", "age"]);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[], label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[]): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.deleteCollectionProperties', [collectionId, propertyKeys],
- true, `Unable to delete collection properties for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted');
}
/**
@@ -849,7 +861,7 @@
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.transfer', [addressObj, collectionId, tokenId, amount],
- true, `Unable to transfer token #${tokenId} from collection #${collectionId}`,
+ true, // `Unable to transfer token #${tokenId} from collection #${collectionId}`,
);
return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, {Substrate: typeof signer === 'string' ? signer : signer.address}, addressObj, amount);
@@ -872,7 +884,7 @@
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.transferFrom', [fromAddressObj, toAddressObj, collectionId, tokenId, amount],
- true, `Unable to transfer token #${tokenId} from collection #${collectionId}`,
+ true, // `Unable to transfer token #${tokenId} from collection #${collectionId}`,
);
return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, fromAddressObj, toAddressObj, amount);
}
@@ -884,22 +896,20 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param label
* @param amount amount of tokens to be burned. For NFT must be set to 1n
* @example burnToken(aliceKeyring, 10, 5);
* @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null```
*/
- async burnToken(signer: TSigner, collectionId: number, tokenId: number, label?: string, amount=1n): Promise<{
+ async burnToken(signer: TSigner, collectionId: number, tokenId: number, amount=1n): Promise<{
success: boolean,
token: number | null
}> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
const burnResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.burnItem', [collectionId, tokenId, amount],
- true, `Unable to burn token for ${label}`,
+ true, // `Unable to burn token for ${label}`,
);
- const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label);
+ const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult);
if (burnedTokens.tokens.length > 1) throw Error('Burned multiple tokens');
return {success: burnedTokens.success, token: burnedTokens.tokens.length > 0 ? burnedTokens.tokens[0] : null};
}
@@ -911,19 +921,17 @@
* @param collectionId ID of collection
* @param fromAddressObj address on behalf of which the token will be burnt
* @param tokenId ID of token
- * @param label
* @param amount amount of tokens to be burned. For NFT must be set to 1n
* @example burnTokenFrom(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}, 5, {Ethereum: "0x9F0583DbB85..."})
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, label?: string, amount=1n): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, amount=1n): Promise<boolean> {
const burnResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.burnFrom', [collectionId, fromAddressObj, tokenId, amount],
- true, `Unable to burn token from for ${label}`,
+ true, // `Unable to burn token from for ${label}`,
);
- const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label);
+ const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult);
return burnedTokens.success && burnedTokens.tokens.length > 0;
}
@@ -933,28 +941,27 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param toAddressObj
- * @param label
+ * @param toAddressObj Substrate or Ethereum address which gets approved use of the signer's tokens
* @param amount amount of token to be approved. For NFT must be set to 1n
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount=1n) {
const approveResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.approve', [toAddressObj, collectionId, tokenId, amount],
- true, `Unable to approve token for ${label}`,
+ true, // `Unable to approve token for ${label}`,
);
- return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved', label);
+ return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved');
}
/**
- * Get the amount of token pieces approved to transfer
+ * Get the amount of token pieces approved to transfer or burn. Normally 0.
+ *
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param toAccountObj
- * @param fromAccountObj
+ * @param toAccountObj address which is approved to use token pieces
+ * @param fromAccountObj address which may have allowed the use of its owned tokens
* @example getTokenApprovedPieces(10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5ERZNF88Mm7UGfPP3mdG..."})
* @returns number of approved to transfer pieces
*/
@@ -963,7 +970,8 @@
}
/**
- * Get the last created token id
+ * Get the last created token ID in a collection
+ *
* @param collectionId ID of collection
* @example getLastTokenId(10);
* @returns id of the last created token
@@ -974,6 +982,7 @@
/**
* Check if token exists
+ *
* @param collectionId ID of collection
* @param tokenId ID of token
* @example isTokenExists(10, 20);
@@ -999,14 +1008,15 @@
/**
* Get token data
+ *
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param blockHashAt
- * @param propertyKeys
+ * @param propertyKeys optionally filter the token properties to only these keys
+ * @param blockHashAt optionally query the data at some block with this hash
* @example getToken(10, 5);
* @returns human readable token data
*/
- async getToken(collectionId: number, tokenId: number, blockHashAt?: string, propertyKeys?: string[]): Promise<{
+ async getToken(collectionId: number, tokenId: number, propertyKeys: string[] = [], blockHashAt?: string): Promise<{
properties: IProperty[];
owner: ICrossAccountId;
normalizedOwner: ICrossAccountId;
@@ -1016,7 +1026,7 @@
tokenData = await this.helper.callRpc('api.rpc.unique.tokenData', [collectionId, tokenId]);
}
else {
- if(typeof propertyKeys === 'undefined') {
+ if(propertyKeys.length == 0) {
const collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman();
if(!collection) return null;
propertyKeys = collection.tokenPropertyPermissions.map((x: ITokenPropertyPermission) => x.key);
@@ -1035,45 +1045,43 @@
/**
* Set permissions to change token properties
+ *
* @param signer keyring of signer
* @param collectionId ID of collection
* @param permissions permissions to change a property by the collection owner or admin
- * @param label
* @example setTokenPropertyPermissions(
* aliceKeyring, 10, [{key: "gender", permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}]
* )
* @returns true if extrinsic success otherwise false
*/
- async setTokenPropertyPermissions(signer: TSigner, collectionId: number, permissions: ITokenPropertyPermission[], label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async setTokenPropertyPermissions(signer: TSigner, collectionId: number, permissions: ITokenPropertyPermission[]): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.setTokenPropertyPermissions', [collectionId, permissions],
- true, `Unable to set token property permissions for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet');
}
/**
* Set token properties
+ *
* @param signer keyring of signer
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param properties
- * @param label
+ * @param properties key-value pairs of metadata which to add to a token. Keys must be permitted in the collection
* @example setTokenProperties(aliceKeyring, 10, 5, [{key: "gender", value: "female"}, {key: "age", value: "23"}])
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[], label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`;
+ async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[]): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.setTokenProperties', [collectionId, tokenId, properties],
- true, `Unable to set token properties for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet');
}
/**
@@ -1082,31 +1090,29 @@
* @param collectionId ID of collection
* @param tokenId ID of token
* @param propertyKeys property keys to be deleted
- * @param label
* @example deleteTokenProperties(aliceKeyring, 10, 5, ["gender", "age"])
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[], label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`;
+ async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[]): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.deleteTokenProperties', [collectionId, tokenId, propertyKeys],
- true, `Unable to delete token properties for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted', label);
+ return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted');
}
/**
* Mint new collection
+ *
* @param signer keyring of signer
* @param collectionOptions basic collection options and properties
* @param mode NFT or RFT type of a collection
- * @param errorLabel
* @example mintCollection(aliceKeyring, {name: 'New', description: "New collection", tokenPrefix: "NEW"}, "NFT")
* @returns object of the created collection
*/
- async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT', errorLabel = 'Unable to mint collection'): Promise<UniqueCollectionBase> {
+ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT'): Promise<UniqueCollectionBase> {
collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object
collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null};
for (const key of ['name', 'description', 'tokenPrefix']) {
@@ -1115,16 +1121,16 @@
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createCollectionEx', [collectionOptions],
- true, errorLabel,
+ true, // errorLabel,
);
- return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel));
+ return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult));
}
- getCollectionObject(collectionId: number): any {
+ getCollectionObject(_collectionId: number): any {
return null;
}
- getTokenObject(collectionId: number, tokenId: number): any {
+ getTokenObject(_collectionId: number, _tokenId: number): any {
return null;
}
}
@@ -1156,7 +1162,7 @@
* Get token's owner
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param blockHashAt
+ * @param blockHashAt optionally query the data at the block with this hash
* @example getTokenOwner(10, 5);
* @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."}
*/
@@ -1238,7 +1244,7 @@
* Get tokens nested in the provided token
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param blockHashAt
+ * @param blockHashAt optionally query the data at the block with this hash
* @example getTokenChildren(10, 5);
* @returns tokens whose depth of nesting is <= 5
*/
@@ -1260,15 +1266,14 @@
* @param signer keyring of signer
* @param tokenObj token to be nested
* @param rootTokenObj token to be parent
- * @param label
* @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4});
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, label='nest token'): Promise<boolean> {
+ async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken): Promise<boolean> {
const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)};
const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress);
if(!result) {
- throw Error(`Unable to nest token for ${label}`);
+ throw Error('Unable to nest token!');
}
return result;
}
@@ -1279,15 +1284,14 @@
* @param tokenObj token to unnest
* @param rootTokenObj parent of a token
* @param toAddressObj address of a new token owner
- * @param label
* @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."});
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId, label='unnest token'): Promise<boolean> {
+ async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId): Promise<boolean> {
const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)};
const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj);
if(!result) {
- throw Error(`Unable to unnest token for ${label}`);
+ throw Error('Unable to unnest token!');
}
return result;
}
@@ -1296,7 +1300,6 @@
* Mint new collection
* @param signer keyring of signer
* @param collectionOptions Collection options
- * @param label
* @example
* mintCollection(aliceKeyring, {
* name: 'New',
@@ -1305,19 +1308,17 @@
* })
* @returns object of the created collection
*/
- async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise<UniqueNFTCollection> {
- return await super.mintCollection(signer, collectionOptions, 'NFT', `Unable to mint NFT collection for ${label}`) as UniqueNFTCollection;
+ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions): Promise<UniqueNFTCollection> {
+ return await super.mintCollection(signer, collectionOptions, 'NFT') as UniqueNFTCollection;
}
/**
* Mint new token
* @param signer keyring of signer
* @param data token data
- * @param label
* @returns created token object
*/
- async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }, label?: string): Promise<UniqueNFTToken> {
- if(typeof label === 'undefined') label = `collection #${data.collectionId}`;
+ async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }): Promise<UniqueNFTToken> {
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, {
@@ -1325,9 +1326,9 @@
properties: data.properties,
},
}],
- true, `Unable to mint NFT token for ${label}`,
+ true,
);
- const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label);
+ const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult);
if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens');
if (createdTokens.tokens.length < 1) throw Error('No tokens minted');
return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId);
@@ -1338,7 +1339,6 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param tokens array of tokens with owner and properties
- * @param label
* @example
* mintMultipleTokens(aliceKeyring, 10, [{
* owner: {Substrate: "5DyN4Y92vZCjv38fg..."},
@@ -1349,15 +1349,14 @@
* }]);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string): Promise<UniqueNFTToken[]> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]): Promise<UniqueNFTToken[]> {
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createMultipleItemsEx', [collectionId, {NFT: tokens}],
- true, `Unable to mint NFT tokens for ${label}`,
+ true,
);
const collection = this.getCollectionObject(collectionId);
- return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
+ return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
}
/**
@@ -1366,7 +1365,6 @@
* @param collectionId ID of collection
* @param owner tokens owner
* @param tokens array of tokens with owner and properties
- * @param label
* @example
* mintMultipleTokensWithOneOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...", [{
* properties: [{
@@ -1379,8 +1377,7 @@
* }]);
* @returns array of newly created tokens
*/
- async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[], label?: string): Promise<UniqueNFTToken[]> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[]): Promise<UniqueNFTToken[]> {
const rawTokens = [];
for (const token of tokens) {
const raw = {NFT: {properties: token.properties}};
@@ -1389,23 +1386,10 @@
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens],
- true, `Unable to mint NFT tokens for ${label}`,
+ true,
);
const collection = this.getCollectionObject(collectionId);
- return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
- }
-
- /**
- * Destroys a concrete instance of NFT.
- * @param signer keyring of signer
- * @param collectionId ID of collection
- * @param tokenId ID of token
- * @param label
- * @example burnToken(aliceKeyring, 10, 5);
- * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null```
- */
- async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string): Promise<{ success: boolean; token: number | null; }> {
- return await super.burnToken(signer, collectionId, tokenId, label, 1n);
+ return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
}
/**
@@ -1415,12 +1399,11 @@
* @param collectionId ID of collection
* @param tokenId ID of token
* @param toAddressObj address to approve
- * @param label
* @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."})
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) {
- return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, amount);
+ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId) {
+ return super.approveToken(signer, collectionId, tokenId, toAddressObj, 1n);
}
}
@@ -1480,7 +1463,7 @@
* @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2000n)
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=100n): Promise<boolean> {
+ async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=1n): Promise<boolean> {
return await super.transferToken(signer, collectionId, tokenId, addressObj, amount);
}
@@ -1495,7 +1478,7 @@
* @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5DfhbVfww7ThF8q6f3i..."}, 2000n)
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n): Promise<boolean> {
+ async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n): Promise<boolean> {
return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount);
}
@@ -1503,7 +1486,6 @@
* Mint new collection
* @param signer keyring of signer
* @param collectionOptions Collection options
- * @param label
* @example
* mintCollection(aliceKeyring, {
* name: 'New',
@@ -1512,20 +1494,18 @@
* })
* @returns object of the created collection
*/
- async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise<UniqueRFTCollection> {
- return await super.mintCollection(signer, collectionOptions, 'RFT', `Unable to mint RFT collection for ${label}`) as UniqueRFTCollection;
+ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions): Promise<UniqueRFTCollection> {
+ return await super.mintCollection(signer, collectionOptions, 'RFT') as UniqueRFTCollection;
}
/**
* Mint new token
* @param signer keyring of signer
* @param data token data
- * @param label
* @example mintToken(aliceKeyring, {collectionId: 10, owner: {Substrate: '5GHoZe9c73RYbVzq...'}, pieces: 10000n});
* @returns created token object
*/
- async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }, label?: string): Promise<UniqueRFTToken> {
- if(typeof label === 'undefined') label = `collection #${data.collectionId}`;
+ async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }): Promise<UniqueRFTToken> {
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, {
@@ -1534,24 +1514,23 @@
properties: data.properties,
},
}],
- true, `Unable to mint RFT token for ${label}`,
+ true,
);
- const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label);
+ const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult);
if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens');
if (createdTokens.tokens.length < 1) throw Error('No tokens minted');
return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId);
}
- async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[], label?: string): Promise<UniqueRFTToken[]> {
+ async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]): Promise<UniqueRFTToken[]> {
throw Error('Not implemented');
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createMultipleItemsEx', [collectionId, {RefungibleMultipleOwners: tokens}],
- true, `Unable to mint RFT tokens for ${label}`,
+ true, // `Unable to mint RFT tokens for ${label}`,
);
const collection = this.getCollectionObject(collectionId);
- return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
+ return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
}
/**
@@ -1560,12 +1539,10 @@
* @param collectionId ID of collection
* @param owner tokens owner
* @param tokens array of tokens with properties and pieces
- * @param label
* @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]);
* @returns array of newly created RFT tokens
*/
- async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[], label?: string): Promise<UniqueRFTToken[]> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[]): Promise<UniqueRFTToken[]> {
const rawTokens = [];
for (const token of tokens) {
const raw = {ReFungible: {pieces: token.pieces, properties: token.properties}};
@@ -1574,10 +1551,10 @@
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens],
- true, `Unable to mint RFT tokens for ${label}`,
+ true,
);
const collection = this.getCollectionObject(collectionId);
- return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
+ return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
}
/**
@@ -1585,13 +1562,12 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param tokenId ID of token
- * @param label
* @param amount number of pieces to be burnt
* @example burnToken(aliceKeyring, 10, 5);
* @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null```
*/
- async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string, amount=100n): Promise<{ success: boolean; token: number | null; }> {
- return await super.burnToken(signer, collectionId, tokenId, label, amount);
+ async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount=1n): Promise<{ success: boolean; token: number | null; }> {
+ return await super.burnToken(signer, collectionId, tokenId, amount);
}
/**
@@ -1601,13 +1577,12 @@
* @param collectionId ID of collection
* @param tokenId ID of token
* @param toAddressObj address to approve
- * @param label
* @param amount number of pieces to be approved
* @example approveToken(aliceKeyring, 10, 5, {Substrate: "5GHoZe9c73RYbVzq..."}, "", 10000n);
* @returns true if the token success, otherwise false
*/
- async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=100n) {
- return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, amount);
+ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount=1n) {
+ return super.approveToken(signer, collectionId, tokenId, toAddressObj, amount);
}
/**
@@ -1627,20 +1602,18 @@
* @param collectionId ID of collection
* @param tokenId ID of token
* @param amount new number of pieces
- * @param label
* @example repartitionToken(aliceKeyring, 10, 5, 12345n);
* @returns true if the repartion was success, otherwise false
*/
- async repartitionToken(signer: TSigner, collectionId: number, tokenId: number, amount: bigint, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async repartitionToken(signer: TSigner, collectionId: number, tokenId: number, amount: bigint): Promise<boolean> {
const currentAmount = await this.getTokenTotalPieces(collectionId, tokenId);
const repartitionResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.repartition', [collectionId, tokenId, amount],
- true, `Unable to repartition RFT token for ${label}`,
+ true,
);
- if(currentAmount < amount) return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemCreated', label);
- return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemDestroyed', label);
+ if(currentAmount < amount) return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemCreated');
+ return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemDestroyed');
}
}
@@ -1661,7 +1634,6 @@
* @param signer keyring of signer
* @param collectionOptions Collection options
* @param decimalPoints number of token decimals
- * @param errorLabel
* @example
* mintCollection(aliceKeyring, {
* name: 'New',
@@ -1670,7 +1642,7 @@
* }, 18)
* @returns newly created fungible collection
*/
- async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0, errorLabel = 'Unable to mint collection'): Promise<UniqueFTCollection> {
+ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0): Promise<UniqueFTCollection> {
collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object
if(collectionOptions.tokenPropertyPermissions) throw Error('Fungible collections has no tokenPropertyPermissions');
collectionOptions.mode = {fungible: decimalPoints};
@@ -1680,9 +1652,9 @@
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createCollectionEx', [collectionOptions],
- true, errorLabel,
+ true,
);
- return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel));
+ return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult));
}
/**
@@ -1691,12 +1663,10 @@
* @param collectionId ID of collection
* @param owner address owner of new tokens
* @param amount amount of tokens to be meanted
- * @param label
* @example mintTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq"}, 1000n);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint, label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint): Promise<boolean> {
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createItem', [collectionId, (typeof owner === 'string') ? {Substrate: owner} : owner, {
@@ -1704,9 +1674,9 @@
value: amount,
},
}],
- true, `Unable to mint fungible tokens for ${label}`,
+ true, // `Unable to mint fungible tokens for ${label}`,
);
- return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label);
+ return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated');
}
/**
@@ -1715,11 +1685,9 @@
* @param collectionId ID of collection
* @param owner tokens owner
* @param tokens array of tokens with properties and pieces
- * @param label
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise<boolean> {
- if(typeof label === 'undefined') label = `collection #${collectionId}`;
+ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[]): Promise<boolean> {
const rawTokens = [];
for (const token of tokens) {
const raw = {Fungible: {Value: token.value}};
@@ -1728,9 +1696,9 @@
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens],
- true, `Unable to mint RFT tokens for ${label}`,
+ true,
);
- return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label);
+ return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated');
}
/**
@@ -1758,12 +1726,12 @@
* Transfer tokens to address
* @param signer keyring of signer
* @param collectionId ID of collection
- * @param toAddressObj address recepient
+ * @param toAddressObj address recipient
* @param amount amount of tokens to be sent
* @example transfer(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount: bigint) {
+ async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount=1n) {
return await super.transferToken(signer, collectionId, 0, toAddressObj, amount);
}
@@ -1777,7 +1745,7 @@
* @example transferFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, {Substrate: "5DfhbVfww7ThF8q6f3ij..."}, 10000n);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) {
+ async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
return await super.transferTokenFrom(signer, collectionId, 0, fromAddressObj, toAddressObj, amount);
}
@@ -1786,12 +1754,11 @@
* @param signer keyring of signer
* @param collectionId ID of collection
* @param amount amount of tokens to be destroyed
- * @param label
* @example burnTokens(aliceKeyring, 10, 1000n);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async burnTokens(signer: IKeyringPair, collectionId: number, amount=100n, label?: string): Promise<boolean> {
- return (await super.burnToken(signer, collectionId, 0, label, amount)).success;
+ async burnTokens(signer: IKeyringPair, collectionId: number, amount=1n): Promise<boolean> {
+ return (await super.burnToken(signer, collectionId, 0, amount)).success;
}
/**
@@ -1800,12 +1767,11 @@
* @param collectionId ID of collection
* @param fromAddressObj address on behalf of which tokens will be burnt
* @param amount amount of tokens to be burnt
- * @param label
* @example burnTokensFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=100n, label?: string): Promise<boolean> {
- return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, label, amount);
+ async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=1n): Promise<boolean> {
+ return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, amount);
}
/**
@@ -1824,12 +1790,11 @@
* @param collectionId ID of collection
* @param toAddressObj address to be approved
* @param amount amount of tokens to be approved
- * @param label
* @example approveTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n)
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) {
- return super.approveToken(signer, collectionId, 0, toAddressObj, label, amount);
+ async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=1n) {
+ return super.approveToken(signer, collectionId, 0, toAddressObj, amount);
}
/**
@@ -1881,6 +1846,13 @@
return blockHash;
}
+ // TODO add docs
+ async getBlock(blockHashOrNumber: string | number): Promise<IBlock | null> {
+ const blockHash = typeof blockHashOrNumber === 'string' ? blockHashOrNumber : await this.getBlockHashByNumber(blockHashOrNumber);
+ if (!blockHash) return null;
+ return (await this.helper.callRpc('api.rpc.chain.getBlock', [blockHash])).toHuman().block;
+ }
+
/**
* Get account nonce
* @param address substrate address
@@ -1915,6 +1887,16 @@
}
/**
+ * Get full substrate balance including free, miscFrozen, feeFrozen, and reserved
+ * @param address substrate address
+ * @returns
+ */
+ async getSubstrateFull(address: TSubstrateAccount): Promise<ISubstrateBalance> {
+ const accountInfo = (await this.helper.callRpc('api.query.system.account', [address])).data;
+ return {free: accountInfo.free.toBigInt(), miscFrozen: accountInfo.miscFrozen.toBigInt(), feeFrozen: accountInfo.feeFrozen.toBigInt(), reserved: accountInfo.reserved.toBigInt()};
+ }
+
+ /**
* Get ethereum address balance
* @param address ethereum address
* @example getEthereum("0x9F0583DbB855d...")
@@ -1927,13 +1909,13 @@
/**
* Transfer tokens to substrate address
* @param signer keyring of signer
- * @param address substrate address of a recepient
+ * @param address substrate address of a recipient
* @param amount amount of tokens to be transfered
* @example transferToSubstrate(aliceKeyring, "5GrwvaEF5zXb26Fz...", 100_000_000_000n);
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise<boolean> {
- const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`);
+ const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true/*, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`*/);
let transfer = {from: null, to: null, amount: 0n} as any;
result.result.events.forEach(({event: {data, method, section}}) => {
@@ -2000,7 +1982,59 @@
}
}
+class StakingGroup extends HelperGroup {
+ /**
+ * Stake tokens for App Promotion
+ * @param signer keyring of signer
+ * @param amountToStake amount of tokens to stake
+ * @param label extra label for log
+ * @returns
+ */
+ async stake(signer: TSigner, amountToStake: bigint, label?: string): Promise<boolean> {
+ if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`;
+ const stakeResult = await this.helper.executeExtrinsic(
+ signer, 'api.tx.appPromotion.stake',
+ [amountToStake], true,
+ );
+ // TODO extract info from stakeResult
+ return true;
+ }
+ /**
+ * Unstake tokens for App Promotion
+ * @param signer keyring of signer
+ * @param amountToUnstake amount of tokens to unstake
+ * @param label extra label for log
+ * @returns block number where balances will be unlocked
+ */
+ async unstake(signer: TSigner, label?: string): Promise<number> {
+ if(typeof label === 'undefined') label = `${signer.address}`;
+ const unstakeResult = await this.helper.executeExtrinsic(
+ signer, 'api.tx.appPromotion.unstake',
+ [], true,
+ );
+ // TODO extract block number fron events
+ return 1;
+ }
+
+ async getTotalStaked(address?: ICrossAccountId): Promise<bigint> {
+ if (address) return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked', [address])).toBigInt();
+ return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt();
+ }
+
+ async getTotalStakedPerBlock(address: ICrossAccountId): Promise<bigint[][]> {
+ return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ }
+
+ async getPendingUnstake(address: ICrossAccountId): Promise<bigint> {
+ return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstake', [address])).toBigInt();
+ }
+
+ async getPendingUnstakePerBlock(address: ICrossAccountId): Promise<bigint[][]> {
+ return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ }
+}
+
export class UniqueHelper extends ChainHelperBase {
chain: ChainGroup;
balance: BalanceGroup;
@@ -2009,6 +2043,7 @@
nft: NFTGroup;
rft: RFTGroup;
ft: FTGroup;
+ staking: StakingGroup;
constructor(logger?: ILogger) {
super(logger);
@@ -2019,6 +2054,7 @@
this.nft = new NFTGroup(this);
this.rft = new RFTGroup(this);
this.ft = new FTGroup(this);
+ this.staking = new StakingGroup(this);
}
}
@@ -2056,64 +2092,72 @@
return await this.helper.collection.getEffectiveLimits(this.collectionId);
}
- async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount, label?: string) {
- return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress, label);
+ async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount) {
+ return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress);
}
- async confirmSponsorship(signer: TSigner, label?: string) {
- return await this.helper.collection.confirmSponsorship(signer, this.collectionId, label);
+ async confirmSponsorship(signer: TSigner) {
+ return await this.helper.collection.confirmSponsorship(signer, this.collectionId);
}
- async setLimits(signer: TSigner, limits: ICollectionLimits, label?: string) {
- return await this.helper.collection.setLimits(signer, this.collectionId, limits, label);
+ async removeSponsor(signer: TSigner) {
+ return await this.helper.collection.removeSponsor(signer, this.collectionId);
}
- async changeOwner(signer: TSigner, ownerAddress: TSubstrateAccount, label?: string) {
- return await this.helper.collection.changeOwner(signer, this.collectionId, ownerAddress, label);
+ async setLimits(signer: TSigner, limits: ICollectionLimits) {
+ return await this.helper.collection.setLimits(signer, this.collectionId, limits);
+ }
+
+ async changeOwner(signer: TSigner, ownerAddress: TSubstrateAccount) {
+ return await this.helper.collection.changeOwner(signer, this.collectionId, ownerAddress);
+ }
+
+ async addAdmin(signer: TSigner, adminAddressObj: ICrossAccountId) {
+ return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj);
}
- async addAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) {
- return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj, label);
+ async enableCertainPermissions(signer: TSigner, accessMode: 'AllowList' | 'Normal' | undefined = 'AllowList', mintMode: boolean | undefined = true) {
+ return await this.setPermissions(signer, {access: accessMode, mintMode: mintMode});
}
- async addToAllowList(signer: TSigner, addressObj: ICrossAccountId, label?: string) {
- return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj, label);
+ async addToAllowList(signer: TSigner, addressObj: ICrossAccountId) {
+ return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj);
}
- async removeFromAllowList(signer: TSigner, addressObj: ICrossAccountId, label?: string) {
- return await this.helper.collection.removeFromAllowList(signer, this.collectionId, addressObj, label);
+ async removeFromAllowList(signer: TSigner, addressObj: ICrossAccountId) {
+ return await this.helper.collection.removeFromAllowList(signer, this.collectionId, addressObj);
}
- async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) {
- return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj, label);
+ async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId) {
+ return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj);
}
- async setProperties(signer: TSigner, properties: IProperty[], label?: string) {
- return await this.helper.collection.setProperties(signer, this.collectionId, properties, label);
+ async setProperties(signer: TSigner, properties: IProperty[]) {
+ return await this.helper.collection.setProperties(signer, this.collectionId, properties);
}
- async deleteProperties(signer: TSigner, propertyKeys: string[], label?: string) {
- return await this.helper.collection.deleteProperties(signer, this.collectionId, propertyKeys, label);
+ async deleteProperties(signer: TSigner, propertyKeys: string[]) {
+ return await this.helper.collection.deleteProperties(signer, this.collectionId, propertyKeys);
}
async getTokenNextSponsored(tokenId: number, addressObj: ICrossAccountId) {
return await this.helper.collection.getTokenNextSponsored(this.collectionId, tokenId, addressObj);
}
- async setPermissions(signer: TSigner, permissions: ICollectionPermissions, label?: string) {
- return await this.helper.collection.setPermissions(signer, this.collectionId, permissions, label);
+ async setPermissions(signer: TSigner, permissions: ICollectionPermissions) {
+ return await this.helper.collection.setPermissions(signer, this.collectionId, permissions);
}
- async enableNesting(signer: TSigner, permissions: INestingPermissions, label?: string) {
- return await this.helper.collection.enableNesting(signer, this.collectionId, permissions, label);
+ async enableNesting(signer: TSigner, permissions: INestingPermissions) {
+ return await this.helper.collection.enableNesting(signer, this.collectionId, permissions);
}
- async disableNesting(signer: TSigner, label?: string) {
- return await this.helper.collection.disableNesting(signer, this.collectionId, label);
+ async disableNesting(signer: TSigner) {
+ return await this.helper.collection.disableNesting(signer, this.collectionId);
}
- async burn(signer: TSigner, label?: string) {
- return await this.helper.collection.burn(signer, this.collectionId, label);
+ async burn(signer: TSigner) {
+ return await this.helper.collection.burn(signer, this.collectionId);
}
}
@@ -2128,7 +2172,7 @@
}
async getToken(tokenId: number, blockHashAt?: string) {
- return await this.helper.nft.getToken(this.collectionId, tokenId, blockHashAt);
+ return await this.helper.nft.getToken(this.collectionId, tokenId, [], blockHashAt);
}
async getTokenOwner(tokenId: number, blockHashAt?: string) {
@@ -2151,44 +2195,44 @@
return await this.helper.nft.transferTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, toAddressObj);
}
- async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, label?: string) {
- return await this.helper.nft.approveToken(signer, this.collectionId, tokenId, toAddressObj, label);
+ async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId) {
+ return await this.helper.nft.approveToken(signer, this.collectionId, tokenId, toAddressObj);
}
async isTokenApproved(tokenId: number, toAddressObj: ICrossAccountId) {
return await this.helper.nft.isTokenApproved(this.collectionId, tokenId, toAddressObj);
}
- async mintToken(signer: TSigner, owner: ICrossAccountId, properties?: IProperty[], label?: string) {
- return await this.helper.nft.mintToken(signer, {collectionId: this.collectionId, owner, properties}, label);
+ async mintToken(signer: TSigner, owner: ICrossAccountId, properties?: IProperty[]) {
+ return await this.helper.nft.mintToken(signer, {collectionId: this.collectionId, owner, properties});
}
- async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string) {
- return await this.helper.nft.mintMultipleTokens(signer, this.collectionId, tokens, label);
+ async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]) {
+ return await this.helper.nft.mintMultipleTokens(signer, this.collectionId, tokens);
}
- async burnToken(signer: TSigner, tokenId: number, label?: string) {
- return await this.helper.nft.burnToken(signer, this.collectionId, tokenId, label);
+ async burnToken(signer: TSigner, tokenId: number) {
+ return await this.helper.nft.burnToken(signer, this.collectionId, tokenId);
}
- async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[], label?: string) {
- return await this.helper.nft.setTokenProperties(signer, this.collectionId, tokenId, properties, label);
+ async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[]) {
+ return await this.helper.nft.setTokenProperties(signer, this.collectionId, tokenId, properties);
}
- async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[], label?: string) {
- return await this.helper.nft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys, label);
+ async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[]) {
+ return await this.helper.nft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys);
}
- async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[], label?: string) {
- return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions, label);
+ async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[]) {
+ return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions);
}
- async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken, label?: string) {
- return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj, label);
+ async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken) {
+ return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj);
}
- async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId, label?: string) {
- return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj, label);
+ async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId) {
+ return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj);
}
}
@@ -2214,59 +2258,59 @@
return await this.helper.rft.getTokenTotalPieces(this.collectionId, tokenId);
}
- async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount=100n) {
+ async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount=1n) {
return await this.helper.rft.transferToken(signer, this.collectionId, tokenId, addressObj, amount);
}
- async transferTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n) {
+ async transferTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
return await this.helper.rft.transferTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, toAddressObj, amount);
}
- async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) {
- return await this.helper.rft.approveToken(signer, this.collectionId, tokenId, toAddressObj, label, amount);
+ async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount=1n) {
+ return await this.helper.rft.approveToken(signer, this.collectionId, tokenId, toAddressObj, amount);
}
async getTokenApprovedPieces(tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) {
return await this.helper.rft.getTokenApprovedPieces(this.collectionId, tokenId, toAddressObj, fromAddressObj);
}
- async repartitionToken(signer: TSigner, tokenId: number, amount: bigint, label?: string) {
- return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount, label);
+ async repartitionToken(signer: TSigner, tokenId: number, amount: bigint) {
+ return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount);
}
- async mintToken(signer: TSigner, owner: ICrossAccountId, pieces=100n, properties?: IProperty[], label?: string) {
- return await this.helper.rft.mintToken(signer, {collectionId: this.collectionId, owner, pieces, properties}, label);
+ async mintToken(signer: TSigner, owner: ICrossAccountId, pieces=100n, properties?: IProperty[]) {
+ return await this.helper.rft.mintToken(signer, {collectionId: this.collectionId, owner, pieces, properties});
}
- async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[], label?: string) {
- return await this.helper.rft.mintMultipleTokens(signer, this.collectionId, tokens, label);
+ async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]) {
+ return await this.helper.rft.mintMultipleTokens(signer, this.collectionId, tokens);
}
- async burnToken(signer: TSigner, tokenId: number, amount=100n, label?: string) {
- return await this.helper.rft.burnToken(signer, this.collectionId, tokenId, label, amount);
+ async burnToken(signer: TSigner, tokenId: number, amount=1n) {
+ return await this.helper.rft.burnToken(signer, this.collectionId, tokenId, amount);
}
- async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[], label?: string) {
- return await this.helper.rft.setTokenProperties(signer, this.collectionId, tokenId, properties, label);
+ async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[]) {
+ return await this.helper.rft.setTokenProperties(signer, this.collectionId, tokenId, properties);
}
- async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[], label?: string) {
- return await this.helper.rft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys, label);
+ async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[]) {
+ return await this.helper.rft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys);
}
- async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[], label?: string) {
- return await this.helper.rft.setTokenPropertyPermissions(signer, this.collectionId, permissions, label);
+ async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[]) {
+ return await this.helper.rft.setTokenPropertyPermissions(signer, this.collectionId, permissions);
}
}
class UniqueFTCollection extends UniqueCollectionBase {
- async mint(signer: TSigner, owner: ICrossAccountId, amount: bigint, label?: string) {
- return await this.helper.ft.mintTokens(signer, this.collectionId, owner, amount, label);
+ async mint(signer: TSigner, owner: ICrossAccountId, amount: bigint) {
+ return await this.helper.ft.mintTokens(signer, this.collectionId, owner, amount);
}
- async mintWithOneOwner(signer: TSigner, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string) {
- return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, owner, tokens, label);
+ async mintWithOneOwner(signer: TSigner, owner: ICrossAccountId, tokens: {value: bigint}[]) {
+ return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, owner, tokens);
}
async getBalance(addressObj: ICrossAccountId) {
@@ -2277,28 +2321,28 @@
return await this.helper.ft.getTop10Owners(this.collectionId);
}
- async transfer(signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) {
+ async transfer(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) {
return await this.helper.ft.transfer(signer, this.collectionId, toAddressObj, amount);
}
- async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) {
+ async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
return await this.helper.ft.transferFrom(signer, this.collectionId, fromAddressObj, toAddressObj, amount);
}
- async burnTokens(signer: TSigner, amount: bigint, label?: string) {
- return await this.helper.ft.burnTokens(signer, this.collectionId, amount, label);
+ async burnTokens(signer: TSigner, amount=1n) {
+ return await this.helper.ft.burnTokens(signer, this.collectionId, amount);
}
- async burnTokensFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint, label?: string) {
- return await this.helper.ft.burnTokensFrom(signer, this.collectionId, fromAddressObj, amount, label);
+ async burnTokensFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount=1n) {
+ return await this.helper.ft.burnTokensFrom(signer, this.collectionId, fromAddressObj, amount);
}
async getTotalPieces() {
return await this.helper.ft.getTotalPieces(this.collectionId);
}
- async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=100n, label?: string) {
- return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount, label);
+ async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) {
+ return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount);
}
async getApprovedTokens(fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) {
@@ -2322,12 +2366,12 @@
return await this.collection.getTokenNextSponsored(this.tokenId, addressObj);
}
- async setProperties(signer: TSigner, properties: IProperty[], label?: string) {
- return await this.collection.setTokenProperties(signer, this.tokenId, properties, label);
+ async setProperties(signer: TSigner, properties: IProperty[]) {
+ return await this.collection.setTokenProperties(signer, this.tokenId, properties);
}
- async deleteProperties(signer: TSigner, propertyKeys: string[], label?: string) {
- return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys, label);
+ async deleteProperties(signer: TSigner, propertyKeys: string[]) {
+ return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys);
}
}
@@ -2356,12 +2400,12 @@
return await this.collection.getTokenChildren(this.tokenId, blockHashAt);
}
- async nest(signer: TSigner, toTokenObj: IToken, label?: string) {
- return await this.collection.nestToken(signer, this.tokenId, toTokenObj, label);
+ async nest(signer: TSigner, toTokenObj: IToken) {
+ return await this.collection.nestToken(signer, this.tokenId, toTokenObj);
}
- async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId, label?: string) {
- return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj, label);
+ async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId) {
+ return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj);
}
async transfer(signer: TSigner, addressObj: ICrossAccountId) {
@@ -2372,16 +2416,16 @@
return await this.collection.transferTokenFrom(signer, this.tokenId, fromAddressObj, toAddressObj);
}
- async approve(signer: TSigner, toAddressObj: ICrossAccountId, label?: string) {
- return await this.collection.approveToken(signer, this.tokenId, toAddressObj, label);
+ async approve(signer: TSigner, toAddressObj: ICrossAccountId) {
+ return await this.collection.approveToken(signer, this.tokenId, toAddressObj);
}
async isApproved(toAddressObj: ICrossAccountId) {
return await this.collection.isTokenApproved(this.tokenId, toAddressObj);
}
- async burn(signer: TSigner, label?: string) {
- return await this.collection.burnToken(signer, this.tokenId, label);
+ async burn(signer: TSigner) {
+ return await this.collection.burnToken(signer, this.tokenId);
}
}
@@ -2405,27 +2449,27 @@
return await this.collection.getTokenTotalPieces(this.tokenId);
}
- async transfer(signer: TSigner, addressObj: ICrossAccountId, amount=100n) {
+ async transfer(signer: TSigner, addressObj: ICrossAccountId, amount=1n) {
return await this.collection.transferToken(signer, this.tokenId, addressObj, amount);
}
- async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n) {
+ async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
return await this.collection.transferTokenFrom(signer, this.tokenId, fromAddressObj, toAddressObj, amount);
}
- async approve(signer: TSigner, toAddressObj: ICrossAccountId, amount=100n, label?: string) {
- return await this.collection.approveToken(signer, this.tokenId, toAddressObj, amount, label);
+ async approve(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) {
+ return await this.collection.approveToken(signer, this.tokenId, toAddressObj, amount);
}
async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) {
return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj);
}
- async repartition(signer: TSigner, amount: bigint, label?: string) {
- return await this.collection.repartitionToken(signer, this.tokenId, amount, label);
+ async repartition(signer: TSigner, amount: bigint) {
+ return await this.collection.repartitionToken(signer, this.tokenId, amount);
}
- async burn(signer: TSigner, amount=100n, label?: string) {
- return await this.collection.burnToken(signer, this.tokenId, amount, label);
+ async burn(signer: TSigner, amount=1n) {
+ return await this.collection.burnToken(signer, this.tokenId, amount);
}
}