difftreelog
feat eth all-in-one create_collection (#971)
in: master
* feat: setNesting api change * fix: change restricted collections to addresses instead of ids * feat: all in one create collection method * fix: code review requests * feat: use struct for create_collection flags * fix: update evm-coder dependency * fix: code review requests * fix: change pending_sponsor to optional cross address * feat: forbid user from using flags * refactor: deduplicate CollectionFlags struct * fix: eth CollectionMode should be NFT * style: fix clippy warning * fix: disable eth create_collection ---------
67 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2646,8 +2646,8 @@
[[package]]
name = "evm-coder"
-version = "0.3.1"
-source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.1#21e61c627f71337d6b8a03899fe8de14bfbf67aa"
+version = "0.3.6"
+source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.6#be59ae41a5d2ec9389bae22d54f81122b6ba55a4"
dependencies = [
"ethereum",
"evm-coder-procedural",
@@ -2658,8 +2658,8 @@
[[package]]
name = "evm-coder-procedural"
-version = "0.3.1"
-source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.1#21e61c627f71337d6b8a03899fe8de14bfbf67aa"
+version = "0.3.6"
+source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.6#be59ae41a5d2ec9389bae22d54f81122b6ba55a4"
dependencies = [
"Inflector",
"hex",
@@ -6489,6 +6489,7 @@
name = "pallet-common"
version = "0.1.14"
dependencies = [
+ "bondrewd",
"ethereum",
"evm-coder",
"frame-benchmarking",
@@ -7530,6 +7531,7 @@
"frame-benchmarking",
"frame-support",
"frame-system",
+ "log",
"pallet-balances-adapter",
"pallet-common",
"pallet-evm",
@@ -14097,6 +14099,7 @@
dependencies = [
"bondrewd",
"derivative",
+ "evm-coder",
"frame-support",
"pallet-evm",
"parity-scale-codec",
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,7 +27,7 @@
[workspace.dependencies]
# Unique
app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false }
-evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.1", default-features = false }
+evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.6", default-features = false, features = ['bondrewd'] }
pallet-app-promotion = { path = "pallets/app-promotion", default-features = false }
pallet-balances-adapter = { default-features = false, path = "pallets/balances-adapter" }
pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.43" }
pallets/common/Cargo.tomldiffbeforeafterboth--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -10,6 +10,7 @@
scale-info = { workspace = true }
+bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
ethereum = { workspace = true }
evm-coder = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }
pallets/common/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/common/src/benchmarking.rs
+++ b/pallets/common/src/benchmarking.rs
@@ -21,10 +21,9 @@
use pallet_evm::account::CrossAccountId;
use frame_benchmarking::{benchmarks, account};
use up_data_structs::{
- CollectionMode, CollectionFlags, CreateCollectionData, CollectionId, Property, PropertyKey,
- PropertyValue, CollectionPermissions, NestingPermissions, AccessMode,
- MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH,
- MAX_PROPERTIES_PER_ITEM,
+ CollectionMode, CreateCollectionData, CollectionId, Property, PropertyKey, PropertyValue,
+ CollectionPermissions, NestingPermissions, AccessMode, MAX_COLLECTION_NAME_LENGTH,
+ MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, MAX_PROPERTIES_PER_ITEM,
};
use frame_support::{
traits::{Get, fungible::Balanced, Imbalance, tokens::Precision},
@@ -47,12 +46,7 @@
.unwrap()
}
pub fn create_var_data<const S: u32>(size: u32) -> BoundedVec<u8, ConstU32<S>> {
- assert!(
- size <= S,
- "size ({}) should be less within bound ({})",
- size,
- S
- );
+ assert!(size <= S, "size ({size}) should be less within bound ({S})",);
(0..size)
.map(|v| (v & 0xff) as u8)
.collect::<Vec<_>>()
@@ -81,7 +75,7 @@
mode: CollectionMode,
handler: impl FnOnce(
T::CrossAccountId,
- CreateCollectionData<T::AccountId>,
+ CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError>,
cast: impl FnOnce(CollectionHandle<T>) -> R,
) -> Result<R, DispatchError> {
@@ -124,9 +118,7 @@
create_collection_raw(
owner,
CollectionMode::NFT,
- |owner: T::CrossAccountId, data| {
- <Pallet<T>>::init_collection(owner.clone(), owner, data, CollectionFlags::default())
- },
+ |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
|h| h,
)
}
pallets/common/src/dispatch.rsdiffbeforeafterboth--- a/pallets/common/src/dispatch.rs
+++ b/pallets/common/src/dispatch.rs
@@ -9,7 +9,7 @@
traits::Get,
};
use sp_runtime::DispatchError;
-use up_data_structs::{CollectionId, CreateCollectionData, CollectionFlags};
+use up_data_structs::{CollectionId, CreateCollectionData};
use crate::{pallet::Config, CommonCollectionOperations};
@@ -76,8 +76,7 @@
fn create(
sender: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
- flags: CollectionFlags,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError>;
/// Delete the collection.
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -402,10 +402,44 @@
Ok(())
}
+ #[solidity(rename_selector = "setCollectionNesting")]
+ fn set_nesting(
+ &mut self,
+ caller: Caller,
+ collection_nesting_and_permissions: eth::CollectionNestingAndPermission,
+ ) -> Result<()> {
+ self.consume_store_reads_and_writes(1, 1)?;
+
+ let caller = T::CrossAccountId::from_eth(caller);
+
+ let mut permissions = self.collection.permissions.clone();
+ let mut nesting = permissions.nesting().clone();
+
+ let bv = if !collection_nesting_and_permissions.restricted.is_empty() {
+ let mut bv = OwnerRestrictedSet::new();
+ for address in collection_nesting_and_permissions.restricted.iter() {
+ bv.try_insert(crate::eth::map_eth_to_id(address).ok_or_else(|| {
+ Error::Revert("Can't convert address into collection id".into())
+ })?)
+ .map_err(|_| "too many collections")?;
+ }
+ Some(bv)
+ } else {
+ None
+ };
+
+ nesting.token_owner = collection_nesting_and_permissions.token_owner;
+ nesting.collection_admin = collection_nesting_and_permissions.collection_admin;
+ nesting.restricted = bv;
+ permissions.nesting = Some(nesting);
+
+ <Pallet<T>>::update_permissions(&caller, self, permissions).map_err(dispatch_to_evm::<T>)
+ }
+
/// Toggle accessibility of collection nesting.
///
/// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- #[solidity(rename_selector = "setCollectionNesting")]
+ #[solidity(hide, rename_selector = "setCollectionNesting")]
fn set_nesting_bool(&mut self, caller: Caller, enable: bool) -> Result<()> {
self.consume_store_reads_and_writes(1, 1)?;
@@ -424,8 +458,8 @@
///
/// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
/// @param collections Addresses of collections that will be available for nesting.
- #[solidity(rename_selector = "setCollectionNesting")]
- fn set_nesting(
+ #[solidity(hide, rename_selector = "setCollectionNesting")]
+ fn set_nesting_collection_ids(
&mut self,
caller: Caller,
enable: bool,
@@ -464,8 +498,28 @@
<Pallet<T>>::update_permissions(&caller, self, permissions).map_err(dispatch_to_evm::<T>)
}
+ #[solidity(rename_selector = "collectionNesting")]
+ fn collection_nesting(&self) -> Result<eth::CollectionNestingAndPermission> {
+ let nesting = self.collection.permissions.nesting();
+
+ Ok(eth::CollectionNestingAndPermission::new(
+ nesting.token_owner,
+ nesting.collection_admin,
+ nesting
+ .restricted
+ .clone()
+ .map(|b| {
+ b.0.into_inner()
+ .iter()
+ .map(|id| crate::eth::collection_id_to_address(id.0.into()))
+ .collect()
+ })
+ .unwrap_or_default(),
+ ))
+ }
+
/// Returns nesting for a collection
- #[solidity(rename_selector = "collectionNestingRestrictedCollectionIds")]
+ #[solidity(hide, rename_selector = "collectionNestingRestrictedCollectionIds")]
fn collection_nesting_restricted_ids(&self) -> Result<eth::CollectionNesting> {
let nesting = self.collection.permissions.nesting();
@@ -480,6 +534,7 @@
}
/// Returns permissions for a collection
+ #[solidity(hide)]
fn collection_nesting_permissions(&self) -> Result<Vec<eth::CollectionNestingPermission>> {
let nesting = self.collection.permissions.nesting();
Ok(vec![
pallets/common/src/eth.rsdiffbeforeafterboth--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -24,7 +24,8 @@
};
pub use pallet_evm::{Config, account::CrossAccountId};
use sp_core::{H160, U256};
-use up_data_structs::CollectionId;
+use up_data_structs::{CollectionId, CollectionFlags};
+use pallet_evm_coder_substrate::execution::Error;
// 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 1
// TODO: Unhardcode prefix
@@ -104,10 +105,26 @@
sub: Default::default(),
}
}
+
+ /// Converts [`CrossAddress`] to `Option<CrossAccountId>`.
+ pub fn into_option_sub_cross_account<T>(&self) -> Result<Option<T::CrossAccountId>, Error>
+ where
+ T: pallet_evm::Config,
+ T::AccountId: From<[u8; 32]>,
+ {
+ if self.eth == Default::default() && self.sub == Default::default() {
+ Ok(None)
+ } else if self.eth == Default::default() {
+ Ok(Some(convert_uint256_to_cross_account::<T>(self.sub)))
+ } else if self.sub == Default::default() {
+ Ok(Some(T::CrossAccountId::from_eth(self.eth)))
+ } else {
+ Err(format!("All fields of cross account is non zeroed {:?}", self).into())
+ }
+ }
+
/// Converts [`CrossAddress`] to `CrossAccountId`.
- pub fn into_sub_cross_account<T>(
- &self,
- ) -> pallet_evm_coder_substrate::execution::Result<T::CrossAccountId>
+ pub fn into_sub_cross_account<T>(&self) -> Result<T::CrossAccountId, Error>
where
T: pallet_evm::Config,
T::AccountId: From<[u8; 32]>,
@@ -124,6 +141,19 @@
}
}
+/// Type of tokens in collection
+#[derive(AbiCoder, Copy, Clone, Default, Debug, PartialEq)]
+#[repr(u8)]
+pub enum CollectionMode {
+ /// Nonfungible
+ #[default]
+ Nonfungible,
+ /// Fungible
+ Fungible,
+ /// Refungible
+ Refungible,
+}
+
/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).
#[derive(Debug, Default, AbiCoder)]
pub struct Property {
@@ -144,7 +174,7 @@
}
impl TryFrom<up_data_structs::Property> for Property {
- type Error = pallet_evm_coder_substrate::execution::Error;
+ type Error = Error;
fn try_from(from: up_data_structs::Property) -> Result<Self, Self::Error> {
let key = evm_coder::types::String::from_utf8(from.key.into())
@@ -155,7 +185,7 @@
}
impl TryInto<up_data_structs::Property> for Property {
- type Error = pallet_evm_coder_substrate::execution::Error;
+ type Error = Error;
fn try_into(self) -> Result<up_data_structs::Property, Self::Error> {
let key = <Vec<u8>>::from(self.key)
@@ -220,17 +250,14 @@
pub fn has_value(&self) -> bool {
self.value.is_some()
}
-}
-impl TryInto<up_data_structs::CollectionLimits> for CollectionLimit {
- type Error = pallet_evm_coder_substrate::execution::Error;
-
- fn try_into(self) -> Result<up_data_structs::CollectionLimits, Self::Error> {
+ /// Set corresponding property in CollectionLimits struct
+ pub fn apply_limit(&self, limits: &mut up_data_structs::CollectionLimits) -> Result<(), Error> {
let value = self
.value
- .ok_or::<Self::Error>("can't convert `None` value to boolean".into())?;
+ .ok_or::<Error>("can't convert `None` value to boolean".into())?;
let value = Some(value.try_into().map_err(|error| {
- Self::Error::Revert(format!(
+ Error::Revert(format!(
"can't convert value to u32 \"{value}\" because: \"{error}\""
))
})?);
@@ -239,14 +266,13 @@
Some(value) => match value {
0 => Ok(Some(false)),
1 => Ok(Some(true)),
- _ => Err(Self::Error::Revert(format!(
+ _ => Err(Error::Revert(format!(
"can't convert value to boolean \"{value}\""
))),
},
None => Ok(None),
};
- let mut limits = up_data_structs::CollectionLimits::default();
match self.field {
CollectionLimitField::AccountTokenOwnership => {
limits.account_token_ownership_limit = value;
@@ -277,10 +303,99 @@
limits.transfers_enabled = convert_value_to_bool()?;
}
};
+ Ok(())
+ }
+}
+
+/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
+#[derive(Debug, Default, AbiCoder)]
+pub struct CollectionLimitValue {
+ field: CollectionLimitField,
+ value: U256,
+}
+
+impl CollectionLimitValue {
+ /// Create [`CollectionLimitValue`] from field and value.
+ pub fn new(field: CollectionLimitField, value: u32) -> Self {
+ Self {
+ field,
+ value: value.into(),
+ }
+ }
+
+ /// Set corresponding property in CollectionLimits struct
+ pub fn apply_limit(&self, limits: &mut up_data_structs::CollectionLimits) -> Result<(), Error> {
+ let value = self.value;
+ let value: u32 = value.try_into().map_err(|error| {
+ Error::Revert(format!(
+ "can't convert value to u32 \"{value}\" because: \"{error}\""
+ ))
+ })?;
+
+ let convert_value_to_bool = || match value {
+ 0 => Ok(Some(false)),
+ 1 => Ok(Some(true)),
+ _ => Err(Error::Revert(format!(
+ "can't convert value to boolean \"{value}\""
+ ))),
+ };
+
+ match self.field {
+ CollectionLimitField::AccountTokenOwnership => {
+ limits.account_token_ownership_limit = Some(value);
+ }
+ CollectionLimitField::SponsoredDataSize => {
+ limits.sponsored_data_size = Some(value);
+ }
+ CollectionLimitField::SponsoredDataRateLimit => {
+ limits.sponsored_data_rate_limit =
+ Some(up_data_structs::SponsoringRateLimit::Blocks(value));
+ }
+ CollectionLimitField::TokenLimit => {
+ limits.token_limit = Some(value);
+ }
+ CollectionLimitField::SponsorTransferTimeout => {
+ limits.sponsor_transfer_timeout = Some(value);
+ }
+ CollectionLimitField::SponsorApproveTimeout => {
+ limits.sponsor_approve_timeout = Some(value);
+ }
+ CollectionLimitField::OwnerCanTransfer => {
+ limits.owner_can_transfer = convert_value_to_bool()?;
+ }
+ CollectionLimitField::OwnerCanDestroy => {
+ limits.owner_can_destroy = convert_value_to_bool()?;
+ }
+ CollectionLimitField::TransferEnabled => {
+ limits.transfers_enabled = convert_value_to_bool()?;
+ }
+ };
+ Ok(())
+ }
+}
+
+impl TryInto<up_data_structs::CollectionLimits> for CollectionLimit {
+ type Error = Error;
+
+ fn try_into(self) -> Result<up_data_structs::CollectionLimits, Self::Error> {
+ let mut limits = up_data_structs::CollectionLimits::default();
+ self.apply_limit(&mut limits)?;
Ok(limits)
}
}
+impl FromIterator<CollectionLimitValue> for Result<up_data_structs::CollectionLimits, Error> {
+ fn from_iter<T: IntoIterator<Item = CollectionLimitValue>>(
+ iter: T,
+ ) -> Result<up_data_structs::CollectionLimits, Error> {
+ let mut limits = up_data_structs::CollectionLimits::default();
+ for value in iter.into_iter() {
+ value.apply_limit(&mut limits)?;
+ }
+ Ok(limits)
+ }
+}
+
/// Ethereum representation of `NestingPermissions` (see [`up_data_structs::NestingPermissions`]) fields as an enumeration.
#[derive(Default, Debug, Clone, Copy, AbiCoder)]
#[repr(u8)]
@@ -384,8 +499,7 @@
/// Convert vector of [`TokenPropertyPermission`] into vector of [`up_data_structs::PropertyKeyPermission`].
pub fn into_property_key_permissions(
permissions: Vec<TokenPropertyPermission>,
- ) -> pallet_evm_coder_substrate::execution::Result<Vec<up_data_structs::PropertyKeyPermission>>
- {
+ ) -> Result<Vec<up_data_structs::PropertyKeyPermission>, Error> {
let mut perms = Vec::new();
for TokenPropertyPermission { key, permissions } in permissions {
@@ -410,6 +524,57 @@
pub uri: String,
}
+/// Nested collections and permissions
+#[derive(Debug, Default, AbiCoder)]
+pub struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ pub token_owner: bool,
+ /// Admin of token collection can nest tokens under token.
+ pub collection_admin: bool,
+ /// If set - only tokens from specified collections can be nested.
+ pub restricted: Vec<Address>,
+}
+
+impl CollectionNestingAndPermission {
+ /// Create [`CollectionNesting`].
+ pub fn new(token_owner: bool, collection_admin: bool, restricted: Vec<Address>) -> Self {
+ Self {
+ token_owner,
+ collection_admin,
+ restricted,
+ }
+ }
+}
+
+/// Collection properties
+#[derive(Debug, Default, AbiCoder)]
+pub struct CreateCollectionData {
+ /// Collection sponsor
+ pub pending_sponsor: CrossAddress,
+ /// Collection name
+ pub name: String,
+ /// Collection description
+ pub description: String,
+ /// Token prefix
+ pub token_prefix: String,
+ /// Token type (NFT, FT or RFT)
+ pub mode: CollectionMode,
+ /// Fungible token precision
+ pub decimals: u8,
+ /// Custom Properties
+ pub properties: Vec<Property>,
+ /// Permissions for token properties
+ pub token_property_permissions: Vec<TokenPropertyPermission>,
+ /// Collection admins
+ pub admin_list: Vec<CrossAddress>,
+ /// Nesting settings
+ pub nesting_settings: CollectionNestingAndPermission,
+ /// Collection limits
+ pub limits: Vec<CollectionLimitValue>,
+ /// Extra collection flags
+ pub flags: CollectionFlags,
+}
+
/// Nested collections.
#[derive(Debug, Default, AbiCoder)]
pub struct CollectionNesting {
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -73,16 +73,15 @@
transactional, fail,
};
use up_data_structs::{
- AccessMode, COLLECTION_NUMBER_LIMIT, Collection, RpcCollection, CollectionFlags,
- RpcCollectionFlags, CollectionId, CreateItemData, MAX_TOKEN_PREFIX_LENGTH,
- COLLECTION_ADMINS_LIMIT, TokenId, TokenChild, CollectionStats, MAX_TOKEN_OWNERSHIP,
- CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT, FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,
- REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT, CUSTOM_DATA_LIMIT, CollectionLimits,
- CreateCollectionData, SponsorshipState, CreateItemExData, SponsoringRateLimit, budget::Budget,
- PhantomType, Property, CollectionProperties as CollectionPropertiesT, TokenProperties,
- PropertiesPermissionMap, PropertyKey, PropertyValue, PropertyPermission, PropertiesError,
- TokenOwnerError, PropertyKeyPermission, TokenData, TrySetProperty, PropertyScope,
- CollectionPermissions,
+ AccessMode, COLLECTION_NUMBER_LIMIT, Collection, RpcCollection, RpcCollectionFlags,
+ CollectionId, CreateItemData, MAX_TOKEN_PREFIX_LENGTH, COLLECTION_ADMINS_LIMIT, TokenId,
+ TokenChild, CollectionStats, MAX_TOKEN_OWNERSHIP, CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT,
+ FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT,
+ CUSTOM_DATA_LIMIT, CollectionLimits, CreateCollectionData, SponsorshipState, CreateItemExData,
+ SponsoringRateLimit, budget::Budget, PhantomType, Property,
+ CollectionProperties as CollectionPropertiesT, TokenProperties, PropertiesPermissionMap,
+ PropertyKey, PropertyValue, PropertyPermission, PropertiesError, TokenOwnerError,
+ PropertyKeyPermission, TokenData, TrySetProperty, PropertyScope, CollectionPermissions,
};
use up_pov_estimate_rpc::PovInfo;
@@ -1094,9 +1093,28 @@
pub fn init_collection(
owner: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
- flags: CollectionFlags,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError> {
+ ensure!(data.flags.is_allowed_for_user(), <Error<T>>::NoPermission);
+ Self::init_collection_internal(owner, payer, data)
+ }
+
+ /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
+ pub fn init_foreign_collection(
+ owner: T::CrossAccountId,
+ payer: T::CrossAccountId,
+ mut data: CreateCollectionData<T::CrossAccountId>,
+ ) -> Result<CollectionId, DispatchError> {
+ data.flags.foreign = true;
+ let id = Self::init_collection_internal(owner, payer, data)?;
+ Ok(id)
+ }
+
+ fn init_collection_internal(
+ owner: T::CrossAccountId,
+ payer: T::CrossAccountId,
+ data: CreateCollectionData<T::CrossAccountId>,
+ ) -> Result<CollectionId, DispatchError> {
{
ensure!(
data.token_prefix.len() <= MAX_TOKEN_PREFIX_LENGTH as usize,
@@ -1127,7 +1145,7 @@
token_prefix: data.token_prefix,
sponsorship: data
.pending_sponsor
- .map(SponsorshipState::Unconfirmed)
+ .map(|sponsor| SponsorshipState::Unconfirmed(sponsor.as_sub().clone()))
.unwrap_or_default(),
limits: data
.limits
@@ -1139,7 +1157,7 @@
Self::clamp_permissions(data.mode.clone(), &Default::default(), permissions)
})
.unwrap_or_else(|| Ok(CollectionPermissions::default()))?,
- flags,
+ flags: data.flags,
};
let mut collection_properties = CollectionPropertiesT::new();
@@ -1156,6 +1174,21 @@
CollectionPropertyPermissions::<T>::insert(id, token_props_permissions);
+ let mut admin_amount = 0u32;
+ for admin in data.admin_list.iter() {
+ if !<IsAdmin<T>>::get((id, admin)) {
+ <IsAdmin<T>>::insert((id, admin), true);
+ admin_amount = admin_amount
+ .checked_add(1)
+ .ok_or(<Error<T>>::CollectionAdminCountExceeded)?;
+ }
+ }
+ ensure!(
+ admin_amount <= Self::collection_admins_limit(),
+ <Error<T>>::CollectionAdminCountExceeded,
+ );
+ <AdminAmount<T>>::insert(id, admin_amount);
+
// Take a (non-refundable) deposit of collection creation
{
let mut imbalance = <Debt<T::AccountId, <T as Config>::Currency>>::zero();
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth--- a/pallets/foreign-assets/src/lib.rs
+++ b/pallets/foreign-assets/src/lib.rs
@@ -42,9 +42,9 @@
RuntimeDebug,
};
use frame_system::pallet_prelude::*;
-use up_data_structs::{CollectionMode};
-use pallet_fungible::{Pallet as PalletFungible};
-use scale_info::{TypeInfo};
+use up_data_structs::CollectionMode;
+use pallet_fungible::Pallet as PalletFungible;
+use scale_info::TypeInfo;
use sp_runtime::{
traits::{One, Zero},
ArithmeticError,
@@ -304,7 +304,7 @@
.collect::<Vec<u16>>();
description.append(&mut name.clone());
- let data: CreateCollectionData<T::AccountId> = CreateCollectionData {
+ let data: CreateCollectionData<T::CrossAccountId> = CreateCollectionData {
name: name.try_into().unwrap(),
description: description.try_into().unwrap(),
mode: CollectionMode::Fungible(md.decimals),
pallets/fungible/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/fungible/src/benchmarking.rs
+++ b/pallets/fungible/src/benchmarking.rs
@@ -31,9 +31,7 @@
create_collection_raw(
owner,
CollectionMode::Fungible(0),
- |owner: T::CrossAccountId, data| {
- <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
- },
+ |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
FungibleHandle::cast,
)
}
pallets/fungible/src/lib.rsdiffbeforeafterboth--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -87,8 +87,8 @@
};
use pallet_evm::account::CrossAccountId;
use up_data_structs::{
- AccessMode, CollectionId, CollectionFlags, TokenId, CreateCollectionData,
- mapping::TokenAddressMapping, budget::Budget, PropertyKey, Property,
+ AccessMode, CollectionId, TokenId, CreateCollectionData, mapping::TokenAddressMapping,
+ budget::Budget, PropertyKey, Property,
};
use pallet_common::{
Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
@@ -219,28 +219,18 @@
pub fn init_collection(
owner: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
- flags: CollectionFlags,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, payer, data, flags)
+ <PalletCommon<T>>::init_collection(owner, payer, data)
}
/// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
pub fn init_foreign_collection(
owner: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError> {
- let id = <PalletCommon<T>>::init_collection(
- owner,
- payer,
- data,
- CollectionFlags {
- foreign: true,
- ..Default::default()
- },
- )?;
- Ok(id)
+ <PalletCommon<T>>::init_foreign_collection(owner, payer, data)
}
/// Destroys a collection.
pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -18,7 +18,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1
+/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
contract Collection is Dummy, ERC165 {
// /// Set collection property.
// ///
@@ -230,47 +230,63 @@
// dummy = 0;
// }
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- /// @dev EVM selector for this function is: 0x112d4586,
- /// or in textual repr: setCollectionNesting(bool)
- function setCollectionNesting(bool enable) public {
+ /// @dev EVM selector for this function is: 0x0b9f3890,
+ /// or in textual repr: setCollectionNesting((bool,bool,address[]))
+ function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) public {
require(false, stub_error);
- enable;
+ collectionNestingAndPermissions;
dummy = 0;
}
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
- /// @param collections Addresses of collections that will be available for nesting.
- /// @dev EVM selector for this function is: 0x64872396,
- /// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections) public {
- require(false, stub_error);
- enable;
- collections;
- dummy = 0;
- }
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+ // /// @dev EVM selector for this function is: 0x112d4586,
+ // /// or in textual repr: setCollectionNesting(bool)
+ // function setCollectionNesting(bool enable) public {
+ // require(false, stub_error);
+ // enable;
+ // dummy = 0;
+ // }
+
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+ // /// @param collections Addresses of collections that will be available for nesting.
+ // /// @dev EVM selector for this function is: 0x64872396,
+ // /// or in textual repr: setCollectionNesting(bool,address[])
+ // function setCollectionNesting(bool enable, address[] memory collections) public {
+ // require(false, stub_error);
+ // enable;
+ // collections;
+ // dummy = 0;
+ // }
- /// Returns nesting for a collection
- /// @dev EVM selector for this function is: 0x22d25bfe,
- /// or in textual repr: collectionNestingRestrictedCollectionIds()
- function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
+ /// @dev EVM selector for this function is: 0x92c660a8,
+ /// or in textual repr: collectionNesting()
+ function collectionNesting() public view returns (CollectionNestingAndPermission memory) {
require(false, stub_error);
dummy;
- return CollectionNesting(false, new uint256[](0));
+ return CollectionNestingAndPermission(false, false, new address[](0));
}
- /// Returns permissions for a collection
- /// @dev EVM selector for this function is: 0x5b2eaf4b,
- /// or in textual repr: collectionNestingPermissions()
- function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
- require(false, stub_error);
- dummy;
- return new CollectionNestingPermission[](0);
- }
+ // /// Returns nesting for a collection
+ // /// @dev EVM selector for this function is: 0x22d25bfe,
+ // /// or in textual repr: collectionNestingRestrictedCollectionIds()
+ // function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
+ // require(false, stub_error);
+ // dummy;
+ // return CollectionNesting(false,new uint256[](0));
+ // }
+
+ // /// Returns permissions for a collection
+ // /// @dev EVM selector for this function is: 0x5b2eaf4b,
+ // /// or in textual repr: collectionNestingPermissions()
+ // function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
+ // require(false, stub_error);
+ // dummy;
+ // return new CollectionNestingPermission[](0);
+ // }
/// Set the collection access method.
/// @param mode Access mode
@@ -469,6 +485,16 @@
uint256[] ids;
}
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
struct CollectionLimit {
CollectionLimitField field;
pallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/benchmarking.rs
+++ b/pallets/nonfungible/src/benchmarking.rs
@@ -57,9 +57,7 @@
create_collection_raw(
owner,
CollectionMode::NFT,
- |owner: T::CrossAccountId, data| {
- <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
- },
+ |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
NonfungibleHandle::cast,
)
}
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -100,10 +100,10 @@
dispatch::{PostDispatchInfo, Pays},
};
use up_data_structs::{
- AccessMode, CollectionId, CollectionFlags, CustomDataLimit, TokenId, CreateCollectionData,
- CreateNftExData, mapping::TokenAddressMapping, budget::Budget, Property, PropertyKey,
- PropertyValue, PropertyKeyPermission, PropertyScope, TrySetProperty, TokenChild,
- AuxPropertyValue, PropertiesPermissionMap, TokenProperties as TokenPropertiesT,
+ AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
+ mapping::TokenAddressMapping, budget::Budget, Property, PropertyKey, PropertyValue,
+ PropertyKeyPermission, PropertyScope, TrySetProperty, TokenChild, AuxPropertyValue,
+ PropertiesPermissionMap, TokenProperties as TokenPropertiesT,
};
use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};
use pallet_common::{
@@ -424,10 +424,9 @@
pub fn init_collection(
owner: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
- flags: CollectionFlags,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, payer, data, flags)
+ <PalletCommon<T>>::init_collection(owner, payer, data)
}
/// Destroy NFT collection
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -165,7 +165,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1
+/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
contract Collection is Dummy, ERC165 {
// /// Set collection property.
// ///
@@ -377,47 +377,63 @@
// dummy = 0;
// }
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- /// @dev EVM selector for this function is: 0x112d4586,
- /// or in textual repr: setCollectionNesting(bool)
- function setCollectionNesting(bool enable) public {
+ /// @dev EVM selector for this function is: 0x0b9f3890,
+ /// or in textual repr: setCollectionNesting((bool,bool,address[]))
+ function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) public {
require(false, stub_error);
- enable;
+ collectionNestingAndPermissions;
dummy = 0;
}
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
- /// @param collections Addresses of collections that will be available for nesting.
- /// @dev EVM selector for this function is: 0x64872396,
- /// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections) public {
- require(false, stub_error);
- enable;
- collections;
- dummy = 0;
- }
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+ // /// @dev EVM selector for this function is: 0x112d4586,
+ // /// or in textual repr: setCollectionNesting(bool)
+ // function setCollectionNesting(bool enable) public {
+ // require(false, stub_error);
+ // enable;
+ // dummy = 0;
+ // }
+
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+ // /// @param collections Addresses of collections that will be available for nesting.
+ // /// @dev EVM selector for this function is: 0x64872396,
+ // /// or in textual repr: setCollectionNesting(bool,address[])
+ // function setCollectionNesting(bool enable, address[] memory collections) public {
+ // require(false, stub_error);
+ // enable;
+ // collections;
+ // dummy = 0;
+ // }
- /// Returns nesting for a collection
- /// @dev EVM selector for this function is: 0x22d25bfe,
- /// or in textual repr: collectionNestingRestrictedCollectionIds()
- function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
+ /// @dev EVM selector for this function is: 0x92c660a8,
+ /// or in textual repr: collectionNesting()
+ function collectionNesting() public view returns (CollectionNestingAndPermission memory) {
require(false, stub_error);
dummy;
- return CollectionNesting(false, new uint256[](0));
+ return CollectionNestingAndPermission(false, false, new address[](0));
}
- /// Returns permissions for a collection
- /// @dev EVM selector for this function is: 0x5b2eaf4b,
- /// or in textual repr: collectionNestingPermissions()
- function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
- require(false, stub_error);
- dummy;
- return new CollectionNestingPermission[](0);
- }
+ // /// Returns nesting for a collection
+ // /// @dev EVM selector for this function is: 0x22d25bfe,
+ // /// or in textual repr: collectionNestingRestrictedCollectionIds()
+ // function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
+ // require(false, stub_error);
+ // dummy;
+ // return CollectionNesting(false,new uint256[](0));
+ // }
+
+ // /// Returns permissions for a collection
+ // /// @dev EVM selector for this function is: 0x5b2eaf4b,
+ // /// or in textual repr: collectionNestingPermissions()
+ // function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
+ // require(false, stub_error);
+ // dummy;
+ // return new CollectionNestingPermission[](0);
+ // }
/// Set the collection access method.
/// @param mode Access mode
@@ -616,6 +632,16 @@
uint256[] ids;
}
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
struct CollectionLimit {
CollectionLimitField field;
pallets/refungible/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -61,9 +61,7 @@
create_collection_raw(
owner,
CollectionMode::ReFungible,
- |owner: T::CrossAccountId, data| {
- <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
- },
+ |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
RefungibleHandle::cast,
)
}
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -104,11 +104,10 @@
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use up_data_structs::{
- AccessMode, budget::Budget, CollectionId, CollectionFlags, CreateCollectionData,
- mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, Property, PropertyKey,
- PropertyKeyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty,
- PropertiesPermissionMap, CreateRefungibleExMultipleOwners, TokenOwnerError,
- TokenProperties as TokenPropertiesT,
+ AccessMode, budget::Budget, CollectionId, CreateCollectionData, mapping::TokenAddressMapping,
+ MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyScope,
+ PropertyValue, TokenId, TrySetProperty, PropertiesPermissionMap,
+ CreateRefungibleExMultipleOwners, TokenOwnerError, TokenProperties as TokenPropertiesT,
};
pub use pallet::*;
@@ -334,10 +333,9 @@
pub fn init_collection(
owner: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
- flags: CollectionFlags,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, payer, data, flags)
+ <PalletCommon<T>>::init_collection(owner, payer, data)
}
/// Destroy RFT collection
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -165,7 +165,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1
+/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
contract Collection is Dummy, ERC165 {
// /// Set collection property.
// ///
@@ -377,47 +377,63 @@
// dummy = 0;
// }
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- /// @dev EVM selector for this function is: 0x112d4586,
- /// or in textual repr: setCollectionNesting(bool)
- function setCollectionNesting(bool enable) public {
+ /// @dev EVM selector for this function is: 0x0b9f3890,
+ /// or in textual repr: setCollectionNesting((bool,bool,address[]))
+ function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) public {
require(false, stub_error);
- enable;
+ collectionNestingAndPermissions;
dummy = 0;
}
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
- /// @param collections Addresses of collections that will be available for nesting.
- /// @dev EVM selector for this function is: 0x64872396,
- /// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections) public {
- require(false, stub_error);
- enable;
- collections;
- dummy = 0;
- }
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+ // /// @dev EVM selector for this function is: 0x112d4586,
+ // /// or in textual repr: setCollectionNesting(bool)
+ // function setCollectionNesting(bool enable) public {
+ // require(false, stub_error);
+ // enable;
+ // dummy = 0;
+ // }
+
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+ // /// @param collections Addresses of collections that will be available for nesting.
+ // /// @dev EVM selector for this function is: 0x64872396,
+ // /// or in textual repr: setCollectionNesting(bool,address[])
+ // function setCollectionNesting(bool enable, address[] memory collections) public {
+ // require(false, stub_error);
+ // enable;
+ // collections;
+ // dummy = 0;
+ // }
- /// Returns nesting for a collection
- /// @dev EVM selector for this function is: 0x22d25bfe,
- /// or in textual repr: collectionNestingRestrictedCollectionIds()
- function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
+ /// @dev EVM selector for this function is: 0x92c660a8,
+ /// or in textual repr: collectionNesting()
+ function collectionNesting() public view returns (CollectionNestingAndPermission memory) {
require(false, stub_error);
dummy;
- return CollectionNesting(false, new uint256[](0));
+ return CollectionNestingAndPermission(false, false, new address[](0));
}
- /// Returns permissions for a collection
- /// @dev EVM selector for this function is: 0x5b2eaf4b,
- /// or in textual repr: collectionNestingPermissions()
- function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
- require(false, stub_error);
- dummy;
- return new CollectionNestingPermission[](0);
- }
+ // /// Returns nesting for a collection
+ // /// @dev EVM selector for this function is: 0x22d25bfe,
+ // /// or in textual repr: collectionNestingRestrictedCollectionIds()
+ // function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
+ // require(false, stub_error);
+ // dummy;
+ // return CollectionNesting(false,new uint256[](0));
+ // }
+
+ // /// Returns permissions for a collection
+ // /// @dev EVM selector for this function is: 0x5b2eaf4b,
+ // /// or in textual repr: collectionNestingPermissions()
+ // function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
+ // require(false, stub_error);
+ // dummy;
+ // return new CollectionNestingPermission[](0);
+ // }
/// Set the collection access method.
/// @param mode Access mode
@@ -616,6 +632,16 @@
uint256[] ids;
}
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
struct CollectionLimit {
CollectionLimitField field;
pallets/structure/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/structure/src/benchmarking.rs
+++ b/pallets/structure/src/benchmarking.rs
@@ -40,7 +40,6 @@
mode: CollectionMode::NFT,
..Default::default()
},
- CollectionFlags::default(),
)?;
let dispatch = T::CollectionDispatch::dispatch(CollectionId(1))?;
let dispatch = dispatch.as_dyn();
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -47,6 +47,7 @@
frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
+log = { workspace = true }
pallet-balances-adapter = { workspace = true }
pallet-common = { workspace = true }
pallet-evm = { workspace = true }
pallets/unique/src/eth/mod.rsdiffbeforeafterboth--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -15,18 +15,16 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
//! Implementation of CollectionHelpers contract.
-
+//!
use core::marker::PhantomData;
use ethereum as _;
use evm_coder::{abi::AbiType, generate_stubgen, solidity_interface, types::*};
-use frame_support::traits::Get;
-use crate::Pallet;
-
+use frame_support::{BoundedVec, traits::Get};
use pallet_common::{
CollectionById,
dispatch::CollectionDispatch,
erc::{CollectionHelpersEvents, static_property::key},
- eth::{map_eth_to_id, collection_id_to_address},
+ eth::{self, map_eth_to_id, collection_id_to_address},
Pallet as PalletCommon, CollectionHandle,
};
use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult};
@@ -36,13 +34,13 @@
frontier_contract,
};
use up_data_structs::{
- CollectionDescription, CollectionMode, CollectionName, CollectionTokenPrefix,
- CreateCollectionData,
+ CollectionDescription, CollectionMode, CollectionName, CollectionPermissions,
+ CollectionTokenPrefix, CreateCollectionData, NestingPermissions,
};
-use crate::{weights::WeightInfo, Config, SelfWeightOf};
+use crate::{weights::WeightInfo, Config, Pallet, SelfWeightOf};
-use alloc::format;
+use alloc::{format, collections::BTreeSet};
use sp_std::vec::Vec;
frontier_contract! {
@@ -113,9 +111,8 @@
let collection_helpers_address =
T::CrossAccountId::from_eth(<T as pallet_common::Config>::ContractAddress::get());
- let collection_id =
- T::CollectionDispatch::create(caller, collection_helpers_address, data, Default::default())
- .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+ let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data)
+ .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
let address = pallet_common::eth::collection_id_to_address(collection_id);
Ok(address)
}
@@ -140,7 +137,119 @@
impl<T> EvmCollectionHelpers<T>
where
T: Config + pallet_common::Config + pallet_nonfungible::Config + pallet_refungible::Config,
+ T::AccountId: From<[u8; 32]>,
{
+/*
+ /// Create a collection
+ /// @return address Address of the newly created collection
+ #[weight(<SelfWeightOf<T>>::create_collection())]
+ #[solidity(rename_selector = "createCollection")]
+ fn create_collection(
+ &mut self,
+ caller: Caller,
+ value: Value,
+ data: eth::CreateCollectionData,
+ ) -> Result<Address> {
+ let (caller, name, description, token_prefix) =
+ convert_data::<T>(caller, data.name, data.description, data.token_prefix)?;
+ if data.mode != eth::CollectionMode::Fungible && data.decimals != 0 {
+ return Err("decimals are only supported for NFT and RFT collections".into());
+ }
+ let mode = match data.mode {
+ eth::CollectionMode::Fungible => CollectionMode::Fungible(data.decimals),
+ eth::CollectionMode::Nonfungible => CollectionMode::NFT,
+ eth::CollectionMode::Refungible => CollectionMode::ReFungible,
+ };
+
+ let properties: BoundedVec<_, _> = data
+ .properties
+ .into_iter()
+ .map(eth::Property::try_into)
+ .collect::<Result<Vec<_>>>()?
+ .try_into()
+ .map_err(|_| "too many properties")?;
+
+ let token_property_permissions =
+ eth::TokenPropertyPermission::into_property_key_permissions(
+ data.token_property_permissions,
+ )?
+ .try_into()
+ .map_err(|_| "too many property permissions")?;
+
+ let limits = if !data.limits.is_empty() {
+ Some(
+ data.limits
+ .into_iter()
+ .collect::<Result<up_data_structs::CollectionLimits>>()?,
+ )
+ } else {
+ None
+ };
+
+ let pending_sponsor = data.pending_sponsor.into_option_sub_cross_account::<T>()?;
+
+ let restricted = if !data.nesting_settings.restricted.is_empty() {
+ Some(
+ data.nesting_settings
+ .restricted
+ .iter()
+ .map(map_eth_to_id)
+ .collect::<Option<BTreeSet<_>>>()
+ .ok_or("can't convert address into collection id")?
+ .try_into()
+ .map_err(|_| "too many collections")?,
+ )
+ } else {
+ None
+ };
+
+ let admin_list = data
+ .admin_list
+ .into_iter()
+ .map(|admin| admin.into_sub_cross_account::<T>())
+ .collect::<Result<Vec<_>>>()?;
+
+ let flags = data.flags;
+ if !flags.is_allowed_for_user() {
+ return Err("internal flags were used".into());
+ }
+
+ let data = CreateCollectionData {
+ name,
+ mode,
+ description,
+ token_prefix,
+ properties,
+ token_property_permissions,
+ limits,
+ pending_sponsor,
+ access: None,
+ permissions: Some(CollectionPermissions {
+ access: None,
+ mint_mode: None,
+ nesting: Some(NestingPermissions {
+ token_owner: data.nesting_settings.token_owner,
+ collection_admin: data.nesting_settings.collection_admin,
+ restricted,
+ #[cfg(feature = "runtime-benchmarks")]
+ permissive: true,
+ }),
+ }),
+ admin_list,
+ flags,
+ };
+ check_sent_amount_equals_collection_creation_price::<T>(value)?;
+ let collection_helpers_address =
+ T::CrossAccountId::from_eth(<T as pallet_common::Config>::ContractAddress::get());
+
+ let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data)
+ .map_err(dispatch_to_evm::<T>)?;
+
+ let address = pallet_common::eth::collection_id_to_address(collection_id);
+ Ok(address)
+ }
+*/
+
/// Create an NFT collection
/// @param name Name of the collection
/// @param description Informative description of the collection
@@ -168,13 +277,8 @@
check_sent_amount_equals_collection_creation_price::<T>(value)?;
let collection_helpers_address =
T::CrossAccountId::from_eth(<T as pallet_common::Config>::ContractAddress::get());
- let collection_id = T::CollectionDispatch::create(
- caller,
- collection_helpers_address,
- data,
- Default::default(),
- )
- .map_err(dispatch_to_evm::<T>)?;
+ let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data)
+ .map_err(dispatch_to_evm::<T>)?;
let address = pallet_common::eth::collection_id_to_address(collection_id);
Ok(address)
@@ -387,6 +491,8 @@
pub struct CollectionHelpersOnMethodCall<T: Config>(PhantomData<*const T>);
impl<T: Config + pallet_nonfungible::Config + pallet_refungible::Config> OnMethodCall<T>
for CollectionHelpersOnMethodCall<T>
+where
+ T::AccountId: From<[u8; 32]>,
{
fn is_reserved(contract: &sp_core::H160) -> bool {
contract == &T::ContractAddress::get()
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -25,8 +25,19 @@
}
/// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0xe65011aa
+/// @dev the ERC-165 identifier for this interface is 0x4135fff1
contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
+ /// Create a collection
+ /// @return address Address of the newly created collection
+ /// @dev EVM selector for this function is: 0xa765ee5b,
+ /// or in textual repr: createCollection(((address,uint256),string,string,string,uint8,uint8,(string,bytes)[],(string,(uint8,bool)[])[],(address,uint256)[],(bool,bool,address[]),(uint8,uint256)[],uint8))
+ function createCollection(CreateCollectionData memory data) public payable returns (address) {
+ require(false, stub_error);
+ data;
+ dummy = 0;
+ return 0x0000000000000000000000000000000000000000;
+ }
+
/// Create an NFT collection
/// @param name Name of the collection
/// @param description Informative description of the collection
@@ -156,3 +167,135 @@
return 0;
}
}
+
+/// Collection properties
+struct CreateCollectionData {
+ /// Collection sponsor
+ CrossAddress pending_sponsor;
+ /// Collection name
+ string name;
+ /// Collection description
+ string description;
+ /// Token prefix
+ string token_prefix;
+ /// Token type (NFT, FT or RFT)
+ CollectionMode mode;
+ /// Fungible token precision
+ uint8 decimals;
+ /// Custom Properties
+ Property[] properties;
+ /// Permissions for token properties
+ TokenPropertyPermission[] token_property_permissions;
+ /// Collection admins
+ CrossAddress[] admin_list;
+ /// Nesting settings
+ CollectionNestingAndPermission nesting_settings;
+ /// Collection limits
+ CollectionLimitValue[] limits;
+ /// Extra collection flags
+ CollectionFlags flags;
+}
+
+/// Cross account struct
+type CollectionFlags is uint8;
+
+library CollectionFlagsLib {
+ /// Tokens in foreign collections can be transferred, but not burnt
+ CollectionFlags constant foreignField = CollectionFlags.wrap(128);
+ /// Supports ERC721Metadata
+ CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);
+ /// External collections can't be managed using `unique` api
+ CollectionFlags constant externalField = CollectionFlags.wrap(1);
+
+ /// Reserved bits
+ function reservedField(uint8 value) public pure returns (CollectionFlags) {
+ require(value < 1 << 5, "out of bound value");
+ return CollectionFlags.wrap(value << 1);
+ }
+}
+
+/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
+struct CollectionLimitValue {
+ CollectionLimitField field;
+ uint256 value;
+}
+
+/// [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.
+enum CollectionLimitField {
+ /// How many tokens can a user have on one account.
+ AccountTokenOwnership,
+ /// How many bytes of data are available for sponsorship.
+ SponsoredDataSize,
+ /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
+ SponsoredDataRateLimit,
+ /// How many tokens can be mined into this collection.
+ TokenLimit,
+ /// Timeouts for transfer sponsoring.
+ SponsorTransferTimeout,
+ /// Timeout for sponsoring an approval in passed blocks.
+ SponsorApproveTimeout,
+ /// Whether the collection owner of the collection can send tokens (which belong to other users).
+ OwnerCanTransfer,
+ /// Can the collection owner burn other people's tokens.
+ OwnerCanDestroy,
+ /// Is it possible to send tokens from this collection between users.
+ TransferEnabled
+}
+
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
+/// Cross account struct
+struct CrossAddress {
+ address eth;
+ uint256 sub;
+}
+
+/// Ethereum representation of Token Property Permissions.
+struct TokenPropertyPermission {
+ /// Token property key.
+ string key;
+ /// Token property permissions.
+ PropertyPermission[] permissions;
+}
+
+/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) as an key and value.
+struct PropertyPermission {
+ /// TokenPermission field.
+ TokenPermissionField code;
+ /// TokenPermission value.
+ bool value;
+}
+
+/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) fields as an enumeration.
+enum TokenPermissionField {
+ /// Permission to change the property and property permission. See [`up_data_structs::PropertyPermission::mutable`]
+ Mutable,
+ /// Change permission for the collection administrator. See [`up_data_structs::PropertyPermission::token_owner`]
+ TokenOwner,
+ /// Permission to change the property for the owner of the token. See [`up_data_structs::PropertyPermission::collection_admin`]
+ CollectionAdmin
+}
+
+/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).
+struct Property {
+ string key;
+ bytes value;
+}
+
+/// Type of tokens in collection
+enum CollectionMode {
+ /// Fungible
+ Fungible,
+ /// Nonfungible
+ Nonfungible,
+ /// Refungible
+ Refungible
+}
pallets/unique/src/lib.rsdiffbeforeafterboth--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -365,7 +365,7 @@
token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,
mode: CollectionMode,
) -> DispatchResult {
- let data: CreateCollectionData<T::AccountId> = CreateCollectionData {
+ let data: CreateCollectionData<T::CrossAccountId> = CreateCollectionData {
name: collection_name,
description: collection_description,
token_prefix,
@@ -390,14 +390,13 @@
#[pallet::weight(<SelfWeightOf<T>>::create_collection())]
pub fn create_collection_ex(
origin: OriginFor<T>,
- data: CreateCollectionData<T::AccountId>,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
// =========
let sender = T::CrossAccountId::from_sub(sender);
- let _id =
- T::CollectionDispatch::create(sender.clone(), sender, data, Default::default())?;
+ let _id = T::CollectionDispatch::create(sender.clone(), sender, data)?;
Ok(())
}
primitives/data-structs/Cargo.tomldiffbeforeafterboth--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -22,6 +22,7 @@
sp-std = { workspace = true }
bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
struct-versioning = { workspace = true }
+evm-coder = { workspace = true }
[features]
default = ["std"]
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -32,11 +32,13 @@
use sp_core::U256;
use sp_runtime::{ArithmeticError, sp_std::prelude::Vec};
+use sp_std::collections::btree_set::BTreeSet;
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
-use bondrewd::Bitfields;
use frame_support::{BoundedVec, traits::ConstU32};
use derivative::Derivative;
use scale_info::TypeInfo;
+use evm_coder::AbiCoderFlags;
+use bondrewd::Bitfields;
mod bondrewd_codec;
mod bounded;
@@ -163,6 +165,14 @@
}
}
+impl Deref for CollectionId {
+ type Target = u32;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+
/// Token id.
#[derive(
Encode,
@@ -350,7 +360,7 @@
pub type CollectionDescription = BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>;
pub type CollectionTokenPrefix = BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>;
-#[derive(Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]
+#[derive(AbiCoderFlags, Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]
#[bondrewd(enforce_bytes = 1)]
pub struct CollectionFlags {
/// Tokens in foreign collections can be transferred, but not burnt
@@ -362,12 +372,18 @@
/// External collections can't be managed using `unique` api
#[bondrewd(bits = "7..8")]
pub external: bool,
-
- #[bondrewd(reserve, bits = "2..7")]
+ /// Reserved flags
+ #[bondrewd(bits = "2..7")]
pub reserved: u8,
}
bondrewd_codec!(CollectionFlags);
+impl CollectionFlags {
+ pub fn is_allowed_for_user(self) -> bool {
+ !self.foreign && !self.external && self.reserved == 0
+ }
+}
+
/// Base structure for represent collection.
///
/// Used to provide basic functionality for all types of collections.
@@ -545,7 +561,7 @@
/// All fields are wrapped in [`Option`], where `None` means chain default.
#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)]
#[derivative(Debug, Default(bound = ""))]
-pub struct CreateCollectionData<AccountId> {
+pub struct CreateCollectionData<CrossAccountId> {
/// Collection mode.
#[derivative(Default(value = "CollectionMode::NFT"))]
pub mode: CollectionMode,
@@ -562,9 +578,6 @@
/// Token prefix.
pub token_prefix: CollectionTokenPrefix,
- /// Pending collection sponsor.
- pub pending_sponsor: Option<AccountId>,
-
/// Collection limits.
pub limits: Option<CollectionLimits>,
@@ -576,6 +589,13 @@
/// Collection properties.
pub properties: CollectionPropertiesVec,
+
+ pub admin_list: Vec<CrossAccountId>,
+
+ /// Pending collection sponsor.
+ pub pending_sponsor: Option<CrossAccountId>,
+
+ pub flags: CollectionFlags,
}
/// Bounded vector of properties permissions. Max length is [`MAX_PROPERTIES_PER_ITEM`].
@@ -833,6 +853,14 @@
}
}
+impl TryFrom<BTreeSet<CollectionId>> for OwnerRestrictedSet {
+ type Error = ();
+
+ fn try_from(value: BTreeSet<CollectionId>) -> Result<Self, Self::Error> {
+ Ok(Self(value.try_into()?))
+ }
+}
+
/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens.
#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
runtime/common/dispatch.rsdiffbeforeafterboth--- a/runtime/common/dispatch.rs
+++ b/runtime/common/dispatch.rs
@@ -25,14 +25,14 @@
};
pub use pallet_common::dispatch::CollectionDispatch;
use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};
-use pallet_balances_adapter::{NativeFungibleHandle};
+use pallet_balances_adapter::NativeFungibleHandle;
use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};
use pallet_refungible::{
Pallet as PalletRefungible, RefungibleHandle, erc_token::RefungibleTokenHandle,
};
use up_data_structs::{
CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping,
- CollectionId, CollectionFlags,
+ CollectionId,
};
#[cfg(not(feature = "refungible"))]
@@ -72,26 +72,21 @@
fn create(
sender: T::CrossAccountId,
payer: T::CrossAccountId,
- data: CreateCollectionData<T::AccountId>,
- flags: CollectionFlags,
+ data: CreateCollectionData<T::CrossAccountId>,
) -> Result<CollectionId, DispatchError> {
let id = match data.mode {
- CollectionMode::NFT => {
- <PalletNonfungible<T>>::init_collection(sender, payer, data, flags)?
- }
+ CollectionMode::NFT => <PalletNonfungible<T>>::init_collection(sender, payer, data)?,
CollectionMode::Fungible(decimal_points) => {
// check params
ensure!(
decimal_points <= MAX_DECIMAL_POINTS,
pallet_unique::Error::<T>::CollectionDecimalPointLimitExceeded
);
- <PalletFungible<T>>::init_collection(sender, payer, data, flags)?
+ <PalletFungible<T>>::init_collection(sender, payer, data)?
}
#[cfg(feature = "refungible")]
- CollectionMode::ReFungible => {
- <PalletRefungible<T>>::init_collection(sender, payer, data, flags)?
- }
+ CollectionMode::ReFungible => <PalletRefungible<T>>::init_collection(sender, payer, data)?,
#[cfg(not(feature = "refungible"))]
CollectionMode::ReFungible => return unsupported!(T),
runtime/common/ethereum/sponsoring.rsdiffbeforeafterboth--- a/runtime/common/ethereum/sponsoring.rs
+++ b/runtime/common/ethereum/sponsoring.rs
@@ -234,6 +234,7 @@
| CollectionOwner
| CollectionAdmins
| CollectionLimits
+ | CollectionNesting
| CollectionNestingRestrictedIds
| CollectionNestingPermissions
| UniqueCollectionType => None,
@@ -249,6 +250,7 @@
| RemoveCollectionAdmin { .. }
| SetNestingBool { .. }
| SetNesting { .. }
+ | SetNestingCollectionIds { .. }
| SetCollectionAccess { .. }
| SetCollectionMintMode { .. }
| SetOwner { .. }
tests/src/benchmarks/opsFee/index.tsdiffbeforeafterboth--- a/tests/src/benchmarks/opsFee/index.ts
+++ b/tests/src/benchmarks/opsFee/index.ts
@@ -1,6 +1,6 @@
import {EthUniqueHelper, usingEthPlaygrounds} from '../../eth/util';
import {readFile} from 'fs/promises';
-import {CollectionLimitField, TokenPermissionField} from '../../eth/util/playgrounds/types';
+import {CollectionLimitField, CreateCollectionData, TokenPermissionField} from '../../eth/util/playgrounds/types';
import {IKeyringPair} from '@polkadot/types/types';
import {UniqueFTCollection, UniqueNFTCollection} from '../../util/playgrounds/unique';
import {Contract} from 'web3-eth-contract';
@@ -399,7 +399,7 @@
() => collection.setLimits(donor, {accountTokenOwnershipLimit: 1000}),
)));
- const {collectionAddress} = await helper.eth.createCollection('nft', ethSigner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(ethSigner, new CreateCollectionData('A', 'B', 'C', 'nft')).send();
const collectionWithEthOwner = await helper.ethNativeContract.collection(collectionAddress, 'nft', ethSigner, true);
@@ -775,7 +775,7 @@
() => collection.setLimits(donor, {accountTokenOwnershipLimit: 1000}),
)));
- const {collectionAddress} = await helper.eth.createCollection('nft', ethSigner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(ethSigner, new CreateCollectionData('A', 'B', 'C', 'nft')).send();
const collectionWithEthOwner = await helper.ethNativeContract.collection(collectionAddress, 'nft', ethSigner, true);
tests/src/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/createCollection.test.ts
+++ b/tests/src/createCollection.test.ts
@@ -16,7 +16,7 @@
import {IKeyringPair} from '@polkadot/types/types';
import {usingPlaygrounds, expect, itSub, Pallets} from './util';
-import {ICollectionCreationOptions, IProperty} from './util/playgrounds/types';
+import {CollectionFlag, ICollectionCreationOptions, IProperty} from './util/playgrounds/types';
import {UniqueHelper} from './util/playgrounds/unique';
async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') {
@@ -36,6 +36,16 @@
if(options.properties) {
expect(data?.raw.properties).to.be.deep.equal(options.properties);
}
+ if(options.adminList) {
+ expect(data?.admins).to.be.deep.equal(options.adminList);
+ }
+
+ if(options.flags) {
+ if((options.flags[0] & 64) != 0)
+ expect(data?.raw.flags.erc721metadata).to.be.true;
+ if((options.flags[0] & 128) != 0)
+ expect(data?.raw.flags.foreign).to.be.false;
+ }
if(options.tokenPropertyPermissions) {
expect(data?.raw.tokenPropertyPermissions).to.be.deep.equal(options.tokenPropertyPermissions);
@@ -46,11 +56,12 @@
describe('integration test: ext. createCollection():', () => {
let alice: IKeyringPair;
+ let bob: IKeyringPair;
before(async () => {
await usingPlaygrounds(async (helper, privateKey) => {
const donor = await privateKey({url: import.meta.url});
- [alice] = await helper.arrange.createAccounts([100n], donor);
+ [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor);
});
});
itSub('Create new NFT collection', async ({helper}) => {
@@ -82,6 +93,30 @@
}, 'nft');
});
+ itSub('create new collection with admin', async ({helper}) => {
+ await mintCollectionHelper(helper, alice, {
+ name: 'name', description: 'descr', tokenPrefix: 'COL',
+ adminList: [{Substrate: bob.address}],
+ }, 'nft');
+ });
+
+ itSub('create new collection with flags', async ({helper}) => {
+ await mintCollectionHelper(helper, alice, {
+ name: 'name', description: 'descr', tokenPrefix: 'COL',
+ flags: [CollectionFlag.Erc721metadata],
+ }, 'nft');
+
+ await mintCollectionHelper(helper, alice, {
+ name: 'name', description: 'descr', tokenPrefix: 'COL',
+ flags: [CollectionFlag.Foreign],
+ }, 'nft');
+
+ await mintCollectionHelper(helper, alice, {
+ name: 'name', description: 'descr', tokenPrefix: 'COL',
+ flags: [CollectionFlag.Erc721metadata, CollectionFlag.Foreign],
+ }, 'nft');
+ });
+
itSub('Create new collection with extra fields', async ({helper}) => {
const collection = await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible');
await collection.setPermissions(alice, {access: 'AllowList'});
tests/src/eth/abi/collectionHelpers.jsondiffbeforeafterboth--- a/tests/src/eth/abi/collectionHelpers.json
+++ b/tests/src/eth/abi/collectionHelpers.json
@@ -75,6 +75,118 @@
},
{
"inputs": [
+ {
+ "components": [
+ {
+ "components": [
+ { "internalType": "address", "name": "eth", "type": "address" },
+ { "internalType": "uint256", "name": "sub", "type": "uint256" }
+ ],
+ "internalType": "struct CrossAddress",
+ "name": "pending_sponsor",
+ "type": "tuple"
+ },
+ { "internalType": "string", "name": "name", "type": "string" },
+ { "internalType": "string", "name": "description", "type": "string" },
+ {
+ "internalType": "string",
+ "name": "token_prefix",
+ "type": "string"
+ },
+ {
+ "internalType": "enum CollectionMode",
+ "name": "mode",
+ "type": "uint8"
+ },
+ { "internalType": "uint8", "name": "decimals", "type": "uint8" },
+ {
+ "components": [
+ { "internalType": "string", "name": "key", "type": "string" },
+ { "internalType": "bytes", "name": "value", "type": "bytes" }
+ ],
+ "internalType": "struct Property[]",
+ "name": "properties",
+ "type": "tuple[]"
+ },
+ {
+ "components": [
+ { "internalType": "string", "name": "key", "type": "string" },
+ {
+ "components": [
+ {
+ "internalType": "enum TokenPermissionField",
+ "name": "code",
+ "type": "uint8"
+ },
+ { "internalType": "bool", "name": "value", "type": "bool" }
+ ],
+ "internalType": "struct PropertyPermission[]",
+ "name": "permissions",
+ "type": "tuple[]"
+ }
+ ],
+ "internalType": "struct TokenPropertyPermission[]",
+ "name": "token_property_permissions",
+ "type": "tuple[]"
+ },
+ {
+ "components": [
+ { "internalType": "address", "name": "eth", "type": "address" },
+ { "internalType": "uint256", "name": "sub", "type": "uint256" }
+ ],
+ "internalType": "struct CrossAddress[]",
+ "name": "admin_list",
+ "type": "tuple[]"
+ },
+ {
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ {
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
+ },
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
+ ],
+ "internalType": "struct CollectionNestingAndPermission",
+ "name": "nesting_settings",
+ "type": "tuple"
+ },
+ {
+ "components": [
+ {
+ "internalType": "enum CollectionLimitField",
+ "name": "field",
+ "type": "uint8"
+ },
+ { "internalType": "uint256", "name": "value", "type": "uint256" }
+ ],
+ "internalType": "struct CollectionLimitValue[]",
+ "name": "limits",
+ "type": "tuple[]"
+ },
+ {
+ "internalType": "CollectionFlags",
+ "name": "flags",
+ "type": "uint8"
+ }
+ ],
+ "internalType": "struct CreateCollectionData",
+ "name": "data",
+ "type": "tuple"
+ }
+ ],
+ "name": "createCollection",
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
+ "stateMutability": "payable",
+ "type": "function"
+ },
+ {
+ "inputs": [
{ "internalType": "string", "name": "name", "type": "string" },
{ "internalType": "uint8", "name": "decimals", "type": "uint8" },
{ "internalType": "string", "name": "description", "type": "string" },
tests/src/eth/abi/fungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/fungible.json
+++ b/tests/src/eth/abi/fungible.json
@@ -280,35 +280,23 @@
},
{
"inputs": [],
- "name": "collectionNestingPermissions",
+ "name": "collectionNesting",
"outputs": [
{
"components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
{
- "internalType": "enum CollectionPermissionField",
- "name": "field",
- "type": "uint8"
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
},
- { "internalType": "bool", "name": "value", "type": "bool" }
- ],
- "internalType": "struct CollectionNestingPermission[]",
- "name": "",
- "type": "tuple[]"
- }
- ],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "collectionNestingRestrictedCollectionIds",
- "outputs": [
- {
- "components": [
- { "internalType": "bool", "name": "token_owner", "type": "bool" },
- { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
],
- "internalType": "struct CollectionNesting",
+ "internalType": "struct CollectionNestingAndPermission",
"name": "",
"type": "tuple"
}
@@ -576,19 +564,24 @@
"type": "function"
},
{
- "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
- "name": "setCollectionNesting",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
"inputs": [
- { "internalType": "bool", "name": "enable", "type": "bool" },
{
- "internalType": "address[]",
- "name": "collections",
- "type": "address[]"
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ {
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
+ },
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
+ ],
+ "internalType": "struct CollectionNestingAndPermission",
+ "name": "collectionNestingAndPermissions",
+ "type": "tuple"
}
],
"name": "setCollectionNesting",
tests/src/eth/abi/fungibleDeprecated.jsondiffbeforeafterboth--- a/tests/src/eth/abi/fungibleDeprecated.json
+++ b/tests/src/eth/abi/fungibleDeprecated.json
@@ -88,5 +88,64 @@
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "collectionNestingPermissions",
+ "outputs": [
+ {
+ "components": [
+ {
+ "internalType": "enum CollectionPermissionField",
+ "name": "field",
+ "type": "uint8"
+ },
+ { "internalType": "bool", "name": "value", "type": "bool" }
+ ],
+ "internalType": "struct CollectionNestingPermission[]",
+ "name": "",
+ "type": "tuple[]"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "collectionNestingRestrictedCollectionIds",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
+ ],
+ "internalType": "struct CollectionNesting",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
+ "name": "setCollectionNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "bool", "name": "enable", "type": "bool" },
+ {
+ "internalType": "address[]",
+ "name": "collections",
+ "type": "address[]"
+ }
+ ],
+ "name": "setCollectionNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
}
]
tests/src/eth/abi/nonFungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/nonFungible.json
+++ b/tests/src/eth/abi/nonFungible.json
@@ -291,35 +291,23 @@
},
{
"inputs": [],
- "name": "collectionNestingPermissions",
+ "name": "collectionNesting",
"outputs": [
{
"components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
{
- "internalType": "enum CollectionPermissionField",
- "name": "field",
- "type": "uint8"
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
},
- { "internalType": "bool", "name": "value", "type": "bool" }
- ],
- "internalType": "struct CollectionNestingPermission[]",
- "name": "",
- "type": "tuple[]"
- }
- ],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "collectionNestingRestrictedCollectionIds",
- "outputs": [
- {
- "components": [
- { "internalType": "bool", "name": "token_owner", "type": "bool" },
- { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
],
- "internalType": "struct CollectionNesting",
+ "internalType": "struct CollectionNestingAndPermission",
"name": "",
"type": "tuple"
}
@@ -705,19 +693,24 @@
"type": "function"
},
{
- "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
- "name": "setCollectionNesting",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
"inputs": [
- { "internalType": "bool", "name": "enable", "type": "bool" },
{
- "internalType": "address[]",
- "name": "collections",
- "type": "address[]"
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ {
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
+ },
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
+ ],
+ "internalType": "struct CollectionNestingAndPermission",
+ "name": "collectionNestingAndPermissions",
+ "type": "tuple"
}
],
"name": "setCollectionNesting",
tests/src/eth/abi/nonFungibleDeprecated.jsondiffbeforeafterboth--- a/tests/src/eth/abi/nonFungibleDeprecated.json
+++ b/tests/src/eth/abi/nonFungibleDeprecated.json
@@ -109,5 +109,64 @@
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "collectionNestingPermissions",
+ "outputs": [
+ {
+ "components": [
+ {
+ "internalType": "enum CollectionPermissionField",
+ "name": "field",
+ "type": "uint8"
+ },
+ { "internalType": "bool", "name": "value", "type": "bool" }
+ ],
+ "internalType": "struct CollectionNestingPermission[]",
+ "name": "",
+ "type": "tuple[]"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "collectionNestingRestrictedCollectionIds",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
+ ],
+ "internalType": "struct CollectionNesting",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
+ "name": "setCollectionNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "bool", "name": "enable", "type": "bool" },
+ {
+ "internalType": "address[]",
+ "name": "collections",
+ "type": "address[]"
+ }
+ ],
+ "name": "setCollectionNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
}
]
tests/src/eth/abi/reFungible.jsondiffbeforeafterboth--- a/tests/src/eth/abi/reFungible.json
+++ b/tests/src/eth/abi/reFungible.json
@@ -273,35 +273,23 @@
},
{
"inputs": [],
- "name": "collectionNestingPermissions",
+ "name": "collectionNesting",
"outputs": [
{
"components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
{
- "internalType": "enum CollectionPermissionField",
- "name": "field",
- "type": "uint8"
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
},
- { "internalType": "bool", "name": "value", "type": "bool" }
- ],
- "internalType": "struct CollectionNestingPermission[]",
- "name": "",
- "type": "tuple[]"
- }
- ],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "collectionNestingRestrictedCollectionIds",
- "outputs": [
- {
- "components": [
- { "internalType": "bool", "name": "token_owner", "type": "bool" },
- { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
],
- "internalType": "struct CollectionNesting",
+ "internalType": "struct CollectionNestingAndPermission",
"name": "",
"type": "tuple"
}
@@ -687,19 +675,24 @@
"type": "function"
},
{
- "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
- "name": "setCollectionNesting",
- "outputs": [],
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
"inputs": [
- { "internalType": "bool", "name": "enable", "type": "bool" },
{
- "internalType": "address[]",
- "name": "collections",
- "type": "address[]"
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ {
+ "internalType": "bool",
+ "name": "collection_admin",
+ "type": "bool"
+ },
+ {
+ "internalType": "address[]",
+ "name": "restricted",
+ "type": "address[]"
+ }
+ ],
+ "internalType": "struct CollectionNestingAndPermission",
+ "name": "collectionNestingAndPermissions",
+ "type": "tuple"
}
],
"name": "setCollectionNesting",
tests/src/eth/abi/reFungibleDeprecated.jsondiffbeforeafterboth--- a/tests/src/eth/abi/reFungibleDeprecated.json
+++ b/tests/src/eth/abi/reFungibleDeprecated.json
@@ -137,5 +137,64 @@
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "collectionNestingPermissions",
+ "outputs": [
+ {
+ "components": [
+ {
+ "internalType": "enum CollectionPermissionField",
+ "name": "field",
+ "type": "uint8"
+ },
+ { "internalType": "bool", "name": "value", "type": "bool" }
+ ],
+ "internalType": "struct CollectionNestingPermission[]",
+ "name": "",
+ "type": "tuple[]"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "collectionNestingRestrictedCollectionIds",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "bool", "name": "token_owner", "type": "bool" },
+ { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
+ ],
+ "internalType": "struct CollectionNesting",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
+ "name": "setCollectionNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ { "internalType": "bool", "name": "enable", "type": "bool" },
+ {
+ "internalType": "address[]",
+ "name": "collections",
+ "type": "address[]"
+ }
+ ],
+ "name": "setCollectionNesting",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
}
]
tests/src/eth/allowlist.test.tsdiffbeforeafterboth--- a/tests/src/eth/allowlist.test.ts
+++ b/tests/src/eth/allowlist.test.ts
@@ -17,6 +17,7 @@
import {IKeyringPair} from '@polkadot/types/types';
import {Pallets} from '../util';
import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from './util';
+import {CreateCollectionData} from './util/playgrounds/types';
describe('EVM contract allowlist', () => {
let donor: IKeyringPair;
@@ -104,7 +105,7 @@
const userEth = await helper.eth.createAccountWithBalance(donor);
const mintParams = testCase.mode === 'ft' ? [userEth, 100] : [userEth];
- const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
const userCrossSub = helper.ethCrossAccount.fromKeyringPair(userSub);
const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);
@@ -178,7 +179,7 @@
const userEth = helper.eth.createAccount();
const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);
- const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, !testCase.cross);
expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;
tests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -20,8 +20,14 @@
}
/// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0xe65011aa
+/// @dev the ERC-165 identifier for this interface is 0x4135fff1
interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
+ /// Create a collection
+ /// @return address Address of the newly created collection
+ /// @dev EVM selector for this function is: 0xa765ee5b,
+ /// or in textual repr: createCollection(((address,uint256),string,string,string,uint8,uint8,(string,bytes)[],(string,(uint8,bool)[])[],(address,uint256)[],(bool,bool,address[]),(uint8,uint256)[],uint8))
+ function createCollection(CreateCollectionData memory data) external payable returns (address);
+
/// Create an NFT collection
/// @param name Name of the collection
/// @param description Informative description of the collection
@@ -94,3 +100,135 @@
/// or in textual repr: collectionId(address)
function collectionId(address collectionAddress) external view returns (uint32);
}
+
+/// Collection properties
+struct CreateCollectionData {
+ /// Collection sponsor
+ CrossAddress pending_sponsor;
+ /// Collection name
+ string name;
+ /// Collection description
+ string description;
+ /// Token prefix
+ string token_prefix;
+ /// Token type (NFT, FT or RFT)
+ CollectionMode mode;
+ /// Fungible token precision
+ uint8 decimals;
+ /// Custom Properties
+ Property[] properties;
+ /// Permissions for token properties
+ TokenPropertyPermission[] token_property_permissions;
+ /// Collection admins
+ CrossAddress[] admin_list;
+ /// Nesting settings
+ CollectionNestingAndPermission nesting_settings;
+ /// Collection limits
+ CollectionLimitValue[] limits;
+ /// Extra collection flags
+ CollectionFlags flags;
+}
+
+/// Cross account struct
+type CollectionFlags is uint8;
+
+library CollectionFlagsLib {
+ /// Tokens in foreign collections can be transferred, but not burnt
+ CollectionFlags constant foreignField = CollectionFlags.wrap(128);
+ /// Supports ERC721Metadata
+ CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);
+ /// External collections can't be managed using `unique` api
+ CollectionFlags constant externalField = CollectionFlags.wrap(1);
+
+ /// Reserved bits
+ function reservedField(uint8 value) public pure returns (CollectionFlags) {
+ require(value < 1 << 5, "out of bound value");
+ return CollectionFlags.wrap(value << 1);
+ }
+}
+
+/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
+struct CollectionLimitValue {
+ CollectionLimitField field;
+ uint256 value;
+}
+
+/// [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.
+enum CollectionLimitField {
+ /// How many tokens can a user have on one account.
+ AccountTokenOwnership,
+ /// How many bytes of data are available for sponsorship.
+ SponsoredDataSize,
+ /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
+ SponsoredDataRateLimit,
+ /// How many tokens can be mined into this collection.
+ TokenLimit,
+ /// Timeouts for transfer sponsoring.
+ SponsorTransferTimeout,
+ /// Timeout for sponsoring an approval in passed blocks.
+ SponsorApproveTimeout,
+ /// Whether the collection owner of the collection can send tokens (which belong to other users).
+ OwnerCanTransfer,
+ /// Can the collection owner burn other people's tokens.
+ OwnerCanDestroy,
+ /// Is it possible to send tokens from this collection between users.
+ TransferEnabled
+}
+
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
+/// Cross account struct
+struct CrossAddress {
+ address eth;
+ uint256 sub;
+}
+
+/// Ethereum representation of Token Property Permissions.
+struct TokenPropertyPermission {
+ /// Token property key.
+ string key;
+ /// Token property permissions.
+ PropertyPermission[] permissions;
+}
+
+/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) as an key and value.
+struct PropertyPermission {
+ /// TokenPermission field.
+ TokenPermissionField code;
+ /// TokenPermission value.
+ bool value;
+}
+
+/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) fields as an enumeration.
+enum TokenPermissionField {
+ /// Permission to change the property and property permission. See [`up_data_structs::PropertyPermission::mutable`]
+ Mutable,
+ /// Change permission for the collection administrator. See [`up_data_structs::PropertyPermission::token_owner`]
+ TokenOwner,
+ /// Permission to change the property for the owner of the token. See [`up_data_structs::PropertyPermission::collection_admin`]
+ CollectionAdmin
+}
+
+/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).
+struct Property {
+ string key;
+ bytes value;
+}
+
+/// Type of tokens in collection
+enum CollectionMode {
+ /// Fungible
+ Fungible,
+ /// Nonfungible
+ Nonfungible,
+ /// Refungible
+ Refungible
+}
tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -13,7 +13,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1
+/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
interface Collection is Dummy, ERC165 {
// /// Set collection property.
// ///
@@ -148,30 +148,38 @@
// /// or in textual repr: removeCollectionAdmin(address)
// function removeCollectionAdmin(address admin) external;
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- /// @dev EVM selector for this function is: 0x112d4586,
- /// or in textual repr: setCollectionNesting(bool)
- function setCollectionNesting(bool enable) external;
+ /// @dev EVM selector for this function is: 0x0b9f3890,
+ /// or in textual repr: setCollectionNesting((bool,bool,address[]))
+ function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) external;
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
- /// @param collections Addresses of collections that will be available for nesting.
- /// @dev EVM selector for this function is: 0x64872396,
- /// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections) external;
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+ // /// @dev EVM selector for this function is: 0x112d4586,
+ // /// or in textual repr: setCollectionNesting(bool)
+ // function setCollectionNesting(bool enable) external;
+
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+ // /// @param collections Addresses of collections that will be available for nesting.
+ // /// @dev EVM selector for this function is: 0x64872396,
+ // /// or in textual repr: setCollectionNesting(bool,address[])
+ // function setCollectionNesting(bool enable, address[] memory collections) external;
+
+ /// @dev EVM selector for this function is: 0x92c660a8,
+ /// or in textual repr: collectionNesting()
+ function collectionNesting() external view returns (CollectionNestingAndPermission memory);
- /// Returns nesting for a collection
- /// @dev EVM selector for this function is: 0x22d25bfe,
- /// or in textual repr: collectionNestingRestrictedCollectionIds()
- function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
+ // /// Returns nesting for a collection
+ // /// @dev EVM selector for this function is: 0x22d25bfe,
+ // /// or in textual repr: collectionNestingRestrictedCollectionIds()
+ // function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
- /// Returns permissions for a collection
- /// @dev EVM selector for this function is: 0x5b2eaf4b,
- /// or in textual repr: collectionNestingPermissions()
- function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
+ // /// Returns permissions for a collection
+ // /// @dev EVM selector for this function is: 0x5b2eaf4b,
+ // /// or in textual repr: collectionNestingPermissions()
+ // function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
/// Set the collection access method.
/// @param mode Access mode
@@ -311,6 +319,16 @@
uint256[] ids;
}
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
struct CollectionLimit {
CollectionLimitField field;
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -118,7 +118,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1
+/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
interface Collection is Dummy, ERC165 {
// /// Set collection property.
// ///
@@ -253,30 +253,38 @@
// /// or in textual repr: removeCollectionAdmin(address)
// function removeCollectionAdmin(address admin) external;
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- /// @dev EVM selector for this function is: 0x112d4586,
- /// or in textual repr: setCollectionNesting(bool)
- function setCollectionNesting(bool enable) external;
+ /// @dev EVM selector for this function is: 0x0b9f3890,
+ /// or in textual repr: setCollectionNesting((bool,bool,address[]))
+ function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) external;
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
- /// @param collections Addresses of collections that will be available for nesting.
- /// @dev EVM selector for this function is: 0x64872396,
- /// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections) external;
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+ // /// @dev EVM selector for this function is: 0x112d4586,
+ // /// or in textual repr: setCollectionNesting(bool)
+ // function setCollectionNesting(bool enable) external;
+
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+ // /// @param collections Addresses of collections that will be available for nesting.
+ // /// @dev EVM selector for this function is: 0x64872396,
+ // /// or in textual repr: setCollectionNesting(bool,address[])
+ // function setCollectionNesting(bool enable, address[] memory collections) external;
+
+ /// @dev EVM selector for this function is: 0x92c660a8,
+ /// or in textual repr: collectionNesting()
+ function collectionNesting() external view returns (CollectionNestingAndPermission memory);
- /// Returns nesting for a collection
- /// @dev EVM selector for this function is: 0x22d25bfe,
- /// or in textual repr: collectionNestingRestrictedCollectionIds()
- function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
+ // /// Returns nesting for a collection
+ // /// @dev EVM selector for this function is: 0x22d25bfe,
+ // /// or in textual repr: collectionNestingRestrictedCollectionIds()
+ // function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
- /// Returns permissions for a collection
- /// @dev EVM selector for this function is: 0x5b2eaf4b,
- /// or in textual repr: collectionNestingPermissions()
- function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
+ // /// Returns permissions for a collection
+ // /// @dev EVM selector for this function is: 0x5b2eaf4b,
+ // /// or in textual repr: collectionNestingPermissions()
+ // function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
/// Set the collection access method.
/// @param mode Access mode
@@ -416,6 +424,16 @@
uint256[] ids;
}
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
struct CollectionLimit {
CollectionLimitField field;
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -118,7 +118,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1
+/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
interface Collection is Dummy, ERC165 {
// /// Set collection property.
// ///
@@ -253,30 +253,38 @@
// /// or in textual repr: removeCollectionAdmin(address)
// function removeCollectionAdmin(address admin) external;
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
- /// @dev EVM selector for this function is: 0x112d4586,
- /// or in textual repr: setCollectionNesting(bool)
- function setCollectionNesting(bool enable) external;
+ /// @dev EVM selector for this function is: 0x0b9f3890,
+ /// or in textual repr: setCollectionNesting((bool,bool,address[]))
+ function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) external;
- /// Toggle accessibility of collection nesting.
- ///
- /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
- /// @param collections Addresses of collections that will be available for nesting.
- /// @dev EVM selector for this function is: 0x64872396,
- /// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections) external;
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
+ // /// @dev EVM selector for this function is: 0x112d4586,
+ // /// or in textual repr: setCollectionNesting(bool)
+ // function setCollectionNesting(bool enable) external;
+
+ // /// Toggle accessibility of collection nesting.
+ // ///
+ // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
+ // /// @param collections Addresses of collections that will be available for nesting.
+ // /// @dev EVM selector for this function is: 0x64872396,
+ // /// or in textual repr: setCollectionNesting(bool,address[])
+ // function setCollectionNesting(bool enable, address[] memory collections) external;
+
+ /// @dev EVM selector for this function is: 0x92c660a8,
+ /// or in textual repr: collectionNesting()
+ function collectionNesting() external view returns (CollectionNestingAndPermission memory);
- /// Returns nesting for a collection
- /// @dev EVM selector for this function is: 0x22d25bfe,
- /// or in textual repr: collectionNestingRestrictedCollectionIds()
- function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
+ // /// Returns nesting for a collection
+ // /// @dev EVM selector for this function is: 0x22d25bfe,
+ // /// or in textual repr: collectionNestingRestrictedCollectionIds()
+ // function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
- /// Returns permissions for a collection
- /// @dev EVM selector for this function is: 0x5b2eaf4b,
- /// or in textual repr: collectionNestingPermissions()
- function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
+ // /// Returns permissions for a collection
+ // /// @dev EVM selector for this function is: 0x5b2eaf4b,
+ // /// or in textual repr: collectionNestingPermissions()
+ // function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
/// Set the collection access method.
/// @param mode Access mode
@@ -416,6 +424,16 @@
uint256[] ids;
}
+/// Nested collections and permissions
+struct CollectionNestingAndPermission {
+ /// Owner of token can nest tokens under it.
+ bool token_owner;
+ /// Admin of token collection can nest tokens under token.
+ bool collection_admin;
+ /// If set - only tokens from specified collections can be nested.
+ address[] restricted;
+}
+
/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
struct CollectionLimit {
CollectionLimitField field;
tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionAdmin.test.ts
+++ b/tests/src/eth/collectionAdmin.test.ts
@@ -19,6 +19,7 @@
import {IEthCrossAccountId} from '../util/playgrounds/types';
import {usingEthPlaygrounds, itEth} from './util';
import {EthUniqueHelper} from './util/playgrounds/unique.dev';
+import {CreateCollectionData} from './util/playgrounds/types';
async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise<any>) {
const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress));
@@ -55,7 +56,7 @@
const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
- const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, true);
// Check isOwnerOrAdminCross returns false:
tests/src/eth/collectionLimits.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionLimits.test.ts
+++ b/tests/src/eth/collectionLimits.test.ts
@@ -1,7 +1,7 @@
import {IKeyringPair} from '@polkadot/types/types';
import {Pallets} from '../util';
import {expect, itEth, usingEthPlaygrounds} from './util';
-import {CollectionLimitField} from './util/playgrounds/types';
+import {CollectionLimitField, CreateCollectionData} from './util/playgrounds/types';
describe('Can set collection limits', () => {
@@ -20,7 +20,7 @@
].map(testCase =>
itEth.ifWithPallets(`for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'FLO', 18);
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'FLO', testCase.case, 18)).send();
const limits = {
accountTokenOwnershipLimit: 1000,
sponsoredDataSize: 1024,
@@ -96,13 +96,13 @@
};
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'ISNI', 18);
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'ISNI', testCase.case, 18)).send();
const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
// Cannot set non-existing limit
await expect(collectionEvm.methods
.setCollectionLimit({field: 9, value: {status: true, value: 1}})
- .call()).to.be.rejectedWith('Returned error: VM Exception while processing transaction: revert Value not convertible into enum "CollectionLimitField"');
+ .call()).to.be.rejectedWith('Returned error: VM Exception while processing transaction: revert value not convertible into enum "CollectionLimitField"');
// Cannot disable limits
await expect(collectionEvm.methods
@@ -129,7 +129,7 @@
itEth.ifWithPallets(`Non-owner and non-admin cannot set collection limits for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const nonOwner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'FLO', 18);
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'FLO', testCase.case, 18)).send();
const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
await expect(collectionEvm.methods
tests/src/eth/createCollection.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/createCollection.test.ts
@@ -0,0 +1,1459 @@
+// 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 {evmToAddress} from '@polkadot/util-crypto';
+import {Pallets, requirePalletsOrSkip} from '../util';
+import {expect, itEth, usingEthPlaygrounds} from './util';
+import {CREATE_COLLECTION_DATA_DEFAULTS, CollectionLimitField, CollectionMode, CreateCollectionData, TokenPermissionField, emptyAddress} from './util/playgrounds/types';
+import {CollectionFlag, IEthCrossAccountId, TCollectionMode} from '../util/playgrounds/types';
+
+const DECIMALS = 18;
+const CREATE_COLLECTION_DATA_DEFAULTS_ARRAY = [
+ [],
+ [],
+ [],
+ [false, false, []],
+ [],
+ [0],
+];
+
+type ElementOf<A> = A extends readonly (infer T)[] ? T : never;
+function* cartesian<T extends Array<Array<any>>, R extends Array<any>>(internalRest: [...R], ...args: [...T]): Generator<[...R, ...{[K in keyof T]: ElementOf<T[K]>}]> {
+ if(args.length === 0) {
+ yield internalRest as any;
+ return;
+ }
+ for(const value of args[0]) {
+ yield* cartesian([...internalRest, value], ...args.slice(1)) as any;
+ }
+}
+
+describe('Create collection from EVM', () => {
+ let donor: IKeyringPair;
+ let nominal: bigint;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (helper, privateKey) => {
+ donor = await privateKey({url: import.meta.url});
+ nominal = helper.balance.getOneTokenNominal();
+ });
+ });
+
+ describe('Fungible collection', () => {
+ before(async function() {
+ await usingEthPlaygrounds((helper) => {
+ requirePalletsOrSkip(this, helper, [Pallets.Fungible]);
+ return Promise.resolve();
+ });
+ });
+
+ itEth('Collection address exist', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
+ expect(await collectionHelpers
+ .methods.isCollectionExist(collectionAddressForNonexistentCollection).call())
+ .to.be.false;
+
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Exister', 'absolutely anything', 'WIWT', 'ft', DECIMALS)).send();
+ expect(await collectionHelpers
+ .methods.isCollectionExist(collectionAddress).call())
+ .to.be.true;
+
+ // check collectionOwner:
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner, true);
+ const collectionOwner = await collectionEvm.methods.collectionOwner().call();
+ expect(helper.address.restoreCrossAccountFromBigInt(BigInt(collectionOwner.sub))).to.eq(helper.address.ethToSubstrate(owner, true));
+ });
+
+ itEth('destroyCollection', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('Exister', 'absolutely anything', 'WIWT', 'ft', DECIMALS)).send();
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+
+ const result = await collectionHelper.methods
+ .destroyCollection(collectionAddress)
+ .send({from: owner});
+
+ const events = helper.eth.normalizeEvents(result.events);
+
+ expect(events).to.be.deep.equal([
+ {
+ address: collectionHelper.options.address,
+ event: 'CollectionDestroyed',
+ args: {
+ collectionId: collectionAddress,
+ },
+ },
+ ]);
+
+ expect(await collectionHelper.methods
+ .isCollectionExist(collectionAddress)
+ .call()).to.be.false;
+ expect(await helper.collection.getData(collectionId)).to.be.null;
+ });
+
+ itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+ {
+ const MAX_NAME_LENGTH = 64;
+ const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);
+ const description = 'A';
+ const tokenPrefix = 'A';
+
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ collectionName,
+ description,
+ tokenPrefix,
+ CollectionMode.Fungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH);
+ }
+ {
+ const MAX_DESCRIPTION_LENGTH = 256;
+ const collectionName = 'A';
+ const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1);
+ const tokenPrefix = 'A';
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ collectionName,
+ description,
+ tokenPrefix,
+ CollectionMode.Fungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH);
+ }
+ {
+ const MAX_TOKEN_PREFIX_LENGTH = 16;
+ const collectionName = 'A';
+ const description = 'A';
+ const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1);
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ collectionName,
+ description,
+ tokenPrefix,
+ CollectionMode.Fungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);
+ }
+ });
+
+ itEth('(!negative test!) cannot create collection if value !== 2', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+ const expects = [0n, 1n, 30n].map(async value => {
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ 'Peasantry',
+ 'absolutely anything',
+ 'TWIW',
+ CollectionMode.Fungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(value * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
+ });
+ await Promise.all(expects);
+ });
+ });
+
+ describe('Nonfungible collection', () => {
+ before(async function() {
+ await usingEthPlaygrounds((helper) => {
+ requirePalletsOrSkip(this, helper, [Pallets.NFT]);
+ return Promise.resolve();
+ });
+ });
+
+ itEth('Create collection', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const name = 'CollectionEVM';
+ const description = 'Some description';
+ const prefix = 'token prefix';
+
+ // todo:playgrounds this might fail when in async environment.
+ const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
+ const {collectionId, collectionAddress, events} = await helper.eth.createCollection(owner, new CreateCollectionData(name, description, prefix, 'nft')).send();
+
+ expect(events).to.be.deep.equal([
+ {
+ address: '0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F',
+ event: 'CollectionCreated',
+ args: {
+ owner: owner,
+ collectionId: collectionAddress,
+ },
+ },
+ ]);
+
+ const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created;
+
+ const collection = helper.nft.getCollectionObject(collectionId);
+ const data = (await collection.getData())!;
+
+ expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);
+ expect(collectionId).to.be.eq(collectionCountAfter);
+ expect(data.name).to.be.eq(name);
+ expect(data.description).to.be.eq(description);
+ expect(data.raw.tokenPrefix).to.be.eq(prefix);
+ expect(data.raw.mode).to.be.eq('NFT');
+
+ const options = await collection.getOptions();
+
+ expect(options.tokenPropertyPermissions).to.be.empty;
+ });
+
+ // this test will occasionally fail when in async environment.
+ itEth('Check collection address exist', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;
+ const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
+ expect(await collectionHelpers.methods
+ .isCollectionExist(expectedCollectionAddress)
+ .call()).to.be.false;
+
+ await collectionHelpers.methods
+ .createCollection([
+ emptyAddress,
+ 'A',
+ 'A',
+ 'A',
+ CollectionMode.Nonfungible,
+ 0,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .send({value: Number(2n * helper.balance.getOneTokenNominal())});
+
+ expect(await collectionHelpers.methods
+ .isCollectionExist(expectedCollectionAddress)
+ .call()).to.be.true;
+ });
+ });
+
+ describe('Create RFT collection from EVM', () => {
+ before(async function() {
+ await usingEthPlaygrounds((helper) => {
+ requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
+ return Promise.resolve();
+ });
+ });
+
+ itEth('Create collection', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const name = 'CollectionEVM';
+ const description = 'Some description';
+ const prefix = 'token prefix';
+
+ const {collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData(name, description, prefix, 'rft')).send();
+ const data = (await helper.rft.getData(collectionId))!;
+ const collection = helper.rft.getCollectionObject(collectionId);
+
+ expect(data.name).to.be.eq(name);
+ expect(data.description).to.be.eq(description);
+ expect(data.raw.tokenPrefix).to.be.eq(prefix);
+ expect(data.raw.mode).to.be.eq('ReFungible');
+
+ const options = await collection.getOptions();
+
+ expect(options.tokenPropertyPermissions).to.be.empty;
+ });
+
+ itEth('Create collection with properties & get description', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const name = 'CollectionEVM';
+ const description = 'Some description';
+ const prefix = 'token prefix';
+ const baseUri = 'BaseURI';
+
+ const {collectionId, collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, name, description, prefix, baseUri);
+ const contract = helper.ethNativeContract.collection(collectionAddress, 'nft');
+
+ const collection = helper.rft.getCollectionObject(collectionId);
+ const data = (await collection.getData())!;
+
+ expect(data.name).to.be.eq(name);
+ expect(data.description).to.be.eq(description);
+ expect(data.raw.tokenPrefix).to.be.eq(prefix);
+ expect(data.raw.mode).to.be.eq('ReFungible');
+
+ expect(await contract.methods.description().call()).to.deep.equal(description);
+
+ const options = await collection.getOptions();
+ expect(options.tokenPropertyPermissions).to.be.deep.equal([
+ {
+ key: 'URI',
+ permission: {mutable: true, collectionAdmin: true, tokenOwner: false},
+ },
+ {
+ key: 'URISuffix',
+ permission: {mutable: true, collectionAdmin: true, tokenOwner: false},
+ },
+ ]);
+ });
+
+ itEth('Set sponsorship', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const sponsor = await helper.eth.createAccountWithBalance(donor);
+ const ss58Format = helper.chain.getChainProperties().ss58Format;
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Sponsor', 'absolutely anything', 'ENVY', 'rft')).send();
+
+ const collection = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+ const sponsorCross = helper.ethCrossAccount.fromAddress(sponsor);
+ await collection.methods.setCollectionSponsorCross(sponsorCross).send();
+
+ let data = (await helper.rft.getData(collectionId))!;
+ expect(data.raw.sponsorship.Unconfirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));
+
+ await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
+
+ const sponsorCollection = await helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);
+ await sponsorCollection.methods.confirmCollectionSponsorship().send();
+
+ data = (await helper.rft.getData(collectionId))!;
+ expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));
+ });
+
+ itEth('Collection address exist', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';
+ const collectionHelpers = await helper.ethNativeContract.collectionHelpers(owner);
+
+ expect(await collectionHelpers
+ .methods.isCollectionExist(collectionAddressForNonexistentCollection).call())
+ .to.be.false;
+
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Exister', 'absolutely anything', 'WIWT', 'rft')).send();
+ expect(await collectionHelpers
+ .methods.isCollectionExist(collectionAddress).call())
+ .to.be.true;
+
+ // check collectionOwner:
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner, true);
+ const collectionOwner = await collectionEvm.methods.collectionOwner().call();
+ expect(helper.address.restoreCrossAccountFromBigInt(BigInt(collectionOwner.sub))).to.eq(helper.address.ethToSubstrate(owner, true));
+ });
+
+ itEth('destroyCollection', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'OLF', 'rft')).send();
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+
+ await expect(collectionHelper.methods
+ .destroyCollection(collectionAddress)
+ .send({from: owner})).to.be.fulfilled;
+
+ expect(await collectionHelper.methods
+ .isCollectionExist(collectionAddress)
+ .call()).to.be.false;
+ expect(await helper.collection.getData(collectionId)).to.be.null;
+ });
+
+ itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+ {
+ const MAX_NAME_LENGTH = 64;
+ const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);
+ const description = 'A';
+ const tokenPrefix = 'A';
+
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ collectionName,
+ description,
+ tokenPrefix,
+ CollectionMode.Refungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH);
+ }
+ {
+ const MAX_DESCRIPTION_LENGTH = 256;
+ const collectionName = 'A';
+ const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1);
+ const tokenPrefix = 'A';
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ collectionName,
+ description,
+ tokenPrefix,
+ CollectionMode.Refungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH);
+ }
+ {
+ const MAX_TOKEN_PREFIX_LENGTH = 16;
+ const collectionName = 'A';
+ const description = 'A';
+ const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1);
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ collectionName,
+ description,
+ tokenPrefix,
+ CollectionMode.Refungible,
+ DECIMALS,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);
+ }
+ });
+
+ itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
+ await expect(collectionHelper.methods
+ .createCollection([
+ emptyAddress,
+ 'Peasantry',
+ 'absolutely anything',
+ 'TWIW',
+ CollectionMode.Refungible,
+ 0,
+ ...CREATE_COLLECTION_DATA_DEFAULTS_ARRAY,
+ ])
+ .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');
+ });
+ });
+
+ describe('Sponsoring', () => {
+ itEth('Сan remove collection sponsor', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const sponsor = await helper.eth.createAccountWithBalance(donor);
+ const sponsorCross = helper.ethCrossAccount.fromAddr(sponsor);
+
+ const {collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Sponsor collection',
+ description: '1',
+ tokenPrefix: '1',
+ collectionMode: 'nft',
+ pendingSponsor: sponsorCross,
+ },
+ ).send();
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+
+ expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true;
+
+ await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});
+ let sponsorStruct = await collectionEvm.methods.collectionSponsor().call({from: owner});
+ expect(helper.address.restoreCrossAccountFromBigInt(BigInt(sponsorStruct.sub))).to.be.eq(helper.address.ethToSubstrate(sponsor, true));
+ expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
+
+ await collectionEvm.methods.removeCollectionSponsor().send({from: owner});
+
+ sponsorStruct = await collectionEvm.methods.collectionSponsor().call({from: owner});
+ expect(sponsorStruct.eth).to.be.eq('0x0000000000000000000000000000000000000000');
+ });
+
+ itEth('Can sponsor from evm address via access list', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const sponsorEth = await helper.eth.createAccountWithBalance(donor);
+ const sponsorCross = helper.ethCrossAccount.fromAddr(sponsorEth);
+
+ const {collectionId, collectionAddress} = await helper.eth.createERC721MetadataCompatibleCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Sponsor collection',
+ description: '1',
+ tokenPrefix: '1',
+ collectionMode: 'nft',
+ pendingSponsor: sponsorCross,
+ limits: [{field: CollectionLimitField.SponsoredDataRateLimit, value: 30n}],
+ tokenPropertyPermissions: [{key: 'key', permissions: [{code: TokenPermissionField.TokenOwner, value: true}]}],
+ },
+ '',
+ );
+
+ const collectionSub = helper.nft.getCollectionObject(collectionId);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+
+ let sponsorship = (await collectionSub.getData())!.raw.sponsorship;
+ expect(sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsorEth, true));
+ // Account cannot confirm sponsorship if it is not set as a sponsor
+ await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
+
+ // Sponsor can confirm sponsorship:
+ await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsorEth});
+ sponsorship = (await collectionSub.getData())!.raw.sponsorship;
+ expect(sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsorEth, true));
+
+ // Create user with no balance:
+ const user = helper.ethCrossAccount.createAccount();
+ const nextTokenId = await collectionEvm.methods.nextTokenId().call();
+ expect(nextTokenId).to.be.equal('1');
+
+ // Set collection permissions:
+ const oldPermissions = (await collectionSub.getData())!.raw.permissions;
+ expect(oldPermissions.mintMode).to.be.false;
+ expect(oldPermissions.access).to.be.equal('Normal');
+
+ await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner});
+ await collectionEvm.methods.addToCollectionAllowListCross(user).send({from: owner});
+ await collectionEvm.methods.setCollectionMintMode(true).send({from: owner});
+
+ const newPermissions = (await collectionSub.getData())!.raw.permissions;
+ expect(newPermissions.mintMode).to.be.true;
+ expect(newPermissions.access).to.be.equal('AllowList');
+
+ const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
+ const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsorEth));
+ const userBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(user.eth));
+
+ // User can mint token without balance:
+ {
+ const result = await collectionEvm.methods.mintCross(user, [{key: 'key', value: Buffer.from('Value')}]).send({from: user.eth});
+ const event = helper.eth.normalizeEvents(result.events)
+ .find(event => event.event === 'Transfer');
+
+ expect(event).to.be.deep.equal({
+ address: collectionAddress,
+ event: 'Transfer',
+ args: {
+ from: '0x0000000000000000000000000000000000000000',
+ to: user.eth,
+ tokenId: '1',
+ },
+ });
+
+ // await collectionEvm.methods.setProperties(1, [{key: 'key', value: Buffer.from('Value1')}]).send({from: user.eth});
+
+ const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
+ const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsorEth));
+ const userBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(user.eth));
+
+ expect(await collectionEvm.methods.properties(nextTokenId, []).call())
+ .to.be.like([
+ [
+ 'key',
+ '0x' + Buffer.from('Value').toString('hex'),
+ ],
+ ]);
+ expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter);
+ expect(userBalanceAfter).to.be.eq(userBalanceBefore);
+ expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true;
+ }
+ });
+
+ itEth('Check that transaction via EVM spend money from sponsor address', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const sponsor = await helper.eth.createAccountWithBalance(donor);
+ const sponsorCross = helper.ethCrossAccount.fromAddr(sponsor);
+ const user = helper.eth.createAccount();
+ const userCross = helper.ethCrossAccount.fromAddress(user);
+
+ const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Sponsor collection',
+ description: '1',
+ tokenPrefix: '1',
+ collectionMode: 'nft',
+ pendingSponsor: sponsorCross,
+ adminList: [userCross],
+ },
+ '',
+ );
+
+ const collectionSub = helper.nft.getCollectionObject(collectionId);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ // Set collection sponsor:
+ let collectionData = (await collectionSub.getData())!;
+ expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));
+ await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('ConfirmSponsorshipFail');
+
+ await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});
+ collectionData = (await collectionSub.getData())!;
+ expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true));
+
+ const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
+ const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
+
+ const mintingResult = await collectionEvm.methods.mintWithTokenURI(user, 'Test URI').send({from: user});
+ const tokenId = mintingResult.events.Transfer.returnValues.tokenId;
+
+ const event = helper.eth.normalizeEvents(mintingResult.events)
+ .find(event => event.event === 'Transfer');
+ const address = helper.ethAddress.fromCollectionId(collectionId);
+
+ expect(event).to.be.deep.equal({
+ address,
+ event: 'Transfer',
+ args: {
+ from: '0x0000000000000000000000000000000000000000',
+ to: user,
+ tokenId: '1',
+ },
+ });
+ expect(await collectionEvm.methods.tokenURI(tokenId).call({from: user})).to.be.equal('Test URI');
+
+ const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
+ expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);
+ const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
+ expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;
+ });
+
+ itEth('Can reassign collection sponsor', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const sponsorEth = await helper.eth.createAccountWithBalance(donor);
+ const sponsorCrossEth = helper.ethCrossAccount.fromAddr(sponsorEth);
+ const [sponsorSub] = await helper.arrange.createAccounts([100n], donor);
+ const sponsorCrossSub = helper.ethCrossAccount.fromKeyringPair(sponsorSub);
+
+ const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Sponsor collection',
+ description: '1',
+ tokenPrefix: '1',
+ collectionMode: 'nft',
+ pendingSponsor: sponsorCrossEth,
+ },
+ '',
+ );
+ const collectionSub = helper.nft.getCollectionObject(collectionId);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+
+ // Set and confirm sponsor:
+ await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsorEth});
+
+ // Can reassign sponsor:
+ await collectionEvm.methods.setCollectionSponsorCross(sponsorCrossSub).send({from: owner});
+ const collectionSponsor = (await collectionSub.getData())?.raw.sponsorship;
+ expect(collectionSponsor).to.deep.eq({Unconfirmed: sponsorSub.address});
+ });
+
+ [
+ 'transfer',
+ 'transferCross',
+ 'transferFrom',
+ 'transferFromCross',
+ ].map(testCase =>
+ itEth(`[${testCase}] Check that transfer via EVM spend money from sponsor address`, async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const sponsor = await helper.eth.createAccountWithBalance(donor);
+ const sponsorCross = helper.ethCrossAccount.fromAddr(sponsor);
+ const user = await helper.eth.createAccountWithBalance(donor);
+ const userCross = helper.ethCrossAccount.fromAddress(user);
+
+ const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Sponsor collection',
+ description: '1',
+ tokenPrefix: '1',
+ collectionMode: 'rft',
+ pendingSponsor: sponsorCross,
+ adminList: [userCross],
+ },
+ '',
+ );
+ const receiver = await helper.eth.createAccountWithBalance(donor);
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
+
+ await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});
+
+ const result = await collectionEvm.methods.mintWithTokenURI(user, 'Test URI').send({from: user});
+ const tokenId = result.events.Transfer.returnValues.tokenId;
+
+ const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
+ const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
+ const userBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(user));
+
+ switch (testCase) {
+ case 'transfer':
+ await collectionEvm.methods.transfer(receiver, tokenId).send({from: user});
+ break;
+ case 'transferCross':
+ await collectionEvm.methods.transferCross(helper.ethCrossAccount.fromAddress(receiver), tokenId).send({from: user});
+ break;
+ case 'transferFrom':
+ await collectionEvm.methods.transferFrom(user, receiver, tokenId).send({from: user});
+ break;
+ case 'transferFromCross':
+ await collectionEvm.methods.transferFromCross(helper.ethCrossAccount.fromAddress(user), helper.ethCrossAccount.fromAddress(receiver), tokenId).send({from: user});
+ break;
+ }
+
+ const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner));
+ expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore);
+ const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor));
+ expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true;
+ const userBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(user));
+ expect(userBalanceAfter).to.be.eq(userBalanceBefore);
+ }));
+ });
+
+ describe('Collection admins', () => {
+ let donor: IKeyringPair;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (_helper, privateKey) => {
+ donor = await privateKey({url: import.meta.url});
+ });
+ });
+
+ [
+ {mode: 'nft' as const, requiredPallets: []},
+ {mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
+ {mode: 'ft' as const, requiredPallets: []},
+ ].map(testCase => {
+ itEth.ifWithPallets(`can add account admin by owner for ${testCase.mode}`, testCase.requiredPallets, async ({helper, privateKey}) => {
+ // arrange
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const adminSub = await privateKey('//admin2');
+ const adminEth = helper.eth.createAccount().toLowerCase();
+
+ const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
+ const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
+
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Mint collection',
+ description: 'a',
+ tokenPrefix: 'b',
+ collectionMode: testCase.mode,
+ adminList: [adminCrossSub, adminCrossEth],
+ },
+ ).send();
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, true);
+
+ // 1. Expect api.rpc.unique.adminlist returns admins:
+ const adminListRpc = await helper.collection.getAdmins(collectionId);
+ expect(adminListRpc).to.has.length(2);
+ expect(adminListRpc).to.be.deep.contain.members([{Substrate: adminSub.address}, {Ethereum: adminEth}]);
+
+ // 2. Expect methods.collectionAdmins == api.rpc.unique.adminlist
+ let adminListEth = await collectionEvm.methods.collectionAdmins().call();
+ adminListEth = adminListEth.map((element: IEthCrossAccountId) => helper.address.convertCrossAccountFromEthCrossAccount(element));
+ expect(adminListRpc).to.be.like(adminListEth);
+
+ // 3. check isOwnerOrAdminCross returns true:
+ expect(await collectionEvm.methods.isOwnerOrAdminCross(adminCrossSub).call()).to.be.true;
+ expect(await collectionEvm.methods.isOwnerOrAdminCross(adminCrossEth).call()).to.be.true;
+ });
+ });
+
+ itEth('cross account admin can mint', async ({helper}) => {
+ // arrange: create collection and accounts
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const adminEth = (await helper.eth.createAccountWithBalance(donor)).toLowerCase();
+ const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
+ const [adminSub] = await helper.arrange.createAccounts([100n], donor);
+ const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
+ const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Mint collection',
+ description: 'a',
+ tokenPrefix: 'b',
+ collectionMode: 'nft',
+ adminList: [adminCrossSub, adminCrossEth],
+ },
+ 'uri',
+ );
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, true);
+
+ // admin (sub and eth) can mint token:
+ await collectionEvm.methods.mint(owner).send({from: adminEth});
+ await helper.nft.mintToken(adminSub, {collectionId, owner: {Ethereum: owner}});
+
+ expect(await helper.collection.getLastTokenId(collectionId)).to.eq(2);
+ });
+
+ itEth('cannot add invalid cross account admin', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const [admin] = await helper.arrange.createAccounts([100n, 100n], donor);
+
+ const adminCross = {
+ eth: helper.address.substrateToEth(admin.address),
+ sub: admin.addressRaw,
+ };
+
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: 'nft',
+ adminList: [adminCross],
+ },
+ ).call()).to.be.rejected;
+ });
+
+ itEth('Remove [cross] admin by owner', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const [adminSub] = await helper.arrange.createAccounts([10n], donor);
+ const adminEth = (await helper.eth.createAccountWithBalance(donor)).toLowerCase();
+ const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
+ const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
+
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: 'nft',
+ adminList: [adminCrossSub, adminCrossEth],
+ },
+ ).send();
+
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+
+ {
+ const adminList = await helper.collection.getAdmins(collectionId);
+ expect(adminList).to.deep.include({Substrate: adminSub.address});
+ expect(adminList).to.deep.include({Ethereum: adminEth});
+ }
+
+ await collectionEvm.methods.removeCollectionAdminCross(adminCrossSub).send();
+ await collectionEvm.methods.removeCollectionAdminCross(adminCrossEth).send();
+ const adminList = await helper.collection.getAdmins(collectionId);
+ expect(adminList.length).to.be.eq(0);
+
+ // Non admin cannot mint:
+ await expect(helper.nft.mintToken(adminSub, {collectionId, owner: {Substrate: adminSub.address}})).to.be.rejectedWith(/common.PublicMintingNotAllowed/);
+ await expect(collectionEvm.methods.mint(adminEth).send({from: adminEth})).to.be.rejected;
+ });
+ });
+
+ describe('Collection limits', () => {
+ describe('Can set collection limits', () => {
+ [
+ {case: 'nft' as const},
+ {case: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
+ {case: 'ft' as const},
+ ].map(testCase =>
+ itEth.ifWithPallets(`for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const limits = {
+ accountTokenOwnershipLimit: 1000n,
+ sponsoredDataSize: 1024n,
+ sponsoredDataRateLimit: 30n,
+ tokenLimit: 1000000n,
+ sponsorTransferTimeout: 6n,
+ sponsorApproveTimeout: 6n,
+ ownerCanTransfer: 1n,
+ ownerCanDestroy: 0n,
+ transfersEnabled: 0n,
+ };
+
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Limits',
+ description: 'absolutely anything',
+ tokenPrefix: 'FLO',
+ collectionMode: testCase.case,
+ limits: [
+ {field: CollectionLimitField.AccountTokenOwnership, value: limits.accountTokenOwnershipLimit},
+ {field: CollectionLimitField.SponsoredDataSize, value: limits.sponsoredDataSize},
+ {field: CollectionLimitField.SponsoredDataRateLimit, value: limits.sponsoredDataRateLimit},
+ {field: CollectionLimitField.TokenLimit, value: limits.tokenLimit},
+ {field: CollectionLimitField.SponsorTransferTimeout, value: limits.sponsorTransferTimeout},
+ {field: CollectionLimitField.SponsorApproveTimeout, value: limits.sponsorApproveTimeout},
+ {field: CollectionLimitField.OwnerCanTransfer, value: limits.ownerCanTransfer},
+ {field: CollectionLimitField.OwnerCanDestroy, value: limits.ownerCanDestroy},
+ {field: CollectionLimitField.TransferEnabled, value: limits.transfersEnabled},
+ ],
+ },
+ ).send();
+
+ const expectedLimits = {
+ accountTokenOwnershipLimit: 1000,
+ sponsoredDataSize: 1024,
+ sponsoredDataRateLimit: {blocks: 30},
+ tokenLimit: 1000000,
+ sponsorTransferTimeout: 6,
+ sponsorApproveTimeout: 6,
+ ownerCanTransfer: true,
+ ownerCanDestroy: false,
+ transfersEnabled: false,
+ };
+
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
+
+ // Check limits from sub:
+ const data = (await helper.rft.getData(collectionId))!;
+ expect(data.raw.limits).to.deep.eq(expectedLimits);
+ expect(await helper.collection.getEffectiveLimits(collectionId)).to.deep.eq(expectedLimits);
+ // Check limits from eth:
+ const limitsEvm = await collectionEvm.methods.collectionLimits().call({from: owner});
+ expect(limitsEvm).to.have.length(9);
+ expect(limitsEvm[0]).to.deep.eq([CollectionLimitField.AccountTokenOwnership.toString(), [true, limits.accountTokenOwnershipLimit.toString()]]);
+ expect(limitsEvm[1]).to.deep.eq([CollectionLimitField.SponsoredDataSize.toString(), [true, limits.sponsoredDataSize.toString()]]);
+ expect(limitsEvm[2]).to.deep.eq([CollectionLimitField.SponsoredDataRateLimit.toString(), [true, limits.sponsoredDataRateLimit.toString()]]);
+ expect(limitsEvm[3]).to.deep.eq([CollectionLimitField.TokenLimit.toString(), [true, limits.tokenLimit.toString()]]);
+ expect(limitsEvm[4]).to.deep.eq([CollectionLimitField.SponsorTransferTimeout.toString(), [true, limits.sponsorTransferTimeout.toString()]]);
+ expect(limitsEvm[5]).to.deep.eq([CollectionLimitField.SponsorApproveTimeout.toString(), [true, limits.sponsorApproveTimeout.toString()]]);
+ expect(limitsEvm[6]).to.deep.eq([CollectionLimitField.OwnerCanTransfer.toString(), [true, limits.ownerCanTransfer.toString()]]);
+ expect(limitsEvm[7]).to.deep.eq([CollectionLimitField.OwnerCanDestroy.toString(), [true, limits.ownerCanDestroy.toString()]]);
+ expect(limitsEvm[8]).to.deep.eq([CollectionLimitField.TransferEnabled.toString(), [true, limits.transfersEnabled.toString()]]);
+ }));
+ });
+
+ describe('(!negative test!) Cannot set invalid collection limits', () => {
+ [
+ {case: 'nft' as const},
+ {case: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
+ {case: 'ft' as const},
+ ].map(testCase =>
+ itEth.ifWithPallets(`for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {
+ const invalidLimits = {
+ accountTokenOwnershipLimit: BigInt(Number.MAX_SAFE_INTEGER),
+ transfersEnabled: 3,
+ };
+
+ const createCollectionData = {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'Limits',
+ description: 'absolutely anything',
+ tokenPrefix: 'ISNI',
+ collectionMode: testCase.case,
+ };
+
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ limits: [{field: 9 as CollectionLimitField, value: 1n}],
+ },
+ ).call()).to.be.rejectedWith('value not convertible into enum "CollectionLimitField"');
+
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ limits: [{field: CollectionLimitField.AccountTokenOwnership, value: invalidLimits.accountTokenOwnershipLimit}],
+ },
+ ).call()).to.be.rejectedWith(`can't convert value to u32 "${invalidLimits.accountTokenOwnershipLimit}"`);
+
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ limits: [{field: CollectionLimitField.TransferEnabled, value: 3n}],
+ },
+ ).call()).to.be.rejectedWith(`can't convert value to boolean "${invalidLimits.transfersEnabled}"`);
+
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ limits: [{field: CollectionLimitField.SponsoredDataSize, value: -1n}],
+ },
+ ).call()).to.be.rejectedWith('value out-of-bounds');
+ }));
+ });
+ });
+
+ describe('Collection properties', () => {
+
+ [
+ {mode: 'nft' as const, methodParams: [{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
+ {mode: 'rft' as const, methodParams: [{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
+ {mode: 'ft' as const, methodParams: [{key: 'testKey1', value: Buffer.from('testValue1')}, {key: 'testKey2', value: Buffer.from('testValue2')}], expectedProps: [{key: 'testKey1', value: 'testValue1'}, {key: 'testKey2', value: 'testValue2'}]},
+ ].map(testCase =>
+ itEth.ifWithPallets(`Collection properties can be set for ${testCase.mode}`, testCase.mode === 'rft' ? [Pallets.ReFungible] : [], async({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(donor);
+ const callerCross = helper.ethCrossAccount.fromAddress(caller);
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'name',
+ description: 'test',
+ tokenPrefix: 'test',
+ collectionMode: testCase.mode,
+ adminList: [callerCross],
+ properties: testCase.methodParams,
+ },
+ ).send();
+
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, caller);
+
+ const raw = (await helper[testCase.mode].getData(collectionId))?.raw;
+ expect(raw.properties).to.deep.equal(testCase.expectedProps);
+
+ // collectionProperties returns properties:
+ expect(await collectionEvm.methods.collectionProperties([]).call()).to.be.like(testCase.expectedProps.map(prop => helper.ethProperty.property(prop.key, prop.value)));
+ }));
+
+ [
+ {mode: 'nft' as const},
+ {mode: 'rft' as const},
+ {mode: 'ft' as const},
+ ].map(testCase =>
+ itEth.ifWithPallets(`Collection properties can be deleted for ${testCase.mode}`, testCase.mode === 'rft' ? [Pallets.ReFungible] : [], async({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(donor);
+ const callerCross = helper.ethCrossAccount.fromAddress(caller);
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'name',
+ description: 'test',
+ tokenPrefix: 'test',
+ collectionMode: testCase.mode,
+ adminList: [callerCross],
+ properties:[
+ {key: 'testKey1', value: Buffer.from('testValue1')},
+ {key: 'testKey2', value: Buffer.from('testValue2')},
+ {key: 'testKey3', value: Buffer.from('testValue3')}],
+ },
+ ).send();
+
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, caller);
+
+ await collectionEvm.methods.deleteCollectionProperties(['testKey1', 'testKey2']).send({from: caller});
+
+ const raw = (await helper[testCase.mode].getData(collectionId))?.raw;
+
+ expect(raw.properties.length).to.equal(1);
+ expect(raw.properties).to.deep.equal([{key: 'testKey3', value: 'testValue3'}]);
+ }));
+
+ itEth('(!negative test!) Cannot set invalid properties', async({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(donor);
+ const callerCross = helper.ethCrossAccount.fromAddress(caller);
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const createCollectionData = {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'name',
+ description: 'test',
+ tokenPrefix: 'test',
+ collectionMode: 'nft' as TCollectionMode,
+ adminList: [callerCross],
+ };
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ properties: [{key: '', value: Buffer.from('val1')}],
+ },
+ ).call()).to.be.rejected;
+
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ properties: [{key: 'déjà vu', value: Buffer.from('hmm...')}],
+ },
+ ).call()).to.be.rejected;
+
+ await expect(helper.eth.createCollection(
+ owner,
+ {
+ ...createCollectionData,
+ properties: [{key: 'a'.repeat(257), value: Buffer.from('val3')}],
+ },
+ ).call()).to.be.rejected;
+ });
+
+ itEth('(!negative test!) cannot delete properties of non-owned collections', async ({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(donor);
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'name',
+ description: 'test',
+ tokenPrefix: 'test',
+ collectionMode: 'nft',
+ properties:[
+ {key: 'testKey1', value: Buffer.from('testValue1')},
+ {key: 'testKey2', value: Buffer.from('testValue2')}],
+ },
+ ).send();
+
+ const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', caller);
+
+ await expect(collectionEvm.methods.deleteCollectionProperties(['testKey2']).send({from: caller})).to.be.rejected;
+ });
+ });
+
+ describe('Token property permissions', () => {
+ [
+ {mode: 'nft' as const, requiredPallets: []},
+ {mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
+ ].map(testCase =>
+ itEth.ifWithPallets(`[${testCase.mode}] Can set all possible token property permissions`, testCase.requiredPallets, async({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
+ for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: testCase.mode,
+ adminList: [caller],
+ tokenPropertyPermissions: [
+ {
+ key: 'testKey',
+ permissions: [
+ {code: TokenPermissionField.Mutable, value: mutable},
+ {code: TokenPermissionField.TokenOwner, value: tokenOwner},
+ {code: TokenPermissionField.CollectionAdmin, value: collectionAdmin},
+ ],
+ },
+ ],
+ },
+ ).send();
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+
+ expect(await helper[testCase.mode].getPropertyPermissions(collectionId)).to.be.deep.equal([{
+ key: 'testKey',
+ permission: {mutable, collectionAdmin, tokenOwner},
+ }]);
+
+ expect(await collection.methods.tokenPropertyPermissions().call({from: caller.eth})).to.be.like([
+ ['testKey', [
+ [TokenPermissionField.Mutable.toString(), mutable],
+ [TokenPermissionField.TokenOwner.toString(), tokenOwner],
+ [TokenPermissionField.CollectionAdmin.toString(), collectionAdmin]],
+ ],
+ ]);
+ }
+ }));
+
+ [
+ {mode: 'nft' as const, requiredPallets: []},
+ {mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
+ ].map(testCase =>
+ itEth.ifWithPallets(`[${testCase.mode}] Can set multiple token property permissions`, testCase.requiredPallets, async({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: testCase.mode,
+ tokenPropertyPermissions: [
+ {
+ key: 'testKey_0',
+ permissions: [
+ {code: TokenPermissionField.Mutable, value: true},
+ {code: TokenPermissionField.TokenOwner, value: true},
+ {code: TokenPermissionField.CollectionAdmin, value: true}],
+ },
+ {
+ key: 'testKey_1',
+ permissions: [
+ {code: TokenPermissionField.Mutable, value: true},
+ {code: TokenPermissionField.TokenOwner, value: false},
+ {code: TokenPermissionField.CollectionAdmin, value: true}],
+ },
+ {
+ key: 'testKey_2',
+ permissions: [
+ {code: TokenPermissionField.Mutable, value: false},
+ {code: TokenPermissionField.TokenOwner, value: true},
+ {code: TokenPermissionField.CollectionAdmin, value: false}],
+ },
+ ],
+ },
+ ).send();
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
+
+ expect(await helper[testCase.mode].getPropertyPermissions(collectionId)).to.be.deep.equal([
+ {
+ key: 'testKey_0',
+ permission: {mutable: true, tokenOwner: true, collectionAdmin: true},
+ },
+ {
+ key: 'testKey_1',
+ permission: {mutable: true, tokenOwner: false, collectionAdmin: true},
+ },
+ {
+ key: 'testKey_2',
+ permission: {mutable: false, tokenOwner: true, collectionAdmin: false},
+ },
+ ]);
+
+ expect(await collection.methods.tokenPropertyPermissions().call({from: owner})).to.be.like([
+ ['testKey_0', [
+ [TokenPermissionField.Mutable.toString(), true],
+ [TokenPermissionField.TokenOwner.toString(), true],
+ [TokenPermissionField.CollectionAdmin.toString(), true]],
+ ],
+ ['testKey_1', [
+ [TokenPermissionField.Mutable.toString(), true],
+ [TokenPermissionField.TokenOwner.toString(), false],
+ [TokenPermissionField.CollectionAdmin.toString(), true]],
+ ],
+ ['testKey_2', [
+ [TokenPermissionField.Mutable.toString(), false],
+ [TokenPermissionField.TokenOwner.toString(), true],
+ [TokenPermissionField.CollectionAdmin.toString(), false]],
+ ],
+ ]);
+ }));
+
+ [
+ {mode: 'nft' as const, requiredPallets: []},
+ {mode: 'rft' as const, requiredPallets: [Pallets.ReFungible]},
+ ].map(testCase =>
+ itEth.ifWithPallets(`Can be deleted for ${testCase.mode}`, testCase.requiredPallets, async({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(donor);
+ const receiver = await helper.ethCrossAccount.createAccountWithBalance(donor);
+ const {collectionAddress} = await helper.eth.createCollection(
+ caller,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: testCase.mode,
+ adminList: [receiver],
+ tokenPropertyPermissions: [
+ {
+ key: 'testKey',
+ permissions: [
+ {code: TokenPermissionField.Mutable, value: true},
+ {code: TokenPermissionField.CollectionAdmin, value: true}],
+ },
+ {
+ key: 'testKey_1',
+ permissions: [
+ {code: TokenPermissionField.Mutable, value: true},
+ {code: TokenPermissionField.CollectionAdmin, value: true}],
+ },
+ ],
+ },
+ ).send();
+
+ const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, caller);
+ const tokenId = (await collection.methods.mintCross(receiver, [{key: 'testKey', value: Buffer.from('testValue')}, {key: 'testKey_1', value: Buffer.from('testValue_1')}]).send()).events.Transfer.returnValues.tokenId;
+ expect(await collection.methods.properties(tokenId, ['testKey', 'testKey_1']).call()).to.has.length(2);
+
+ await collection.methods.deleteProperties(tokenId, ['testKey', 'testKey_1']).send({from: caller});
+ expect(await collection.methods.properties(tokenId, ['testKey', 'testKey_1']).call()).to.has.length(0);
+ }));
+ });
+
+ describe('Nesting', () => {
+ itEth('NFT: allows an Owner to nest/unnest their token', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: 'nft',
+ nestingSettings: {token_owner: true, collection_admin: false, restricted: []},
+ },
+ ).send();
+
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+
+ // Create a token to be nested to
+ const mintingTargetNFTTokenIdResult = await contract.methods.mint(owner).send({from: owner});
+ const targetNFTTokenId = mintingTargetNFTTokenIdResult.events.Transfer.returnValues.tokenId;
+ const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNFTTokenId);
+
+ // Create a nested token
+ const mintingFirstTokenIdResult = await contract.methods.mint(targetNftTokenAddress).send({from: owner});
+ const firstTokenId = mintingFirstTokenIdResult.events.Transfer.returnValues.tokenId;
+ expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress);
+
+ // Create a token to be nested and nest
+ const mintingSecondTokenIdResult = await contract.methods.mint(owner).send({from: owner});
+ const secondTokenId = mintingSecondTokenIdResult.events.Transfer.returnValues.tokenId;
+
+ 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: collectionNesting()', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionAddress: unnestedCollectionAddress} = await helper.eth.createCollection(
+ owner,
+ new CreateCollectionData('A', 'B', 'C', 'nft'),
+ ).send();
+
+ const unnestedContract = await helper.ethNativeContract.collection(unnestedCollectionAddress, 'nft', owner);
+ expect(await unnestedContract.methods.collectionNesting().call({from: owner})).to.be.like([false, false, []]);
+
+ const {collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: 'nft',
+ nestingSettings: {token_owner: true, collection_admin: false, restricted: [unnestedCollectionAddress.toString()]},
+ },
+ ).send();
+
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+ expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([true, false, [unnestedCollectionAddress.toString()]]);
+ await contract.methods.setCollectionNesting([false, false, []]).send({from: owner});
+ expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([false, false, []]);
+ });
+
+ itEth('NFT: disallows to nest token if nesting is disabled', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(
+ owner,
+ {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: 'nft',
+ nestingSettings: {token_owner: false, collection_admin: false, restricted: []},
+ },
+ ).send();
+
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
+
+ // Create a token to nest into
+ const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner});
+ const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId;
+ const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId);
+
+ // Create a token to nest
+ const mintingNftTokenIdResult = await contract.methods.mint(owner).send({from: owner});
+ const nftTokenId = mintingNftTokenIdResult.events.Transfer.returnValues.tokenId;
+
+ // Try to nest
+ await expect(contract.methods
+ .transfer(targetNftTokenAddress, nftTokenId)
+ .call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest');
+ });
+ });
+
+ describe('Flags', () => {
+ const createCollectionData = {
+ ...CREATE_COLLECTION_DATA_DEFAULTS,
+ name: 'A',
+ description: 'B',
+ tokenPrefix: 'C',
+ collectionMode: 'nft' as TCollectionMode,
+ };
+
+ itEth('NFT: use numbers for flags', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: 0}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: false});
+ }
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: 64}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: true});
+ }
+ });
+
+ itEth('NFT: foreign flag number is ignored', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: 128}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: false});
+ }
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: 192}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: true});
+ }
+ });
+
+ itEth('NFT: use enum for flags', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: [CollectionFlag.Erc721metadata]}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: true});
+ }
+ });
+
+ itEth('NFT: foreign flag enum is ignored', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: [CollectionFlag.Foreign]}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: false});
+ }
+
+ {
+ const {collectionId} = await helper.eth.createCollection(owner, {...createCollectionData, flags: [CollectionFlag.Erc721metadata | CollectionFlag.Foreign]}).send();
+ expect((await helper.nft.getData(collectionId))?.raw.flags).to.be.deep.equal({foreign: false, erc721metadata: true});
+ }
+ });
+ });
+});
tests/src/eth/destroyCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/destroyCollection.test.ts
+++ b/tests/src/eth/destroyCollection.test.ts
@@ -17,13 +17,15 @@
import {IKeyringPair} from '@polkadot/types/types';
import {Pallets} from '../util';
import {expect, itEth, usingEthPlaygrounds} from './util';
+import {TCollectionMode} from '../util/playgrounds/types';
+import {CreateCollectionData} from './util/playgrounds/types';
describe('Destroy Collection from EVM', function() {
let donor: IKeyringPair;
const testCases = [
- {case: 'rft' as const, params: ['Limits', 'absolutely anything', 'OLF'], requiredPallets: [Pallets.ReFungible]},
- {case: 'nft' as const, params: ['Limits', 'absolutely anything', 'OLF'], requiredPallets: [Pallets.NFT]},
- {case: 'ft' as const, params: ['Limits', 'absolutely anything', 'OLF', 18], requiredPallets: [Pallets.Fungible]},
+ {case: 'rft' as const, params: ['Limits', 'absolutely anything', 'OLF', 'rft'], requiredPallets: [Pallets.ReFungible]},
+ {case: 'nft' as const, params: ['Limits', 'absolutely anything', 'OLF', 'nft'], requiredPallets: [Pallets.NFT]},
+ {case: 'ft' as const, params: ['Limits', 'absolutely anything', 'OLF', 'ft', 18], requiredPallets: [Pallets.Fungible]},
];
before(async function() {
@@ -40,8 +42,7 @@
const unexistedCollection = helper.ethAddress.fromCollectionId(1000000);
const collectionHelpers = await helper.ethNativeContract.collectionHelpers(signer);
- const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, ...testCase.params as [string, string, string, number?]);
-
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData(...testCase.params as [string, string, string, TCollectionMode, number?])).send();
// cannot burn collec
await expect(collectionHelpers.methods
.destroyCollection(collectionAddress)
tests/src/eth/events.test.tsdiffbeforeafterboth--- a/tests/src/eth/events.test.ts
+++ b/tests/src/eth/events.test.ts
@@ -19,7 +19,7 @@
import {EthUniqueHelper, itEth, usingEthPlaygrounds} from './util';
import {IEvent, TCollectionMode} from '../util/playgrounds/types';
import {Pallets, requirePalletsOrSkip} from '../util';
-import {CollectionLimitField, TokenPermissionField, NormalizedEvent} from './util/playgrounds/types';
+import {CollectionLimitField, TokenPermissionField, NormalizedEvent, CreateCollectionData} from './util/playgrounds/types';
let donor: IKeyringPair;
@@ -39,7 +39,8 @@
async function testCollectionCreatedAndDestroy(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const {unsubscribe, collectedEvents: subEvents} = await helper.subscribeEvents([{section: 'common', names: ['CollectionCreated', 'CollectionDestroyed']}]);
- const {collectionAddress, events: ethEvents} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress, events: ethEvents} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
+
await helper.wait.newBlocks(1);
{
expect(ethEvents).to.containSubset([
@@ -72,7 +73,7 @@
async function testCollectionPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
@@ -113,7 +114,7 @@
async function testPropertyPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
@@ -144,7 +145,7 @@
async function testAllowListAddressAddedAndRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const user = helper.ethCrossAccount.createAccount();
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any[] = [];
@@ -186,7 +187,7 @@
async function testCollectionAdminAddedAndRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const user = helper.ethCrossAccount.createAccount();
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
@@ -226,7 +227,7 @@
async function testCollectionLimitSet(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
@@ -253,7 +254,7 @@
async function testCollectionOwnerChanged(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const newOwner = helper.ethCrossAccount.createAccount();
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
@@ -279,7 +280,7 @@
async function testCollectionPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
@@ -320,7 +321,7 @@
async function testCollectionSponsorSetAndConfirmedAndThenRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
const sponsor = await helper.ethCrossAccount.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
const ethEvents: any = [];
@@ -374,7 +375,7 @@
async function testTokenPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
const result = await collection.methods.mint(owner).send({from: owner});
const tokenId = result.events.Transfer.returnValues.tokenId;
tests/src/eth/marketplace-v2/Market.soldiffbeforeafterboth--- a/tests/src/eth/marketplace-v2/Market.sol
+++ b/tests/src/eth/marketplace-v2/Market.sol
@@ -7,7 +7,7 @@
import "@openzeppelin/contracts/access/Ownable.sol";
import { UniqueNFT, CrossAddress } from "@unique-nft/solidity-interfaces/contracts/UniqueNFT.sol";
import { UniqueFungible, CrossAddress as CrossAddressF } from "@unique-nft/solidity-interfaces/contracts/UniqueFungible.sol";
-import "@unique-nft/solidity-interfaces/contracts/CollectionHelpers.sol";
+import { CollectionHelpers } from "@unique-nft/solidity-interfaces/contracts/CollectionHelpers.sol";
import "./royalty/UniqueRoyaltyHelper.sol";
contract Market is Ownable, ReentrancyGuard {
tests/src/eth/marketplace/marketplace.test.tsdiffbeforeafterboth--- a/tests/src/eth/marketplace/marketplace.test.ts
+++ b/tests/src/eth/marketplace/marketplace.test.ts
@@ -60,7 +60,7 @@
await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});
await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});
- const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address});
+ const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: {Substrate: alice.address}});
await collection.confirmSponsorship(alice);
await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});
const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
@@ -114,7 +114,7 @@
await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});
await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});
- const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address});
+ const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: {Substrate: alice.address}});
await collection.confirmSponsorship(alice);
await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});
const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
tests/src/eth/nesting/nest.test.tsdiffbeforeafterboth--- a/tests/src/eth/nesting/nest.test.ts
+++ b/tests/src/eth/nesting/nest.test.ts
@@ -6,11 +6,12 @@
const createNestingCollection = async (
helper: EthUniqueHelper,
owner: string,
+ mergeDeprecated = false,
): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => {
const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
- await contract.methods.setCollectionNesting(true).send({from: owner});
+ const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, mergeDeprecated);
+ await contract.methods.setCollectionNesting([true, false, []]).send({from: owner});
return {collectionId, collectionAddress, contract};
};
@@ -52,27 +53,44 @@
expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);
});
+ itEth('NFT: collectionNesting()', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const {collectionAddress: unnestedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
+ const unnestedContract = await helper.ethNativeContract.collection(unnestedCollectionAddress, 'nft', owner);
+ expect(await unnestedContract.methods.collectionNesting().call({from: owner})).to.be.like([false, false, []]);
+
+ const {contract} = await createNestingCollection(helper, owner);
+ expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([true, false, []]);
+ await contract.methods.setCollectionNesting([true, false, [unnestedCollectionAddress]]).send({from: owner});
+ expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([true, false, [unnestedCollectionAddress]]);
+ await contract.methods.setCollectionNesting([false, true, [unnestedCollectionAddress]]).send({from: owner});
+ expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([false, true, [unnestedCollectionAddress]]);
+ await contract.methods.setCollectionNesting([false, false, []]).send({from: owner});
+ expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([false, false, []]);
+ });
+
+ // Sof-deprecated
itEth('NFT: collectionNestingRestrictedCollectionIds() & collectionNestingPermissions', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionId: unnestedCollsectionId, collectionAddress: unnsetedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
- const unnestedContract = await helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner);
+ const unnestedContract = await helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner, true);
expect(await unnestedContract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([false, []]);
- const {contract} = await createNestingCollection(helper, owner);
+ const {contract} = await createNestingCollection(helper, owner, true);
expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, []]);
- await contract.methods.setCollectionNesting(true, [unnsetedCollectionAddress]).send({from: owner});
+ await contract.methods['setCollectionNesting(bool,address[])'](true, [unnsetedCollectionAddress]).send({from: owner});
expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, [unnestedCollsectionId.toString()]]);
expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', true]]);
- await contract.methods.setCollectionNesting(false).send({from: owner});
+ await contract.methods['setCollectionNesting(bool)'](false).send({from: owner});
expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', false]]);
});
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});
+ const {collectionId: collectionIdA, contract: contractA} = await createNestingCollection(helper, owner);
+ const {contract: contractB} = await createNestingCollection(helper, owner);
+ await contractA.methods.setCollectionNesting([true, false, [contractA.options.address, contractB.options.address]]).send({from: owner});
// Create a token to nest into
const mintingtargetNftTokenIdResult = await contractA.methods.mint(owner).send({from: owner});
@@ -101,7 +119,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionId, contract} = await createNestingCollection(helper, owner);
- await contract.methods.setCollectionNesting(false).send({from: owner});
+ await contract.methods.setCollectionNesting([false, false, []]).send({from: owner});
// Create a token to nest into
const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner});
@@ -143,10 +161,10 @@
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);
+ const {collectionId: collectionIdA, contract: contractA} = await createNestingCollection(helper, owner);
+ const {collectionId: collectionIdB, contract: contractB} = await createNestingCollection(helper, owner);
- await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});
+ await contractA.methods.setCollectionNesting([true, false, [contractA.options.address, contractB.options.address]]).send({from: owner});
// Create a token in one collection
const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner});
@@ -166,10 +184,10 @@
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 {collectionId: collectionIdA, contract: contractA} = await createNestingCollection(helper, owner);
const {contract: contractB} = await createNestingCollection(helper, owner);
- await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner});
+ await contractA.methods.setCollectionNesting([true, false, [contractA.options.address]]).send({from: owner});
// Create a token in one collection
const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner});
@@ -251,7 +269,7 @@
itEth(`Disallow nest into collection without nesting permission [${testCase.mode}] (except for native fungible collection)`, async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const {collectionId: targetCollectionId, contract: targetContract} = await createNestingCollection(helper, owner);
- await targetContract.methods.setCollectionNesting(false).send({from: owner});
+ await targetContract.methods.setCollectionNesting([false, false, []]).send({from: owner});
const {contract: ftContract} = await createFungibleCollection(helper, owner, testCase.mode);
tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -20,7 +20,7 @@
import {ITokenPropertyPermission} from '../util/playgrounds/types';
import {Pallets} from '../util';
import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '../util/playgrounds/unique';
-import {TokenPermissionField} from './util/playgrounds/types';
+import {CreateCollectionData, TokenPermissionField} from './util/playgrounds/types';
describe('EVM token properties', () => {
let donor: IKeyringPair;
@@ -41,7 +41,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {
- const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await collection.methods.addCollectionAdminCross(caller).send({from: owner});
@@ -75,7 +75,7 @@
itEth.ifWithPallets(`[${testCase.mode}] Can set multiple token property permissions as owner`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await collection.methods.setTokenPropertyPermissions([
@@ -138,7 +138,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
- const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await collection.methods.addCollectionAdminCross(caller).send({from: owner});
@@ -455,7 +455,7 @@
const owner = await helper.eth.createAccountWithBalance(donor);
const caller = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await expect(collection.methods.setTokenPropertyPermissions([
@@ -474,7 +474,7 @@
itEth.ifWithPallets(`[${testCase.mode}] Cannot set token property permissions with invalid character`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
await expect(collection.methods.setTokenPropertyPermissions([
@@ -494,7 +494,7 @@
itEth.ifWithPallets(`[${testCase.mode}] Can reconfigure token property permissions to stricter ones`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
// 1. Owner sets strict property-permissions:
@@ -530,7 +530,7 @@
itEth.ifWithPallets(`[${testCase.mode}] Cannot reconfigure token property permissions to less strict ones`, testCase.requiredPallets, async({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');
+ const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
// 1. Owner sets strict property-permissions:
tests/src/eth/tokens/callMethodsERC20.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokens/callMethodsERC20.test.ts
+++ b/tests/src/eth/tokens/callMethodsERC20.test.ts
@@ -17,6 +17,7 @@
import {Pallets, requirePalletsOrSkip} from '../../util';
import {expect, itEth, usingEthPlaygrounds} from '../util';
import {IKeyringPair} from '@polkadot/types/types';
+import {CreateCollectionData} from '../util/playgrounds/types';
[
{mode: 'ft' as const, requiredPallets: []},
@@ -36,7 +37,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const mintingParams = testCase.mode === 'ft' ? [caller, 200n] : [caller];
- const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'TotalSupply', '6', '6');
+ const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('TotalSupply', '6', '6', testCase.mode)).send();
if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});
// Use collection contract for FT or token contract for RFT:
@@ -57,7 +58,7 @@
const caller = await helper.eth.createAccountWithBalance(donor);
const mintingParams = testCase.mode === 'ft' ? [caller, 200n] : [caller];
- const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'BalanceOf', 'Descroption', 'Prefix');
+ const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('BalanceOf', 'Descroption', 'Prefix', testCase.mode)).send();
if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});
// Use collection contract for FT or token contract for RFT:
@@ -76,7 +77,7 @@
itEth('decimals', async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
- const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'BalanceOf', 'Descroption', 'Prefix');
+ const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('BalanceOf', 'Descroption', 'Prefix', testCase.mode)).send();
if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});
// Use collection contract for FT or token contract for RFT:
tests/src/eth/tokens/callMethodsERC721.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokens/callMethodsERC721.test.ts
+++ b/tests/src/eth/tokens/callMethodsERC721.test.ts
@@ -17,6 +17,7 @@
import {Pallets} from '../../util';
import {expect, itEth, usingEthPlaygrounds} from '../util';
import {IKeyringPair} from '@polkadot/types/types';
+import {CreateCollectionData} from '../util/playgrounds/types';
describe('ERC-721 call methods', () => {
@@ -37,7 +38,7 @@
const [callerSub] = await helper.arrange.createAccounts([100n], donor);
const [name, description, tokenPrefix] = ['Name', 'Description', 'Symbol'];
- const {collection: collectionEth} = await helper.eth.createCollection(testCase.mode, callerEth, name, description, tokenPrefix);
+ const {collection: collectionEth} = await helper.eth.createCollection(callerEth, new CreateCollectionData(name, description, tokenPrefix, testCase.mode)).send();
await collectionEth.methods.mint(callerEth).send({from: callerEth});
const {collectionId} = await helper[testCase.mode].mintCollection(callerSub, {name, description, tokenPrefix});
const collectionSub = await helper.ethNativeContract.collectionById(collectionId, testCase.mode, callerEth);
@@ -60,7 +61,7 @@
itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: totalSupply`, testCase.requiredPallets, async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
- const {collection} = await helper.eth.createCollection(testCase.mode, caller, 'TotalSupply', '6', '6');
+ const {collection} = await helper.eth.createCollection(caller, new CreateCollectionData('TotalSupply', '6', '6', testCase.mode)).send();
await collection.methods.mint(caller).send({from: caller});
const totalSupply = await collection.methods.totalSupply().call();
@@ -75,7 +76,7 @@
itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: balanceOf`, testCase.requiredPallets, async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
- const {collection} = await helper.eth.createCollection(testCase.mode, caller, 'BalanceOf', 'Descroption', 'Prefix');
+ const {collection} = await helper.eth.createCollection(caller, new CreateCollectionData('BalanceOf', 'Descroption', 'Prefix', testCase.mode)).send();
await collection.methods.mint(caller).send({from: caller});
await collection.methods.mint(caller).send({from: caller});
await collection.methods.mint(caller).send({from: caller});
@@ -91,7 +92,7 @@
].map(testCase => {
itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: ownerOf`, testCase.requiredPallets, async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
- const {collection} = await helper.eth.createCollection(testCase.mode, caller, 'OwnerOf', '6', '6');
+ const {collection} = await helper.eth.createCollection(caller, new CreateCollectionData('OwnerOf', '6', '6', testCase.mode)).send();
const result = await collection.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
@@ -108,7 +109,7 @@
itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: ownerOf after burn`, testCase.requiredPallets, async ({helper}) => {
const caller = await helper.eth.createAccountWithBalance(donor);
const receiver = helper.eth.createAccount();
- const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'OwnerOf-AfterBurn', '6', '6');
+ const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('OwnerOf-AfterBurn', '6', '6', testCase.mode)).send();
const result = await collection.methods.mint(caller).send();
const tokenId = result.events.Transfer.returnValues.tokenId;
tests/src/eth/tokens/minting.test.tsdiffbeforeafterboth--- a/tests/src/eth/tokens/minting.test.ts
+++ b/tests/src/eth/tokens/minting.test.ts
@@ -17,6 +17,7 @@
import {IKeyringPair} from '@polkadot/types/types';
import {Pallets} from '../../util';
import {expect, itEth, usingEthPlaygrounds} from '../util';
+import {CreateCollectionData} from '../util/playgrounds/types';
describe('Minting tokens', () => {
@@ -78,7 +79,7 @@
const receiver = helper.eth.createAccount();
const mintingParams = testCase.mode === 'ft' ? [receiver, 100] : [receiver];
- const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'Name', 'Desc', 'Prefix');
+ const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('Name', 'Desc', 'Prefix', testCase.mode)).send();
const result = await collection.methods.mint(...mintingParams).send({from: owner});
@@ -112,7 +113,7 @@
const receiver = helper.eth.createAccount();
const mintingParams = testCase.mode === 'ft' ? [receiver, 100] : [receiver];
- const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'Name', 'Desc', 'Prefix');
+ const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('Name', 'Desc', 'Prefix', testCase.mode)).send();
const result = await collection.methods.mint(...mintingParams).send({from: owner});
tests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/types.ts
+++ b/tests/src/eth/util/playgrounds/types.ts
@@ -1,3 +1,5 @@
+import {CollectionFlag, TCollectionMode} from '../../../util/playgrounds/types';
+
export interface ContractImports {
solPath: string;
fsPath: string;
@@ -19,8 +21,10 @@
value: bigint,
}
+export type EthAddress = string;
+
export interface CrossAddress {
- readonly eth: string,
+ readonly eth: EthAddress,
readonly sub: string | Uint8Array,
}
@@ -48,3 +52,81 @@
field: CollectionLimitField,
value: OptionUint,
}
+
+export interface CollectionLimitValue {
+ field: CollectionLimitField,
+ value: bigint,
+}
+
+export enum CollectionMode {
+ Fungible,
+ Nonfungible,
+ Refungible,
+}
+
+export interface PropertyPermission {
+ code: TokenPermissionField,
+ value: boolean,
+}
+export interface TokenPropertyPermission {
+ key: string,
+ permissions: PropertyPermission[],
+}
+export interface CollectionNestingAndPermission {
+ token_owner: boolean,
+ collection_admin: boolean,
+ restricted: string[],
+}
+
+export const emptyAddress: [string, string] = [
+ '0x0000000000000000000000000000000000000000',
+ '0',
+];
+
+export const CREATE_COLLECTION_DATA_DEFAULTS = {
+ decimals: 0,
+ properties: [],
+ tokenPropertyPermissions: [],
+ adminList: [],
+ nestingSettings: {token_owner: false, collection_admin: false, restricted: []},
+ limits: [],
+ pendingSponsor: emptyAddress,
+ flags: 0,
+};
+
+export interface Property {
+ key: string;
+ value: Buffer;
+}
+
+export class CreateCollectionData {
+ name: string;
+ description: string;
+ tokenPrefix: string;
+ collectionMode: TCollectionMode;
+ decimals? = 0;
+ properties?: Property[] = [];
+ tokenPropertyPermissions?: TokenPropertyPermission[] = [];
+ adminList?: CrossAddress[] = [];
+ nestingSettings?: CollectionNestingAndPermission = {token_owner: false, collection_admin: false, restricted: []};
+ limits?: CollectionLimitValue[] = [];
+ pendingSponsor?: [string, string] = emptyAddress;
+ flags?: number | CollectionFlag[] = [0];
+
+ constructor(
+ name: string,
+ description: string,
+ tokenPrefix: string,
+ collectionMode: TCollectionMode,
+ decimals = 18,
+ ) {
+ this.name = name;
+ this.description = description;
+ this.tokenPrefix = tokenPrefix;
+ this.collectionMode = collectionMode;
+ if(collectionMode == 'ft')
+ this.decimals = decimals;
+ else
+ this.decimals = 0;
+ }
+}
\ No newline at end of file
tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -18,7 +18,7 @@
import {ArrangeGroup, DevUniqueHelper} from '../../../util/playgrounds/unique.dev';
-import {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty} from './types';
+import {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty, CollectionMode, CreateCollectionData} from './types';
// Native contracts ABI
import collectionHelpersAbi from '../../abi/collectionHelpers.json' assert {type: 'json'};
@@ -50,7 +50,6 @@
}
}
-
class ContractGroup extends EthGroupBase {
async findImports(imports?: ContractImports[]) {
if(!imports) return function(path: string) {
@@ -181,7 +180,84 @@
}
}
+class CreateCollectionTransaction {
+ signer: string;
+ data: CreateCollectionData;
+ mergeDeprecated: boolean;
+ helper: EthUniqueHelper;
+
+ constructor(helper: EthUniqueHelper, signer: string, data: CreateCollectionData, mergeDeprecated = false) {
+ this.helper = helper;
+ this.signer = signer;
+
+ let flags = 0;
+ // convert CollectionFlags to number and join them in one number
+ if(!data.flags || typeof data.flags == 'number') {
+ flags = data.flags ?? 0;
+ } else {
+ for(let i = 0; i < data.flags.length; i++){
+ const flag = data.flags[i];
+ flags = flags | flag;
+ }
+ }
+ data.flags = flags;
+
+ this.data = data;
+ this.mergeDeprecated = mergeDeprecated;
+ }
+
+ private async createTransaction() {
+ const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(this.signer);
+ let collectionMode;
+ switch (this.data.collectionMode) {
+ case 'nft': collectionMode = CollectionMode.Nonfungible; break;
+ case 'rft': collectionMode = CollectionMode.Refungible; break;
+ case 'ft': collectionMode = CollectionMode.Fungible; break;
+ }
+
+ const tx = collectionHelper.methods.createCollection([
+ this.data.pendingSponsor,
+ this.data.name,
+ this.data.description,
+ this.data.tokenPrefix,
+ collectionMode,
+ this.data.decimals,
+ this.data.properties,
+ this.data.tokenPropertyPermissions,
+ this.data.adminList,
+ this.data.nestingSettings,
+ this.data.limits,
+ this.data.flags,
+ ]);
+ return tx;
+ }
+
+ async send(options?: any): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[], collection: Contract }> {
+ const collectionCreationPrice = {
+ value: Number(this.helper.balance.getCollectionCreationPrice()),
+ };
+ const tx = await this.createTransaction();
+ const result = await tx.send({...options, ...collectionCreationPrice});
+ const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
+ const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress);
+ const events = this.helper.eth.normalizeEvents(result.events);
+ const collection = await this.helper.ethNativeContract.collectionById(collectionId, this.data.collectionMode, this.signer, this.mergeDeprecated);
+
+ return {collectionId, collectionAddress, events, collection};
+ }
+
+ async call(options?: any) {
+ const collectionCreationPrice = {
+ value: Number(this.helper.balance.getCollectionCreationPrice()),
+ };
+ const tx = await this.createTransaction();
+
+ return await tx.call({...options, ...collectionCreationPrice});
+ }
+}
+
+
class EthGroup extends EthGroupBase {
DEFAULT_GAS = 2_500_000;
@@ -236,30 +312,28 @@
}
}
- async createCollection(mode: TCollectionMode, signer: string, name: string, description: string, tokenPrefix: string, decimals = 18, mergeDeprecated = false): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[], collection: Contract }> {
- const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice();
+ createCollection(signer: string, data: CreateCollectionData, mergeDeprecated = false): CreateCollectionTransaction {
+ return new CreateCollectionTransaction(this.helper, signer, data, mergeDeprecated);
+ }
+
+ createNFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
+ return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'nft')).send();
+ }
+
+ async createERC721MetadataCompatibleCollection(signer: string, data: CreateCollectionData, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
- const functionName: string = this.createCollectionMethodName(mode);
-
- const functionParams = mode === 'ft' ? [name, decimals, description, tokenPrefix] : [name, description, tokenPrefix];
- const result = await collectionHelper.methods[functionName](...functionParams).send({value: Number(collectionCreationPrice)});
- const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
- const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress);
- const events = this.helper.eth.normalizeEvents(result.events);
- const collection = await this.helper.ethNativeContract.collectionById(collectionId, mode, signer, mergeDeprecated);
+ const {collectionId, collectionAddress, events} = await this.createCollection(signer, data).send();
- return {collectionId, collectionAddress, events, collection};
- }
+ await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
- createNFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
- return this.createCollection('nft', signer, name, description, tokenPrefix);
+ return {collectionId, collectionAddress, events};
}
async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
- const {collectionId, collectionAddress, events} = await this.createCollection('nft', signer, name, description, tokenPrefix);
+ const {collectionId, collectionAddress, events} = await this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'nft')).send();
await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
@@ -267,17 +341,17 @@
}
createRFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
- return this.createCollection('rft', signer, name, description, tokenPrefix);
+ return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'rft')).send();
}
createFungibleCollection(signer: string, name: string, decimals: number, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
- return this.createCollection('ft', signer, name, description, tokenPrefix, decimals);
+ return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'ft')).send();
}
async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
- const {collectionId, collectionAddress, events} = await this.createCollection('rft', signer, name, description, tokenPrefix);
+ const {collectionId, collectionAddress, events} = await this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'rft')).send();
await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
@@ -432,6 +506,13 @@
};
}
+ fromAddr(address: TEthereumAccount): [string, string] {
+ return [
+ address,
+ '0',
+ ];
+ }
+
fromKeyringPair(keyring: IKeyringPair): CrossAddress {
return {
eth: '0x0000000000000000000000000000000000000000',
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -1499,7 +1499,7 @@
*
* * `data`: Explicit data of a collection used for its creation.
**/
- createCollectionEx: AugmentedSubmittable<(data: UpDataStructsCreateCollectionData | { mode?: any; access?: any; name?: any; description?: any; tokenPrefix?: any; pendingSponsor?: any; limits?: any; permissions?: any; tokenPropertyPermissions?: any; properties?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [UpDataStructsCreateCollectionData]>;
+ createCollectionEx: AugmentedSubmittable<(data: UpDataStructsCreateCollectionData | { mode?: any; access?: any; name?: any; description?: any; tokenPrefix?: any; limits?: any; permissions?: any; tokenPropertyPermissions?: any; properties?: any; adminList?: any; pendingSponsor?: any; flags?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [UpDataStructsCreateCollectionData]>;
/**
* Mint an item within a collection.
*
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -25,7 +25,7 @@
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractExecResultU64, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractInstantiateResultU64, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
-import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractConstructorSpecV4, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractContractSpecV4, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEnvironmentV4, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMessageSpecV3, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractMetadataV4, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
+import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractContractSpecV4, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractMetadataV4, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
@@ -254,7 +254,6 @@
ContractConstructorSpecV1: ContractConstructorSpecV1;
ContractConstructorSpecV2: ContractConstructorSpecV2;
ContractConstructorSpecV3: ContractConstructorSpecV3;
- ContractConstructorSpecV4: ContractConstructorSpecV4;
ContractContractSpecV0: ContractContractSpecV0;
ContractContractSpecV1: ContractContractSpecV1;
ContractContractSpecV2: ContractContractSpecV2;
@@ -263,7 +262,6 @@
ContractCryptoHasher: ContractCryptoHasher;
ContractDiscriminant: ContractDiscriminant;
ContractDisplayName: ContractDisplayName;
- ContractEnvironmentV4: ContractEnvironmentV4;
ContractEventParamSpecLatest: ContractEventParamSpecLatest;
ContractEventParamSpecV0: ContractEventParamSpecV0;
ContractEventParamSpecV2: ContractEventParamSpecV2;
@@ -300,7 +298,6 @@
ContractMessageSpecV0: ContractMessageSpecV0;
ContractMessageSpecV1: ContractMessageSpecV1;
ContractMessageSpecV2: ContractMessageSpecV2;
- ContractMessageSpecV3: ContractMessageSpecV3;
ContractMetadata: ContractMetadata;
ContractMetadataLatest: ContractMetadataLatest;
ContractMetadataV0: ContractMetadataV0;
tests/src/interfaces/default/types.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34import type { Data } from '@polkadot/types';5import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';6import type { ITuple } from '@polkadot/types-codec/types';7import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime';8import type { Event } from '@polkadot/types/interfaces/system';910/** @name CumulusPalletDmpQueueCall */11export interface CumulusPalletDmpQueueCall extends Enum {12 readonly isServiceOverweight: boolean;13 readonly asServiceOverweight: {14 readonly index: u64;15 readonly weightLimit: SpWeightsWeightV2Weight;16 } & Struct;17 readonly type: 'ServiceOverweight';18}1920/** @name CumulusPalletDmpQueueConfigData */21export interface CumulusPalletDmpQueueConfigData extends Struct {22 readonly maxIndividual: SpWeightsWeightV2Weight;23}2425/** @name CumulusPalletDmpQueueError */26export interface CumulusPalletDmpQueueError extends Enum {27 readonly isUnknown: boolean;28 readonly isOverLimit: boolean;29 readonly type: 'Unknown' | 'OverLimit';30}3132/** @name CumulusPalletDmpQueueEvent */33export interface CumulusPalletDmpQueueEvent extends Enum {34 readonly isInvalidFormat: boolean;35 readonly asInvalidFormat: {36 readonly messageId: U8aFixed;37 } & Struct;38 readonly isUnsupportedVersion: boolean;39 readonly asUnsupportedVersion: {40 readonly messageId: U8aFixed;41 } & Struct;42 readonly isExecutedDownward: boolean;43 readonly asExecutedDownward: {44 readonly messageId: U8aFixed;45 readonly outcome: XcmV3TraitsOutcome;46 } & Struct;47 readonly isWeightExhausted: boolean;48 readonly asWeightExhausted: {49 readonly messageId: U8aFixed;50 readonly remainingWeight: SpWeightsWeightV2Weight;51 readonly requiredWeight: SpWeightsWeightV2Weight;52 } & Struct;53 readonly isOverweightEnqueued: boolean;54 readonly asOverweightEnqueued: {55 readonly messageId: U8aFixed;56 readonly overweightIndex: u64;57 readonly requiredWeight: SpWeightsWeightV2Weight;58 } & Struct;59 readonly isOverweightServiced: boolean;60 readonly asOverweightServiced: {61 readonly overweightIndex: u64;62 readonly weightUsed: SpWeightsWeightV2Weight;63 } & Struct;64 readonly isMaxMessagesExhausted: boolean;65 readonly asMaxMessagesExhausted: {66 readonly messageId: U8aFixed;67 } & Struct;68 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced' | 'MaxMessagesExhausted';69}7071/** @name CumulusPalletDmpQueuePageIndexData */72export interface CumulusPalletDmpQueuePageIndexData extends Struct {73 readonly beginUsed: u32;74 readonly endUsed: u32;75 readonly overweightCount: u64;76}7778/** @name CumulusPalletParachainSystemCall */79export interface CumulusPalletParachainSystemCall extends Enum {80 readonly isSetValidationData: boolean;81 readonly asSetValidationData: {82 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;83 } & Struct;84 readonly isSudoSendUpwardMessage: boolean;85 readonly asSudoSendUpwardMessage: {86 readonly message: Bytes;87 } & Struct;88 readonly isAuthorizeUpgrade: boolean;89 readonly asAuthorizeUpgrade: {90 readonly codeHash: H256;91 readonly checkVersion: bool;92 } & Struct;93 readonly isEnactAuthorizedUpgrade: boolean;94 readonly asEnactAuthorizedUpgrade: {95 readonly code: Bytes;96 } & Struct;97 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';98}99100/** @name CumulusPalletParachainSystemCodeUpgradeAuthorization */101export interface CumulusPalletParachainSystemCodeUpgradeAuthorization extends Struct {102 readonly codeHash: H256;103 readonly checkVersion: bool;104}105106/** @name CumulusPalletParachainSystemError */107export interface CumulusPalletParachainSystemError extends Enum {108 readonly isOverlappingUpgrades: boolean;109 readonly isProhibitedByPolkadot: boolean;110 readonly isTooBig: boolean;111 readonly isValidationDataNotAvailable: boolean;112 readonly isHostConfigurationNotAvailable: boolean;113 readonly isNotScheduled: boolean;114 readonly isNothingAuthorized: boolean;115 readonly isUnauthorized: boolean;116 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';117}118119/** @name CumulusPalletParachainSystemEvent */120export interface CumulusPalletParachainSystemEvent extends Enum {121 readonly isValidationFunctionStored: boolean;122 readonly isValidationFunctionApplied: boolean;123 readonly asValidationFunctionApplied: {124 readonly relayChainBlockNum: u32;125 } & Struct;126 readonly isValidationFunctionDiscarded: boolean;127 readonly isUpgradeAuthorized: boolean;128 readonly asUpgradeAuthorized: {129 readonly codeHash: H256;130 } & Struct;131 readonly isDownwardMessagesReceived: boolean;132 readonly asDownwardMessagesReceived: {133 readonly count: u32;134 } & Struct;135 readonly isDownwardMessagesProcessed: boolean;136 readonly asDownwardMessagesProcessed: {137 readonly weightUsed: SpWeightsWeightV2Weight;138 readonly dmqHead: H256;139 } & Struct;140 readonly isUpwardMessageSent: boolean;141 readonly asUpwardMessageSent: {142 readonly messageHash: Option<U8aFixed>;143 } & Struct;144 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed' | 'UpwardMessageSent';145}146147/** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot */148export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {149 readonly dmqMqcHead: H256;150 readonly relayDispatchQueueSize: CumulusPalletParachainSystemRelayStateSnapshotRelayDispachQueueSize;151 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV4AbridgedHrmpChannel]>>;152 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV4AbridgedHrmpChannel]>>;153}154155/** @name CumulusPalletParachainSystemRelayStateSnapshotRelayDispachQueueSize */156export interface CumulusPalletParachainSystemRelayStateSnapshotRelayDispachQueueSize extends Struct {157 readonly remainingCount: u32;158 readonly remainingSize: u32;159}160161/** @name CumulusPalletXcmCall */162export interface CumulusPalletXcmCall extends Null {}163164/** @name CumulusPalletXcmError */165export interface CumulusPalletXcmError extends Null {}166167/** @name CumulusPalletXcmEvent */168export interface CumulusPalletXcmEvent extends Enum {169 readonly isInvalidFormat: boolean;170 readonly asInvalidFormat: U8aFixed;171 readonly isUnsupportedVersion: boolean;172 readonly asUnsupportedVersion: U8aFixed;173 readonly isExecutedDownward: boolean;174 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV3TraitsOutcome]>;175 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';176}177178/** @name CumulusPalletXcmpQueueCall */179export interface CumulusPalletXcmpQueueCall extends Enum {180 readonly isServiceOverweight: boolean;181 readonly asServiceOverweight: {182 readonly index: u64;183 readonly weightLimit: SpWeightsWeightV2Weight;184 } & Struct;185 readonly isSuspendXcmExecution: boolean;186 readonly isResumeXcmExecution: boolean;187 readonly isUpdateSuspendThreshold: boolean;188 readonly asUpdateSuspendThreshold: {189 readonly new_: u32;190 } & Struct;191 readonly isUpdateDropThreshold: boolean;192 readonly asUpdateDropThreshold: {193 readonly new_: u32;194 } & Struct;195 readonly isUpdateResumeThreshold: boolean;196 readonly asUpdateResumeThreshold: {197 readonly new_: u32;198 } & Struct;199 readonly isUpdateThresholdWeight: boolean;200 readonly asUpdateThresholdWeight: {201 readonly new_: SpWeightsWeightV2Weight;202 } & Struct;203 readonly isUpdateWeightRestrictDecay: boolean;204 readonly asUpdateWeightRestrictDecay: {205 readonly new_: SpWeightsWeightV2Weight;206 } & Struct;207 readonly isUpdateXcmpMaxIndividualWeight: boolean;208 readonly asUpdateXcmpMaxIndividualWeight: {209 readonly new_: SpWeightsWeightV2Weight;210 } & Struct;211 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';212}213214/** @name CumulusPalletXcmpQueueError */215export interface CumulusPalletXcmpQueueError extends Enum {216 readonly isFailedToSend: boolean;217 readonly isBadXcmOrigin: boolean;218 readonly isBadXcm: boolean;219 readonly isBadOverweightIndex: boolean;220 readonly isWeightOverLimit: boolean;221 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';222}223224/** @name CumulusPalletXcmpQueueEvent */225export interface CumulusPalletXcmpQueueEvent extends Enum {226 readonly isSuccess: boolean;227 readonly asSuccess: {228 readonly messageHash: Option<U8aFixed>;229 readonly weight: SpWeightsWeightV2Weight;230 } & Struct;231 readonly isFail: boolean;232 readonly asFail: {233 readonly messageHash: Option<U8aFixed>;234 readonly error: XcmV3TraitsError;235 readonly weight: SpWeightsWeightV2Weight;236 } & Struct;237 readonly isBadVersion: boolean;238 readonly asBadVersion: {239 readonly messageHash: Option<U8aFixed>;240 } & Struct;241 readonly isBadFormat: boolean;242 readonly asBadFormat: {243 readonly messageHash: Option<U8aFixed>;244 } & Struct;245 readonly isXcmpMessageSent: boolean;246 readonly asXcmpMessageSent: {247 readonly messageHash: Option<U8aFixed>;248 } & Struct;249 readonly isOverweightEnqueued: boolean;250 readonly asOverweightEnqueued: {251 readonly sender: u32;252 readonly sentAt: u32;253 readonly index: u64;254 readonly required: SpWeightsWeightV2Weight;255 } & Struct;256 readonly isOverweightServiced: boolean;257 readonly asOverweightServiced: {258 readonly index: u64;259 readonly used: SpWeightsWeightV2Weight;260 } & Struct;261 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';262}263264/** @name CumulusPalletXcmpQueueInboundChannelDetails */265export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {266 readonly sender: u32;267 readonly state: CumulusPalletXcmpQueueInboundState;268 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;269}270271/** @name CumulusPalletXcmpQueueInboundState */272export interface CumulusPalletXcmpQueueInboundState extends Enum {273 readonly isOk: boolean;274 readonly isSuspended: boolean;275 readonly type: 'Ok' | 'Suspended';276}277278/** @name CumulusPalletXcmpQueueOutboundChannelDetails */279export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {280 readonly recipient: u32;281 readonly state: CumulusPalletXcmpQueueOutboundState;282 readonly signalsExist: bool;283 readonly firstIndex: u16;284 readonly lastIndex: u16;285}286287/** @name CumulusPalletXcmpQueueOutboundState */288export interface CumulusPalletXcmpQueueOutboundState extends Enum {289 readonly isOk: boolean;290 readonly isSuspended: boolean;291 readonly type: 'Ok' | 'Suspended';292}293294/** @name CumulusPalletXcmpQueueQueueConfigData */295export interface CumulusPalletXcmpQueueQueueConfigData extends Struct {296 readonly suspendThreshold: u32;297 readonly dropThreshold: u32;298 readonly resumeThreshold: u32;299 readonly thresholdWeight: SpWeightsWeightV2Weight;300 readonly weightRestrictDecay: SpWeightsWeightV2Weight;301 readonly xcmpMaxIndividualWeight: SpWeightsWeightV2Weight;302}303304/** @name CumulusPrimitivesParachainInherentParachainInherentData */305export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {306 readonly validationData: PolkadotPrimitivesV4PersistedValidationData;307 readonly relayChainState: SpTrieStorageProof;308 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;309 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;310}311312/** @name EthbloomBloom */313export interface EthbloomBloom extends U8aFixed {}314315/** @name EthereumBlock */316export interface EthereumBlock extends Struct {317 readonly header: EthereumHeader;318 readonly transactions: Vec<EthereumTransactionTransactionV2>;319 readonly ommers: Vec<EthereumHeader>;320}321322/** @name EthereumHeader */323export interface EthereumHeader extends Struct {324 readonly parentHash: H256;325 readonly ommersHash: H256;326 readonly beneficiary: H160;327 readonly stateRoot: H256;328 readonly transactionsRoot: H256;329 readonly receiptsRoot: H256;330 readonly logsBloom: EthbloomBloom;331 readonly difficulty: U256;332 readonly number: U256;333 readonly gasLimit: U256;334 readonly gasUsed: U256;335 readonly timestamp: u64;336 readonly extraData: Bytes;337 readonly mixHash: H256;338 readonly nonce: EthereumTypesHashH64;339}340341/** @name EthereumLog */342export interface EthereumLog extends Struct {343 readonly address: H160;344 readonly topics: Vec<H256>;345 readonly data: Bytes;346}347348/** @name EthereumReceiptEip658ReceiptData */349export interface EthereumReceiptEip658ReceiptData extends Struct {350 readonly statusCode: u8;351 readonly usedGas: U256;352 readonly logsBloom: EthbloomBloom;353 readonly logs: Vec<EthereumLog>;354}355356/** @name EthereumReceiptReceiptV3 */357export interface EthereumReceiptReceiptV3 extends Enum {358 readonly isLegacy: boolean;359 readonly asLegacy: EthereumReceiptEip658ReceiptData;360 readonly isEip2930: boolean;361 readonly asEip2930: EthereumReceiptEip658ReceiptData;362 readonly isEip1559: boolean;363 readonly asEip1559: EthereumReceiptEip658ReceiptData;364 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';365}366367/** @name EthereumTransactionAccessListItem */368export interface EthereumTransactionAccessListItem extends Struct {369 readonly address: H160;370 readonly storageKeys: Vec<H256>;371}372373/** @name EthereumTransactionEip1559Transaction */374export interface EthereumTransactionEip1559Transaction extends Struct {375 readonly chainId: u64;376 readonly nonce: U256;377 readonly maxPriorityFeePerGas: U256;378 readonly maxFeePerGas: U256;379 readonly gasLimit: U256;380 readonly action: EthereumTransactionTransactionAction;381 readonly value: U256;382 readonly input: Bytes;383 readonly accessList: Vec<EthereumTransactionAccessListItem>;384 readonly oddYParity: bool;385 readonly r: H256;386 readonly s: H256;387}388389/** @name EthereumTransactionEip2930Transaction */390export interface EthereumTransactionEip2930Transaction extends Struct {391 readonly chainId: u64;392 readonly nonce: U256;393 readonly gasPrice: U256;394 readonly gasLimit: U256;395 readonly action: EthereumTransactionTransactionAction;396 readonly value: U256;397 readonly input: Bytes;398 readonly accessList: Vec<EthereumTransactionAccessListItem>;399 readonly oddYParity: bool;400 readonly r: H256;401 readonly s: H256;402}403404/** @name EthereumTransactionLegacyTransaction */405export interface EthereumTransactionLegacyTransaction extends Struct {406 readonly nonce: U256;407 readonly gasPrice: U256;408 readonly gasLimit: U256;409 readonly action: EthereumTransactionTransactionAction;410 readonly value: U256;411 readonly input: Bytes;412 readonly signature: EthereumTransactionTransactionSignature;413}414415/** @name EthereumTransactionTransactionAction */416export interface EthereumTransactionTransactionAction extends Enum {417 readonly isCall: boolean;418 readonly asCall: H160;419 readonly isCreate: boolean;420 readonly type: 'Call' | 'Create';421}422423/** @name EthereumTransactionTransactionSignature */424export interface EthereumTransactionTransactionSignature extends Struct {425 readonly v: u64;426 readonly r: H256;427 readonly s: H256;428}429430/** @name EthereumTransactionTransactionV2 */431export interface EthereumTransactionTransactionV2 extends Enum {432 readonly isLegacy: boolean;433 readonly asLegacy: EthereumTransactionLegacyTransaction;434 readonly isEip2930: boolean;435 readonly asEip2930: EthereumTransactionEip2930Transaction;436 readonly isEip1559: boolean;437 readonly asEip1559: EthereumTransactionEip1559Transaction;438 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';439}440441/** @name EthereumTypesHashH64 */442export interface EthereumTypesHashH64 extends U8aFixed {}443444/** @name EvmCoreErrorExitError */445export interface EvmCoreErrorExitError extends Enum {446 readonly isStackUnderflow: boolean;447 readonly isStackOverflow: boolean;448 readonly isInvalidJump: boolean;449 readonly isInvalidRange: boolean;450 readonly isDesignatedInvalid: boolean;451 readonly isCallTooDeep: boolean;452 readonly isCreateCollision: boolean;453 readonly isCreateContractLimit: boolean;454 readonly isOutOfOffset: boolean;455 readonly isOutOfGas: boolean;456 readonly isOutOfFund: boolean;457 readonly isPcUnderflow: boolean;458 readonly isCreateEmpty: boolean;459 readonly isOther: boolean;460 readonly asOther: Text;461 readonly isMaxNonce: boolean;462 readonly isInvalidCode: boolean;463 readonly asInvalidCode: u8;464 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'MaxNonce' | 'InvalidCode';465}466467/** @name EvmCoreErrorExitFatal */468export interface EvmCoreErrorExitFatal extends Enum {469 readonly isNotSupported: boolean;470 readonly isUnhandledInterrupt: boolean;471 readonly isCallErrorAsFatal: boolean;472 readonly asCallErrorAsFatal: EvmCoreErrorExitError;473 readonly isOther: boolean;474 readonly asOther: Text;475 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';476}477478/** @name EvmCoreErrorExitReason */479export interface EvmCoreErrorExitReason extends Enum {480 readonly isSucceed: boolean;481 readonly asSucceed: EvmCoreErrorExitSucceed;482 readonly isError: boolean;483 readonly asError: EvmCoreErrorExitError;484 readonly isRevert: boolean;485 readonly asRevert: EvmCoreErrorExitRevert;486 readonly isFatal: boolean;487 readonly asFatal: EvmCoreErrorExitFatal;488 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';489}490491/** @name EvmCoreErrorExitRevert */492export interface EvmCoreErrorExitRevert extends Enum {493 readonly isReverted: boolean;494 readonly type: 'Reverted';495}496497/** @name EvmCoreErrorExitSucceed */498export interface EvmCoreErrorExitSucceed extends Enum {499 readonly isStopped: boolean;500 readonly isReturned: boolean;501 readonly isSuicided: boolean;502 readonly type: 'Stopped' | 'Returned' | 'Suicided';503}504505/** @name FpRpcTransactionStatus */506export interface FpRpcTransactionStatus extends Struct {507 readonly transactionHash: H256;508 readonly transactionIndex: u32;509 readonly from: H160;510 readonly to: Option<H160>;511 readonly contractAddress: Option<H160>;512 readonly logs: Vec<EthereumLog>;513 readonly logsBloom: EthbloomBloom;514}515516/** @name FrameSupportDispatchDispatchClass */517export interface FrameSupportDispatchDispatchClass extends Enum {518 readonly isNormal: boolean;519 readonly isOperational: boolean;520 readonly isMandatory: boolean;521 readonly type: 'Normal' | 'Operational' | 'Mandatory';522}523524/** @name FrameSupportDispatchDispatchInfo */525export interface FrameSupportDispatchDispatchInfo extends Struct {526 readonly weight: SpWeightsWeightV2Weight;527 readonly class: FrameSupportDispatchDispatchClass;528 readonly paysFee: FrameSupportDispatchPays;529}530531/** @name FrameSupportDispatchPays */532export interface FrameSupportDispatchPays extends Enum {533 readonly isYes: boolean;534 readonly isNo: boolean;535 readonly type: 'Yes' | 'No';536}537538/** @name FrameSupportDispatchPerDispatchClassU32 */539export interface FrameSupportDispatchPerDispatchClassU32 extends Struct {540 readonly normal: u32;541 readonly operational: u32;542 readonly mandatory: u32;543}544545/** @name FrameSupportDispatchPerDispatchClassWeight */546export interface FrameSupportDispatchPerDispatchClassWeight extends Struct {547 readonly normal: SpWeightsWeightV2Weight;548 readonly operational: SpWeightsWeightV2Weight;549 readonly mandatory: SpWeightsWeightV2Weight;550}551552/** @name FrameSupportDispatchPerDispatchClassWeightsPerClass */553export interface FrameSupportDispatchPerDispatchClassWeightsPerClass extends Struct {554 readonly normal: FrameSystemLimitsWeightsPerClass;555 readonly operational: FrameSystemLimitsWeightsPerClass;556 readonly mandatory: FrameSystemLimitsWeightsPerClass;557}558559/** @name FrameSupportPalletId */560export interface FrameSupportPalletId extends U8aFixed {}561562/** @name FrameSupportTokensMiscBalanceStatus */563export interface FrameSupportTokensMiscBalanceStatus extends Enum {564 readonly isFree: boolean;565 readonly isReserved: boolean;566 readonly type: 'Free' | 'Reserved';567}568569/** @name FrameSystemAccountInfo */570export interface FrameSystemAccountInfo extends Struct {571 readonly nonce: u32;572 readonly consumers: u32;573 readonly providers: u32;574 readonly sufficients: u32;575 readonly data: PalletBalancesAccountData;576}577578/** @name FrameSystemCall */579export interface FrameSystemCall extends Enum {580 readonly isRemark: boolean;581 readonly asRemark: {582 readonly remark: Bytes;583 } & Struct;584 readonly isSetHeapPages: boolean;585 readonly asSetHeapPages: {586 readonly pages: u64;587 } & Struct;588 readonly isSetCode: boolean;589 readonly asSetCode: {590 readonly code: Bytes;591 } & Struct;592 readonly isSetCodeWithoutChecks: boolean;593 readonly asSetCodeWithoutChecks: {594 readonly code: Bytes;595 } & Struct;596 readonly isSetStorage: boolean;597 readonly asSetStorage: {598 readonly items: Vec<ITuple<[Bytes, Bytes]>>;599 } & Struct;600 readonly isKillStorage: boolean;601 readonly asKillStorage: {602 readonly keys_: Vec<Bytes>;603 } & Struct;604 readonly isKillPrefix: boolean;605 readonly asKillPrefix: {606 readonly prefix: Bytes;607 readonly subkeys: u32;608 } & Struct;609 readonly isRemarkWithEvent: boolean;610 readonly asRemarkWithEvent: {611 readonly remark: Bytes;612 } & Struct;613 readonly type: 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';614}615616/** @name FrameSystemError */617export interface FrameSystemError extends Enum {618 readonly isInvalidSpecName: boolean;619 readonly isSpecVersionNeedsToIncrease: boolean;620 readonly isFailedToExtractRuntimeVersion: boolean;621 readonly isNonDefaultComposite: boolean;622 readonly isNonZeroRefCount: boolean;623 readonly isCallFiltered: boolean;624 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';625}626627/** @name FrameSystemEvent */628export interface FrameSystemEvent extends Enum {629 readonly isExtrinsicSuccess: boolean;630 readonly asExtrinsicSuccess: {631 readonly dispatchInfo: FrameSupportDispatchDispatchInfo;632 } & Struct;633 readonly isExtrinsicFailed: boolean;634 readonly asExtrinsicFailed: {635 readonly dispatchError: SpRuntimeDispatchError;636 readonly dispatchInfo: FrameSupportDispatchDispatchInfo;637 } & Struct;638 readonly isCodeUpdated: boolean;639 readonly isNewAccount: boolean;640 readonly asNewAccount: {641 readonly account: AccountId32;642 } & Struct;643 readonly isKilledAccount: boolean;644 readonly asKilledAccount: {645 readonly account: AccountId32;646 } & Struct;647 readonly isRemarked: boolean;648 readonly asRemarked: {649 readonly sender: AccountId32;650 readonly hash_: H256;651 } & Struct;652 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';653}654655/** @name FrameSystemEventRecord */656export interface FrameSystemEventRecord extends Struct {657 readonly phase: FrameSystemPhase;658 readonly event: Event;659 readonly topics: Vec<H256>;660}661662/** @name FrameSystemExtensionsCheckGenesis */663export interface FrameSystemExtensionsCheckGenesis extends Null {}664665/** @name FrameSystemExtensionsCheckNonce */666export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}667668/** @name FrameSystemExtensionsCheckSpecVersion */669export interface FrameSystemExtensionsCheckSpecVersion extends Null {}670671/** @name FrameSystemExtensionsCheckTxVersion */672export interface FrameSystemExtensionsCheckTxVersion extends Null {}673674/** @name FrameSystemExtensionsCheckWeight */675export interface FrameSystemExtensionsCheckWeight extends Null {}676677/** @name FrameSystemLastRuntimeUpgradeInfo */678export interface FrameSystemLastRuntimeUpgradeInfo extends Struct {679 readonly specVersion: Compact<u32>;680 readonly specName: Text;681}682683/** @name FrameSystemLimitsBlockLength */684export interface FrameSystemLimitsBlockLength extends Struct {685 readonly max: FrameSupportDispatchPerDispatchClassU32;686}687688/** @name FrameSystemLimitsBlockWeights */689export interface FrameSystemLimitsBlockWeights extends Struct {690 readonly baseBlock: SpWeightsWeightV2Weight;691 readonly maxBlock: SpWeightsWeightV2Weight;692 readonly perClass: FrameSupportDispatchPerDispatchClassWeightsPerClass;693}694695/** @name FrameSystemLimitsWeightsPerClass */696export interface FrameSystemLimitsWeightsPerClass extends Struct {697 readonly baseExtrinsic: SpWeightsWeightV2Weight;698 readonly maxExtrinsic: Option<SpWeightsWeightV2Weight>;699 readonly maxTotal: Option<SpWeightsWeightV2Weight>;700 readonly reserved: Option<SpWeightsWeightV2Weight>;701}702703/** @name FrameSystemPhase */704export interface FrameSystemPhase extends Enum {705 readonly isApplyExtrinsic: boolean;706 readonly asApplyExtrinsic: u32;707 readonly isFinalization: boolean;708 readonly isInitialization: boolean;709 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';710}711712/** @name OpalRuntimeRuntime */713export interface OpalRuntimeRuntime extends Null {}714715/** @name OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls */716export interface OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls extends Null {}717718/** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance */719export interface OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance extends Null {}720721/** @name OpalRuntimeRuntimeCommonSessionKeys */722export interface OpalRuntimeRuntimeCommonSessionKeys extends Struct {723 readonly aura: SpConsensusAuraSr25519AppSr25519Public;724}725726/** @name OrmlTokensAccountData */727export interface OrmlTokensAccountData extends Struct {728 readonly free: u128;729 readonly reserved: u128;730 readonly frozen: u128;731}732733/** @name OrmlTokensBalanceLock */734export interface OrmlTokensBalanceLock extends Struct {735 readonly id: U8aFixed;736 readonly amount: u128;737}738739/** @name OrmlTokensModuleCall */740export interface OrmlTokensModuleCall extends Enum {741 readonly isTransfer: boolean;742 readonly asTransfer: {743 readonly dest: MultiAddress;744 readonly currencyId: PalletForeignAssetsAssetIds;745 readonly amount: Compact<u128>;746 } & Struct;747 readonly isTransferAll: boolean;748 readonly asTransferAll: {749 readonly dest: MultiAddress;750 readonly currencyId: PalletForeignAssetsAssetIds;751 readonly keepAlive: bool;752 } & Struct;753 readonly isTransferKeepAlive: boolean;754 readonly asTransferKeepAlive: {755 readonly dest: MultiAddress;756 readonly currencyId: PalletForeignAssetsAssetIds;757 readonly amount: Compact<u128>;758 } & Struct;759 readonly isForceTransfer: boolean;760 readonly asForceTransfer: {761 readonly source: MultiAddress;762 readonly dest: MultiAddress;763 readonly currencyId: PalletForeignAssetsAssetIds;764 readonly amount: Compact<u128>;765 } & Struct;766 readonly isSetBalance: boolean;767 readonly asSetBalance: {768 readonly who: MultiAddress;769 readonly currencyId: PalletForeignAssetsAssetIds;770 readonly newFree: Compact<u128>;771 readonly newReserved: Compact<u128>;772 } & Struct;773 readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance';774}775776/** @name OrmlTokensModuleError */777export interface OrmlTokensModuleError extends Enum {778 readonly isBalanceTooLow: boolean;779 readonly isAmountIntoBalanceFailed: boolean;780 readonly isLiquidityRestrictions: boolean;781 readonly isMaxLocksExceeded: boolean;782 readonly isKeepAlive: boolean;783 readonly isExistentialDeposit: boolean;784 readonly isDeadAccount: boolean;785 readonly isTooManyReserves: boolean;786 readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';787}788789/** @name OrmlTokensModuleEvent */790export interface OrmlTokensModuleEvent extends Enum {791 readonly isEndowed: boolean;792 readonly asEndowed: {793 readonly currencyId: PalletForeignAssetsAssetIds;794 readonly who: AccountId32;795 readonly amount: u128;796 } & Struct;797 readonly isDustLost: boolean;798 readonly asDustLost: {799 readonly currencyId: PalletForeignAssetsAssetIds;800 readonly who: AccountId32;801 readonly amount: u128;802 } & Struct;803 readonly isTransfer: boolean;804 readonly asTransfer: {805 readonly currencyId: PalletForeignAssetsAssetIds;806 readonly from: AccountId32;807 readonly to: AccountId32;808 readonly amount: u128;809 } & Struct;810 readonly isReserved: boolean;811 readonly asReserved: {812 readonly currencyId: PalletForeignAssetsAssetIds;813 readonly who: AccountId32;814 readonly amount: u128;815 } & Struct;816 readonly isUnreserved: boolean;817 readonly asUnreserved: {818 readonly currencyId: PalletForeignAssetsAssetIds;819 readonly who: AccountId32;820 readonly amount: u128;821 } & Struct;822 readonly isReserveRepatriated: boolean;823 readonly asReserveRepatriated: {824 readonly currencyId: PalletForeignAssetsAssetIds;825 readonly from: AccountId32;826 readonly to: AccountId32;827 readonly amount: u128;828 readonly status: FrameSupportTokensMiscBalanceStatus;829 } & Struct;830 readonly isBalanceSet: boolean;831 readonly asBalanceSet: {832 readonly currencyId: PalletForeignAssetsAssetIds;833 readonly who: AccountId32;834 readonly free: u128;835 readonly reserved: u128;836 } & Struct;837 readonly isTotalIssuanceSet: boolean;838 readonly asTotalIssuanceSet: {839 readonly currencyId: PalletForeignAssetsAssetIds;840 readonly amount: u128;841 } & Struct;842 readonly isWithdrawn: boolean;843 readonly asWithdrawn: {844 readonly currencyId: PalletForeignAssetsAssetIds;845 readonly who: AccountId32;846 readonly amount: u128;847 } & Struct;848 readonly isSlashed: boolean;849 readonly asSlashed: {850 readonly currencyId: PalletForeignAssetsAssetIds;851 readonly who: AccountId32;852 readonly freeAmount: u128;853 readonly reservedAmount: u128;854 } & Struct;855 readonly isDeposited: boolean;856 readonly asDeposited: {857 readonly currencyId: PalletForeignAssetsAssetIds;858 readonly who: AccountId32;859 readonly amount: u128;860 } & Struct;861 readonly isLockSet: boolean;862 readonly asLockSet: {863 readonly lockId: U8aFixed;864 readonly currencyId: PalletForeignAssetsAssetIds;865 readonly who: AccountId32;866 readonly amount: u128;867 } & Struct;868 readonly isLockRemoved: boolean;869 readonly asLockRemoved: {870 readonly lockId: U8aFixed;871 readonly currencyId: PalletForeignAssetsAssetIds;872 readonly who: AccountId32;873 } & Struct;874 readonly isLocked: boolean;875 readonly asLocked: {876 readonly currencyId: PalletForeignAssetsAssetIds;877 readonly who: AccountId32;878 readonly amount: u128;879 } & Struct;880 readonly isUnlocked: boolean;881 readonly asUnlocked: {882 readonly currencyId: PalletForeignAssetsAssetIds;883 readonly who: AccountId32;884 readonly amount: u128;885 } & Struct;886 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved' | 'Locked' | 'Unlocked';887}888889/** @name OrmlTokensReserveData */890export interface OrmlTokensReserveData extends Struct {891 readonly id: Null;892 readonly amount: u128;893}894895/** @name OrmlVestingModuleCall */896export interface OrmlVestingModuleCall extends Enum {897 readonly isClaim: boolean;898 readonly isVestedTransfer: boolean;899 readonly asVestedTransfer: {900 readonly dest: MultiAddress;901 readonly schedule: OrmlVestingVestingSchedule;902 } & Struct;903 readonly isUpdateVestingSchedules: boolean;904 readonly asUpdateVestingSchedules: {905 readonly who: MultiAddress;906 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;907 } & Struct;908 readonly isClaimFor: boolean;909 readonly asClaimFor: {910 readonly dest: MultiAddress;911 } & Struct;912 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';913}914915/** @name OrmlVestingModuleError */916export interface OrmlVestingModuleError extends Enum {917 readonly isZeroVestingPeriod: boolean;918 readonly isZeroVestingPeriodCount: boolean;919 readonly isInsufficientBalanceToLock: boolean;920 readonly isTooManyVestingSchedules: boolean;921 readonly isAmountLow: boolean;922 readonly isMaxVestingSchedulesExceeded: boolean;923 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';924}925926/** @name OrmlVestingModuleEvent */927export interface OrmlVestingModuleEvent extends Enum {928 readonly isVestingScheduleAdded: boolean;929 readonly asVestingScheduleAdded: {930 readonly from: AccountId32;931 readonly to: AccountId32;932 readonly vestingSchedule: OrmlVestingVestingSchedule;933 } & Struct;934 readonly isClaimed: boolean;935 readonly asClaimed: {936 readonly who: AccountId32;937 readonly amount: u128;938 } & Struct;939 readonly isVestingSchedulesUpdated: boolean;940 readonly asVestingSchedulesUpdated: {941 readonly who: AccountId32;942 } & Struct;943 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';944}945946/** @name OrmlVestingVestingSchedule */947export interface OrmlVestingVestingSchedule extends Struct {948 readonly start: u32;949 readonly period: u32;950 readonly periodCount: u32;951 readonly perPeriod: Compact<u128>;952}953954/** @name OrmlXtokensModuleCall */955export interface OrmlXtokensModuleCall extends Enum {956 readonly isTransfer: boolean;957 readonly asTransfer: {958 readonly currencyId: PalletForeignAssetsAssetIds;959 readonly amount: u128;960 readonly dest: XcmVersionedMultiLocation;961 readonly destWeightLimit: XcmV3WeightLimit;962 } & Struct;963 readonly isTransferMultiasset: boolean;964 readonly asTransferMultiasset: {965 readonly asset: XcmVersionedMultiAsset;966 readonly dest: XcmVersionedMultiLocation;967 readonly destWeightLimit: XcmV3WeightLimit;968 } & Struct;969 readonly isTransferWithFee: boolean;970 readonly asTransferWithFee: {971 readonly currencyId: PalletForeignAssetsAssetIds;972 readonly amount: u128;973 readonly fee: u128;974 readonly dest: XcmVersionedMultiLocation;975 readonly destWeightLimit: XcmV3WeightLimit;976 } & Struct;977 readonly isTransferMultiassetWithFee: boolean;978 readonly asTransferMultiassetWithFee: {979 readonly asset: XcmVersionedMultiAsset;980 readonly fee: XcmVersionedMultiAsset;981 readonly dest: XcmVersionedMultiLocation;982 readonly destWeightLimit: XcmV3WeightLimit;983 } & Struct;984 readonly isTransferMulticurrencies: boolean;985 readonly asTransferMulticurrencies: {986 readonly currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>;987 readonly feeItem: u32;988 readonly dest: XcmVersionedMultiLocation;989 readonly destWeightLimit: XcmV3WeightLimit;990 } & Struct;991 readonly isTransferMultiassets: boolean;992 readonly asTransferMultiassets: {993 readonly assets: XcmVersionedMultiAssets;994 readonly feeItem: u32;995 readonly dest: XcmVersionedMultiLocation;996 readonly destWeightLimit: XcmV3WeightLimit;997 } & Struct;998 readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets';999}10001001/** @name OrmlXtokensModuleError */1002export interface OrmlXtokensModuleError extends Enum {1003 readonly isAssetHasNoReserve: boolean;1004 readonly isNotCrossChainTransfer: boolean;1005 readonly isInvalidDest: boolean;1006 readonly isNotCrossChainTransferableCurrency: boolean;1007 readonly isUnweighableMessage: boolean;1008 readonly isXcmExecutionFailed: boolean;1009 readonly isCannotReanchor: boolean;1010 readonly isInvalidAncestry: boolean;1011 readonly isInvalidAsset: boolean;1012 readonly isDestinationNotInvertible: boolean;1013 readonly isBadVersion: boolean;1014 readonly isDistinctReserveForAssetAndFee: boolean;1015 readonly isZeroFee: boolean;1016 readonly isZeroAmount: boolean;1017 readonly isTooManyAssetsBeingSent: boolean;1018 readonly isAssetIndexNonExistent: boolean;1019 readonly isFeeNotEnough: boolean;1020 readonly isNotSupportedMultiLocation: boolean;1021 readonly isMinXcmFeeNotDefined: boolean;1022 readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';1023}10241025/** @name OrmlXtokensModuleEvent */1026export interface OrmlXtokensModuleEvent extends Enum {1027 readonly isTransferredMultiAssets: boolean;1028 readonly asTransferredMultiAssets: {1029 readonly sender: AccountId32;1030 readonly assets: XcmV3MultiassetMultiAssets;1031 readonly fee: XcmV3MultiAsset;1032 readonly dest: XcmV3MultiLocation;1033 } & Struct;1034 readonly type: 'TransferredMultiAssets';1035}10361037/** @name PalletAppPromotionCall */1038export interface PalletAppPromotionCall extends Enum {1039 readonly isSetAdminAddress: boolean;1040 readonly asSetAdminAddress: {1041 readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;1042 } & Struct;1043 readonly isStake: boolean;1044 readonly asStake: {1045 readonly amount: u128;1046 } & Struct;1047 readonly isUnstakeAll: boolean;1048 readonly isSponsorCollection: boolean;1049 readonly asSponsorCollection: {1050 readonly collectionId: u32;1051 } & Struct;1052 readonly isStopSponsoringCollection: boolean;1053 readonly asStopSponsoringCollection: {1054 readonly collectionId: u32;1055 } & Struct;1056 readonly isSponsorContract: boolean;1057 readonly asSponsorContract: {1058 readonly contractId: H160;1059 } & Struct;1060 readonly isStopSponsoringContract: boolean;1061 readonly asStopSponsoringContract: {1062 readonly contractId: H160;1063 } & Struct;1064 readonly isPayoutStakers: boolean;1065 readonly asPayoutStakers: {1066 readonly stakersNumber: Option<u8>;1067 } & Struct;1068 readonly isUnstakePartial: boolean;1069 readonly asUnstakePartial: {1070 readonly amount: u128;1071 } & Struct;1072 readonly isForceUnstake: boolean;1073 readonly asForceUnstake: {1074 readonly pendingBlocks: Vec<u32>;1075 } & Struct;1076 readonly type: 'SetAdminAddress' | 'Stake' | 'UnstakeAll' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers' | 'UnstakePartial' | 'ForceUnstake';1077}10781079/** @name PalletAppPromotionError */1080export interface PalletAppPromotionError extends Enum {1081 readonly isAdminNotSet: boolean;1082 readonly isNoPermission: boolean;1083 readonly isNotSufficientFunds: boolean;1084 readonly isPendingForBlockOverflow: boolean;1085 readonly isSponsorNotSet: boolean;1086 readonly isInsufficientStakedBalance: boolean;1087 readonly isInconsistencyState: boolean;1088 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'InsufficientStakedBalance' | 'InconsistencyState';1089}10901091/** @name PalletAppPromotionEvent */1092export interface PalletAppPromotionEvent extends Enum {1093 readonly isStakingRecalculation: boolean;1094 readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;1095 readonly isStake: boolean;1096 readonly asStake: ITuple<[AccountId32, u128]>;1097 readonly isUnstake: boolean;1098 readonly asUnstake: ITuple<[AccountId32, u128]>;1099 readonly isSetAdmin: boolean;1100 readonly asSetAdmin: AccountId32;1101 readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';1102}11031104/** @name PalletBalancesAccountData */1105export interface PalletBalancesAccountData extends Struct {1106 readonly free: u128;1107 readonly reserved: u128;1108 readonly frozen: u128;1109 readonly flags: u128;1110}11111112/** @name PalletBalancesBalanceLock */1113export interface PalletBalancesBalanceLock extends Struct {1114 readonly id: U8aFixed;1115 readonly amount: u128;1116 readonly reasons: PalletBalancesReasons;1117}11181119/** @name PalletBalancesCall */1120export interface PalletBalancesCall extends Enum {1121 readonly isTransferAllowDeath: boolean;1122 readonly asTransferAllowDeath: {1123 readonly dest: MultiAddress;1124 readonly value: Compact<u128>;1125 } & Struct;1126 readonly isSetBalanceDeprecated: boolean;1127 readonly asSetBalanceDeprecated: {1128 readonly who: MultiAddress;1129 readonly newFree: Compact<u128>;1130 readonly oldReserved: Compact<u128>;1131 } & Struct;1132 readonly isForceTransfer: boolean;1133 readonly asForceTransfer: {1134 readonly source: MultiAddress;1135 readonly dest: MultiAddress;1136 readonly value: Compact<u128>;1137 } & Struct;1138 readonly isTransferKeepAlive: boolean;1139 readonly asTransferKeepAlive: {1140 readonly dest: MultiAddress;1141 readonly value: Compact<u128>;1142 } & Struct;1143 readonly isTransferAll: boolean;1144 readonly asTransferAll: {1145 readonly dest: MultiAddress;1146 readonly keepAlive: bool;1147 } & Struct;1148 readonly isForceUnreserve: boolean;1149 readonly asForceUnreserve: {1150 readonly who: MultiAddress;1151 readonly amount: u128;1152 } & Struct;1153 readonly isUpgradeAccounts: boolean;1154 readonly asUpgradeAccounts: {1155 readonly who: Vec<AccountId32>;1156 } & Struct;1157 readonly isTransfer: boolean;1158 readonly asTransfer: {1159 readonly dest: MultiAddress;1160 readonly value: Compact<u128>;1161 } & Struct;1162 readonly isForceSetBalance: boolean;1163 readonly asForceSetBalance: {1164 readonly who: MultiAddress;1165 readonly newFree: Compact<u128>;1166 } & Struct;1167 readonly type: 'TransferAllowDeath' | 'SetBalanceDeprecated' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve' | 'UpgradeAccounts' | 'Transfer' | 'ForceSetBalance';1168}11691170/** @name PalletBalancesError */1171export interface PalletBalancesError extends Enum {1172 readonly isVestingBalance: boolean;1173 readonly isLiquidityRestrictions: boolean;1174 readonly isInsufficientBalance: boolean;1175 readonly isExistentialDeposit: boolean;1176 readonly isExpendability: boolean;1177 readonly isExistingVestingSchedule: boolean;1178 readonly isDeadAccount: boolean;1179 readonly isTooManyReserves: boolean;1180 readonly isTooManyHolds: boolean;1181 readonly isTooManyFreezes: boolean;1182 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'Expendability' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves' | 'TooManyHolds' | 'TooManyFreezes';1183}11841185/** @name PalletBalancesEvent */1186export interface PalletBalancesEvent extends Enum {1187 readonly isEndowed: boolean;1188 readonly asEndowed: {1189 readonly account: AccountId32;1190 readonly freeBalance: u128;1191 } & Struct;1192 readonly isDustLost: boolean;1193 readonly asDustLost: {1194 readonly account: AccountId32;1195 readonly amount: u128;1196 } & Struct;1197 readonly isTransfer: boolean;1198 readonly asTransfer: {1199 readonly from: AccountId32;1200 readonly to: AccountId32;1201 readonly amount: u128;1202 } & Struct;1203 readonly isBalanceSet: boolean;1204 readonly asBalanceSet: {1205 readonly who: AccountId32;1206 readonly free: u128;1207 } & Struct;1208 readonly isReserved: boolean;1209 readonly asReserved: {1210 readonly who: AccountId32;1211 readonly amount: u128;1212 } & Struct;1213 readonly isUnreserved: boolean;1214 readonly asUnreserved: {1215 readonly who: AccountId32;1216 readonly amount: u128;1217 } & Struct;1218 readonly isReserveRepatriated: boolean;1219 readonly asReserveRepatriated: {1220 readonly from: AccountId32;1221 readonly to: AccountId32;1222 readonly amount: u128;1223 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;1224 } & Struct;1225 readonly isDeposit: boolean;1226 readonly asDeposit: {1227 readonly who: AccountId32;1228 readonly amount: u128;1229 } & Struct;1230 readonly isWithdraw: boolean;1231 readonly asWithdraw: {1232 readonly who: AccountId32;1233 readonly amount: u128;1234 } & Struct;1235 readonly isSlashed: boolean;1236 readonly asSlashed: {1237 readonly who: AccountId32;1238 readonly amount: u128;1239 } & Struct;1240 readonly isMinted: boolean;1241 readonly asMinted: {1242 readonly who: AccountId32;1243 readonly amount: u128;1244 } & Struct;1245 readonly isBurned: boolean;1246 readonly asBurned: {1247 readonly who: AccountId32;1248 readonly amount: u128;1249 } & Struct;1250 readonly isSuspended: boolean;1251 readonly asSuspended: {1252 readonly who: AccountId32;1253 readonly amount: u128;1254 } & Struct;1255 readonly isRestored: boolean;1256 readonly asRestored: {1257 readonly who: AccountId32;1258 readonly amount: u128;1259 } & Struct;1260 readonly isUpgraded: boolean;1261 readonly asUpgraded: {1262 readonly who: AccountId32;1263 } & Struct;1264 readonly isIssued: boolean;1265 readonly asIssued: {1266 readonly amount: u128;1267 } & Struct;1268 readonly isRescinded: boolean;1269 readonly asRescinded: {1270 readonly amount: u128;1271 } & Struct;1272 readonly isLocked: boolean;1273 readonly asLocked: {1274 readonly who: AccountId32;1275 readonly amount: u128;1276 } & Struct;1277 readonly isUnlocked: boolean;1278 readonly asUnlocked: {1279 readonly who: AccountId32;1280 readonly amount: u128;1281 } & Struct;1282 readonly isFrozen: boolean;1283 readonly asFrozen: {1284 readonly who: AccountId32;1285 readonly amount: u128;1286 } & Struct;1287 readonly isThawed: boolean;1288 readonly asThawed: {1289 readonly who: AccountId32;1290 readonly amount: u128;1291 } & Struct;1292 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed' | 'Minted' | 'Burned' | 'Suspended' | 'Restored' | 'Upgraded' | 'Issued' | 'Rescinded' | 'Locked' | 'Unlocked' | 'Frozen' | 'Thawed';1293}12941295/** @name PalletBalancesIdAmount */1296export interface PalletBalancesIdAmount extends Struct {1297 readonly id: U8aFixed;1298 readonly amount: u128;1299}13001301/** @name PalletBalancesReasons */1302export interface PalletBalancesReasons extends Enum {1303 readonly isFee: boolean;1304 readonly isMisc: boolean;1305 readonly isAll: boolean;1306 readonly type: 'Fee' | 'Misc' | 'All';1307}13081309/** @name PalletBalancesReserveData */1310export interface PalletBalancesReserveData extends Struct {1311 readonly id: U8aFixed;1312 readonly amount: u128;1313}13141315/** @name PalletCollatorSelectionCall */1316export interface PalletCollatorSelectionCall extends Enum {1317 readonly isAddInvulnerable: boolean;1318 readonly asAddInvulnerable: {1319 readonly new_: AccountId32;1320 } & Struct;1321 readonly isRemoveInvulnerable: boolean;1322 readonly asRemoveInvulnerable: {1323 readonly who: AccountId32;1324 } & Struct;1325 readonly isGetLicense: boolean;1326 readonly isOnboard: boolean;1327 readonly isOffboard: boolean;1328 readonly isReleaseLicense: boolean;1329 readonly isForceReleaseLicense: boolean;1330 readonly asForceReleaseLicense: {1331 readonly who: AccountId32;1332 } & Struct;1333 readonly type: 'AddInvulnerable' | 'RemoveInvulnerable' | 'GetLicense' | 'Onboard' | 'Offboard' | 'ReleaseLicense' | 'ForceReleaseLicense';1334}13351336/** @name PalletCollatorSelectionError */1337export interface PalletCollatorSelectionError extends Enum {1338 readonly isTooManyCandidates: boolean;1339 readonly isUnknown: boolean;1340 readonly isPermission: boolean;1341 readonly isAlreadyHoldingLicense: boolean;1342 readonly isNoLicense: boolean;1343 readonly isAlreadyCandidate: boolean;1344 readonly isNotCandidate: boolean;1345 readonly isTooManyInvulnerables: boolean;1346 readonly isTooFewInvulnerables: boolean;1347 readonly isAlreadyInvulnerable: boolean;1348 readonly isNotInvulnerable: boolean;1349 readonly isNoAssociatedValidatorId: boolean;1350 readonly isValidatorNotRegistered: boolean;1351 readonly type: 'TooManyCandidates' | 'Unknown' | 'Permission' | 'AlreadyHoldingLicense' | 'NoLicense' | 'AlreadyCandidate' | 'NotCandidate' | 'TooManyInvulnerables' | 'TooFewInvulnerables' | 'AlreadyInvulnerable' | 'NotInvulnerable' | 'NoAssociatedValidatorId' | 'ValidatorNotRegistered';1352}13531354/** @name PalletCollatorSelectionEvent */1355export interface PalletCollatorSelectionEvent extends Enum {1356 readonly isInvulnerableAdded: boolean;1357 readonly asInvulnerableAdded: {1358 readonly invulnerable: AccountId32;1359 } & Struct;1360 readonly isInvulnerableRemoved: boolean;1361 readonly asInvulnerableRemoved: {1362 readonly invulnerable: AccountId32;1363 } & Struct;1364 readonly isLicenseObtained: boolean;1365 readonly asLicenseObtained: {1366 readonly accountId: AccountId32;1367 readonly deposit: u128;1368 } & Struct;1369 readonly isLicenseReleased: boolean;1370 readonly asLicenseReleased: {1371 readonly accountId: AccountId32;1372 readonly depositReturned: u128;1373 } & Struct;1374 readonly isCandidateAdded: boolean;1375 readonly asCandidateAdded: {1376 readonly accountId: AccountId32;1377 } & Struct;1378 readonly isCandidateRemoved: boolean;1379 readonly asCandidateRemoved: {1380 readonly accountId: AccountId32;1381 } & Struct;1382 readonly type: 'InvulnerableAdded' | 'InvulnerableRemoved' | 'LicenseObtained' | 'LicenseReleased' | 'CandidateAdded' | 'CandidateRemoved';1383}13841385/** @name PalletCommonError */1386export interface PalletCommonError extends Enum {1387 readonly isCollectionNotFound: boolean;1388 readonly isMustBeTokenOwner: boolean;1389 readonly isNoPermission: boolean;1390 readonly isCantDestroyNotEmptyCollection: boolean;1391 readonly isPublicMintingNotAllowed: boolean;1392 readonly isAddressNotInAllowlist: boolean;1393 readonly isCollectionNameLimitExceeded: boolean;1394 readonly isCollectionDescriptionLimitExceeded: boolean;1395 readonly isCollectionTokenPrefixLimitExceeded: boolean;1396 readonly isTotalCollectionsLimitExceeded: boolean;1397 readonly isCollectionAdminCountExceeded: boolean;1398 readonly isCollectionLimitBoundsExceeded: boolean;1399 readonly isOwnerPermissionsCantBeReverted: boolean;1400 readonly isTransferNotAllowed: boolean;1401 readonly isAccountTokenLimitExceeded: boolean;1402 readonly isCollectionTokenLimitExceeded: boolean;1403 readonly isMetadataFlagFrozen: boolean;1404 readonly isTokenNotFound: boolean;1405 readonly isTokenValueTooLow: boolean;1406 readonly isApprovedValueTooLow: boolean;1407 readonly isCantApproveMoreThanOwned: boolean;1408 readonly isAddressIsNotEthMirror: boolean;1409 readonly isAddressIsZero: boolean;1410 readonly isUnsupportedOperation: boolean;1411 readonly isNotSufficientFounds: boolean;1412 readonly isUserIsNotAllowedToNest: boolean;1413 readonly isSourceCollectionIsNotAllowedToNest: boolean;1414 readonly isCollectionFieldSizeExceeded: boolean;1415 readonly isNoSpaceForProperty: boolean;1416 readonly isPropertyLimitReached: boolean;1417 readonly isPropertyKeyIsTooLong: boolean;1418 readonly isInvalidCharacterInPropertyKey: boolean;1419 readonly isEmptyPropertyKey: boolean;1420 readonly isCollectionIsExternal: boolean;1421 readonly isCollectionIsInternal: boolean;1422 readonly isConfirmSponsorshipFail: boolean;1423 readonly isUserIsNotCollectionAdmin: boolean;1424 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsNotEthMirror' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal' | 'ConfirmSponsorshipFail' | 'UserIsNotCollectionAdmin';1425}14261427/** @name PalletCommonEvent */1428export interface PalletCommonEvent extends Enum {1429 readonly isCollectionCreated: boolean;1430 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1431 readonly isCollectionDestroyed: boolean;1432 readonly asCollectionDestroyed: u32;1433 readonly isItemCreated: boolean;1434 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1435 readonly isItemDestroyed: boolean;1436 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1437 readonly isTransfer: boolean;1438 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1439 readonly isApproved: boolean;1440 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1441 readonly isApprovedForAll: boolean;1442 readonly asApprovedForAll: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, bool]>;1443 readonly isCollectionPropertySet: boolean;1444 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1445 readonly isCollectionPropertyDeleted: boolean;1446 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1447 readonly isTokenPropertySet: boolean;1448 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1449 readonly isTokenPropertyDeleted: boolean;1450 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1451 readonly isPropertyPermissionSet: boolean;1452 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1453 readonly isAllowListAddressAdded: boolean;1454 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1455 readonly isAllowListAddressRemoved: boolean;1456 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1457 readonly isCollectionAdminAdded: boolean;1458 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1459 readonly isCollectionAdminRemoved: boolean;1460 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1461 readonly isCollectionLimitSet: boolean;1462 readonly asCollectionLimitSet: u32;1463 readonly isCollectionOwnerChanged: boolean;1464 readonly asCollectionOwnerChanged: ITuple<[u32, AccountId32]>;1465 readonly isCollectionPermissionSet: boolean;1466 readonly asCollectionPermissionSet: u32;1467 readonly isCollectionSponsorSet: boolean;1468 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;1469 readonly isSponsorshipConfirmed: boolean;1470 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;1471 readonly isCollectionSponsorRemoved: boolean;1472 readonly asCollectionSponsorRemoved: u32;1473 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'ApprovedForAll' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet' | 'AllowListAddressAdded' | 'AllowListAddressRemoved' | 'CollectionAdminAdded' | 'CollectionAdminRemoved' | 'CollectionLimitSet' | 'CollectionOwnerChanged' | 'CollectionPermissionSet' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionSponsorRemoved';1474}14751476/** @name PalletConfigurationAppPromotionConfiguration */1477export interface PalletConfigurationAppPromotionConfiguration extends Struct {1478 readonly recalculationInterval: Option<u32>;1479 readonly pendingInterval: Option<u32>;1480 readonly intervalIncome: Option<Perbill>;1481 readonly maxStakersPerCalculation: Option<u8>;1482}14831484/** @name PalletConfigurationCall */1485export interface PalletConfigurationCall extends Enum {1486 readonly isSetWeightToFeeCoefficientOverride: boolean;1487 readonly asSetWeightToFeeCoefficientOverride: {1488 readonly coeff: Option<u64>;1489 } & Struct;1490 readonly isSetMinGasPriceOverride: boolean;1491 readonly asSetMinGasPriceOverride: {1492 readonly coeff: Option<u64>;1493 } & Struct;1494 readonly isSetAppPromotionConfigurationOverride: boolean;1495 readonly asSetAppPromotionConfigurationOverride: {1496 readonly configuration: PalletConfigurationAppPromotionConfiguration;1497 } & Struct;1498 readonly isSetCollatorSelectionDesiredCollators: boolean;1499 readonly asSetCollatorSelectionDesiredCollators: {1500 readonly max: Option<u32>;1501 } & Struct;1502 readonly isSetCollatorSelectionLicenseBond: boolean;1503 readonly asSetCollatorSelectionLicenseBond: {1504 readonly amount: Option<u128>;1505 } & Struct;1506 readonly isSetCollatorSelectionKickThreshold: boolean;1507 readonly asSetCollatorSelectionKickThreshold: {1508 readonly threshold: Option<u32>;1509 } & Struct;1510 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride' | 'SetAppPromotionConfigurationOverride' | 'SetCollatorSelectionDesiredCollators' | 'SetCollatorSelectionLicenseBond' | 'SetCollatorSelectionKickThreshold';1511}15121513/** @name PalletConfigurationError */1514export interface PalletConfigurationError extends Enum {1515 readonly isInconsistentConfiguration: boolean;1516 readonly type: 'InconsistentConfiguration';1517}15181519/** @name PalletConfigurationEvent */1520export interface PalletConfigurationEvent extends Enum {1521 readonly isNewDesiredCollators: boolean;1522 readonly asNewDesiredCollators: {1523 readonly desiredCollators: Option<u32>;1524 } & Struct;1525 readonly isNewCollatorLicenseBond: boolean;1526 readonly asNewCollatorLicenseBond: {1527 readonly bondCost: Option<u128>;1528 } & Struct;1529 readonly isNewCollatorKickThreshold: boolean;1530 readonly asNewCollatorKickThreshold: {1531 readonly lengthInBlocks: Option<u32>;1532 } & Struct;1533 readonly type: 'NewDesiredCollators' | 'NewCollatorLicenseBond' | 'NewCollatorKickThreshold';1534}15351536/** @name PalletEthereumCall */1537export interface PalletEthereumCall extends Enum {1538 readonly isTransact: boolean;1539 readonly asTransact: {1540 readonly transaction: EthereumTransactionTransactionV2;1541 } & Struct;1542 readonly type: 'Transact';1543}15441545/** @name PalletEthereumError */1546export interface PalletEthereumError extends Enum {1547 readonly isInvalidSignature: boolean;1548 readonly isPreLogExists: boolean;1549 readonly type: 'InvalidSignature' | 'PreLogExists';1550}15511552/** @name PalletEthereumEvent */1553export interface PalletEthereumEvent extends Enum {1554 readonly isExecuted: boolean;1555 readonly asExecuted: {1556 readonly from: H160;1557 readonly to: H160;1558 readonly transactionHash: H256;1559 readonly exitReason: EvmCoreErrorExitReason;1560 readonly extraData: Bytes;1561 } & Struct;1562 readonly type: 'Executed';1563}15641565/** @name PalletEthereumFakeTransactionFinalizer */1566export interface PalletEthereumFakeTransactionFinalizer extends Null {}15671568/** @name PalletEvmAccountBasicCrossAccountIdRepr */1569export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1570 readonly isSubstrate: boolean;1571 readonly asSubstrate: AccountId32;1572 readonly isEthereum: boolean;1573 readonly asEthereum: H160;1574 readonly type: 'Substrate' | 'Ethereum';1575}15761577/** @name PalletEvmCall */1578export interface PalletEvmCall extends Enum {1579 readonly isWithdraw: boolean;1580 readonly asWithdraw: {1581 readonly address: H160;1582 readonly value: u128;1583 } & Struct;1584 readonly isCall: boolean;1585 readonly asCall: {1586 readonly source: H160;1587 readonly target: H160;1588 readonly input: Bytes;1589 readonly value: U256;1590 readonly gasLimit: u64;1591 readonly maxFeePerGas: U256;1592 readonly maxPriorityFeePerGas: Option<U256>;1593 readonly nonce: Option<U256>;1594 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1595 } & Struct;1596 readonly isCreate: boolean;1597 readonly asCreate: {1598 readonly source: H160;1599 readonly init: Bytes;1600 readonly value: U256;1601 readonly gasLimit: u64;1602 readonly maxFeePerGas: U256;1603 readonly maxPriorityFeePerGas: Option<U256>;1604 readonly nonce: Option<U256>;1605 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1606 } & Struct;1607 readonly isCreate2: boolean;1608 readonly asCreate2: {1609 readonly source: H160;1610 readonly init: Bytes;1611 readonly salt: H256;1612 readonly value: U256;1613 readonly gasLimit: u64;1614 readonly maxFeePerGas: U256;1615 readonly maxPriorityFeePerGas: Option<U256>;1616 readonly nonce: Option<U256>;1617 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1618 } & Struct;1619 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';1620}16211622/** @name PalletEvmCodeMetadata */1623export interface PalletEvmCodeMetadata extends Struct {1624 readonly size_: u64;1625 readonly hash_: H256;1626}16271628/** @name PalletEvmCoderSubstrateError */1629export interface PalletEvmCoderSubstrateError extends Enum {1630 readonly isOutOfGas: boolean;1631 readonly isOutOfFund: boolean;1632 readonly type: 'OutOfGas' | 'OutOfFund';1633}16341635/** @name PalletEvmContractHelpersCall */1636export interface PalletEvmContractHelpersCall extends Enum {1637 readonly isMigrateFromSelfSponsoring: boolean;1638 readonly asMigrateFromSelfSponsoring: {1639 readonly addresses: Vec<H160>;1640 } & Struct;1641 readonly type: 'MigrateFromSelfSponsoring';1642}16431644/** @name PalletEvmContractHelpersError */1645export interface PalletEvmContractHelpersError extends Enum {1646 readonly isNoPermission: boolean;1647 readonly isNoPendingSponsor: boolean;1648 readonly isTooManyMethodsHaveSponsoredLimit: boolean;1649 readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';1650}16511652/** @name PalletEvmContractHelpersEvent */1653export interface PalletEvmContractHelpersEvent extends Enum {1654 readonly isContractSponsorSet: boolean;1655 readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;1656 readonly isContractSponsorshipConfirmed: boolean;1657 readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;1658 readonly isContractSponsorRemoved: boolean;1659 readonly asContractSponsorRemoved: H160;1660 readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';1661}16621663/** @name PalletEvmContractHelpersSponsoringModeT */1664export interface PalletEvmContractHelpersSponsoringModeT extends Enum {1665 readonly isDisabled: boolean;1666 readonly isAllowlisted: boolean;1667 readonly isGenerous: boolean;1668 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';1669}16701671/** @name PalletEvmError */1672export interface PalletEvmError extends Enum {1673 readonly isBalanceLow: boolean;1674 readonly isFeeOverflow: boolean;1675 readonly isPaymentOverflow: boolean;1676 readonly isWithdrawFailed: boolean;1677 readonly isGasPriceTooLow: boolean;1678 readonly isInvalidNonce: boolean;1679 readonly isGasLimitTooLow: boolean;1680 readonly isGasLimitTooHigh: boolean;1681 readonly isUndefined: boolean;1682 readonly isReentrancy: boolean;1683 readonly isTransactionMustComeFromEOA: boolean;1684 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce' | 'GasLimitTooLow' | 'GasLimitTooHigh' | 'Undefined' | 'Reentrancy' | 'TransactionMustComeFromEOA';1685}16861687/** @name PalletEvmEvent */1688export interface PalletEvmEvent extends Enum {1689 readonly isLog: boolean;1690 readonly asLog: {1691 readonly log: EthereumLog;1692 } & Struct;1693 readonly isCreated: boolean;1694 readonly asCreated: {1695 readonly address: H160;1696 } & Struct;1697 readonly isCreatedFailed: boolean;1698 readonly asCreatedFailed: {1699 readonly address: H160;1700 } & Struct;1701 readonly isExecuted: boolean;1702 readonly asExecuted: {1703 readonly address: H160;1704 } & Struct;1705 readonly isExecutedFailed: boolean;1706 readonly asExecutedFailed: {1707 readonly address: H160;1708 } & Struct;1709 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed';1710}17111712/** @name PalletEvmMigrationCall */1713export interface PalletEvmMigrationCall extends Enum {1714 readonly isBegin: boolean;1715 readonly asBegin: {1716 readonly address: H160;1717 } & Struct;1718 readonly isSetData: boolean;1719 readonly asSetData: {1720 readonly address: H160;1721 readonly data: Vec<ITuple<[H256, H256]>>;1722 } & Struct;1723 readonly isFinish: boolean;1724 readonly asFinish: {1725 readonly address: H160;1726 readonly code: Bytes;1727 } & Struct;1728 readonly isInsertEthLogs: boolean;1729 readonly asInsertEthLogs: {1730 readonly logs: Vec<EthereumLog>;1731 } & Struct;1732 readonly isInsertEvents: boolean;1733 readonly asInsertEvents: {1734 readonly events: Vec<Bytes>;1735 } & Struct;1736 readonly isRemoveRmrkData: boolean;1737 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'RemoveRmrkData';1738}17391740/** @name PalletEvmMigrationError */1741export interface PalletEvmMigrationError extends Enum {1742 readonly isAccountNotEmpty: boolean;1743 readonly isAccountIsNotMigrating: boolean;1744 readonly isBadEvent: boolean;1745 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating' | 'BadEvent';1746}17471748/** @name PalletEvmMigrationEvent */1749export interface PalletEvmMigrationEvent extends Enum {1750 readonly isTestEvent: boolean;1751 readonly type: 'TestEvent';1752}17531754/** @name PalletForeignAssetsAssetIds */1755export interface PalletForeignAssetsAssetIds extends Enum {1756 readonly isForeignAssetId: boolean;1757 readonly asForeignAssetId: u32;1758 readonly isNativeAssetId: boolean;1759 readonly asNativeAssetId: PalletForeignAssetsNativeCurrency;1760 readonly type: 'ForeignAssetId' | 'NativeAssetId';1761}17621763/** @name PalletForeignAssetsModuleAssetMetadata */1764export interface PalletForeignAssetsModuleAssetMetadata extends Struct {1765 readonly name: Bytes;1766 readonly symbol: Bytes;1767 readonly decimals: u8;1768 readonly minimalBalance: u128;1769}17701771/** @name PalletForeignAssetsModuleCall */1772export interface PalletForeignAssetsModuleCall extends Enum {1773 readonly isRegisterForeignAsset: boolean;1774 readonly asRegisterForeignAsset: {1775 readonly owner: AccountId32;1776 readonly location: XcmVersionedMultiLocation;1777 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1778 } & Struct;1779 readonly isUpdateForeignAsset: boolean;1780 readonly asUpdateForeignAsset: {1781 readonly foreignAssetId: u32;1782 readonly location: XcmVersionedMultiLocation;1783 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1784 } & Struct;1785 readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';1786}17871788/** @name PalletForeignAssetsModuleError */1789export interface PalletForeignAssetsModuleError extends Enum {1790 readonly isBadLocation: boolean;1791 readonly isMultiLocationExisted: boolean;1792 readonly isAssetIdNotExists: boolean;1793 readonly isAssetIdExisted: boolean;1794 readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';1795}17961797/** @name PalletForeignAssetsModuleEvent */1798export interface PalletForeignAssetsModuleEvent extends Enum {1799 readonly isForeignAssetRegistered: boolean;1800 readonly asForeignAssetRegistered: {1801 readonly assetId: u32;1802 readonly assetAddress: XcmV3MultiLocation;1803 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1804 } & Struct;1805 readonly isForeignAssetUpdated: boolean;1806 readonly asForeignAssetUpdated: {1807 readonly assetId: u32;1808 readonly assetAddress: XcmV3MultiLocation;1809 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1810 } & Struct;1811 readonly isAssetRegistered: boolean;1812 readonly asAssetRegistered: {1813 readonly assetId: PalletForeignAssetsAssetIds;1814 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1815 } & Struct;1816 readonly isAssetUpdated: boolean;1817 readonly asAssetUpdated: {1818 readonly assetId: PalletForeignAssetsAssetIds;1819 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1820 } & Struct;1821 readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated';1822}18231824/** @name PalletForeignAssetsNativeCurrency */1825export interface PalletForeignAssetsNativeCurrency extends Enum {1826 readonly isHere: boolean;1827 readonly isParent: boolean;1828 readonly type: 'Here' | 'Parent';1829}18301831/** @name PalletFungibleError */1832export interface PalletFungibleError extends Enum {1833 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;1834 readonly isFungibleItemsHaveNoId: boolean;1835 readonly isFungibleItemsDontHaveData: boolean;1836 readonly isFungibleDisallowsNesting: boolean;1837 readonly isSettingPropertiesNotAllowed: boolean;1838 readonly isSettingAllowanceForAllNotAllowed: boolean;1839 readonly isFungibleTokensAreAlwaysValid: boolean;1840 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed' | 'SettingAllowanceForAllNotAllowed' | 'FungibleTokensAreAlwaysValid';1841}18421843/** @name PalletIdentityBitFlags */1844export interface PalletIdentityBitFlags extends Struct {1845 readonly _bitLength: 64;1846 readonly Display: 1;1847 readonly Legal: 2;1848 readonly Web: 4;1849 readonly Riot: 8;1850 readonly Email: 16;1851 readonly PgpFingerprint: 32;1852 readonly Image: 64;1853 readonly Twitter: 128;1854}18551856/** @name PalletIdentityCall */1857export interface PalletIdentityCall extends Enum {1858 readonly isAddRegistrar: boolean;1859 readonly asAddRegistrar: {1860 readonly account: MultiAddress;1861 } & Struct;1862 readonly isSetIdentity: boolean;1863 readonly asSetIdentity: {1864 readonly info: PalletIdentityIdentityInfo;1865 } & Struct;1866 readonly isSetSubs: boolean;1867 readonly asSetSubs: {1868 readonly subs: Vec<ITuple<[AccountId32, Data]>>;1869 } & Struct;1870 readonly isClearIdentity: boolean;1871 readonly isRequestJudgement: boolean;1872 readonly asRequestJudgement: {1873 readonly regIndex: Compact<u32>;1874 readonly maxFee: Compact<u128>;1875 } & Struct;1876 readonly isCancelRequest: boolean;1877 readonly asCancelRequest: {1878 readonly regIndex: u32;1879 } & Struct;1880 readonly isSetFee: boolean;1881 readonly asSetFee: {1882 readonly index: Compact<u32>;1883 readonly fee: Compact<u128>;1884 } & Struct;1885 readonly isSetAccountId: boolean;1886 readonly asSetAccountId: {1887 readonly index: Compact<u32>;1888 readonly new_: MultiAddress;1889 } & Struct;1890 readonly isSetFields: boolean;1891 readonly asSetFields: {1892 readonly index: Compact<u32>;1893 readonly fields: PalletIdentityBitFlags;1894 } & Struct;1895 readonly isProvideJudgement: boolean;1896 readonly asProvideJudgement: {1897 readonly regIndex: Compact<u32>;1898 readonly target: MultiAddress;1899 readonly judgement: PalletIdentityJudgement;1900 readonly identity: H256;1901 } & Struct;1902 readonly isKillIdentity: boolean;1903 readonly asKillIdentity: {1904 readonly target: MultiAddress;1905 } & Struct;1906 readonly isAddSub: boolean;1907 readonly asAddSub: {1908 readonly sub: MultiAddress;1909 readonly data: Data;1910 } & Struct;1911 readonly isRenameSub: boolean;1912 readonly asRenameSub: {1913 readonly sub: MultiAddress;1914 readonly data: Data;1915 } & Struct;1916 readonly isRemoveSub: boolean;1917 readonly asRemoveSub: {1918 readonly sub: MultiAddress;1919 } & Struct;1920 readonly isQuitSub: boolean;1921 readonly isForceInsertIdentities: boolean;1922 readonly asForceInsertIdentities: {1923 readonly identities: Vec<ITuple<[AccountId32, PalletIdentityRegistration]>>;1924 } & Struct;1925 readonly isForceRemoveIdentities: boolean;1926 readonly asForceRemoveIdentities: {1927 readonly identities: Vec<AccountId32>;1928 } & Struct;1929 readonly isForceSetSubs: boolean;1930 readonly asForceSetSubs: {1931 readonly subs: Vec<ITuple<[AccountId32, ITuple<[u128, Vec<ITuple<[AccountId32, Data]>>]>]>>;1932 } & Struct;1933 readonly type: 'AddRegistrar' | 'SetIdentity' | 'SetSubs' | 'ClearIdentity' | 'RequestJudgement' | 'CancelRequest' | 'SetFee' | 'SetAccountId' | 'SetFields' | 'ProvideJudgement' | 'KillIdentity' | 'AddSub' | 'RenameSub' | 'RemoveSub' | 'QuitSub' | 'ForceInsertIdentities' | 'ForceRemoveIdentities' | 'ForceSetSubs';1934}19351936/** @name PalletIdentityError */1937export interface PalletIdentityError extends Enum {1938 readonly isTooManySubAccounts: boolean;1939 readonly isNotFound: boolean;1940 readonly isNotNamed: boolean;1941 readonly isEmptyIndex: boolean;1942 readonly isFeeChanged: boolean;1943 readonly isNoIdentity: boolean;1944 readonly isStickyJudgement: boolean;1945 readonly isJudgementGiven: boolean;1946 readonly isInvalidJudgement: boolean;1947 readonly isInvalidIndex: boolean;1948 readonly isInvalidTarget: boolean;1949 readonly isTooManyFields: boolean;1950 readonly isTooManyRegistrars: boolean;1951 readonly isAlreadyClaimed: boolean;1952 readonly isNotSub: boolean;1953 readonly isNotOwned: boolean;1954 readonly isJudgementForDifferentIdentity: boolean;1955 readonly isJudgementPaymentFailed: boolean;1956 readonly type: 'TooManySubAccounts' | 'NotFound' | 'NotNamed' | 'EmptyIndex' | 'FeeChanged' | 'NoIdentity' | 'StickyJudgement' | 'JudgementGiven' | 'InvalidJudgement' | 'InvalidIndex' | 'InvalidTarget' | 'TooManyFields' | 'TooManyRegistrars' | 'AlreadyClaimed' | 'NotSub' | 'NotOwned' | 'JudgementForDifferentIdentity' | 'JudgementPaymentFailed';1957}19581959/** @name PalletIdentityEvent */1960export interface PalletIdentityEvent extends Enum {1961 readonly isIdentitySet: boolean;1962 readonly asIdentitySet: {1963 readonly who: AccountId32;1964 } & Struct;1965 readonly isIdentityCleared: boolean;1966 readonly asIdentityCleared: {1967 readonly who: AccountId32;1968 readonly deposit: u128;1969 } & Struct;1970 readonly isIdentityKilled: boolean;1971 readonly asIdentityKilled: {1972 readonly who: AccountId32;1973 readonly deposit: u128;1974 } & Struct;1975 readonly isIdentitiesInserted: boolean;1976 readonly asIdentitiesInserted: {1977 readonly amount: u32;1978 } & Struct;1979 readonly isIdentitiesRemoved: boolean;1980 readonly asIdentitiesRemoved: {1981 readonly amount: u32;1982 } & Struct;1983 readonly isJudgementRequested: boolean;1984 readonly asJudgementRequested: {1985 readonly who: AccountId32;1986 readonly registrarIndex: u32;1987 } & Struct;1988 readonly isJudgementUnrequested: boolean;1989 readonly asJudgementUnrequested: {1990 readonly who: AccountId32;1991 readonly registrarIndex: u32;1992 } & Struct;1993 readonly isJudgementGiven: boolean;1994 readonly asJudgementGiven: {1995 readonly target: AccountId32;1996 readonly registrarIndex: u32;1997 } & Struct;1998 readonly isRegistrarAdded: boolean;1999 readonly asRegistrarAdded: {2000 readonly registrarIndex: u32;2001 } & Struct;2002 readonly isSubIdentityAdded: boolean;2003 readonly asSubIdentityAdded: {2004 readonly sub: AccountId32;2005 readonly main: AccountId32;2006 readonly deposit: u128;2007 } & Struct;2008 readonly isSubIdentityRemoved: boolean;2009 readonly asSubIdentityRemoved: {2010 readonly sub: AccountId32;2011 readonly main: AccountId32;2012 readonly deposit: u128;2013 } & Struct;2014 readonly isSubIdentityRevoked: boolean;2015 readonly asSubIdentityRevoked: {2016 readonly sub: AccountId32;2017 readonly main: AccountId32;2018 readonly deposit: u128;2019 } & Struct;2020 readonly isSubIdentitiesInserted: boolean;2021 readonly asSubIdentitiesInserted: {2022 readonly amount: u32;2023 } & Struct;2024 readonly type: 'IdentitySet' | 'IdentityCleared' | 'IdentityKilled' | 'IdentitiesInserted' | 'IdentitiesRemoved' | 'JudgementRequested' | 'JudgementUnrequested' | 'JudgementGiven' | 'RegistrarAdded' | 'SubIdentityAdded' | 'SubIdentityRemoved' | 'SubIdentityRevoked' | 'SubIdentitiesInserted';2025}20262027/** @name PalletIdentityIdentityField */2028export interface PalletIdentityIdentityField extends Enum {2029 readonly isDisplay: boolean;2030 readonly isLegal: boolean;2031 readonly isWeb: boolean;2032 readonly isRiot: boolean;2033 readonly isEmail: boolean;2034 readonly isPgpFingerprint: boolean;2035 readonly isImage: boolean;2036 readonly isTwitter: boolean;2037 readonly type: 'Display' | 'Legal' | 'Web' | 'Riot' | 'Email' | 'PgpFingerprint' | 'Image' | 'Twitter';2038}20392040/** @name PalletIdentityIdentityInfo */2041export interface PalletIdentityIdentityInfo extends Struct {2042 readonly additional: Vec<ITuple<[Data, Data]>>;2043 readonly display: Data;2044 readonly legal: Data;2045 readonly web: Data;2046 readonly riot: Data;2047 readonly email: Data;2048 readonly pgpFingerprint: Option<U8aFixed>;2049 readonly image: Data;2050 readonly twitter: Data;2051}20522053/** @name PalletIdentityJudgement */2054export interface PalletIdentityJudgement extends Enum {2055 readonly isUnknown: boolean;2056 readonly isFeePaid: boolean;2057 readonly asFeePaid: u128;2058 readonly isReasonable: boolean;2059 readonly isKnownGood: boolean;2060 readonly isOutOfDate: boolean;2061 readonly isLowQuality: boolean;2062 readonly isErroneous: boolean;2063 readonly type: 'Unknown' | 'FeePaid' | 'Reasonable' | 'KnownGood' | 'OutOfDate' | 'LowQuality' | 'Erroneous';2064}20652066/** @name PalletIdentityRegistrarInfo */2067export interface PalletIdentityRegistrarInfo extends Struct {2068 readonly account: AccountId32;2069 readonly fee: u128;2070 readonly fields: PalletIdentityBitFlags;2071}20722073/** @name PalletIdentityRegistration */2074export interface PalletIdentityRegistration extends Struct {2075 readonly judgements: Vec<ITuple<[u32, PalletIdentityJudgement]>>;2076 readonly deposit: u128;2077 readonly info: PalletIdentityIdentityInfo;2078}20792080/** @name PalletInflationCall */2081export interface PalletInflationCall extends Enum {2082 readonly isStartInflation: boolean;2083 readonly asStartInflation: {2084 readonly inflationStartRelayBlock: u32;2085 } & Struct;2086 readonly type: 'StartInflation';2087}20882089/** @name PalletMaintenanceCall */2090export interface PalletMaintenanceCall extends Enum {2091 readonly isEnable: boolean;2092 readonly isDisable: boolean;2093 readonly isExecutePreimage: boolean;2094 readonly asExecutePreimage: {2095 readonly hash_: H256;2096 readonly weightBound: SpWeightsWeightV2Weight;2097 } & Struct;2098 readonly type: 'Enable' | 'Disable' | 'ExecutePreimage';2099}21002101/** @name PalletMaintenanceError */2102export interface PalletMaintenanceError extends Null {}21032104/** @name PalletMaintenanceEvent */2105export interface PalletMaintenanceEvent extends Enum {2106 readonly isMaintenanceEnabled: boolean;2107 readonly isMaintenanceDisabled: boolean;2108 readonly type: 'MaintenanceEnabled' | 'MaintenanceDisabled';2109}21102111/** @name PalletNonfungibleError */2112export interface PalletNonfungibleError extends Enum {2113 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;2114 readonly isNonfungibleItemsHaveNoAmount: boolean;2115 readonly isCantBurnNftWithChildren: boolean;2116 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';2117}21182119/** @name PalletNonfungibleItemData */2120export interface PalletNonfungibleItemData extends Struct {2121 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2122}21232124/** @name PalletPreimageCall */2125export interface PalletPreimageCall extends Enum {2126 readonly isNotePreimage: boolean;2127 readonly asNotePreimage: {2128 readonly bytes: Bytes;2129 } & Struct;2130 readonly isUnnotePreimage: boolean;2131 readonly asUnnotePreimage: {2132 readonly hash_: H256;2133 } & Struct;2134 readonly isRequestPreimage: boolean;2135 readonly asRequestPreimage: {2136 readonly hash_: H256;2137 } & Struct;2138 readonly isUnrequestPreimage: boolean;2139 readonly asUnrequestPreimage: {2140 readonly hash_: H256;2141 } & Struct;2142 readonly type: 'NotePreimage' | 'UnnotePreimage' | 'RequestPreimage' | 'UnrequestPreimage';2143}21442145/** @name PalletPreimageError */2146export interface PalletPreimageError extends Enum {2147 readonly isTooBig: boolean;2148 readonly isAlreadyNoted: boolean;2149 readonly isNotAuthorized: boolean;2150 readonly isNotNoted: boolean;2151 readonly isRequested: boolean;2152 readonly isNotRequested: boolean;2153 readonly type: 'TooBig' | 'AlreadyNoted' | 'NotAuthorized' | 'NotNoted' | 'Requested' | 'NotRequested';2154}21552156/** @name PalletPreimageEvent */2157export interface PalletPreimageEvent extends Enum {2158 readonly isNoted: boolean;2159 readonly asNoted: {2160 readonly hash_: H256;2161 } & Struct;2162 readonly isRequested: boolean;2163 readonly asRequested: {2164 readonly hash_: H256;2165 } & Struct;2166 readonly isCleared: boolean;2167 readonly asCleared: {2168 readonly hash_: H256;2169 } & Struct;2170 readonly type: 'Noted' | 'Requested' | 'Cleared';2171}21722173/** @name PalletPreimageRequestStatus */2174export interface PalletPreimageRequestStatus extends Enum {2175 readonly isUnrequested: boolean;2176 readonly asUnrequested: {2177 readonly deposit: ITuple<[AccountId32, u128]>;2178 readonly len: u32;2179 } & Struct;2180 readonly isRequested: boolean;2181 readonly asRequested: {2182 readonly deposit: Option<ITuple<[AccountId32, u128]>>;2183 readonly count: u32;2184 readonly len: Option<u32>;2185 } & Struct;2186 readonly type: 'Unrequested' | 'Requested';2187}21882189/** @name PalletRefungibleError */2190export interface PalletRefungibleError extends Enum {2191 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;2192 readonly isWrongRefungiblePieces: boolean;2193 readonly isRepartitionWhileNotOwningAllPieces: boolean;2194 readonly isRefungibleDisallowsNesting: boolean;2195 readonly isSettingPropertiesNotAllowed: boolean;2196 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';2197}21982199/** @name PalletSessionCall */2200export interface PalletSessionCall extends Enum {2201 readonly isSetKeys: boolean;2202 readonly asSetKeys: {2203 readonly keys_: OpalRuntimeRuntimeCommonSessionKeys;2204 readonly proof: Bytes;2205 } & Struct;2206 readonly isPurgeKeys: boolean;2207 readonly type: 'SetKeys' | 'PurgeKeys';2208}22092210/** @name PalletSessionError */2211export interface PalletSessionError extends Enum {2212 readonly isInvalidProof: boolean;2213 readonly isNoAssociatedValidatorId: boolean;2214 readonly isDuplicatedKey: boolean;2215 readonly isNoKeys: boolean;2216 readonly isNoAccount: boolean;2217 readonly type: 'InvalidProof' | 'NoAssociatedValidatorId' | 'DuplicatedKey' | 'NoKeys' | 'NoAccount';2218}22192220/** @name PalletSessionEvent */2221export interface PalletSessionEvent extends Enum {2222 readonly isNewSession: boolean;2223 readonly asNewSession: {2224 readonly sessionIndex: u32;2225 } & Struct;2226 readonly type: 'NewSession';2227}22282229/** @name PalletStateTrieMigrationCall */2230export interface PalletStateTrieMigrationCall extends Enum {2231 readonly isControlAutoMigration: boolean;2232 readonly asControlAutoMigration: {2233 readonly maybeConfig: Option<PalletStateTrieMigrationMigrationLimits>;2234 } & Struct;2235 readonly isContinueMigrate: boolean;2236 readonly asContinueMigrate: {2237 readonly limits: PalletStateTrieMigrationMigrationLimits;2238 readonly realSizeUpper: u32;2239 readonly witnessTask: PalletStateTrieMigrationMigrationTask;2240 } & Struct;2241 readonly isMigrateCustomTop: boolean;2242 readonly asMigrateCustomTop: {2243 readonly keys_: Vec<Bytes>;2244 readonly witnessSize: u32;2245 } & Struct;2246 readonly isMigrateCustomChild: boolean;2247 readonly asMigrateCustomChild: {2248 readonly root: Bytes;2249 readonly childKeys: Vec<Bytes>;2250 readonly totalSize: u32;2251 } & Struct;2252 readonly isSetSignedMaxLimits: boolean;2253 readonly asSetSignedMaxLimits: {2254 readonly limits: PalletStateTrieMigrationMigrationLimits;2255 } & Struct;2256 readonly isForceSetProgress: boolean;2257 readonly asForceSetProgress: {2258 readonly progressTop: PalletStateTrieMigrationProgress;2259 readonly progressChild: PalletStateTrieMigrationProgress;2260 } & Struct;2261 readonly type: 'ControlAutoMigration' | 'ContinueMigrate' | 'MigrateCustomTop' | 'MigrateCustomChild' | 'SetSignedMaxLimits' | 'ForceSetProgress';2262}22632264/** @name PalletStateTrieMigrationError */2265export interface PalletStateTrieMigrationError extends Enum {2266 readonly isMaxSignedLimits: boolean;2267 readonly isKeyTooLong: boolean;2268 readonly isNotEnoughFunds: boolean;2269 readonly isBadWitness: boolean;2270 readonly isSignedMigrationNotAllowed: boolean;2271 readonly isBadChildRoot: boolean;2272 readonly type: 'MaxSignedLimits' | 'KeyTooLong' | 'NotEnoughFunds' | 'BadWitness' | 'SignedMigrationNotAllowed' | 'BadChildRoot';2273}22742275/** @name PalletStateTrieMigrationEvent */2276export interface PalletStateTrieMigrationEvent extends Enum {2277 readonly isMigrated: boolean;2278 readonly asMigrated: {2279 readonly top: u32;2280 readonly child: u32;2281 readonly compute: PalletStateTrieMigrationMigrationCompute;2282 } & Struct;2283 readonly isSlashed: boolean;2284 readonly asSlashed: {2285 readonly who: AccountId32;2286 readonly amount: u128;2287 } & Struct;2288 readonly isAutoMigrationFinished: boolean;2289 readonly isHalted: boolean;2290 readonly asHalted: {2291 readonly error: PalletStateTrieMigrationError;2292 } & Struct;2293 readonly type: 'Migrated' | 'Slashed' | 'AutoMigrationFinished' | 'Halted';2294}22952296/** @name PalletStateTrieMigrationMigrationCompute */2297export interface PalletStateTrieMigrationMigrationCompute extends Enum {2298 readonly isSigned: boolean;2299 readonly isAuto: boolean;2300 readonly type: 'Signed' | 'Auto';2301}23022303/** @name PalletStateTrieMigrationMigrationLimits */2304export interface PalletStateTrieMigrationMigrationLimits extends Struct {2305 readonly size_: u32;2306 readonly item: u32;2307}23082309/** @name PalletStateTrieMigrationMigrationTask */2310export interface PalletStateTrieMigrationMigrationTask extends Struct {2311 readonly progressTop: PalletStateTrieMigrationProgress;2312 readonly progressChild: PalletStateTrieMigrationProgress;2313 readonly size_: u32;2314 readonly topItems: u32;2315 readonly childItems: u32;2316}23172318/** @name PalletStateTrieMigrationProgress */2319export interface PalletStateTrieMigrationProgress extends Enum {2320 readonly isToStart: boolean;2321 readonly isLastKey: boolean;2322 readonly asLastKey: Bytes;2323 readonly isComplete: boolean;2324 readonly type: 'ToStart' | 'LastKey' | 'Complete';2325}23262327/** @name PalletStructureCall */2328export interface PalletStructureCall extends Null {}23292330/** @name PalletStructureError */2331export interface PalletStructureError extends Enum {2332 readonly isOuroborosDetected: boolean;2333 readonly isDepthLimit: boolean;2334 readonly isBreadthLimit: boolean;2335 readonly isTokenNotFound: boolean;2336 readonly isCantNestTokenUnderCollection: boolean;2337 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound' | 'CantNestTokenUnderCollection';2338}23392340/** @name PalletStructureEvent */2341export interface PalletStructureEvent extends Enum {2342 readonly isExecuted: boolean;2343 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;2344 readonly type: 'Executed';2345}23462347/** @name PalletSudoCall */2348export interface PalletSudoCall extends Enum {2349 readonly isSudo: boolean;2350 readonly asSudo: {2351 readonly call: Call;2352 } & Struct;2353 readonly isSudoUncheckedWeight: boolean;2354 readonly asSudoUncheckedWeight: {2355 readonly call: Call;2356 readonly weight: SpWeightsWeightV2Weight;2357 } & Struct;2358 readonly isSetKey: boolean;2359 readonly asSetKey: {2360 readonly new_: MultiAddress;2361 } & Struct;2362 readonly isSudoAs: boolean;2363 readonly asSudoAs: {2364 readonly who: MultiAddress;2365 readonly call: Call;2366 } & Struct;2367 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';2368}23692370/** @name PalletSudoError */2371export interface PalletSudoError extends Enum {2372 readonly isRequireSudo: boolean;2373 readonly type: 'RequireSudo';2374}23752376/** @name PalletSudoEvent */2377export interface PalletSudoEvent extends Enum {2378 readonly isSudid: boolean;2379 readonly asSudid: {2380 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;2381 } & Struct;2382 readonly isKeyChanged: boolean;2383 readonly asKeyChanged: {2384 readonly oldSudoer: Option<AccountId32>;2385 } & Struct;2386 readonly isSudoAsDone: boolean;2387 readonly asSudoAsDone: {2388 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;2389 } & Struct;2390 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';2391}23922393/** @name PalletTemplateTransactionPaymentChargeTransactionPayment */2394export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}23952396/** @name PalletTestUtilsCall */2397export interface PalletTestUtilsCall extends Enum {2398 readonly isEnable: boolean;2399 readonly isSetTestValue: boolean;2400 readonly asSetTestValue: {2401 readonly value: u32;2402 } & Struct;2403 readonly isSetTestValueAndRollback: boolean;2404 readonly asSetTestValueAndRollback: {2405 readonly value: u32;2406 } & Struct;2407 readonly isIncTestValue: boolean;2408 readonly isJustTakeFee: boolean;2409 readonly isBatchAll: boolean;2410 readonly asBatchAll: {2411 readonly calls: Vec<Call>;2412 } & Struct;2413 readonly type: 'Enable' | 'SetTestValue' | 'SetTestValueAndRollback' | 'IncTestValue' | 'JustTakeFee' | 'BatchAll';2414}24152416/** @name PalletTestUtilsError */2417export interface PalletTestUtilsError extends Enum {2418 readonly isTestPalletDisabled: boolean;2419 readonly isTriggerRollback: boolean;2420 readonly type: 'TestPalletDisabled' | 'TriggerRollback';2421}24222423/** @name PalletTestUtilsEvent */2424export interface PalletTestUtilsEvent extends Enum {2425 readonly isValueIsSet: boolean;2426 readonly isShouldRollback: boolean;2427 readonly isBatchCompleted: boolean;2428 readonly type: 'ValueIsSet' | 'ShouldRollback' | 'BatchCompleted';2429}24302431/** @name PalletTimestampCall */2432export interface PalletTimestampCall extends Enum {2433 readonly isSet: boolean;2434 readonly asSet: {2435 readonly now: Compact<u64>;2436 } & Struct;2437 readonly type: 'Set';2438}24392440/** @name PalletTransactionPaymentEvent */2441export interface PalletTransactionPaymentEvent extends Enum {2442 readonly isTransactionFeePaid: boolean;2443 readonly asTransactionFeePaid: {2444 readonly who: AccountId32;2445 readonly actualFee: u128;2446 readonly tip: u128;2447 } & Struct;2448 readonly type: 'TransactionFeePaid';2449}24502451/** @name PalletTransactionPaymentReleases */2452export interface PalletTransactionPaymentReleases extends Enum {2453 readonly isV1Ancient: boolean;2454 readonly isV2: boolean;2455 readonly type: 'V1Ancient' | 'V2';2456}24572458/** @name PalletTreasuryCall */2459export interface PalletTreasuryCall extends Enum {2460 readonly isProposeSpend: boolean;2461 readonly asProposeSpend: {2462 readonly value: Compact<u128>;2463 readonly beneficiary: MultiAddress;2464 } & Struct;2465 readonly isRejectProposal: boolean;2466 readonly asRejectProposal: {2467 readonly proposalId: Compact<u32>;2468 } & Struct;2469 readonly isApproveProposal: boolean;2470 readonly asApproveProposal: {2471 readonly proposalId: Compact<u32>;2472 } & Struct;2473 readonly isSpend: boolean;2474 readonly asSpend: {2475 readonly amount: Compact<u128>;2476 readonly beneficiary: MultiAddress;2477 } & Struct;2478 readonly isRemoveApproval: boolean;2479 readonly asRemoveApproval: {2480 readonly proposalId: Compact<u32>;2481 } & Struct;2482 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';2483}24842485/** @name PalletTreasuryError */2486export interface PalletTreasuryError extends Enum {2487 readonly isInsufficientProposersBalance: boolean;2488 readonly isInvalidIndex: boolean;2489 readonly isTooManyApprovals: boolean;2490 readonly isInsufficientPermission: boolean;2491 readonly isProposalNotApproved: boolean;2492 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';2493}24942495/** @name PalletTreasuryEvent */2496export interface PalletTreasuryEvent extends Enum {2497 readonly isProposed: boolean;2498 readonly asProposed: {2499 readonly proposalIndex: u32;2500 } & Struct;2501 readonly isSpending: boolean;2502 readonly asSpending: {2503 readonly budgetRemaining: u128;2504 } & Struct;2505 readonly isAwarded: boolean;2506 readonly asAwarded: {2507 readonly proposalIndex: u32;2508 readonly award: u128;2509 readonly account: AccountId32;2510 } & Struct;2511 readonly isRejected: boolean;2512 readonly asRejected: {2513 readonly proposalIndex: u32;2514 readonly slashed: u128;2515 } & Struct;2516 readonly isBurnt: boolean;2517 readonly asBurnt: {2518 readonly burntFunds: u128;2519 } & Struct;2520 readonly isRollover: boolean;2521 readonly asRollover: {2522 readonly rolloverBalance: u128;2523 } & Struct;2524 readonly isDeposit: boolean;2525 readonly asDeposit: {2526 readonly value: u128;2527 } & Struct;2528 readonly isSpendApproved: boolean;2529 readonly asSpendApproved: {2530 readonly proposalIndex: u32;2531 readonly amount: u128;2532 readonly beneficiary: AccountId32;2533 } & Struct;2534 readonly isUpdatedInactive: boolean;2535 readonly asUpdatedInactive: {2536 readonly reactivated: u128;2537 readonly deactivated: u128;2538 } & Struct;2539 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved' | 'UpdatedInactive';2540}25412542/** @name PalletTreasuryProposal */2543export interface PalletTreasuryProposal extends Struct {2544 readonly proposer: AccountId32;2545 readonly value: u128;2546 readonly beneficiary: AccountId32;2547 readonly bond: u128;2548}25492550/** @name PalletUniqueCall */2551export interface PalletUniqueCall extends Enum {2552 readonly isCreateCollection: boolean;2553 readonly asCreateCollection: {2554 readonly collectionName: Vec<u16>;2555 readonly collectionDescription: Vec<u16>;2556 readonly tokenPrefix: Bytes;2557 readonly mode: UpDataStructsCollectionMode;2558 } & Struct;2559 readonly isCreateCollectionEx: boolean;2560 readonly asCreateCollectionEx: {2561 readonly data: UpDataStructsCreateCollectionData;2562 } & Struct;2563 readonly isDestroyCollection: boolean;2564 readonly asDestroyCollection: {2565 readonly collectionId: u32;2566 } & Struct;2567 readonly isAddToAllowList: boolean;2568 readonly asAddToAllowList: {2569 readonly collectionId: u32;2570 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2571 } & Struct;2572 readonly isRemoveFromAllowList: boolean;2573 readonly asRemoveFromAllowList: {2574 readonly collectionId: u32;2575 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2576 } & Struct;2577 readonly isChangeCollectionOwner: boolean;2578 readonly asChangeCollectionOwner: {2579 readonly collectionId: u32;2580 readonly newOwner: AccountId32;2581 } & Struct;2582 readonly isAddCollectionAdmin: boolean;2583 readonly asAddCollectionAdmin: {2584 readonly collectionId: u32;2585 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;2586 } & Struct;2587 readonly isRemoveCollectionAdmin: boolean;2588 readonly asRemoveCollectionAdmin: {2589 readonly collectionId: u32;2590 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;2591 } & Struct;2592 readonly isSetCollectionSponsor: boolean;2593 readonly asSetCollectionSponsor: {2594 readonly collectionId: u32;2595 readonly newSponsor: AccountId32;2596 } & Struct;2597 readonly isConfirmSponsorship: boolean;2598 readonly asConfirmSponsorship: {2599 readonly collectionId: u32;2600 } & Struct;2601 readonly isRemoveCollectionSponsor: boolean;2602 readonly asRemoveCollectionSponsor: {2603 readonly collectionId: u32;2604 } & Struct;2605 readonly isCreateItem: boolean;2606 readonly asCreateItem: {2607 readonly collectionId: u32;2608 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2609 readonly data: UpDataStructsCreateItemData;2610 } & Struct;2611 readonly isCreateMultipleItems: boolean;2612 readonly asCreateMultipleItems: {2613 readonly collectionId: u32;2614 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2615 readonly itemsData: Vec<UpDataStructsCreateItemData>;2616 } & Struct;2617 readonly isSetCollectionProperties: boolean;2618 readonly asSetCollectionProperties: {2619 readonly collectionId: u32;2620 readonly properties: Vec<UpDataStructsProperty>;2621 } & Struct;2622 readonly isDeleteCollectionProperties: boolean;2623 readonly asDeleteCollectionProperties: {2624 readonly collectionId: u32;2625 readonly propertyKeys: Vec<Bytes>;2626 } & Struct;2627 readonly isSetTokenProperties: boolean;2628 readonly asSetTokenProperties: {2629 readonly collectionId: u32;2630 readonly tokenId: u32;2631 readonly properties: Vec<UpDataStructsProperty>;2632 } & Struct;2633 readonly isDeleteTokenProperties: boolean;2634 readonly asDeleteTokenProperties: {2635 readonly collectionId: u32;2636 readonly tokenId: u32;2637 readonly propertyKeys: Vec<Bytes>;2638 } & Struct;2639 readonly isSetTokenPropertyPermissions: boolean;2640 readonly asSetTokenPropertyPermissions: {2641 readonly collectionId: u32;2642 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2643 } & Struct;2644 readonly isCreateMultipleItemsEx: boolean;2645 readonly asCreateMultipleItemsEx: {2646 readonly collectionId: u32;2647 readonly data: UpDataStructsCreateItemExData;2648 } & Struct;2649 readonly isSetTransfersEnabledFlag: boolean;2650 readonly asSetTransfersEnabledFlag: {2651 readonly collectionId: u32;2652 readonly value: bool;2653 } & Struct;2654 readonly isBurnItem: boolean;2655 readonly asBurnItem: {2656 readonly collectionId: u32;2657 readonly itemId: u32;2658 readonly value: u128;2659 } & Struct;2660 readonly isBurnFrom: boolean;2661 readonly asBurnFrom: {2662 readonly collectionId: u32;2663 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2664 readonly itemId: u32;2665 readonly value: u128;2666 } & Struct;2667 readonly isTransfer: boolean;2668 readonly asTransfer: {2669 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2670 readonly collectionId: u32;2671 readonly itemId: u32;2672 readonly value: u128;2673 } & Struct;2674 readonly isApprove: boolean;2675 readonly asApprove: {2676 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;2677 readonly collectionId: u32;2678 readonly itemId: u32;2679 readonly amount: u128;2680 } & Struct;2681 readonly isApproveFrom: boolean;2682 readonly asApproveFrom: {2683 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2684 readonly to: PalletEvmAccountBasicCrossAccountIdRepr;2685 readonly collectionId: u32;2686 readonly itemId: u32;2687 readonly amount: u128;2688 } & Struct;2689 readonly isTransferFrom: boolean;2690 readonly asTransferFrom: {2691 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2692 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2693 readonly collectionId: u32;2694 readonly itemId: u32;2695 readonly value: u128;2696 } & Struct;2697 readonly isSetCollectionLimits: boolean;2698 readonly asSetCollectionLimits: {2699 readonly collectionId: u32;2700 readonly newLimit: UpDataStructsCollectionLimits;2701 } & Struct;2702 readonly isSetCollectionPermissions: boolean;2703 readonly asSetCollectionPermissions: {2704 readonly collectionId: u32;2705 readonly newPermission: UpDataStructsCollectionPermissions;2706 } & Struct;2707 readonly isRepartition: boolean;2708 readonly asRepartition: {2709 readonly collectionId: u32;2710 readonly tokenId: u32;2711 readonly amount: u128;2712 } & Struct;2713 readonly isSetAllowanceForAll: boolean;2714 readonly asSetAllowanceForAll: {2715 readonly collectionId: u32;2716 readonly operator: PalletEvmAccountBasicCrossAccountIdRepr;2717 readonly approve: bool;2718 } & Struct;2719 readonly isForceRepairCollection: boolean;2720 readonly asForceRepairCollection: {2721 readonly collectionId: u32;2722 } & Struct;2723 readonly isForceRepairItem: boolean;2724 readonly asForceRepairItem: {2725 readonly collectionId: u32;2726 readonly itemId: u32;2727 } & Struct;2728 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' | 'ApproveFrom' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition' | 'SetAllowanceForAll' | 'ForceRepairCollection' | 'ForceRepairItem';2729}27302731/** @name PalletUniqueError */2732export interface PalletUniqueError extends Enum {2733 readonly isCollectionDecimalPointLimitExceeded: boolean;2734 readonly isEmptyArgument: boolean;2735 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;2736 readonly type: 'CollectionDecimalPointLimitExceeded' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';2737}27382739/** @name PalletXcmCall */2740export interface PalletXcmCall extends Enum {2741 readonly isSend: boolean;2742 readonly asSend: {2743 readonly dest: XcmVersionedMultiLocation;2744 readonly message: XcmVersionedXcm;2745 } & Struct;2746 readonly isTeleportAssets: boolean;2747 readonly asTeleportAssets: {2748 readonly dest: XcmVersionedMultiLocation;2749 readonly beneficiary: XcmVersionedMultiLocation;2750 readonly assets: XcmVersionedMultiAssets;2751 readonly feeAssetItem: u32;2752 } & Struct;2753 readonly isReserveTransferAssets: boolean;2754 readonly asReserveTransferAssets: {2755 readonly dest: XcmVersionedMultiLocation;2756 readonly beneficiary: XcmVersionedMultiLocation;2757 readonly assets: XcmVersionedMultiAssets;2758 readonly feeAssetItem: u32;2759 } & Struct;2760 readonly isExecute: boolean;2761 readonly asExecute: {2762 readonly message: XcmVersionedXcm;2763 readonly maxWeight: SpWeightsWeightV2Weight;2764 } & Struct;2765 readonly isForceXcmVersion: boolean;2766 readonly asForceXcmVersion: {2767 readonly location: XcmV3MultiLocation;2768 readonly xcmVersion: u32;2769 } & Struct;2770 readonly isForceDefaultXcmVersion: boolean;2771 readonly asForceDefaultXcmVersion: {2772 readonly maybeXcmVersion: Option<u32>;2773 } & Struct;2774 readonly isForceSubscribeVersionNotify: boolean;2775 readonly asForceSubscribeVersionNotify: {2776 readonly location: XcmVersionedMultiLocation;2777 } & Struct;2778 readonly isForceUnsubscribeVersionNotify: boolean;2779 readonly asForceUnsubscribeVersionNotify: {2780 readonly location: XcmVersionedMultiLocation;2781 } & Struct;2782 readonly isLimitedReserveTransferAssets: boolean;2783 readonly asLimitedReserveTransferAssets: {2784 readonly dest: XcmVersionedMultiLocation;2785 readonly beneficiary: XcmVersionedMultiLocation;2786 readonly assets: XcmVersionedMultiAssets;2787 readonly feeAssetItem: u32;2788 readonly weightLimit: XcmV3WeightLimit;2789 } & Struct;2790 readonly isLimitedTeleportAssets: boolean;2791 readonly asLimitedTeleportAssets: {2792 readonly dest: XcmVersionedMultiLocation;2793 readonly beneficiary: XcmVersionedMultiLocation;2794 readonly assets: XcmVersionedMultiAssets;2795 readonly feeAssetItem: u32;2796 readonly weightLimit: XcmV3WeightLimit;2797 } & Struct;2798 readonly isForceSuspension: boolean;2799 readonly asForceSuspension: {2800 readonly suspended: bool;2801 } & Struct;2802 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets' | 'ForceSuspension';2803}28042805/** @name PalletXcmError */2806export interface PalletXcmError extends Enum {2807 readonly isUnreachable: boolean;2808 readonly isSendFailure: boolean;2809 readonly isFiltered: boolean;2810 readonly isUnweighableMessage: boolean;2811 readonly isDestinationNotInvertible: boolean;2812 readonly isEmpty: boolean;2813 readonly isCannotReanchor: boolean;2814 readonly isTooManyAssets: boolean;2815 readonly isInvalidOrigin: boolean;2816 readonly isBadVersion: boolean;2817 readonly isBadLocation: boolean;2818 readonly isNoSubscription: boolean;2819 readonly isAlreadySubscribed: boolean;2820 readonly isInvalidAsset: boolean;2821 readonly isLowBalance: boolean;2822 readonly isTooManyLocks: boolean;2823 readonly isAccountNotSovereign: boolean;2824 readonly isFeesNotMet: boolean;2825 readonly isLockNotFound: boolean;2826 readonly isInUse: boolean;2827 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed' | 'InvalidAsset' | 'LowBalance' | 'TooManyLocks' | 'AccountNotSovereign' | 'FeesNotMet' | 'LockNotFound' | 'InUse';2828}28292830/** @name PalletXcmEvent */2831export interface PalletXcmEvent extends Enum {2832 readonly isAttempted: boolean;2833 readonly asAttempted: XcmV3TraitsOutcome;2834 readonly isSent: boolean;2835 readonly asSent: ITuple<[XcmV3MultiLocation, XcmV3MultiLocation, XcmV3Xcm]>;2836 readonly isUnexpectedResponse: boolean;2837 readonly asUnexpectedResponse: ITuple<[XcmV3MultiLocation, u64]>;2838 readonly isResponseReady: boolean;2839 readonly asResponseReady: ITuple<[u64, XcmV3Response]>;2840 readonly isNotified: boolean;2841 readonly asNotified: ITuple<[u64, u8, u8]>;2842 readonly isNotifyOverweight: boolean;2843 readonly asNotifyOverweight: ITuple<[u64, u8, u8, SpWeightsWeightV2Weight, SpWeightsWeightV2Weight]>;2844 readonly isNotifyDispatchError: boolean;2845 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;2846 readonly isNotifyDecodeFailed: boolean;2847 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;2848 readonly isInvalidResponder: boolean;2849 readonly asInvalidResponder: ITuple<[XcmV3MultiLocation, u64, Option<XcmV3MultiLocation>]>;2850 readonly isInvalidResponderVersion: boolean;2851 readonly asInvalidResponderVersion: ITuple<[XcmV3MultiLocation, u64]>;2852 readonly isResponseTaken: boolean;2853 readonly asResponseTaken: u64;2854 readonly isAssetsTrapped: boolean;2855 readonly asAssetsTrapped: ITuple<[H256, XcmV3MultiLocation, XcmVersionedMultiAssets]>;2856 readonly isVersionChangeNotified: boolean;2857 readonly asVersionChangeNotified: ITuple<[XcmV3MultiLocation, u32, XcmV3MultiassetMultiAssets]>;2858 readonly isSupportedVersionChanged: boolean;2859 readonly asSupportedVersionChanged: ITuple<[XcmV3MultiLocation, u32]>;2860 readonly isNotifyTargetSendFail: boolean;2861 readonly asNotifyTargetSendFail: ITuple<[XcmV3MultiLocation, u64, XcmV3TraitsError]>;2862 readonly isNotifyTargetMigrationFail: boolean;2863 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;2864 readonly isInvalidQuerierVersion: boolean;2865 readonly asInvalidQuerierVersion: ITuple<[XcmV3MultiLocation, u64]>;2866 readonly isInvalidQuerier: boolean;2867 readonly asInvalidQuerier: ITuple<[XcmV3MultiLocation, u64, XcmV3MultiLocation, Option<XcmV3MultiLocation>]>;2868 readonly isVersionNotifyStarted: boolean;2869 readonly asVersionNotifyStarted: ITuple<[XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>;2870 readonly isVersionNotifyRequested: boolean;2871 readonly asVersionNotifyRequested: ITuple<[XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>;2872 readonly isVersionNotifyUnrequested: boolean;2873 readonly asVersionNotifyUnrequested: ITuple<[XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>;2874 readonly isFeesPaid: boolean;2875 readonly asFeesPaid: ITuple<[XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>;2876 readonly isAssetsClaimed: boolean;2877 readonly asAssetsClaimed: ITuple<[H256, XcmV3MultiLocation, XcmVersionedMultiAssets]>;2878 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail' | 'InvalidQuerierVersion' | 'InvalidQuerier' | 'VersionNotifyStarted' | 'VersionNotifyRequested' | 'VersionNotifyUnrequested' | 'FeesPaid' | 'AssetsClaimed';2879}28802881/** @name PalletXcmQueryStatus */2882export interface PalletXcmQueryStatus extends Enum {2883 readonly isPending: boolean;2884 readonly asPending: {2885 readonly responder: XcmVersionedMultiLocation;2886 readonly maybeMatchQuerier: Option<XcmVersionedMultiLocation>;2887 readonly maybeNotify: Option<ITuple<[u8, u8]>>;2888 readonly timeout: u32;2889 } & Struct;2890 readonly isVersionNotifier: boolean;2891 readonly asVersionNotifier: {2892 readonly origin: XcmVersionedMultiLocation;2893 readonly isActive: bool;2894 } & Struct;2895 readonly isReady: boolean;2896 readonly asReady: {2897 readonly response: XcmVersionedResponse;2898 readonly at: u32;2899 } & Struct;2900 readonly type: 'Pending' | 'VersionNotifier' | 'Ready';2901}29022903/** @name PalletXcmRemoteLockedFungibleRecord */2904export interface PalletXcmRemoteLockedFungibleRecord extends Struct {2905 readonly amount: u128;2906 readonly owner: XcmVersionedMultiLocation;2907 readonly locker: XcmVersionedMultiLocation;2908 readonly consumers: Vec<ITuple<[Null, u128]>>;2909}29102911/** @name PalletXcmVersionMigrationStage */2912export interface PalletXcmVersionMigrationStage extends Enum {2913 readonly isMigrateSupportedVersion: boolean;2914 readonly isMigrateVersionNotifiers: boolean;2915 readonly isNotifyCurrentTargets: boolean;2916 readonly asNotifyCurrentTargets: Option<Bytes>;2917 readonly isMigrateAndNotifyOldTargets: boolean;2918 readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';2919}29202921/** @name ParachainInfoCall */2922export interface ParachainInfoCall extends Null {}29232924/** @name PhantomTypeUpDataStructs */2925export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, UpPovEstimateRpcPovInfo]>> {}29262927/** @name PolkadotCorePrimitivesInboundDownwardMessage */2928export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {2929 readonly sentAt: u32;2930 readonly msg: Bytes;2931}29322933/** @name PolkadotCorePrimitivesInboundHrmpMessage */2934export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {2935 readonly sentAt: u32;2936 readonly data: Bytes;2937}29382939/** @name PolkadotCorePrimitivesOutboundHrmpMessage */2940export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {2941 readonly recipient: u32;2942 readonly data: Bytes;2943}29442945/** @name PolkadotParachainPrimitivesXcmpMessageFormat */2946export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {2947 readonly isConcatenatedVersionedXcm: boolean;2948 readonly isConcatenatedEncodedBlob: boolean;2949 readonly isSignals: boolean;2950 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';2951}29522953/** @name PolkadotPrimitivesV4AbridgedHostConfiguration */2954export interface PolkadotPrimitivesV4AbridgedHostConfiguration extends Struct {2955 readonly maxCodeSize: u32;2956 readonly maxHeadDataSize: u32;2957 readonly maxUpwardQueueCount: u32;2958 readonly maxUpwardQueueSize: u32;2959 readonly maxUpwardMessageSize: u32;2960 readonly maxUpwardMessageNumPerCandidate: u32;2961 readonly hrmpMaxMessageNumPerCandidate: u32;2962 readonly validationUpgradeCooldown: u32;2963 readonly validationUpgradeDelay: u32;2964}29652966/** @name PolkadotPrimitivesV4AbridgedHrmpChannel */2967export interface PolkadotPrimitivesV4AbridgedHrmpChannel extends Struct {2968 readonly maxCapacity: u32;2969 readonly maxTotalSize: u32;2970 readonly maxMessageSize: u32;2971 readonly msgCount: u32;2972 readonly totalSize: u32;2973 readonly mqcHead: Option<H256>;2974}29752976/** @name PolkadotPrimitivesV4PersistedValidationData */2977export interface PolkadotPrimitivesV4PersistedValidationData extends Struct {2978 readonly parentHead: Bytes;2979 readonly relayParentNumber: u32;2980 readonly relayParentStorageRoot: H256;2981 readonly maxPovSize: u32;2982}29832984/** @name PolkadotPrimitivesV4UpgradeRestriction */2985export interface PolkadotPrimitivesV4UpgradeRestriction extends Enum {2986 readonly isPresent: boolean;2987 readonly type: 'Present';2988}29892990/** @name SpArithmeticArithmeticError */2991export interface SpArithmeticArithmeticError extends Enum {2992 readonly isUnderflow: boolean;2993 readonly isOverflow: boolean;2994 readonly isDivisionByZero: boolean;2995 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';2996}29972998/** @name SpConsensusAuraSr25519AppSr25519Public */2999export interface SpConsensusAuraSr25519AppSr25519Public extends SpCoreSr25519Public {}30003001/** @name SpCoreCryptoKeyTypeId */3002export interface SpCoreCryptoKeyTypeId extends U8aFixed {}30033004/** @name SpCoreEcdsaSignature */3005export interface SpCoreEcdsaSignature extends U8aFixed {}30063007/** @name SpCoreEd25519Signature */3008export interface SpCoreEd25519Signature extends U8aFixed {}30093010/** @name SpCoreSr25519Public */3011export interface SpCoreSr25519Public extends U8aFixed {}30123013/** @name SpCoreSr25519Signature */3014export interface SpCoreSr25519Signature extends U8aFixed {}30153016/** @name SpRuntimeDigest */3017export interface SpRuntimeDigest extends Struct {3018 readonly logs: Vec<SpRuntimeDigestDigestItem>;3019}30203021/** @name SpRuntimeDigestDigestItem */3022export interface SpRuntimeDigestDigestItem extends Enum {3023 readonly isOther: boolean;3024 readonly asOther: Bytes;3025 readonly isConsensus: boolean;3026 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;3027 readonly isSeal: boolean;3028 readonly asSeal: ITuple<[U8aFixed, Bytes]>;3029 readonly isPreRuntime: boolean;3030 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;3031 readonly isRuntimeEnvironmentUpdated: boolean;3032 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';3033}30343035/** @name SpRuntimeDispatchError */3036export interface SpRuntimeDispatchError extends Enum {3037 readonly isOther: boolean;3038 readonly isCannotLookup: boolean;3039 readonly isBadOrigin: boolean;3040 readonly isModule: boolean;3041 readonly asModule: SpRuntimeModuleError;3042 readonly isConsumerRemaining: boolean;3043 readonly isNoProviders: boolean;3044 readonly isTooManyConsumers: boolean;3045 readonly isToken: boolean;3046 readonly asToken: SpRuntimeTokenError;3047 readonly isArithmetic: boolean;3048 readonly asArithmetic: SpArithmeticArithmeticError;3049 readonly isTransactional: boolean;3050 readonly asTransactional: SpRuntimeTransactionalError;3051 readonly isExhausted: boolean;3052 readonly isCorruption: boolean;3053 readonly isUnavailable: boolean;3054 readonly isRootNotAllowed: boolean;3055 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional' | 'Exhausted' | 'Corruption' | 'Unavailable' | 'RootNotAllowed';3056}30573058/** @name SpRuntimeModuleError */3059export interface SpRuntimeModuleError extends Struct {3060 readonly index: u8;3061 readonly error: U8aFixed;3062}30633064/** @name SpRuntimeMultiSignature */3065export interface SpRuntimeMultiSignature extends Enum {3066 readonly isEd25519: boolean;3067 readonly asEd25519: SpCoreEd25519Signature;3068 readonly isSr25519: boolean;3069 readonly asSr25519: SpCoreSr25519Signature;3070 readonly isEcdsa: boolean;3071 readonly asEcdsa: SpCoreEcdsaSignature;3072 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';3073}30743075/** @name SpRuntimeTokenError */3076export interface SpRuntimeTokenError extends Enum {3077 readonly isFundsUnavailable: boolean;3078 readonly isOnlyProvider: boolean;3079 readonly isBelowMinimum: boolean;3080 readonly isCannotCreate: boolean;3081 readonly isUnknownAsset: boolean;3082 readonly isFrozen: boolean;3083 readonly isUnsupported: boolean;3084 readonly isCannotCreateHold: boolean;3085 readonly isNotExpendable: boolean;3086 readonly isBlocked: boolean;3087 readonly type: 'FundsUnavailable' | 'OnlyProvider' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported' | 'CannotCreateHold' | 'NotExpendable' | 'Blocked';3088}30893090/** @name SpRuntimeTransactionalError */3091export interface SpRuntimeTransactionalError extends Enum {3092 readonly isLimitReached: boolean;3093 readonly isNoLayer: boolean;3094 readonly type: 'LimitReached' | 'NoLayer';3095}30963097/** @name SpRuntimeTransactionValidityInvalidTransaction */3098export interface SpRuntimeTransactionValidityInvalidTransaction extends Enum {3099 readonly isCall: boolean;3100 readonly isPayment: boolean;3101 readonly isFuture: boolean;3102 readonly isStale: boolean;3103 readonly isBadProof: boolean;3104 readonly isAncientBirthBlock: boolean;3105 readonly isExhaustsResources: boolean;3106 readonly isCustom: boolean;3107 readonly asCustom: u8;3108 readonly isBadMandatory: boolean;3109 readonly isMandatoryValidation: boolean;3110 readonly isBadSigner: boolean;3111 readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryValidation' | 'BadSigner';3112}31133114/** @name SpRuntimeTransactionValidityTransactionValidityError */3115export interface SpRuntimeTransactionValidityTransactionValidityError extends Enum {3116 readonly isInvalid: boolean;3117 readonly asInvalid: SpRuntimeTransactionValidityInvalidTransaction;3118 readonly isUnknown: boolean;3119 readonly asUnknown: SpRuntimeTransactionValidityUnknownTransaction;3120 readonly type: 'Invalid' | 'Unknown';3121}31223123/** @name SpRuntimeTransactionValidityUnknownTransaction */3124export interface SpRuntimeTransactionValidityUnknownTransaction extends Enum {3125 readonly isCannotLookup: boolean;3126 readonly isNoUnsignedValidator: boolean;3127 readonly isCustom: boolean;3128 readonly asCustom: u8;3129 readonly type: 'CannotLookup' | 'NoUnsignedValidator' | 'Custom';3130}31313132/** @name SpTrieStorageProof */3133export interface SpTrieStorageProof extends Struct {3134 readonly trieNodes: BTreeSet<Bytes>;3135}31363137/** @name SpVersionRuntimeVersion */3138export interface SpVersionRuntimeVersion extends Struct {3139 readonly specName: Text;3140 readonly implName: Text;3141 readonly authoringVersion: u32;3142 readonly specVersion: u32;3143 readonly implVersion: u32;3144 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;3145 readonly transactionVersion: u32;3146 readonly stateVersion: u8;3147}31483149/** @name SpWeightsRuntimeDbWeight */3150export interface SpWeightsRuntimeDbWeight extends Struct {3151 readonly read: u64;3152 readonly write: u64;3153}31543155/** @name SpWeightsWeightV2Weight */3156export interface SpWeightsWeightV2Weight extends Struct {3157 readonly refTime: Compact<u64>;3158 readonly proofSize: Compact<u64>;3159}31603161/** @name UpDataStructsAccessMode */3162export interface UpDataStructsAccessMode extends Enum {3163 readonly isNormal: boolean;3164 readonly isAllowList: boolean;3165 readonly type: 'Normal' | 'AllowList';3166}31673168/** @name UpDataStructsCollection */3169export interface UpDataStructsCollection extends Struct {3170 readonly owner: AccountId32;3171 readonly mode: UpDataStructsCollectionMode;3172 readonly name: Vec<u16>;3173 readonly description: Vec<u16>;3174 readonly tokenPrefix: Bytes;3175 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3176 readonly limits: UpDataStructsCollectionLimits;3177 readonly permissions: UpDataStructsCollectionPermissions;3178 readonly flags: U8aFixed;3179}31803181/** @name UpDataStructsCollectionLimits */3182export interface UpDataStructsCollectionLimits extends Struct {3183 readonly accountTokenOwnershipLimit: Option<u32>;3184 readonly sponsoredDataSize: Option<u32>;3185 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;3186 readonly tokenLimit: Option<u32>;3187 readonly sponsorTransferTimeout: Option<u32>;3188 readonly sponsorApproveTimeout: Option<u32>;3189 readonly ownerCanTransfer: Option<bool>;3190 readonly ownerCanDestroy: Option<bool>;3191 readonly transfersEnabled: Option<bool>;3192}31933194/** @name UpDataStructsCollectionMode */3195export interface UpDataStructsCollectionMode extends Enum {3196 readonly isNft: boolean;3197 readonly isFungible: boolean;3198 readonly asFungible: u8;3199 readonly isReFungible: boolean;3200 readonly type: 'Nft' | 'Fungible' | 'ReFungible';3201}32023203/** @name UpDataStructsCollectionPermissions */3204export interface UpDataStructsCollectionPermissions extends Struct {3205 readonly access: Option<UpDataStructsAccessMode>;3206 readonly mintMode: Option<bool>;3207 readonly nesting: Option<UpDataStructsNestingPermissions>;3208}32093210/** @name UpDataStructsCollectionStats */3211export interface UpDataStructsCollectionStats extends Struct {3212 readonly created: u32;3213 readonly destroyed: u32;3214 readonly alive: u32;3215}32163217/** @name UpDataStructsCreateCollectionData */3218export interface UpDataStructsCreateCollectionData extends Struct {3219 readonly mode: UpDataStructsCollectionMode;3220 readonly access: Option<UpDataStructsAccessMode>;3221 readonly name: Vec<u16>;3222 readonly description: Vec<u16>;3223 readonly tokenPrefix: Bytes;3224 readonly pendingSponsor: Option<AccountId32>;3225 readonly limits: Option<UpDataStructsCollectionLimits>;3226 readonly permissions: Option<UpDataStructsCollectionPermissions>;3227 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3228 readonly properties: Vec<UpDataStructsProperty>;3229}32303231/** @name UpDataStructsCreateFungibleData */3232export interface UpDataStructsCreateFungibleData extends Struct {3233 readonly value: u128;3234}32353236/** @name UpDataStructsCreateItemData */3237export interface UpDataStructsCreateItemData extends Enum {3238 readonly isNft: boolean;3239 readonly asNft: UpDataStructsCreateNftData;3240 readonly isFungible: boolean;3241 readonly asFungible: UpDataStructsCreateFungibleData;3242 readonly isReFungible: boolean;3243 readonly asReFungible: UpDataStructsCreateReFungibleData;3244 readonly type: 'Nft' | 'Fungible' | 'ReFungible';3245}32463247/** @name UpDataStructsCreateItemExData */3248export interface UpDataStructsCreateItemExData extends Enum {3249 readonly isNft: boolean;3250 readonly asNft: Vec<UpDataStructsCreateNftExData>;3251 readonly isFungible: boolean;3252 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr,u128>;3253 readonly isRefungibleMultipleItems: boolean;3254 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;3255 readonly isRefungibleMultipleOwners: boolean;3256 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;3257 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';3258}32593260/** @name UpDataStructsCreateNftData */3261export interface UpDataStructsCreateNftData extends Struct {3262 readonly properties: Vec<UpDataStructsProperty>;3263}32643265/** @name UpDataStructsCreateNftExData */3266export interface UpDataStructsCreateNftExData extends Struct {3267 readonly properties: Vec<UpDataStructsProperty>;3268 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;3269}32703271/** @name UpDataStructsCreateReFungibleData */3272export interface UpDataStructsCreateReFungibleData extends Struct {3273 readonly pieces: u128;3274 readonly properties: Vec<UpDataStructsProperty>;3275}32763277/** @name UpDataStructsCreateRefungibleExMultipleOwners */3278export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {3279 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;3280 readonly properties: Vec<UpDataStructsProperty>;3281}32823283/** @name UpDataStructsCreateRefungibleExSingleOwner */3284export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {3285 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;3286 readonly pieces: u128;3287 readonly properties: Vec<UpDataStructsProperty>;3288}32893290/** @name UpDataStructsNestingPermissions */3291export interface UpDataStructsNestingPermissions extends Struct {3292 readonly tokenOwner: bool;3293 readonly collectionAdmin: bool;3294 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;3295}32963297/** @name UpDataStructsOwnerRestrictedSet */3298export interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}32993300/** @name UpDataStructsProperties */3301export interface UpDataStructsProperties extends Struct {3302 readonly map: UpDataStructsPropertiesMapBoundedVec;3303 readonly consumedSpace: u32;3304 readonly reserved: u32;3305}33063307/** @name UpDataStructsPropertiesMapBoundedVec */3308export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}33093310/** @name UpDataStructsPropertiesMapPropertyPermission */3311export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}33123313/** @name UpDataStructsProperty */3314export interface UpDataStructsProperty extends Struct {3315 readonly key: Bytes;3316 readonly value: Bytes;3317}33183319/** @name UpDataStructsPropertyKeyPermission */3320export interface UpDataStructsPropertyKeyPermission extends Struct {3321 readonly key: Bytes;3322 readonly permission: UpDataStructsPropertyPermission;3323}33243325/** @name UpDataStructsPropertyPermission */3326export interface UpDataStructsPropertyPermission extends Struct {3327 readonly mutable: bool;3328 readonly collectionAdmin: bool;3329 readonly tokenOwner: bool;3330}33313332/** @name UpDataStructsPropertyScope */3333export interface UpDataStructsPropertyScope extends Enum {3334 readonly isNone: boolean;3335 readonly isRmrk: boolean;3336 readonly type: 'None' | 'Rmrk';3337}33383339/** @name UpDataStructsRpcCollection */3340export interface UpDataStructsRpcCollection extends Struct {3341 readonly owner: AccountId32;3342 readonly mode: UpDataStructsCollectionMode;3343 readonly name: Vec<u16>;3344 readonly description: Vec<u16>;3345 readonly tokenPrefix: Bytes;3346 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;3347 readonly limits: UpDataStructsCollectionLimits;3348 readonly permissions: UpDataStructsCollectionPermissions;3349 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3350 readonly properties: Vec<UpDataStructsProperty>;3351 readonly readOnly: bool;3352 readonly flags: UpDataStructsRpcCollectionFlags;3353}33543355/** @name UpDataStructsRpcCollectionFlags */3356export interface UpDataStructsRpcCollectionFlags extends Struct {3357 readonly foreign: bool;3358 readonly erc721metadata: bool;3359}33603361/** @name UpDataStructsSponsoringRateLimit */3362export interface UpDataStructsSponsoringRateLimit extends Enum {3363 readonly isSponsoringDisabled: boolean;3364 readonly isBlocks: boolean;3365 readonly asBlocks: u32;3366 readonly type: 'SponsoringDisabled' | 'Blocks';3367}33683369/** @name UpDataStructsSponsorshipStateAccountId32 */3370export interface UpDataStructsSponsorshipStateAccountId32 extends Enum {3371 readonly isDisabled: boolean;3372 readonly isUnconfirmed: boolean;3373 readonly asUnconfirmed: AccountId32;3374 readonly isConfirmed: boolean;3375 readonly asConfirmed: AccountId32;3376 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3377}33783379/** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr */3380export interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {3381 readonly isDisabled: boolean;3382 readonly isUnconfirmed: boolean;3383 readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3384 readonly isConfirmed: boolean;3385 readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3386 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3387}33883389/** @name UpDataStructsTokenChild */3390export interface UpDataStructsTokenChild extends Struct {3391 readonly token: u32;3392 readonly collection: u32;3393}33943395/** @name UpDataStructsTokenData */3396export interface UpDataStructsTokenData extends Struct {3397 readonly properties: Vec<UpDataStructsProperty>;3398 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3399 readonly pieces: u128;3400}34013402/** @name UpPovEstimateRpcPovInfo */3403export interface UpPovEstimateRpcPovInfo extends Struct {3404 readonly proofSize: u64;3405 readonly compactProofSize: u64;3406 readonly compressedProofSize: u64;3407 readonly results: Vec<Result<Result<Null, SpRuntimeDispatchError>, SpRuntimeTransactionValidityTransactionValidityError>>;3408 readonly keyValues: Vec<UpPovEstimateRpcTrieKeyValue>;3409}34103411/** @name UpPovEstimateRpcTrieKeyValue */3412export interface UpPovEstimateRpcTrieKeyValue extends Struct {3413 readonly key: Bytes;3414 readonly value: Bytes;3415}34163417/** @name XcmDoubleEncoded */3418export interface XcmDoubleEncoded extends Struct {3419 readonly encoded: Bytes;3420}34213422/** @name XcmV2BodyId */3423export interface XcmV2BodyId extends Enum {3424 readonly isUnit: boolean;3425 readonly isNamed: boolean;3426 readonly asNamed: Bytes;3427 readonly isIndex: boolean;3428 readonly asIndex: Compact<u32>;3429 readonly isExecutive: boolean;3430 readonly isTechnical: boolean;3431 readonly isLegislative: boolean;3432 readonly isJudicial: boolean;3433 readonly isDefense: boolean;3434 readonly isAdministration: boolean;3435 readonly isTreasury: boolean;3436 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial' | 'Defense' | 'Administration' | 'Treasury';3437}34383439/** @name XcmV2BodyPart */3440export interface XcmV2BodyPart extends Enum {3441 readonly isVoice: boolean;3442 readonly isMembers: boolean;3443 readonly asMembers: {3444 readonly count: Compact<u32>;3445 } & Struct;3446 readonly isFraction: boolean;3447 readonly asFraction: {3448 readonly nom: Compact<u32>;3449 readonly denom: Compact<u32>;3450 } & Struct;3451 readonly isAtLeastProportion: boolean;3452 readonly asAtLeastProportion: {3453 readonly nom: Compact<u32>;3454 readonly denom: Compact<u32>;3455 } & Struct;3456 readonly isMoreThanProportion: boolean;3457 readonly asMoreThanProportion: {3458 readonly nom: Compact<u32>;3459 readonly denom: Compact<u32>;3460 } & Struct;3461 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';3462}34633464/** @name XcmV2Instruction */3465export interface XcmV2Instruction extends Enum {3466 readonly isWithdrawAsset: boolean;3467 readonly asWithdrawAsset: XcmV2MultiassetMultiAssets;3468 readonly isReserveAssetDeposited: boolean;3469 readonly asReserveAssetDeposited: XcmV2MultiassetMultiAssets;3470 readonly isReceiveTeleportedAsset: boolean;3471 readonly asReceiveTeleportedAsset: XcmV2MultiassetMultiAssets;3472 readonly isQueryResponse: boolean;3473 readonly asQueryResponse: {3474 readonly queryId: Compact<u64>;3475 readonly response: XcmV2Response;3476 readonly maxWeight: Compact<u64>;3477 } & Struct;3478 readonly isTransferAsset: boolean;3479 readonly asTransferAsset: {3480 readonly assets: XcmV2MultiassetMultiAssets;3481 readonly beneficiary: XcmV2MultiLocation;3482 } & Struct;3483 readonly isTransferReserveAsset: boolean;3484 readonly asTransferReserveAsset: {3485 readonly assets: XcmV2MultiassetMultiAssets;3486 readonly dest: XcmV2MultiLocation;3487 readonly xcm: XcmV2Xcm;3488 } & Struct;3489 readonly isTransact: boolean;3490 readonly asTransact: {3491 readonly originType: XcmV2OriginKind;3492 readonly requireWeightAtMost: Compact<u64>;3493 readonly call: XcmDoubleEncoded;3494 } & Struct;3495 readonly isHrmpNewChannelOpenRequest: boolean;3496 readonly asHrmpNewChannelOpenRequest: {3497 readonly sender: Compact<u32>;3498 readonly maxMessageSize: Compact<u32>;3499 readonly maxCapacity: Compact<u32>;3500 } & Struct;3501 readonly isHrmpChannelAccepted: boolean;3502 readonly asHrmpChannelAccepted: {3503 readonly recipient: Compact<u32>;3504 } & Struct;3505 readonly isHrmpChannelClosing: boolean;3506 readonly asHrmpChannelClosing: {3507 readonly initiator: Compact<u32>;3508 readonly sender: Compact<u32>;3509 readonly recipient: Compact<u32>;3510 } & Struct;3511 readonly isClearOrigin: boolean;3512 readonly isDescendOrigin: boolean;3513 readonly asDescendOrigin: XcmV2MultilocationJunctions;3514 readonly isReportError: boolean;3515 readonly asReportError: {3516 readonly queryId: Compact<u64>;3517 readonly dest: XcmV2MultiLocation;3518 readonly maxResponseWeight: Compact<u64>;3519 } & Struct;3520 readonly isDepositAsset: boolean;3521 readonly asDepositAsset: {3522 readonly assets: XcmV2MultiassetMultiAssetFilter;3523 readonly maxAssets: Compact<u32>;3524 readonly beneficiary: XcmV2MultiLocation;3525 } & Struct;3526 readonly isDepositReserveAsset: boolean;3527 readonly asDepositReserveAsset: {3528 readonly assets: XcmV2MultiassetMultiAssetFilter;3529 readonly maxAssets: Compact<u32>;3530 readonly dest: XcmV2MultiLocation;3531 readonly xcm: XcmV2Xcm;3532 } & Struct;3533 readonly isExchangeAsset: boolean;3534 readonly asExchangeAsset: {3535 readonly give: XcmV2MultiassetMultiAssetFilter;3536 readonly receive: XcmV2MultiassetMultiAssets;3537 } & Struct;3538 readonly isInitiateReserveWithdraw: boolean;3539 readonly asInitiateReserveWithdraw: {3540 readonly assets: XcmV2MultiassetMultiAssetFilter;3541 readonly reserve: XcmV2MultiLocation;3542 readonly xcm: XcmV2Xcm;3543 } & Struct;3544 readonly isInitiateTeleport: boolean;3545 readonly asInitiateTeleport: {3546 readonly assets: XcmV2MultiassetMultiAssetFilter;3547 readonly dest: XcmV2MultiLocation;3548 readonly xcm: XcmV2Xcm;3549 } & Struct;3550 readonly isQueryHolding: boolean;3551 readonly asQueryHolding: {3552 readonly queryId: Compact<u64>;3553 readonly dest: XcmV2MultiLocation;3554 readonly assets: XcmV2MultiassetMultiAssetFilter;3555 readonly maxResponseWeight: Compact<u64>;3556 } & Struct;3557 readonly isBuyExecution: boolean;3558 readonly asBuyExecution: {3559 readonly fees: XcmV2MultiAsset;3560 readonly weightLimit: XcmV2WeightLimit;3561 } & Struct;3562 readonly isRefundSurplus: boolean;3563 readonly isSetErrorHandler: boolean;3564 readonly asSetErrorHandler: XcmV2Xcm;3565 readonly isSetAppendix: boolean;3566 readonly asSetAppendix: XcmV2Xcm;3567 readonly isClearError: boolean;3568 readonly isClaimAsset: boolean;3569 readonly asClaimAsset: {3570 readonly assets: XcmV2MultiassetMultiAssets;3571 readonly ticket: XcmV2MultiLocation;3572 } & Struct;3573 readonly isTrap: boolean;3574 readonly asTrap: Compact<u64>;3575 readonly isSubscribeVersion: boolean;3576 readonly asSubscribeVersion: {3577 readonly queryId: Compact<u64>;3578 readonly maxResponseWeight: Compact<u64>;3579 } & Struct;3580 readonly isUnsubscribeVersion: boolean;3581 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';3582}35833584/** @name XcmV2Junction */3585export interface XcmV2Junction extends Enum {3586 readonly isParachain: boolean;3587 readonly asParachain: Compact<u32>;3588 readonly isAccountId32: boolean;3589 readonly asAccountId32: {3590 readonly network: XcmV2NetworkId;3591 readonly id: U8aFixed;3592 } & Struct;3593 readonly isAccountIndex64: boolean;3594 readonly asAccountIndex64: {3595 readonly network: XcmV2NetworkId;3596 readonly index: Compact<u64>;3597 } & Struct;3598 readonly isAccountKey20: boolean;3599 readonly asAccountKey20: {3600 readonly network: XcmV2NetworkId;3601 readonly key: U8aFixed;3602 } & Struct;3603 readonly isPalletInstance: boolean;3604 readonly asPalletInstance: u8;3605 readonly isGeneralIndex: boolean;3606 readonly asGeneralIndex: Compact<u128>;3607 readonly isGeneralKey: boolean;3608 readonly asGeneralKey: Bytes;3609 readonly isOnlyChild: boolean;3610 readonly isPlurality: boolean;3611 readonly asPlurality: {3612 readonly id: XcmV2BodyId;3613 readonly part: XcmV2BodyPart;3614 } & Struct;3615 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';3616}36173618/** @name XcmV2MultiAsset */3619export interface XcmV2MultiAsset extends Struct {3620 readonly id: XcmV2MultiassetAssetId;3621 readonly fun: XcmV2MultiassetFungibility;3622}36233624/** @name XcmV2MultiassetAssetId */3625export interface XcmV2MultiassetAssetId extends Enum {3626 readonly isConcrete: boolean;3627 readonly asConcrete: XcmV2MultiLocation;3628 readonly isAbstract: boolean;3629 readonly asAbstract: Bytes;3630 readonly type: 'Concrete' | 'Abstract';3631}36323633/** @name XcmV2MultiassetAssetInstance */3634export interface XcmV2MultiassetAssetInstance extends Enum {3635 readonly isUndefined: boolean;3636 readonly isIndex: boolean;3637 readonly asIndex: Compact<u128>;3638 readonly isArray4: boolean;3639 readonly asArray4: U8aFixed;3640 readonly isArray8: boolean;3641 readonly asArray8: U8aFixed;3642 readonly isArray16: boolean;3643 readonly asArray16: U8aFixed;3644 readonly isArray32: boolean;3645 readonly asArray32: U8aFixed;3646 readonly isBlob: boolean;3647 readonly asBlob: Bytes;3648 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';3649}36503651/** @name XcmV2MultiassetFungibility */3652export interface XcmV2MultiassetFungibility extends Enum {3653 readonly isFungible: boolean;3654 readonly asFungible: Compact<u128>;3655 readonly isNonFungible: boolean;3656 readonly asNonFungible: XcmV2MultiassetAssetInstance;3657 readonly type: 'Fungible' | 'NonFungible';3658}36593660/** @name XcmV2MultiassetMultiAssetFilter */3661export interface XcmV2MultiassetMultiAssetFilter extends Enum {3662 readonly isDefinite: boolean;3663 readonly asDefinite: XcmV2MultiassetMultiAssets;3664 readonly isWild: boolean;3665 readonly asWild: XcmV2MultiassetWildMultiAsset;3666 readonly type: 'Definite' | 'Wild';3667}36683669/** @name XcmV2MultiassetMultiAssets */3670export interface XcmV2MultiassetMultiAssets extends Vec<XcmV2MultiAsset> {}36713672/** @name XcmV2MultiassetWildFungibility */3673export interface XcmV2MultiassetWildFungibility extends Enum {3674 readonly isFungible: boolean;3675 readonly isNonFungible: boolean;3676 readonly type: 'Fungible' | 'NonFungible';3677}36783679/** @name XcmV2MultiassetWildMultiAsset */3680export interface XcmV2MultiassetWildMultiAsset extends Enum {3681 readonly isAll: boolean;3682 readonly isAllOf: boolean;3683 readonly asAllOf: {3684 readonly id: XcmV2MultiassetAssetId;3685 readonly fun: XcmV2MultiassetWildFungibility;3686 } & Struct;3687 readonly type: 'All' | 'AllOf';3688}36893690/** @name XcmV2MultiLocation */3691export interface XcmV2MultiLocation extends Struct {3692 readonly parents: u8;3693 readonly interior: XcmV2MultilocationJunctions;3694}36953696/** @name XcmV2MultilocationJunctions */3697export interface XcmV2MultilocationJunctions extends Enum {3698 readonly isHere: boolean;3699 readonly isX1: boolean;3700 readonly asX1: XcmV2Junction;3701 readonly isX2: boolean;3702 readonly asX2: ITuple<[XcmV2Junction, XcmV2Junction]>;3703 readonly isX3: boolean;3704 readonly asX3: ITuple<[XcmV2Junction, XcmV2Junction, XcmV2Junction]>;3705 readonly isX4: boolean;3706 readonly asX4: ITuple<[XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction]>;3707 readonly isX5: boolean;3708 readonly asX5: ITuple<[XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction]>;3709 readonly isX6: boolean;3710 readonly asX6: ITuple<[XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction]>;3711 readonly isX7: boolean;3712 readonly asX7: ITuple<[XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction]>;3713 readonly isX8: boolean;3714 readonly asX8: ITuple<[XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction, XcmV2Junction]>;3715 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';3716}37173718/** @name XcmV2NetworkId */3719export interface XcmV2NetworkId extends Enum {3720 readonly isAny: boolean;3721 readonly isNamed: boolean;3722 readonly asNamed: Bytes;3723 readonly isPolkadot: boolean;3724 readonly isKusama: boolean;3725 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';3726}37273728/** @name XcmV2OriginKind */3729export interface XcmV2OriginKind extends Enum {3730 readonly isNative: boolean;3731 readonly isSovereignAccount: boolean;3732 readonly isSuperuser: boolean;3733 readonly isXcm: boolean;3734 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';3735}37363737/** @name XcmV2Response */3738export interface XcmV2Response extends Enum {3739 readonly isNull: boolean;3740 readonly isAssets: boolean;3741 readonly asAssets: XcmV2MultiassetMultiAssets;3742 readonly isExecutionResult: boolean;3743 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;3744 readonly isVersion: boolean;3745 readonly asVersion: u32;3746 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';3747}37483749/** @name XcmV2TraitsError */3750export interface XcmV2TraitsError extends Enum {3751 readonly isOverflow: boolean;3752 readonly isUnimplemented: boolean;3753 readonly isUntrustedReserveLocation: boolean;3754 readonly isUntrustedTeleportLocation: boolean;3755 readonly isMultiLocationFull: boolean;3756 readonly isMultiLocationNotInvertible: boolean;3757 readonly isBadOrigin: boolean;3758 readonly isInvalidLocation: boolean;3759 readonly isAssetNotFound: boolean;3760 readonly isFailedToTransactAsset: boolean;3761 readonly isNotWithdrawable: boolean;3762 readonly isLocationCannotHold: boolean;3763 readonly isExceedsMaxMessageSize: boolean;3764 readonly isDestinationUnsupported: boolean;3765 readonly isTransport: boolean;3766 readonly isUnroutable: boolean;3767 readonly isUnknownClaim: boolean;3768 readonly isFailedToDecode: boolean;3769 readonly isMaxWeightInvalid: boolean;3770 readonly isNotHoldingFees: boolean;3771 readonly isTooExpensive: boolean;3772 readonly isTrap: boolean;3773 readonly asTrap: u64;3774 readonly isUnhandledXcmVersion: boolean;3775 readonly isWeightLimitReached: boolean;3776 readonly asWeightLimitReached: u64;3777 readonly isBarrier: boolean;3778 readonly isWeightNotComputable: boolean;3779 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';3780}37813782/** @name XcmV2WeightLimit */3783export interface XcmV2WeightLimit extends Enum {3784 readonly isUnlimited: boolean;3785 readonly isLimited: boolean;3786 readonly asLimited: Compact<u64>;3787 readonly type: 'Unlimited' | 'Limited';3788}37893790/** @name XcmV2Xcm */3791export interface XcmV2Xcm extends Vec<XcmV2Instruction> {}37923793/** @name XcmV3Instruction */3794export interface XcmV3Instruction extends Enum {3795 readonly isWithdrawAsset: boolean;3796 readonly asWithdrawAsset: XcmV3MultiassetMultiAssets;3797 readonly isReserveAssetDeposited: boolean;3798 readonly asReserveAssetDeposited: XcmV3MultiassetMultiAssets;3799 readonly isReceiveTeleportedAsset: boolean;3800 readonly asReceiveTeleportedAsset: XcmV3MultiassetMultiAssets;3801 readonly isQueryResponse: boolean;3802 readonly asQueryResponse: {3803 readonly queryId: Compact<u64>;3804 readonly response: XcmV3Response;3805 readonly maxWeight: SpWeightsWeightV2Weight;3806 readonly querier: Option<XcmV3MultiLocation>;3807 } & Struct;3808 readonly isTransferAsset: boolean;3809 readonly asTransferAsset: {3810 readonly assets: XcmV3MultiassetMultiAssets;3811 readonly beneficiary: XcmV3MultiLocation;3812 } & Struct;3813 readonly isTransferReserveAsset: boolean;3814 readonly asTransferReserveAsset: {3815 readonly assets: XcmV3MultiassetMultiAssets;3816 readonly dest: XcmV3MultiLocation;3817 readonly xcm: XcmV3Xcm;3818 } & Struct;3819 readonly isTransact: boolean;3820 readonly asTransact: {3821 readonly originKind: XcmV2OriginKind;3822 readonly requireWeightAtMost: SpWeightsWeightV2Weight;3823 readonly call: XcmDoubleEncoded;3824 } & Struct;3825 readonly isHrmpNewChannelOpenRequest: boolean;3826 readonly asHrmpNewChannelOpenRequest: {3827 readonly sender: Compact<u32>;3828 readonly maxMessageSize: Compact<u32>;3829 readonly maxCapacity: Compact<u32>;3830 } & Struct;3831 readonly isHrmpChannelAccepted: boolean;3832 readonly asHrmpChannelAccepted: {3833 readonly recipient: Compact<u32>;3834 } & Struct;3835 readonly isHrmpChannelClosing: boolean;3836 readonly asHrmpChannelClosing: {3837 readonly initiator: Compact<u32>;3838 readonly sender: Compact<u32>;3839 readonly recipient: Compact<u32>;3840 } & Struct;3841 readonly isClearOrigin: boolean;3842 readonly isDescendOrigin: boolean;3843 readonly asDescendOrigin: XcmV3Junctions;3844 readonly isReportError: boolean;3845 readonly asReportError: XcmV3QueryResponseInfo;3846 readonly isDepositAsset: boolean;3847 readonly asDepositAsset: {3848 readonly assets: XcmV3MultiassetMultiAssetFilter;3849 readonly beneficiary: XcmV3MultiLocation;3850 } & Struct;3851 readonly isDepositReserveAsset: boolean;3852 readonly asDepositReserveAsset: {3853 readonly assets: XcmV3MultiassetMultiAssetFilter;3854 readonly dest: XcmV3MultiLocation;3855 readonly xcm: XcmV3Xcm;3856 } & Struct;3857 readonly isExchangeAsset: boolean;3858 readonly asExchangeAsset: {3859 readonly give: XcmV3MultiassetMultiAssetFilter;3860 readonly want: XcmV3MultiassetMultiAssets;3861 readonly maximal: bool;3862 } & Struct;3863 readonly isInitiateReserveWithdraw: boolean;3864 readonly asInitiateReserveWithdraw: {3865 readonly assets: XcmV3MultiassetMultiAssetFilter;3866 readonly reserve: XcmV3MultiLocation;3867 readonly xcm: XcmV3Xcm;3868 } & Struct;3869 readonly isInitiateTeleport: boolean;3870 readonly asInitiateTeleport: {3871 readonly assets: XcmV3MultiassetMultiAssetFilter;3872 readonly dest: XcmV3MultiLocation;3873 readonly xcm: XcmV3Xcm;3874 } & Struct;3875 readonly isReportHolding: boolean;3876 readonly asReportHolding: {3877 readonly responseInfo: XcmV3QueryResponseInfo;3878 readonly assets: XcmV3MultiassetMultiAssetFilter;3879 } & Struct;3880 readonly isBuyExecution: boolean;3881 readonly asBuyExecution: {3882 readonly fees: XcmV3MultiAsset;3883 readonly weightLimit: XcmV3WeightLimit;3884 } & Struct;3885 readonly isRefundSurplus: boolean;3886 readonly isSetErrorHandler: boolean;3887 readonly asSetErrorHandler: XcmV3Xcm;3888 readonly isSetAppendix: boolean;3889 readonly asSetAppendix: XcmV3Xcm;3890 readonly isClearError: boolean;3891 readonly isClaimAsset: boolean;3892 readonly asClaimAsset: {3893 readonly assets: XcmV3MultiassetMultiAssets;3894 readonly ticket: XcmV3MultiLocation;3895 } & Struct;3896 readonly isTrap: boolean;3897 readonly asTrap: Compact<u64>;3898 readonly isSubscribeVersion: boolean;3899 readonly asSubscribeVersion: {3900 readonly queryId: Compact<u64>;3901 readonly maxResponseWeight: SpWeightsWeightV2Weight;3902 } & Struct;3903 readonly isUnsubscribeVersion: boolean;3904 readonly isBurnAsset: boolean;3905 readonly asBurnAsset: XcmV3MultiassetMultiAssets;3906 readonly isExpectAsset: boolean;3907 readonly asExpectAsset: XcmV3MultiassetMultiAssets;3908 readonly isExpectOrigin: boolean;3909 readonly asExpectOrigin: Option<XcmV3MultiLocation>;3910 readonly isExpectError: boolean;3911 readonly asExpectError: Option<ITuple<[u32, XcmV3TraitsError]>>;3912 readonly isExpectTransactStatus: boolean;3913 readonly asExpectTransactStatus: XcmV3MaybeErrorCode;3914 readonly isQueryPallet: boolean;3915 readonly asQueryPallet: {3916 readonly moduleName: Bytes;3917 readonly responseInfo: XcmV3QueryResponseInfo;3918 } & Struct;3919 readonly isExpectPallet: boolean;3920 readonly asExpectPallet: {3921 readonly index: Compact<u32>;3922 readonly name: Bytes;3923 readonly moduleName: Bytes;3924 readonly crateMajor: Compact<u32>;3925 readonly minCrateMinor: Compact<u32>;3926 } & Struct;3927 readonly isReportTransactStatus: boolean;3928 readonly asReportTransactStatus: XcmV3QueryResponseInfo;3929 readonly isClearTransactStatus: boolean;3930 readonly isUniversalOrigin: boolean;3931 readonly asUniversalOrigin: XcmV3Junction;3932 readonly isExportMessage: boolean;3933 readonly asExportMessage: {3934 readonly network: XcmV3JunctionNetworkId;3935 readonly destination: XcmV3Junctions;3936 readonly xcm: XcmV3Xcm;3937 } & Struct;3938 readonly isLockAsset: boolean;3939 readonly asLockAsset: {3940 readonly asset: XcmV3MultiAsset;3941 readonly unlocker: XcmV3MultiLocation;3942 } & Struct;3943 readonly isUnlockAsset: boolean;3944 readonly asUnlockAsset: {3945 readonly asset: XcmV3MultiAsset;3946 readonly target: XcmV3MultiLocation;3947 } & Struct;3948 readonly isNoteUnlockable: boolean;3949 readonly asNoteUnlockable: {3950 readonly asset: XcmV3MultiAsset;3951 readonly owner: XcmV3MultiLocation;3952 } & Struct;3953 readonly isRequestUnlock: boolean;3954 readonly asRequestUnlock: {3955 readonly asset: XcmV3MultiAsset;3956 readonly locker: XcmV3MultiLocation;3957 } & Struct;3958 readonly isSetFeesMode: boolean;3959 readonly asSetFeesMode: {3960 readonly jitWithdraw: bool;3961 } & Struct;3962 readonly isSetTopic: boolean;3963 readonly asSetTopic: U8aFixed;3964 readonly isClearTopic: boolean;3965 readonly isAliasOrigin: boolean;3966 readonly asAliasOrigin: XcmV3MultiLocation;3967 readonly isUnpaidExecution: boolean;3968 readonly asUnpaidExecution: {3969 readonly weightLimit: XcmV3WeightLimit;3970 readonly checkOrigin: Option<XcmV3MultiLocation>;3971 } & Struct;3972 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'ReportHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion' | 'BurnAsset' | 'ExpectAsset' | 'ExpectOrigin' | 'ExpectError' | 'ExpectTransactStatus' | 'QueryPallet' | 'ExpectPallet' | 'ReportTransactStatus' | 'ClearTransactStatus' | 'UniversalOrigin' | 'ExportMessage' | 'LockAsset' | 'UnlockAsset' | 'NoteUnlockable' | 'RequestUnlock' | 'SetFeesMode' | 'SetTopic' | 'ClearTopic' | 'AliasOrigin' | 'UnpaidExecution';3973}39743975/** @name XcmV3Junction */3976export interface XcmV3Junction extends Enum {3977 readonly isParachain: boolean;3978 readonly asParachain: Compact<u32>;3979 readonly isAccountId32: boolean;3980 readonly asAccountId32: {3981 readonly network: Option<XcmV3JunctionNetworkId>;3982 readonly id: U8aFixed;3983 } & Struct;3984 readonly isAccountIndex64: boolean;3985 readonly asAccountIndex64: {3986 readonly network: Option<XcmV3JunctionNetworkId>;3987 readonly index: Compact<u64>;3988 } & Struct;3989 readonly isAccountKey20: boolean;3990 readonly asAccountKey20: {3991 readonly network: Option<XcmV3JunctionNetworkId>;3992 readonly key: U8aFixed;3993 } & Struct;3994 readonly isPalletInstance: boolean;3995 readonly asPalletInstance: u8;3996 readonly isGeneralIndex: boolean;3997 readonly asGeneralIndex: Compact<u128>;3998 readonly isGeneralKey: boolean;3999 readonly asGeneralKey: {4000 readonly length: u8;4001 readonly data: U8aFixed;4002 } & Struct;4003 readonly isOnlyChild: boolean;4004 readonly isPlurality: boolean;4005 readonly asPlurality: {4006 readonly id: XcmV3JunctionBodyId;4007 readonly part: XcmV3JunctionBodyPart;4008 } & Struct;4009 readonly isGlobalConsensus: boolean;4010 readonly asGlobalConsensus: XcmV3JunctionNetworkId;4011 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality' | 'GlobalConsensus';4012}40134014/** @name XcmV3JunctionBodyId */4015export interface XcmV3JunctionBodyId extends Enum {4016 readonly isUnit: boolean;4017 readonly isMoniker: boolean;4018 readonly asMoniker: U8aFixed;4019 readonly isIndex: boolean;4020 readonly asIndex: Compact<u32>;4021 readonly isExecutive: boolean;4022 readonly isTechnical: boolean;4023 readonly isLegislative: boolean;4024 readonly isJudicial: boolean;4025 readonly isDefense: boolean;4026 readonly isAdministration: boolean;4027 readonly isTreasury: boolean;4028 readonly type: 'Unit' | 'Moniker' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial' | 'Defense' | 'Administration' | 'Treasury';4029}40304031/** @name XcmV3JunctionBodyPart */4032export interface XcmV3JunctionBodyPart extends Enum {4033 readonly isVoice: boolean;4034 readonly isMembers: boolean;4035 readonly asMembers: {4036 readonly count: Compact<u32>;4037 } & Struct;4038 readonly isFraction: boolean;4039 readonly asFraction: {4040 readonly nom: Compact<u32>;4041 readonly denom: Compact<u32>;4042 } & Struct;4043 readonly isAtLeastProportion: boolean;4044 readonly asAtLeastProportion: {4045 readonly nom: Compact<u32>;4046 readonly denom: Compact<u32>;4047 } & Struct;4048 readonly isMoreThanProportion: boolean;4049 readonly asMoreThanProportion: {4050 readonly nom: Compact<u32>;4051 readonly denom: Compact<u32>;4052 } & Struct;4053 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';4054}40554056/** @name XcmV3JunctionNetworkId */4057export interface XcmV3JunctionNetworkId extends Enum {4058 readonly isByGenesis: boolean;4059 readonly asByGenesis: U8aFixed;4060 readonly isByFork: boolean;4061 readonly asByFork: {4062 readonly blockNumber: u64;4063 readonly blockHash: U8aFixed;4064 } & Struct;4065 readonly isPolkadot: boolean;4066 readonly isKusama: boolean;4067 readonly isWestend: boolean;4068 readonly isRococo: boolean;4069 readonly isWococo: boolean;4070 readonly isEthereum: boolean;4071 readonly asEthereum: {4072 readonly chainId: Compact<u64>;4073 } & Struct;4074 readonly isBitcoinCore: boolean;4075 readonly isBitcoinCash: boolean;4076 readonly type: 'ByGenesis' | 'ByFork' | 'Polkadot' | 'Kusama' | 'Westend' | 'Rococo' | 'Wococo' | 'Ethereum' | 'BitcoinCore' | 'BitcoinCash';4077}40784079/** @name XcmV3Junctions */4080export interface XcmV3Junctions extends Enum {4081 readonly isHere: boolean;4082 readonly isX1: boolean;4083 readonly asX1: XcmV3Junction;4084 readonly isX2: boolean;4085 readonly asX2: ITuple<[XcmV3Junction, XcmV3Junction]>;4086 readonly isX3: boolean;4087 readonly asX3: ITuple<[XcmV3Junction, XcmV3Junction, XcmV3Junction]>;4088 readonly isX4: boolean;4089 readonly asX4: ITuple<[XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction]>;4090 readonly isX5: boolean;4091 readonly asX5: ITuple<[XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction]>;4092 readonly isX6: boolean;4093 readonly asX6: ITuple<[XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction]>;4094 readonly isX7: boolean;4095 readonly asX7: ITuple<[XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction]>;4096 readonly isX8: boolean;4097 readonly asX8: ITuple<[XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction, XcmV3Junction]>;4098 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';4099}41004101/** @name XcmV3MaybeErrorCode */4102export interface XcmV3MaybeErrorCode extends Enum {4103 readonly isSuccess: boolean;4104 readonly isError: boolean;4105 readonly asError: Bytes;4106 readonly isTruncatedError: boolean;4107 readonly asTruncatedError: Bytes;4108 readonly type: 'Success' | 'Error' | 'TruncatedError';4109}41104111/** @name XcmV3MultiAsset */4112export interface XcmV3MultiAsset extends Struct {4113 readonly id: XcmV3MultiassetAssetId;4114 readonly fun: XcmV3MultiassetFungibility;4115}41164117/** @name XcmV3MultiassetAssetId */4118export interface XcmV3MultiassetAssetId extends Enum {4119 readonly isConcrete: boolean;4120 readonly asConcrete: XcmV3MultiLocation;4121 readonly isAbstract: boolean;4122 readonly asAbstract: U8aFixed;4123 readonly type: 'Concrete' | 'Abstract';4124}41254126/** @name XcmV3MultiassetAssetInstance */4127export interface XcmV3MultiassetAssetInstance extends Enum {4128 readonly isUndefined: boolean;4129 readonly isIndex: boolean;4130 readonly asIndex: Compact<u128>;4131 readonly isArray4: boolean;4132 readonly asArray4: U8aFixed;4133 readonly isArray8: boolean;4134 readonly asArray8: U8aFixed;4135 readonly isArray16: boolean;4136 readonly asArray16: U8aFixed;4137 readonly isArray32: boolean;4138 readonly asArray32: U8aFixed;4139 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32';4140}41414142/** @name XcmV3MultiassetFungibility */4143export interface XcmV3MultiassetFungibility extends Enum {4144 readonly isFungible: boolean;4145 readonly asFungible: Compact<u128>;4146 readonly isNonFungible: boolean;4147 readonly asNonFungible: XcmV3MultiassetAssetInstance;4148 readonly type: 'Fungible' | 'NonFungible';4149}41504151/** @name XcmV3MultiassetMultiAssetFilter */4152export interface XcmV3MultiassetMultiAssetFilter extends Enum {4153 readonly isDefinite: boolean;4154 readonly asDefinite: XcmV3MultiassetMultiAssets;4155 readonly isWild: boolean;4156 readonly asWild: XcmV3MultiassetWildMultiAsset;4157 readonly type: 'Definite' | 'Wild';4158}41594160/** @name XcmV3MultiassetMultiAssets */4161export interface XcmV3MultiassetMultiAssets extends Vec<XcmV3MultiAsset> {}41624163/** @name XcmV3MultiassetWildFungibility */4164export interface XcmV3MultiassetWildFungibility extends Enum {4165 readonly isFungible: boolean;4166 readonly isNonFungible: boolean;4167 readonly type: 'Fungible' | 'NonFungible';4168}41694170/** @name XcmV3MultiassetWildMultiAsset */4171export interface XcmV3MultiassetWildMultiAsset extends Enum {4172 readonly isAll: boolean;4173 readonly isAllOf: boolean;4174 readonly asAllOf: {4175 readonly id: XcmV3MultiassetAssetId;4176 readonly fun: XcmV3MultiassetWildFungibility;4177 } & Struct;4178 readonly isAllCounted: boolean;4179 readonly asAllCounted: Compact<u32>;4180 readonly isAllOfCounted: boolean;4181 readonly asAllOfCounted: {4182 readonly id: XcmV3MultiassetAssetId;4183 readonly fun: XcmV3MultiassetWildFungibility;4184 readonly count: Compact<u32>;4185 } & Struct;4186 readonly type: 'All' | 'AllOf' | 'AllCounted' | 'AllOfCounted';4187}41884189/** @name XcmV3MultiLocation */4190export interface XcmV3MultiLocation extends Struct {4191 readonly parents: u8;4192 readonly interior: XcmV3Junctions;4193}41944195/** @name XcmV3PalletInfo */4196export interface XcmV3PalletInfo extends Struct {4197 readonly index: Compact<u32>;4198 readonly name: Bytes;4199 readonly moduleName: Bytes;4200 readonly major: Compact<u32>;4201 readonly minor: Compact<u32>;4202 readonly patch: Compact<u32>;4203}42044205/** @name XcmV3QueryResponseInfo */4206export interface XcmV3QueryResponseInfo extends Struct {4207 readonly destination: XcmV3MultiLocation;4208 readonly queryId: Compact<u64>;4209 readonly maxWeight: SpWeightsWeightV2Weight;4210}42114212/** @name XcmV3Response */4213export interface XcmV3Response extends Enum {4214 readonly isNull: boolean;4215 readonly isAssets: boolean;4216 readonly asAssets: XcmV3MultiassetMultiAssets;4217 readonly isExecutionResult: boolean;4218 readonly asExecutionResult: Option<ITuple<[u32, XcmV3TraitsError]>>;4219 readonly isVersion: boolean;4220 readonly asVersion: u32;4221 readonly isPalletsInfo: boolean;4222 readonly asPalletsInfo: Vec<XcmV3PalletInfo>;4223 readonly isDispatchResult: boolean;4224 readonly asDispatchResult: XcmV3MaybeErrorCode;4225 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version' | 'PalletsInfo' | 'DispatchResult';4226}42274228/** @name XcmV3TraitsError */4229export interface XcmV3TraitsError extends Enum {4230 readonly isOverflow: boolean;4231 readonly isUnimplemented: boolean;4232 readonly isUntrustedReserveLocation: boolean;4233 readonly isUntrustedTeleportLocation: boolean;4234 readonly isLocationFull: boolean;4235 readonly isLocationNotInvertible: boolean;4236 readonly isBadOrigin: boolean;4237 readonly isInvalidLocation: boolean;4238 readonly isAssetNotFound: boolean;4239 readonly isFailedToTransactAsset: boolean;4240 readonly isNotWithdrawable: boolean;4241 readonly isLocationCannotHold: boolean;4242 readonly isExceedsMaxMessageSize: boolean;4243 readonly isDestinationUnsupported: boolean;4244 readonly isTransport: boolean;4245 readonly isUnroutable: boolean;4246 readonly isUnknownClaim: boolean;4247 readonly isFailedToDecode: boolean;4248 readonly isMaxWeightInvalid: boolean;4249 readonly isNotHoldingFees: boolean;4250 readonly isTooExpensive: boolean;4251 readonly isTrap: boolean;4252 readonly asTrap: u64;4253 readonly isExpectationFalse: boolean;4254 readonly isPalletNotFound: boolean;4255 readonly isNameMismatch: boolean;4256 readonly isVersionIncompatible: boolean;4257 readonly isHoldingWouldOverflow: boolean;4258 readonly isExportError: boolean;4259 readonly isReanchorFailed: boolean;4260 readonly isNoDeal: boolean;4261 readonly isFeesNotMet: boolean;4262 readonly isLockError: boolean;4263 readonly isNoPermission: boolean;4264 readonly isUnanchored: boolean;4265 readonly isNotDepositable: boolean;4266 readonly isUnhandledXcmVersion: boolean;4267 readonly isWeightLimitReached: boolean;4268 readonly asWeightLimitReached: SpWeightsWeightV2Weight;4269 readonly isBarrier: boolean;4270 readonly isWeightNotComputable: boolean;4271 readonly isExceedsStackLimit: boolean;4272 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'LocationFull' | 'LocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'ExpectationFalse' | 'PalletNotFound' | 'NameMismatch' | 'VersionIncompatible' | 'HoldingWouldOverflow' | 'ExportError' | 'ReanchorFailed' | 'NoDeal' | 'FeesNotMet' | 'LockError' | 'NoPermission' | 'Unanchored' | 'NotDepositable' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable' | 'ExceedsStackLimit';4273}42744275/** @name XcmV3TraitsOutcome */4276export interface XcmV3TraitsOutcome extends Enum {4277 readonly isComplete: boolean;4278 readonly asComplete: SpWeightsWeightV2Weight;4279 readonly isIncomplete: boolean;4280 readonly asIncomplete: ITuple<[SpWeightsWeightV2Weight, XcmV3TraitsError]>;4281 readonly isError: boolean;4282 readonly asError: XcmV3TraitsError;4283 readonly type: 'Complete' | 'Incomplete' | 'Error';4284}42854286/** @name XcmV3WeightLimit */4287export interface XcmV3WeightLimit extends Enum {4288 readonly isUnlimited: boolean;4289 readonly isLimited: boolean;4290 readonly asLimited: SpWeightsWeightV2Weight;4291 readonly type: 'Unlimited' | 'Limited';4292}42934294/** @name XcmV3Xcm */4295export interface XcmV3Xcm extends Vec<XcmV3Instruction> {}42964297/** @name XcmVersionedAssetId */4298export interface XcmVersionedAssetId extends Enum {4299 readonly isV3: boolean;4300 readonly asV3: XcmV3MultiassetAssetId;4301 readonly type: 'V3';4302}43034304/** @name XcmVersionedMultiAsset */4305export interface XcmVersionedMultiAsset extends Enum {4306 readonly isV2: boolean;4307 readonly asV2: XcmV2MultiAsset;4308 readonly isV3: boolean;4309 readonly asV3: XcmV3MultiAsset;4310 readonly type: 'V2' | 'V3';4311}43124313/** @name XcmVersionedMultiAssets */4314export interface XcmVersionedMultiAssets extends Enum {4315 readonly isV2: boolean;4316 readonly asV2: XcmV2MultiassetMultiAssets;4317 readonly isV3: boolean;4318 readonly asV3: XcmV3MultiassetMultiAssets;4319 readonly type: 'V2' | 'V3';4320}43214322/** @name XcmVersionedMultiLocation */4323export interface XcmVersionedMultiLocation extends Enum {4324 readonly isV2: boolean;4325 readonly asV2: XcmV2MultiLocation;4326 readonly isV3: boolean;4327 readonly asV3: XcmV3MultiLocation;4328 readonly type: 'V2' | 'V3';4329}43304331/** @name XcmVersionedResponse */4332export interface XcmVersionedResponse extends Enum {4333 readonly isV2: boolean;4334 readonly asV2: XcmV2Response;4335 readonly isV3: boolean;4336 readonly asV3: XcmV3Response;4337 readonly type: 'V2' | 'V3';4338}43394340/** @name XcmVersionedXcm */4341export interface XcmVersionedXcm extends Enum {4342 readonly isV2: boolean;4343 readonly asV2: XcmV2Xcm;4344 readonly isV3: boolean;4345 readonly asV3: XcmV3Xcm;4346 readonly type: 'V2' | 'V3';4347}43484349export type PHANTOM_DEFAULT = 'default';tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -2904,7 +2904,7 @@
}
},
/**
- * Lookup335: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
+ * Lookup335: up_data_structs::CreateCollectionData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateCollectionData: {
mode: 'UpDataStructsCollectionMode',
@@ -2912,11 +2912,13 @@
name: 'Vec<u16>',
description: 'Vec<u16>',
tokenPrefix: 'Bytes',
- pendingSponsor: 'Option<AccountId32>',
limits: 'Option<UpDataStructsCollectionLimits>',
permissions: 'Option<UpDataStructsCollectionPermissions>',
tokenPropertyPermissions: 'Vec<UpDataStructsPropertyKeyPermission>',
- properties: 'Vec<UpDataStructsProperty>'
+ properties: 'Vec<UpDataStructsProperty>',
+ adminList: 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>',
+ pendingSponsor: 'Option<PalletEvmAccountBasicCrossAccountIdRepr>',
+ flags: '[u8;1]'
},
/**
* Lookup337: up_data_structs::AccessMode
@@ -2990,7 +2992,7 @@
value: 'Bytes'
},
/**
- * Lookup360: up_data_structs::CreateItemData
+ * Lookup362: up_data_structs::CreateItemData
**/
UpDataStructsCreateItemData: {
_enum: {
@@ -3000,26 +3002,26 @@
}
},
/**
- * Lookup361: up_data_structs::CreateNftData
+ * Lookup363: up_data_structs::CreateNftData
**/
UpDataStructsCreateNftData: {
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup362: up_data_structs::CreateFungibleData
+ * Lookup364: up_data_structs::CreateFungibleData
**/
UpDataStructsCreateFungibleData: {
value: 'u128'
},
/**
- * Lookup363: up_data_structs::CreateReFungibleData
+ * Lookup365: up_data_structs::CreateReFungibleData
**/
UpDataStructsCreateReFungibleData: {
pieces: 'u128',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup366: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup368: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateItemExData: {
_enum: {
@@ -3030,14 +3032,14 @@
}
},
/**
- * Lookup368: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup370: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateNftExData: {
properties: 'Vec<UpDataStructsProperty>',
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup375: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup377: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExSingleOwner: {
user: 'PalletEvmAccountBasicCrossAccountIdRepr',
@@ -3045,14 +3047,14 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup377: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup379: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExMultipleOwners: {
users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup378: pallet_configuration::pallet::Call<T>
+ * Lookup380: pallet_configuration::pallet::Call<T>
**/
PalletConfigurationCall: {
_enum: {
@@ -3078,7 +3080,7 @@
}
},
/**
- * Lookup380: pallet_configuration::AppPromotionConfiguration<BlockNumber>
+ * Lookup382: pallet_configuration::AppPromotionConfiguration<BlockNumber>
**/
PalletConfigurationAppPromotionConfiguration: {
recalculationInterval: 'Option<u32>',
@@ -3087,11 +3089,11 @@
maxStakersPerCalculation: 'Option<u8>'
},
/**
- * Lookup384: pallet_structure::pallet::Call<T>
+ * Lookup386: pallet_structure::pallet::Call<T>
**/
PalletStructureCall: 'Null',
/**
- * Lookup385: pallet_app_promotion::pallet::Call<T>
+ * Lookup387: pallet_app_promotion::pallet::Call<T>
**/
PalletAppPromotionCall: {
_enum: {
@@ -3126,7 +3128,7 @@
}
},
/**
- * Lookup386: pallet_foreign_assets::module::Call<T>
+ * Lookup388: pallet_foreign_assets::module::Call<T>
**/
PalletForeignAssetsModuleCall: {
_enum: {
@@ -3143,7 +3145,7 @@
}
},
/**
- * Lookup387: pallet_evm::pallet::Call<T>
+ * Lookup389: pallet_evm::pallet::Call<T>
**/
PalletEvmCall: {
_enum: {
@@ -3186,7 +3188,7 @@
}
},
/**
- * Lookup393: pallet_ethereum::pallet::Call<T>
+ * Lookup395: pallet_ethereum::pallet::Call<T>
**/
PalletEthereumCall: {
_enum: {
@@ -3196,7 +3198,7 @@
}
},
/**
- * Lookup394: ethereum::transaction::TransactionV2
+ * Lookup396: ethereum::transaction::TransactionV2
**/
EthereumTransactionTransactionV2: {
_enum: {
@@ -3206,7 +3208,7 @@
}
},
/**
- * Lookup395: ethereum::transaction::LegacyTransaction
+ * Lookup397: ethereum::transaction::LegacyTransaction
**/
EthereumTransactionLegacyTransaction: {
nonce: 'U256',
@@ -3218,7 +3220,7 @@
signature: 'EthereumTransactionTransactionSignature'
},
/**
- * Lookup396: ethereum::transaction::TransactionAction
+ * Lookup398: ethereum::transaction::TransactionAction
**/
EthereumTransactionTransactionAction: {
_enum: {
@@ -3227,7 +3229,7 @@
}
},
/**
- * Lookup397: ethereum::transaction::TransactionSignature
+ * Lookup399: ethereum::transaction::TransactionSignature
**/
EthereumTransactionTransactionSignature: {
v: 'u64',
@@ -3235,7 +3237,7 @@
s: 'H256'
},
/**
- * Lookup399: ethereum::transaction::EIP2930Transaction
+ * Lookup401: ethereum::transaction::EIP2930Transaction
**/
EthereumTransactionEip2930Transaction: {
chainId: 'u64',
@@ -3251,14 +3253,14 @@
s: 'H256'
},
/**
- * Lookup401: ethereum::transaction::AccessListItem
+ * Lookup403: ethereum::transaction::AccessListItem
**/
EthereumTransactionAccessListItem: {
address: 'H160',
storageKeys: 'Vec<H256>'
},
/**
- * Lookup402: ethereum::transaction::EIP1559Transaction
+ * Lookup404: ethereum::transaction::EIP1559Transaction
**/
EthereumTransactionEip1559Transaction: {
chainId: 'u64',
@@ -3275,7 +3277,7 @@
s: 'H256'
},
/**
- * Lookup403: pallet_evm_contract_helpers::pallet::Call<T>
+ * Lookup405: pallet_evm_contract_helpers::pallet::Call<T>
**/
PalletEvmContractHelpersCall: {
_enum: {
@@ -3285,7 +3287,7 @@
}
},
/**
- * Lookup405: pallet_evm_migration::pallet::Call<T>
+ * Lookup407: pallet_evm_migration::pallet::Call<T>
**/
PalletEvmMigrationCall: {
_enum: {
@@ -3310,7 +3312,7 @@
}
},
/**
- * Lookup409: pallet_maintenance::pallet::Call<T>
+ * Lookup411: pallet_maintenance::pallet::Call<T>
**/
PalletMaintenanceCall: {
_enum: {
@@ -3326,7 +3328,7 @@
}
},
/**
- * Lookup410: pallet_test_utils::pallet::Call<T>
+ * Lookup412: pallet_test_utils::pallet::Call<T>
**/
PalletTestUtilsCall: {
_enum: {
@@ -3345,32 +3347,32 @@
}
},
/**
- * Lookup412: pallet_sudo::pallet::Error<T>
+ * Lookup414: pallet_sudo::pallet::Error<T>
**/
PalletSudoError: {
_enum: ['RequireSudo']
},
/**
- * Lookup414: orml_vesting::module::Error<T>
+ * Lookup416: orml_vesting::module::Error<T>
**/
OrmlVestingModuleError: {
_enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
},
/**
- * Lookup415: orml_xtokens::module::Error<T>
+ * Lookup417: orml_xtokens::module::Error<T>
**/
OrmlXtokensModuleError: {
_enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined']
},
/**
- * Lookup418: orml_tokens::BalanceLock<Balance>
+ * Lookup420: orml_tokens::BalanceLock<Balance>
**/
OrmlTokensBalanceLock: {
id: '[u8;8]',
amount: 'u128'
},
/**
- * Lookup420: orml_tokens::AccountData<Balance>
+ * Lookup422: orml_tokens::AccountData<Balance>
**/
OrmlTokensAccountData: {
free: 'u128',
@@ -3378,20 +3380,20 @@
frozen: 'u128'
},
/**
- * Lookup422: orml_tokens::ReserveData<ReserveIdentifier, Balance>
+ * Lookup424: orml_tokens::ReserveData<ReserveIdentifier, Balance>
**/
OrmlTokensReserveData: {
id: 'Null',
amount: 'u128'
},
/**
- * Lookup424: orml_tokens::module::Error<T>
+ * Lookup426: orml_tokens::module::Error<T>
**/
OrmlTokensModuleError: {
_enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves']
},
/**
- * Lookup429: pallet_identity::types::RegistrarInfo<Balance, sp_core::crypto::AccountId32>
+ * Lookup431: pallet_identity::types::RegistrarInfo<Balance, sp_core::crypto::AccountId32>
**/
PalletIdentityRegistrarInfo: {
account: 'AccountId32',
@@ -3399,13 +3401,13 @@
fields: 'PalletIdentityBitFlags'
},
/**
- * Lookup431: pallet_identity::pallet::Error<T>
+ * Lookup433: pallet_identity::pallet::Error<T>
**/
PalletIdentityError: {
_enum: ['TooManySubAccounts', 'NotFound', 'NotNamed', 'EmptyIndex', 'FeeChanged', 'NoIdentity', 'StickyJudgement', 'JudgementGiven', 'InvalidJudgement', 'InvalidIndex', 'InvalidTarget', 'TooManyFields', 'TooManyRegistrars', 'AlreadyClaimed', 'NotSub', 'NotOwned', 'JudgementForDifferentIdentity', 'JudgementPaymentFailed']
},
/**
- * Lookup432: pallet_preimage::RequestStatus<sp_core::crypto::AccountId32, Balance>
+ * Lookup434: pallet_preimage::RequestStatus<sp_core::crypto::AccountId32, Balance>
**/
PalletPreimageRequestStatus: {
_enum: {
@@ -3421,13 +3423,13 @@
}
},
/**
- * Lookup437: pallet_preimage::pallet::Error<T>
+ * Lookup439: pallet_preimage::pallet::Error<T>
**/
PalletPreimageError: {
_enum: ['TooBig', 'AlreadyNoted', 'NotAuthorized', 'NotNoted', 'Requested', 'NotRequested']
},
/**
- * Lookup439: cumulus_pallet_xcmp_queue::InboundChannelDetails
+ * Lookup441: cumulus_pallet_xcmp_queue::InboundChannelDetails
**/
CumulusPalletXcmpQueueInboundChannelDetails: {
sender: 'u32',
@@ -3435,19 +3437,19 @@
messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
},
/**
- * Lookup440: cumulus_pallet_xcmp_queue::InboundState
+ * Lookup442: cumulus_pallet_xcmp_queue::InboundState
**/
CumulusPalletXcmpQueueInboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup443: polkadot_parachain::primitives::XcmpMessageFormat
+ * Lookup445: polkadot_parachain::primitives::XcmpMessageFormat
**/
PolkadotParachainPrimitivesXcmpMessageFormat: {
_enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
},
/**
- * Lookup446: cumulus_pallet_xcmp_queue::OutboundChannelDetails
+ * Lookup448: cumulus_pallet_xcmp_queue::OutboundChannelDetails
**/
CumulusPalletXcmpQueueOutboundChannelDetails: {
recipient: 'u32',
@@ -3457,13 +3459,13 @@
lastIndex: 'u16'
},
/**
- * Lookup447: cumulus_pallet_xcmp_queue::OutboundState
+ * Lookup449: cumulus_pallet_xcmp_queue::OutboundState
**/
CumulusPalletXcmpQueueOutboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup449: cumulus_pallet_xcmp_queue::QueueConfigData
+ * Lookup451: cumulus_pallet_xcmp_queue::QueueConfigData
**/
CumulusPalletXcmpQueueQueueConfigData: {
suspendThreshold: 'u32',
@@ -3474,13 +3476,13 @@
xcmpMaxIndividualWeight: 'SpWeightsWeightV2Weight'
},
/**
- * Lookup451: cumulus_pallet_xcmp_queue::pallet::Error<T>
+ * Lookup453: cumulus_pallet_xcmp_queue::pallet::Error<T>
**/
CumulusPalletXcmpQueueError: {
_enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
},
/**
- * Lookup452: pallet_xcm::pallet::QueryStatus<BlockNumber>
+ * Lookup454: pallet_xcm::pallet::QueryStatus<BlockNumber>
**/
PalletXcmQueryStatus: {
_enum: {
@@ -3501,7 +3503,7 @@
}
},
/**
- * Lookup456: xcm::VersionedResponse
+ * Lookup458: xcm::VersionedResponse
**/
XcmVersionedResponse: {
_enum: {
@@ -3512,7 +3514,7 @@
}
},
/**
- * Lookup462: pallet_xcm::pallet::VersionMigrationStage
+ * Lookup464: pallet_xcm::pallet::VersionMigrationStage
**/
PalletXcmVersionMigrationStage: {
_enum: {
@@ -3523,7 +3525,7 @@
}
},
/**
- * Lookup465: xcm::VersionedAssetId
+ * Lookup467: xcm::VersionedAssetId
**/
XcmVersionedAssetId: {
_enum: {
@@ -3534,7 +3536,7 @@
}
},
/**
- * Lookup466: pallet_xcm::pallet::RemoteLockedFungibleRecord<ConsumerIdentifier, MaxConsumers>
+ * Lookup468: pallet_xcm::pallet::RemoteLockedFungibleRecord<ConsumerIdentifier, MaxConsumers>
**/
PalletXcmRemoteLockedFungibleRecord: {
amount: 'u128',
@@ -3543,23 +3545,23 @@
consumers: 'Vec<(Null,u128)>'
},
/**
- * Lookup473: pallet_xcm::pallet::Error<T>
+ * Lookup475: pallet_xcm::pallet::Error<T>
**/
PalletXcmError: {
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed', 'InvalidAsset', 'LowBalance', 'TooManyLocks', 'AccountNotSovereign', 'FeesNotMet', 'LockNotFound', 'InUse']
},
/**
- * Lookup474: cumulus_pallet_xcm::pallet::Error<T>
+ * Lookup476: cumulus_pallet_xcm::pallet::Error<T>
**/
CumulusPalletXcmError: 'Null',
/**
- * Lookup475: cumulus_pallet_dmp_queue::ConfigData
+ * Lookup477: cumulus_pallet_dmp_queue::ConfigData
**/
CumulusPalletDmpQueueConfigData: {
maxIndividual: 'SpWeightsWeightV2Weight'
},
/**
- * Lookup476: cumulus_pallet_dmp_queue::PageIndexData
+ * Lookup478: cumulus_pallet_dmp_queue::PageIndexData
**/
CumulusPalletDmpQueuePageIndexData: {
beginUsed: 'u32',
@@ -3567,25 +3569,25 @@
overweightCount: 'u64'
},
/**
- * Lookup479: cumulus_pallet_dmp_queue::pallet::Error<T>
+ * Lookup481: cumulus_pallet_dmp_queue::pallet::Error<T>
**/
CumulusPalletDmpQueueError: {
_enum: ['Unknown', 'OverLimit']
},
/**
- * Lookup483: pallet_unique::pallet::Error<T>
+ * Lookup485: pallet_unique::pallet::Error<T>
**/
PalletUniqueError: {
_enum: ['CollectionDecimalPointLimitExceeded', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']
},
/**
- * Lookup484: pallet_configuration::pallet::Error<T>
+ * Lookup486: pallet_configuration::pallet::Error<T>
**/
PalletConfigurationError: {
_enum: ['InconsistentConfiguration']
},
/**
- * Lookup485: up_data_structs::Collection<sp_core::crypto::AccountId32>
+ * Lookup487: up_data_structs::Collection<sp_core::crypto::AccountId32>
**/
UpDataStructsCollection: {
owner: 'AccountId32',
@@ -3599,7 +3601,7 @@
flags: '[u8;1]'
},
/**
- * Lookup486: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+ * Lookup488: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
**/
UpDataStructsSponsorshipStateAccountId32: {
_enum: {
@@ -3609,7 +3611,7 @@
}
},
/**
- * Lookup487: up_data_structs::Properties
+ * Lookup489: up_data_structs::Properties
**/
UpDataStructsProperties: {
map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -3617,15 +3619,15 @@
reserved: 'u32'
},
/**
- * Lookup488: up_data_structs::PropertiesMap<bounded_collections::bounded_vec::BoundedVec<T, S>>
+ * Lookup490: up_data_structs::PropertiesMap<bounded_collections::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
/**
- * Lookup493: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
+ * Lookup495: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
**/
UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
/**
- * Lookup500: up_data_structs::CollectionStats
+ * Lookup502: up_data_structs::CollectionStats
**/
UpDataStructsCollectionStats: {
created: 'u32',
@@ -3633,18 +3635,18 @@
alive: 'u32'
},
/**
- * Lookup501: up_data_structs::TokenChild
+ * Lookup503: up_data_structs::TokenChild
**/
UpDataStructsTokenChild: {
token: 'u32',
collection: 'u32'
},
/**
- * Lookup502: PhantomType::up_data_structs<T>
+ * Lookup504: PhantomType::up_data_structs<T>
**/
PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,UpPovEstimateRpcPovInfo);0]',
/**
- * Lookup504: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup506: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
@@ -3652,7 +3654,7 @@
pieces: 'u128'
},
/**
- * Lookup506: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup507: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -3669,14 +3671,14 @@
flags: 'UpDataStructsRpcCollectionFlags'
},
/**
- * Lookup507: up_data_structs::RpcCollectionFlags
+ * Lookup508: up_data_structs::RpcCollectionFlags
**/
UpDataStructsRpcCollectionFlags: {
foreign: 'bool',
erc721metadata: 'bool'
},
/**
- * Lookup508: up_pov_estimate_rpc::PovInfo
+ * Lookup509: up_pov_estimate_rpc::PovInfo
**/
UpPovEstimateRpcPovInfo: {
proofSize: 'u64',
@@ -3686,7 +3688,7 @@
keyValues: 'Vec<UpPovEstimateRpcTrieKeyValue>'
},
/**
- * Lookup511: sp_runtime::transaction_validity::TransactionValidityError
+ * Lookup512: sp_runtime::transaction_validity::TransactionValidityError
**/
SpRuntimeTransactionValidityTransactionValidityError: {
_enum: {
@@ -3695,7 +3697,7 @@
}
},
/**
- * Lookup512: sp_runtime::transaction_validity::InvalidTransaction
+ * Lookup513: sp_runtime::transaction_validity::InvalidTransaction
**/
SpRuntimeTransactionValidityInvalidTransaction: {
_enum: {
@@ -3713,7 +3715,7 @@
}
},
/**
- * Lookup513: sp_runtime::transaction_validity::UnknownTransaction
+ * Lookup514: sp_runtime::transaction_validity::UnknownTransaction
**/
SpRuntimeTransactionValidityUnknownTransaction: {
_enum: {
@@ -3723,68 +3725,68 @@
}
},
/**
- * Lookup515: up_pov_estimate_rpc::TrieKeyValue
+ * Lookup516: up_pov_estimate_rpc::TrieKeyValue
**/
UpPovEstimateRpcTrieKeyValue: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup517: pallet_common::pallet::Error<T>
+ * Lookup518: 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', 'AddressIsNotEthMirror', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal', 'ConfirmSponsorshipFail', 'UserIsNotCollectionAdmin']
},
/**
- * Lookup519: pallet_fungible::pallet::Error<T>
+ * Lookup520: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed', 'SettingAllowanceForAllNotAllowed', 'FungibleTokensAreAlwaysValid']
},
/**
- * Lookup524: pallet_refungible::pallet::Error<T>
+ * Lookup525: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup525: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup526: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup527: up_data_structs::PropertyScope
+ * Lookup528: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
_enum: ['None', 'Rmrk']
},
/**
- * Lookup530: pallet_nonfungible::pallet::Error<T>
+ * Lookup531: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup531: pallet_structure::pallet::Error<T>
+ * Lookup532: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound', 'CantNestTokenUnderCollection']
},
/**
- * Lookup536: pallet_app_promotion::pallet::Error<T>
+ * Lookup537: pallet_app_promotion::pallet::Error<T>
**/
PalletAppPromotionError: {
_enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'InsufficientStakedBalance', 'InconsistencyState']
},
/**
- * Lookup537: pallet_foreign_assets::module::Error<T>
+ * Lookup538: pallet_foreign_assets::module::Error<T>
**/
PalletForeignAssetsModuleError: {
_enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted']
},
/**
- * Lookup538: pallet_evm::CodeMetadata
+ * Lookup539: pallet_evm::CodeMetadata
**/
PalletEvmCodeMetadata: {
_alias: {
@@ -3795,13 +3797,13 @@
hash_: 'H256'
},
/**
- * Lookup540: pallet_evm::pallet::Error<T>
+ * Lookup541: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce', 'GasLimitTooLow', 'GasLimitTooHigh', 'Undefined', 'Reentrancy', 'TransactionMustComeFromEOA']
},
/**
- * Lookup543: fp_rpc::TransactionStatus
+ * Lookup544: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3813,11 +3815,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup545: ethbloom::Bloom
+ * Lookup546: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup547: ethereum::receipt::ReceiptV3
+ * Lookup548: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3827,7 +3829,7 @@
}
},
/**
- * Lookup548: ethereum::receipt::EIP658ReceiptData
+ * Lookup549: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3836,7 +3838,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup549: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup550: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3844,7 +3846,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup550: ethereum::header::Header
+ * Lookup551: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3864,23 +3866,23 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup551: ethereum_types::hash::H64
+ * Lookup552: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup556: pallet_ethereum::pallet::Error<T>
+ * Lookup557: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup557: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup558: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup558: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup559: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {
_enum: {
@@ -3890,35 +3892,35 @@
}
},
/**
- * Lookup559: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup560: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup565: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup566: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
_enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit']
},
/**
- * Lookup566: pallet_evm_migration::pallet::Error<T>
+ * Lookup567: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating', 'BadEvent']
},
/**
- * Lookup567: pallet_maintenance::pallet::Error<T>
+ * Lookup568: pallet_maintenance::pallet::Error<T>
**/
PalletMaintenanceError: 'Null',
/**
- * Lookup568: pallet_test_utils::pallet::Error<T>
+ * Lookup569: pallet_test_utils::pallet::Error<T>
**/
PalletTestUtilsError: {
_enum: ['TestPalletDisabled', 'TriggerRollback']
},
/**
- * Lookup570: sp_runtime::MultiSignature
+ * Lookup571: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3928,55 +3930,55 @@
}
},
/**
- * Lookup571: sp_core::ed25519::Signature
+ * Lookup572: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup573: sp_core::sr25519::Signature
+ * Lookup574: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup574: sp_core::ecdsa::Signature
+ * Lookup575: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup577: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup578: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup578: frame_system::extensions::check_tx_version::CheckTxVersion<T>
+ * Lookup579: frame_system::extensions::check_tx_version::CheckTxVersion<T>
**/
FrameSystemExtensionsCheckTxVersion: 'Null',
/**
- * Lookup579: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup580: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup582: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup583: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup583: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup584: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup584: opal_runtime::runtime_common::maintenance::CheckMaintenance
+ * Lookup585: opal_runtime::runtime_common::maintenance::CheckMaintenance
**/
OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: 'Null',
/**
- * Lookup585: opal_runtime::runtime_common::identity::DisableIdentityCalls
+ * Lookup586: opal_runtime::runtime_common::identity::DisableIdentityCalls
**/
OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls: 'Null',
/**
- * Lookup586: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup587: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup587: opal_runtime::Runtime
+ * Lookup588: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup588: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup589: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -3181,11 +3181,13 @@
readonly name: Vec<u16>;
readonly description: Vec<u16>;
readonly tokenPrefix: Bytes;
- readonly pendingSponsor: Option<AccountId32>;
readonly limits: Option<UpDataStructsCollectionLimits>;
readonly permissions: Option<UpDataStructsCollectionPermissions>;
readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;
readonly properties: Vec<UpDataStructsProperty>;
+ readonly adminList: Vec<PalletEvmAccountBasicCrossAccountIdRepr>;
+ readonly pendingSponsor: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
+ readonly flags: U8aFixed;
}
/** @name UpDataStructsAccessMode (337) */
@@ -3252,7 +3254,7 @@
readonly value: Bytes;
}
- /** @name UpDataStructsCreateItemData (360) */
+ /** @name UpDataStructsCreateItemData (362) */
interface UpDataStructsCreateItemData extends Enum {
readonly isNft: boolean;
readonly asNft: UpDataStructsCreateNftData;
@@ -3263,23 +3265,23 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateNftData (361) */
+ /** @name UpDataStructsCreateNftData (363) */
interface UpDataStructsCreateNftData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateFungibleData (362) */
+ /** @name UpDataStructsCreateFungibleData (364) */
interface UpDataStructsCreateFungibleData extends Struct {
readonly value: u128;
}
- /** @name UpDataStructsCreateReFungibleData (363) */
+ /** @name UpDataStructsCreateReFungibleData (365) */
interface UpDataStructsCreateReFungibleData extends Struct {
readonly pieces: u128;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateItemExData (366) */
+ /** @name UpDataStructsCreateItemExData (368) */
interface UpDataStructsCreateItemExData extends Enum {
readonly isNft: boolean;
readonly asNft: Vec<UpDataStructsCreateNftExData>;
@@ -3292,26 +3294,26 @@
readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';
}
- /** @name UpDataStructsCreateNftExData (368) */
+ /** @name UpDataStructsCreateNftExData (370) */
interface UpDataStructsCreateNftExData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name UpDataStructsCreateRefungibleExSingleOwner (375) */
+ /** @name UpDataStructsCreateRefungibleExSingleOwner (377) */
interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {
readonly user: PalletEvmAccountBasicCrossAccountIdRepr;
readonly pieces: u128;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateRefungibleExMultipleOwners (377) */
+ /** @name UpDataStructsCreateRefungibleExMultipleOwners (379) */
interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {
readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name PalletConfigurationCall (378) */
+ /** @name PalletConfigurationCall (380) */
interface PalletConfigurationCall extends Enum {
readonly isSetWeightToFeeCoefficientOverride: boolean;
readonly asSetWeightToFeeCoefficientOverride: {
@@ -3340,7 +3342,7 @@
readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride' | 'SetAppPromotionConfigurationOverride' | 'SetCollatorSelectionDesiredCollators' | 'SetCollatorSelectionLicenseBond' | 'SetCollatorSelectionKickThreshold';
}
- /** @name PalletConfigurationAppPromotionConfiguration (380) */
+ /** @name PalletConfigurationAppPromotionConfiguration (382) */
interface PalletConfigurationAppPromotionConfiguration extends Struct {
readonly recalculationInterval: Option<u32>;
readonly pendingInterval: Option<u32>;
@@ -3348,10 +3350,10 @@
readonly maxStakersPerCalculation: Option<u8>;
}
- /** @name PalletStructureCall (384) */
+ /** @name PalletStructureCall (386) */
type PalletStructureCall = Null;
- /** @name PalletAppPromotionCall (385) */
+ /** @name PalletAppPromotionCall (387) */
interface PalletAppPromotionCall extends Enum {
readonly isSetAdminAddress: boolean;
readonly asSetAdminAddress: {
@@ -3393,7 +3395,7 @@
readonly type: 'SetAdminAddress' | 'Stake' | 'UnstakeAll' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers' | 'UnstakePartial' | 'ForceUnstake';
}
- /** @name PalletForeignAssetsModuleCall (386) */
+ /** @name PalletForeignAssetsModuleCall (388) */
interface PalletForeignAssetsModuleCall extends Enum {
readonly isRegisterForeignAsset: boolean;
readonly asRegisterForeignAsset: {
@@ -3410,7 +3412,7 @@
readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';
}
- /** @name PalletEvmCall (387) */
+ /** @name PalletEvmCall (389) */
interface PalletEvmCall extends Enum {
readonly isWithdraw: boolean;
readonly asWithdraw: {
@@ -3455,7 +3457,7 @@
readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';
}
- /** @name PalletEthereumCall (393) */
+ /** @name PalletEthereumCall (395) */
interface PalletEthereumCall extends Enum {
readonly isTransact: boolean;
readonly asTransact: {
@@ -3464,7 +3466,7 @@
readonly type: 'Transact';
}
- /** @name EthereumTransactionTransactionV2 (394) */
+ /** @name EthereumTransactionTransactionV2 (396) */
interface EthereumTransactionTransactionV2 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumTransactionLegacyTransaction;
@@ -3475,7 +3477,7 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumTransactionLegacyTransaction (395) */
+ /** @name EthereumTransactionLegacyTransaction (397) */
interface EthereumTransactionLegacyTransaction extends Struct {
readonly nonce: U256;
readonly gasPrice: U256;
@@ -3486,7 +3488,7 @@
readonly signature: EthereumTransactionTransactionSignature;
}
- /** @name EthereumTransactionTransactionAction (396) */
+ /** @name EthereumTransactionTransactionAction (398) */
interface EthereumTransactionTransactionAction extends Enum {
readonly isCall: boolean;
readonly asCall: H160;
@@ -3494,14 +3496,14 @@
readonly type: 'Call' | 'Create';
}
- /** @name EthereumTransactionTransactionSignature (397) */
+ /** @name EthereumTransactionTransactionSignature (399) */
interface EthereumTransactionTransactionSignature extends Struct {
readonly v: u64;
readonly r: H256;
readonly s: H256;
}
- /** @name EthereumTransactionEip2930Transaction (399) */
+ /** @name EthereumTransactionEip2930Transaction (401) */
interface EthereumTransactionEip2930Transaction extends Struct {
readonly chainId: u64;
readonly nonce: U256;
@@ -3516,13 +3518,13 @@
readonly s: H256;
}
- /** @name EthereumTransactionAccessListItem (401) */
+ /** @name EthereumTransactionAccessListItem (403) */
interface EthereumTransactionAccessListItem extends Struct {
readonly address: H160;
readonly storageKeys: Vec<H256>;
}
- /** @name EthereumTransactionEip1559Transaction (402) */
+ /** @name EthereumTransactionEip1559Transaction (404) */
interface EthereumTransactionEip1559Transaction extends Struct {
readonly chainId: u64;
readonly nonce: U256;
@@ -3538,7 +3540,7 @@
readonly s: H256;
}
- /** @name PalletEvmContractHelpersCall (403) */
+ /** @name PalletEvmContractHelpersCall (405) */
interface PalletEvmContractHelpersCall extends Enum {
readonly isMigrateFromSelfSponsoring: boolean;
readonly asMigrateFromSelfSponsoring: {
@@ -3547,7 +3549,7 @@
readonly type: 'MigrateFromSelfSponsoring';
}
- /** @name PalletEvmMigrationCall (405) */
+ /** @name PalletEvmMigrationCall (407) */
interface PalletEvmMigrationCall extends Enum {
readonly isBegin: boolean;
readonly asBegin: {
@@ -3575,7 +3577,7 @@
readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'RemoveRmrkData';
}
- /** @name PalletMaintenanceCall (409) */
+ /** @name PalletMaintenanceCall (411) */
interface PalletMaintenanceCall extends Enum {
readonly isEnable: boolean;
readonly isDisable: boolean;
@@ -3587,7 +3589,7 @@
readonly type: 'Enable' | 'Disable' | 'ExecutePreimage';
}
- /** @name PalletTestUtilsCall (410) */
+ /** @name PalletTestUtilsCall (412) */
interface PalletTestUtilsCall extends Enum {
readonly isEnable: boolean;
readonly isSetTestValue: boolean;
@@ -3607,13 +3609,13 @@
readonly type: 'Enable' | 'SetTestValue' | 'SetTestValueAndRollback' | 'IncTestValue' | 'JustTakeFee' | 'BatchAll';
}
- /** @name PalletSudoError (412) */
+ /** @name PalletSudoError (414) */
interface PalletSudoError extends Enum {
readonly isRequireSudo: boolean;
readonly type: 'RequireSudo';
}
- /** @name OrmlVestingModuleError (414) */
+ /** @name OrmlVestingModuleError (416) */
interface OrmlVestingModuleError extends Enum {
readonly isZeroVestingPeriod: boolean;
readonly isZeroVestingPeriodCount: boolean;
@@ -3624,7 +3626,7 @@
readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';
}
- /** @name OrmlXtokensModuleError (415) */
+ /** @name OrmlXtokensModuleError (417) */
interface OrmlXtokensModuleError extends Enum {
readonly isAssetHasNoReserve: boolean;
readonly isNotCrossChainTransfer: boolean;
@@ -3648,26 +3650,26 @@
readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';
}
- /** @name OrmlTokensBalanceLock (418) */
+ /** @name OrmlTokensBalanceLock (420) */
interface OrmlTokensBalanceLock extends Struct {
readonly id: U8aFixed;
readonly amount: u128;
}
- /** @name OrmlTokensAccountData (420) */
+ /** @name OrmlTokensAccountData (422) */
interface OrmlTokensAccountData extends Struct {
readonly free: u128;
readonly reserved: u128;
readonly frozen: u128;
}
- /** @name OrmlTokensReserveData (422) */
+ /** @name OrmlTokensReserveData (424) */
interface OrmlTokensReserveData extends Struct {
readonly id: Null;
readonly amount: u128;
}
- /** @name OrmlTokensModuleError (424) */
+ /** @name OrmlTokensModuleError (426) */
interface OrmlTokensModuleError extends Enum {
readonly isBalanceTooLow: boolean;
readonly isAmountIntoBalanceFailed: boolean;
@@ -3680,14 +3682,14 @@
readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';
}
- /** @name PalletIdentityRegistrarInfo (429) */
+ /** @name PalletIdentityRegistrarInfo (431) */
interface PalletIdentityRegistrarInfo extends Struct {
readonly account: AccountId32;
readonly fee: u128;
readonly fields: PalletIdentityBitFlags;
}
- /** @name PalletIdentityError (431) */
+ /** @name PalletIdentityError (433) */
interface PalletIdentityError extends Enum {
readonly isTooManySubAccounts: boolean;
readonly isNotFound: boolean;
@@ -3710,7 +3712,7 @@
readonly type: 'TooManySubAccounts' | 'NotFound' | 'NotNamed' | 'EmptyIndex' | 'FeeChanged' | 'NoIdentity' | 'StickyJudgement' | 'JudgementGiven' | 'InvalidJudgement' | 'InvalidIndex' | 'InvalidTarget' | 'TooManyFields' | 'TooManyRegistrars' | 'AlreadyClaimed' | 'NotSub' | 'NotOwned' | 'JudgementForDifferentIdentity' | 'JudgementPaymentFailed';
}
- /** @name PalletPreimageRequestStatus (432) */
+ /** @name PalletPreimageRequestStatus (434) */
interface PalletPreimageRequestStatus extends Enum {
readonly isUnrequested: boolean;
readonly asUnrequested: {
@@ -3726,7 +3728,7 @@
readonly type: 'Unrequested' | 'Requested';
}
- /** @name PalletPreimageError (437) */
+ /** @name PalletPreimageError (439) */
interface PalletPreimageError extends Enum {
readonly isTooBig: boolean;
readonly isAlreadyNoted: boolean;
@@ -3737,21 +3739,21 @@
readonly type: 'TooBig' | 'AlreadyNoted' | 'NotAuthorized' | 'NotNoted' | 'Requested' | 'NotRequested';
}
- /** @name CumulusPalletXcmpQueueInboundChannelDetails (439) */
+ /** @name CumulusPalletXcmpQueueInboundChannelDetails (441) */
interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {
readonly sender: u32;
readonly state: CumulusPalletXcmpQueueInboundState;
readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;
}
- /** @name CumulusPalletXcmpQueueInboundState (440) */
+ /** @name CumulusPalletXcmpQueueInboundState (442) */
interface CumulusPalletXcmpQueueInboundState extends Enum {
readonly isOk: boolean;
readonly isSuspended: boolean;
readonly type: 'Ok' | 'Suspended';
}
- /** @name PolkadotParachainPrimitivesXcmpMessageFormat (443) */
+ /** @name PolkadotParachainPrimitivesXcmpMessageFormat (445) */
interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {
readonly isConcatenatedVersionedXcm: boolean;
readonly isConcatenatedEncodedBlob: boolean;
@@ -3759,7 +3761,7 @@
readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';
}
- /** @name CumulusPalletXcmpQueueOutboundChannelDetails (446) */
+ /** @name CumulusPalletXcmpQueueOutboundChannelDetails (448) */
interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {
readonly recipient: u32;
readonly state: CumulusPalletXcmpQueueOutboundState;
@@ -3768,14 +3770,14 @@
readonly lastIndex: u16;
}
- /** @name CumulusPalletXcmpQueueOutboundState (447) */
+ /** @name CumulusPalletXcmpQueueOutboundState (449) */
interface CumulusPalletXcmpQueueOutboundState extends Enum {
readonly isOk: boolean;
readonly isSuspended: boolean;
readonly type: 'Ok' | 'Suspended';
}
- /** @name CumulusPalletXcmpQueueQueueConfigData (449) */
+ /** @name CumulusPalletXcmpQueueQueueConfigData (451) */
interface CumulusPalletXcmpQueueQueueConfigData extends Struct {
readonly suspendThreshold: u32;
readonly dropThreshold: u32;
@@ -3785,7 +3787,7 @@
readonly xcmpMaxIndividualWeight: SpWeightsWeightV2Weight;
}
- /** @name CumulusPalletXcmpQueueError (451) */
+ /** @name CumulusPalletXcmpQueueError (453) */
interface CumulusPalletXcmpQueueError extends Enum {
readonly isFailedToSend: boolean;
readonly isBadXcmOrigin: boolean;
@@ -3795,7 +3797,7 @@
readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';
}
- /** @name PalletXcmQueryStatus (452) */
+ /** @name PalletXcmQueryStatus (454) */
interface PalletXcmQueryStatus extends Enum {
readonly isPending: boolean;
readonly asPending: {
@@ -3817,7 +3819,7 @@
readonly type: 'Pending' | 'VersionNotifier' | 'Ready';
}
- /** @name XcmVersionedResponse (456) */
+ /** @name XcmVersionedResponse (458) */
interface XcmVersionedResponse extends Enum {
readonly isV2: boolean;
readonly asV2: XcmV2Response;
@@ -3826,7 +3828,7 @@
readonly type: 'V2' | 'V3';
}
- /** @name PalletXcmVersionMigrationStage (462) */
+ /** @name PalletXcmVersionMigrationStage (464) */
interface PalletXcmVersionMigrationStage extends Enum {
readonly isMigrateSupportedVersion: boolean;
readonly isMigrateVersionNotifiers: boolean;
@@ -3836,14 +3838,14 @@
readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';
}
- /** @name XcmVersionedAssetId (465) */
+ /** @name XcmVersionedAssetId (467) */
interface XcmVersionedAssetId extends Enum {
readonly isV3: boolean;
readonly asV3: XcmV3MultiassetAssetId;
readonly type: 'V3';
}
- /** @name PalletXcmRemoteLockedFungibleRecord (466) */
+ /** @name PalletXcmRemoteLockedFungibleRecord (468) */
interface PalletXcmRemoteLockedFungibleRecord extends Struct {
readonly amount: u128;
readonly owner: XcmVersionedMultiLocation;
@@ -3851,7 +3853,7 @@
readonly consumers: Vec<ITuple<[Null, u128]>>;
}
- /** @name PalletXcmError (473) */
+ /** @name PalletXcmError (475) */
interface PalletXcmError extends Enum {
readonly isUnreachable: boolean;
readonly isSendFailure: boolean;
@@ -3876,29 +3878,29 @@
readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed' | 'InvalidAsset' | 'LowBalance' | 'TooManyLocks' | 'AccountNotSovereign' | 'FeesNotMet' | 'LockNotFound' | 'InUse';
}
- /** @name CumulusPalletXcmError (474) */
+ /** @name CumulusPalletXcmError (476) */
type CumulusPalletXcmError = Null;
- /** @name CumulusPalletDmpQueueConfigData (475) */
+ /** @name CumulusPalletDmpQueueConfigData (477) */
interface CumulusPalletDmpQueueConfigData extends Struct {
readonly maxIndividual: SpWeightsWeightV2Weight;
}
- /** @name CumulusPalletDmpQueuePageIndexData (476) */
+ /** @name CumulusPalletDmpQueuePageIndexData (478) */
interface CumulusPalletDmpQueuePageIndexData extends Struct {
readonly beginUsed: u32;
readonly endUsed: u32;
readonly overweightCount: u64;
}
- /** @name CumulusPalletDmpQueueError (479) */
+ /** @name CumulusPalletDmpQueueError (481) */
interface CumulusPalletDmpQueueError extends Enum {
readonly isUnknown: boolean;
readonly isOverLimit: boolean;
readonly type: 'Unknown' | 'OverLimit';
}
- /** @name PalletUniqueError (483) */
+ /** @name PalletUniqueError (485) */
interface PalletUniqueError extends Enum {
readonly isCollectionDecimalPointLimitExceeded: boolean;
readonly isEmptyArgument: boolean;
@@ -3906,13 +3908,13 @@
readonly type: 'CollectionDecimalPointLimitExceeded' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';
}
- /** @name PalletConfigurationError (484) */
+ /** @name PalletConfigurationError (486) */
interface PalletConfigurationError extends Enum {
readonly isInconsistentConfiguration: boolean;
readonly type: 'InconsistentConfiguration';
}
- /** @name UpDataStructsCollection (485) */
+ /** @name UpDataStructsCollection (487) */
interface UpDataStructsCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3925,7 +3927,7 @@
readonly flags: U8aFixed;
}
- /** @name UpDataStructsSponsorshipStateAccountId32 (486) */
+ /** @name UpDataStructsSponsorshipStateAccountId32 (488) */
interface UpDataStructsSponsorshipStateAccountId32 extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -3935,43 +3937,43 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name UpDataStructsProperties (487) */
+ /** @name UpDataStructsProperties (489) */
interface UpDataStructsProperties extends Struct {
readonly map: UpDataStructsPropertiesMapBoundedVec;
readonly consumedSpace: u32;
readonly reserved: u32;
}
- /** @name UpDataStructsPropertiesMapBoundedVec (488) */
+ /** @name UpDataStructsPropertiesMapBoundedVec (490) */
interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
- /** @name UpDataStructsPropertiesMapPropertyPermission (493) */
+ /** @name UpDataStructsPropertiesMapPropertyPermission (495) */
interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
- /** @name UpDataStructsCollectionStats (500) */
+ /** @name UpDataStructsCollectionStats (502) */
interface UpDataStructsCollectionStats extends Struct {
readonly created: u32;
readonly destroyed: u32;
readonly alive: u32;
}
- /** @name UpDataStructsTokenChild (501) */
+ /** @name UpDataStructsTokenChild (503) */
interface UpDataStructsTokenChild extends Struct {
readonly token: u32;
readonly collection: u32;
}
- /** @name PhantomTypeUpDataStructs (502) */
+ /** @name PhantomTypeUpDataStructs (504) */
interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, UpPovEstimateRpcPovInfo]>> {}
- /** @name UpDataStructsTokenData (504) */
+ /** @name UpDataStructsTokenData (506) */
interface UpDataStructsTokenData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
readonly pieces: u128;
}
- /** @name UpDataStructsRpcCollection (506) */
+ /** @name UpDataStructsRpcCollection (507) */
interface UpDataStructsRpcCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3987,13 +3989,13 @@
readonly flags: UpDataStructsRpcCollectionFlags;
}
- /** @name UpDataStructsRpcCollectionFlags (507) */
+ /** @name UpDataStructsRpcCollectionFlags (508) */
interface UpDataStructsRpcCollectionFlags extends Struct {
readonly foreign: bool;
readonly erc721metadata: bool;
}
- /** @name UpPovEstimateRpcPovInfo (508) */
+ /** @name UpPovEstimateRpcPovInfo (509) */
interface UpPovEstimateRpcPovInfo extends Struct {
readonly proofSize: u64;
readonly compactProofSize: u64;
@@ -4002,7 +4004,7 @@
readonly keyValues: Vec<UpPovEstimateRpcTrieKeyValue>;
}
- /** @name SpRuntimeTransactionValidityTransactionValidityError (511) */
+ /** @name SpRuntimeTransactionValidityTransactionValidityError (512) */
interface SpRuntimeTransactionValidityTransactionValidityError extends Enum {
readonly isInvalid: boolean;
readonly asInvalid: SpRuntimeTransactionValidityInvalidTransaction;
@@ -4011,7 +4013,7 @@
readonly type: 'Invalid' | 'Unknown';
}
- /** @name SpRuntimeTransactionValidityInvalidTransaction (512) */
+ /** @name SpRuntimeTransactionValidityInvalidTransaction (513) */
interface SpRuntimeTransactionValidityInvalidTransaction extends Enum {
readonly isCall: boolean;
readonly isPayment: boolean;
@@ -4028,7 +4030,7 @@
readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryValidation' | 'BadSigner';
}
- /** @name SpRuntimeTransactionValidityUnknownTransaction (513) */
+ /** @name SpRuntimeTransactionValidityUnknownTransaction (514) */
interface SpRuntimeTransactionValidityUnknownTransaction extends Enum {
readonly isCannotLookup: boolean;
readonly isNoUnsignedValidator: boolean;
@@ -4037,13 +4039,13 @@
readonly type: 'CannotLookup' | 'NoUnsignedValidator' | 'Custom';
}
- /** @name UpPovEstimateRpcTrieKeyValue (515) */
+ /** @name UpPovEstimateRpcTrieKeyValue (516) */
interface UpPovEstimateRpcTrieKeyValue extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name PalletCommonError (517) */
+ /** @name PalletCommonError (518) */
interface PalletCommonError extends Enum {
readonly isCollectionNotFound: boolean;
readonly isMustBeTokenOwner: boolean;
@@ -4085,7 +4087,7 @@
readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsNotEthMirror' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal' | 'ConfirmSponsorshipFail' | 'UserIsNotCollectionAdmin';
}
- /** @name PalletFungibleError (519) */
+ /** @name PalletFungibleError (520) */
interface PalletFungibleError extends Enum {
readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isFungibleItemsHaveNoId: boolean;
@@ -4097,7 +4099,7 @@
readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed' | 'SettingAllowanceForAllNotAllowed' | 'FungibleTokensAreAlwaysValid';
}
- /** @name PalletRefungibleError (524) */
+ /** @name PalletRefungibleError (525) */
interface PalletRefungibleError extends Enum {
readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isWrongRefungiblePieces: boolean;
@@ -4107,19 +4109,19 @@
readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletNonfungibleItemData (525) */
+ /** @name PalletNonfungibleItemData (526) */
interface PalletNonfungibleItemData extends Struct {
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name UpDataStructsPropertyScope (527) */
+ /** @name UpDataStructsPropertyScope (528) */
interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
readonly type: 'None' | 'Rmrk';
}
- /** @name PalletNonfungibleError (530) */
+ /** @name PalletNonfungibleError (531) */
interface PalletNonfungibleError extends Enum {
readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isNonfungibleItemsHaveNoAmount: boolean;
@@ -4127,7 +4129,7 @@
readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
}
- /** @name PalletStructureError (531) */
+ /** @name PalletStructureError (532) */
interface PalletStructureError extends Enum {
readonly isOuroborosDetected: boolean;
readonly isDepthLimit: boolean;
@@ -4137,7 +4139,7 @@
readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound' | 'CantNestTokenUnderCollection';
}
- /** @name PalletAppPromotionError (536) */
+ /** @name PalletAppPromotionError (537) */
interface PalletAppPromotionError extends Enum {
readonly isAdminNotSet: boolean;
readonly isNoPermission: boolean;
@@ -4149,7 +4151,7 @@
readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'InsufficientStakedBalance' | 'InconsistencyState';
}
- /** @name PalletForeignAssetsModuleError (537) */
+ /** @name PalletForeignAssetsModuleError (538) */
interface PalletForeignAssetsModuleError extends Enum {
readonly isBadLocation: boolean;
readonly isMultiLocationExisted: boolean;
@@ -4158,13 +4160,13 @@
readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';
}
- /** @name PalletEvmCodeMetadata (538) */
+ /** @name PalletEvmCodeMetadata (539) */
interface PalletEvmCodeMetadata extends Struct {
readonly size_: u64;
readonly hash_: H256;
}
- /** @name PalletEvmError (540) */
+ /** @name PalletEvmError (541) */
interface PalletEvmError extends Enum {
readonly isBalanceLow: boolean;
readonly isFeeOverflow: boolean;
@@ -4180,7 +4182,7 @@
readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce' | 'GasLimitTooLow' | 'GasLimitTooHigh' | 'Undefined' | 'Reentrancy' | 'TransactionMustComeFromEOA';
}
- /** @name FpRpcTransactionStatus (543) */
+ /** @name FpRpcTransactionStatus (544) */
interface FpRpcTransactionStatus extends Struct {
readonly transactionHash: H256;
readonly transactionIndex: u32;
@@ -4191,10 +4193,10 @@
readonly logsBloom: EthbloomBloom;
}
- /** @name EthbloomBloom (545) */
+ /** @name EthbloomBloom (546) */
interface EthbloomBloom extends U8aFixed {}
- /** @name EthereumReceiptReceiptV3 (547) */
+ /** @name EthereumReceiptReceiptV3 (548) */
interface EthereumReceiptReceiptV3 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumReceiptEip658ReceiptData;
@@ -4205,7 +4207,7 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumReceiptEip658ReceiptData (548) */
+ /** @name EthereumReceiptEip658ReceiptData (549) */
interface EthereumReceiptEip658ReceiptData extends Struct {
readonly statusCode: u8;
readonly usedGas: U256;
@@ -4213,14 +4215,14 @@
readonly logs: Vec<EthereumLog>;
}
- /** @name EthereumBlock (549) */
+ /** @name EthereumBlock (550) */
interface EthereumBlock extends Struct {
readonly header: EthereumHeader;
readonly transactions: Vec<EthereumTransactionTransactionV2>;
readonly ommers: Vec<EthereumHeader>;
}
- /** @name EthereumHeader (550) */
+ /** @name EthereumHeader (551) */
interface EthereumHeader extends Struct {
readonly parentHash: H256;
readonly ommersHash: H256;
@@ -4239,24 +4241,24 @@
readonly nonce: EthereumTypesHashH64;
}
- /** @name EthereumTypesHashH64 (551) */
+ /** @name EthereumTypesHashH64 (552) */
interface EthereumTypesHashH64 extends U8aFixed {}
- /** @name PalletEthereumError (556) */
+ /** @name PalletEthereumError (557) */
interface PalletEthereumError extends Enum {
readonly isInvalidSignature: boolean;
readonly isPreLogExists: boolean;
readonly type: 'InvalidSignature' | 'PreLogExists';
}
- /** @name PalletEvmCoderSubstrateError (557) */
+ /** @name PalletEvmCoderSubstrateError (558) */
interface PalletEvmCoderSubstrateError extends Enum {
readonly isOutOfGas: boolean;
readonly isOutOfFund: boolean;
readonly type: 'OutOfGas' | 'OutOfFund';
}
- /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (558) */
+ /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (559) */
interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -4266,7 +4268,7 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name PalletEvmContractHelpersSponsoringModeT (559) */
+ /** @name PalletEvmContractHelpersSponsoringModeT (560) */
interface PalletEvmContractHelpersSponsoringModeT extends Enum {
readonly isDisabled: boolean;
readonly isAllowlisted: boolean;
@@ -4274,7 +4276,7 @@
readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
}
- /** @name PalletEvmContractHelpersError (565) */
+ /** @name PalletEvmContractHelpersError (566) */
interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly isNoPendingSponsor: boolean;
@@ -4282,7 +4284,7 @@
readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';
}
- /** @name PalletEvmMigrationError (566) */
+ /** @name PalletEvmMigrationError (567) */
interface PalletEvmMigrationError extends Enum {
readonly isAccountNotEmpty: boolean;
readonly isAccountIsNotMigrating: boolean;
@@ -4290,17 +4292,17 @@
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating' | 'BadEvent';
}
- /** @name PalletMaintenanceError (567) */
+ /** @name PalletMaintenanceError (568) */
type PalletMaintenanceError = Null;
- /** @name PalletTestUtilsError (568) */
+ /** @name PalletTestUtilsError (569) */
interface PalletTestUtilsError extends Enum {
readonly isTestPalletDisabled: boolean;
readonly isTriggerRollback: boolean;
readonly type: 'TestPalletDisabled' | 'TriggerRollback';
}
- /** @name SpRuntimeMultiSignature (570) */
+ /** @name SpRuntimeMultiSignature (571) */
interface SpRuntimeMultiSignature extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Signature;
@@ -4311,43 +4313,43 @@
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
- /** @name SpCoreEd25519Signature (571) */
+ /** @name SpCoreEd25519Signature (572) */
interface SpCoreEd25519Signature extends U8aFixed {}
- /** @name SpCoreSr25519Signature (573) */
+ /** @name SpCoreSr25519Signature (574) */
interface SpCoreSr25519Signature extends U8aFixed {}
- /** @name SpCoreEcdsaSignature (574) */
+ /** @name SpCoreEcdsaSignature (575) */
interface SpCoreEcdsaSignature extends U8aFixed {}
- /** @name FrameSystemExtensionsCheckSpecVersion (577) */
+ /** @name FrameSystemExtensionsCheckSpecVersion (578) */
type FrameSystemExtensionsCheckSpecVersion = Null;
- /** @name FrameSystemExtensionsCheckTxVersion (578) */
+ /** @name FrameSystemExtensionsCheckTxVersion (579) */
type FrameSystemExtensionsCheckTxVersion = Null;
- /** @name FrameSystemExtensionsCheckGenesis (579) */
+ /** @name FrameSystemExtensionsCheckGenesis (580) */
type FrameSystemExtensionsCheckGenesis = Null;
- /** @name FrameSystemExtensionsCheckNonce (582) */
+ /** @name FrameSystemExtensionsCheckNonce (583) */
interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
- /** @name FrameSystemExtensionsCheckWeight (583) */
+ /** @name FrameSystemExtensionsCheckWeight (584) */
type FrameSystemExtensionsCheckWeight = Null;
- /** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance (584) */
+ /** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance (585) */
type OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance = Null;
- /** @name OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls (585) */
+ /** @name OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls (586) */
type OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls = Null;
- /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (586) */
+ /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (587) */
interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
- /** @name OpalRuntimeRuntime (587) */
+ /** @name OpalRuntimeRuntime (588) */
type OpalRuntimeRuntime = Null;
- /** @name PalletEthereumFakeTransactionFinalizer (588) */
+ /** @name PalletEthereumFakeTransactionFinalizer (589) */
type PalletEthereumFakeTransactionFinalizer = Null;
} // declare module
tests/src/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth--- a/tests/src/sub/appPromotion/appPromotion.test.ts
+++ b/tests/src/sub/appPromotion/appPromotion.test.ts
@@ -51,6 +51,7 @@
donor = await privateKey({url: import.meta.url});
palletAddress = helper.arrange.calculatePalletAddress('appstake');
palletAdmin = await privateKey('//PromotionAdmin');
+
nominal = helper.balance.getOneTokenNominal();
const accountBalances = new Array(200).fill(1000n);
@@ -96,7 +97,6 @@
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);
@@ -497,13 +497,13 @@
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});
+ const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: {Substrate: oldSponsor.address}});
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.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});
+ const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: {Substrate: oldSponsor.address}});
await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
@@ -584,7 +584,7 @@
itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => {
const api = helper.getApi();
const [collectionOwner] = await getAccounts(1);
- const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});
+ const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: {Substrate: collectionOwner.address}});
await collection.confirmSponsorship(collectionOwner);
await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
tests/src/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -142,6 +142,21 @@
}
}
+export interface ICollectionFlags {
+ foreign: boolean,
+ erc721metadata: boolean,
+}
+
+export enum CollectionFlag {
+ None = 0,
+ /// External collections can't be managed using `unique` api
+ External = 1,
+ /// Supports ERC721Metadata
+ Erc721metadata = 64,
+ /// Tokens in foreign collections can be transferred, but not burnt
+ Foreign = 128,
+}
+
export interface ICollectionCreationOptions {
name?: string | number[];
description?: string | number[];
@@ -155,7 +170,9 @@
properties?: IProperty[];
tokenPropertyPermissions?: ITokenPropertyPermission[];
limits?: ICollectionLimits;
- pendingSponsor?: TSubstrateAccount;
+ pendingSponsor?: ICrossAccountId;
+ adminList?: ICrossAccountId[];
+ flags?: number[] | CollectionFlag[] ,
}
export interface IChainProperties {
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -44,10 +44,12 @@
MoonbeamAssetInfo,
DemocracyStandardAccountVote,
IEthCrossAccountId,
+ CollectionFlag,
} from './types';
import {RuntimeDispatchInfo} from '@polkadot/types/interfaces';
import type {Vec} from '@polkadot/types-codec';
import {FrameSystemEventRecord, PalletBalancesIdAmount} from '@polkadot/types/lookup';
+import {arrayUnzip} from '@polkadot/util';
export class CrossAccountId {
Substrate!: TSubstrateAccount;
@@ -1624,6 +1626,17 @@
for(const key of ['name', 'description', 'tokenPrefix']) {
if(typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string);
}
+
+ let flags = 0;
+ // convert CollectionFlags to number and join them in one number
+ if(collectionOptions.flags) {
+ for(let i = 0; i < collectionOptions.flags.length; i++){
+ const flag = collectionOptions.flags[i];
+ flags = flags | flag;
+ }
+ }
+ collectionOptions.flags = [flags];
+
const creationResult = await this.helper.executeExtrinsic(
signer,
'api.tx.unique.createCollectionEx', [collectionOptions],