git.delta.rocks / unique-network / refs/commits / 68b26b95f7a0

difftreelog

CORE-238 add effective_collection_limits

Trubnikov Sergey2022-03-24parent: #c8aac15.patch.diff
in: master

13 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -9360,6 +9360,42 @@
 ]
 
 [[package]]
+name = "sc-consensus-manual-seal"
+version = "0.10.0-dev"
+source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.17#22d40c761a985482f93bbbea5ba4199bdba74f8e"
+dependencies = [
+ "assert_matches",
+ "async-trait",
+ "futures 0.3.21",
+ "jsonrpc-core",
+ "jsonrpc-core-client",
+ "jsonrpc-derive",
+ "log",
+ "parity-scale-codec",
+ "sc-client-api",
+ "sc-consensus",
+ "sc-consensus-aura",
+ "sc-consensus-babe",
+ "sc-consensus-epochs",
+ "sc-transaction-pool",
+ "sc-transaction-pool-api",
+ "serde",
+ "sp-api",
+ "sp-blockchain",
+ "sp-consensus",
+ "sp-consensus-aura",
+ "sp-consensus-babe",
+ "sp-consensus-slots",
+ "sp-core",
+ "sp-inherents",
+ "sp-keystore",
+ "sp-runtime",
+ "sp-timestamp",
+ "substrate-prometheus-endpoint",
+ "thiserror",
+]
+
+[[package]]
 name = "sc-consensus-slots"
 version = "0.10.0-dev"
 source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.17#22d40c761a985482f93bbbea5ba4199bdba74f8e"
@@ -11697,7 +11733,7 @@
  "chrono",
  "lazy_static",
  "matchers",
- "parking_lot 0.11.2",
+ "parking_lot 0.10.2",
  "regex",
  "serde",
  "serde_json",
@@ -11957,6 +11993,7 @@
  "sc-client-api",
  "sc-consensus",
  "sc-consensus-aura",
+ "sc-consensus-manual-seal",
  "sc-executor",
  "sc-finality-grandpa",
  "sc-keystore",
modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -19,7 +19,7 @@
 use codec::Decode;
 use jsonrpc_core::{Error as RpcError, ErrorCode, Result};
 use jsonrpc_derive::rpc;
-use up_data_structs::{Collection, CollectionId, CollectionStats, TokenId};
+use up_data_structs::{Collection, CollectionId, CollectionStats, CollectionLimits, TokenId};
 use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt};
 use sp_blockchain::HeaderBackend;
 use up_rpc::UniqueApi as UniqueRuntimeApi;
@@ -119,6 +119,12 @@
 	) -> Result<Option<Collection<AccountId>>>;
 	#[rpc(name = "unique_collectionStats")]
 	fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;
+	#[rpc(name = "unique_effectiveCollectionLimits")]
+	fn effective_collection_limits(
+		&self,
+		collection_id: CollectionId,
+		at: Option<BlockHash>
+	) -> Result<Option<CollectionLimits>>;
 }
 
 pub struct Unique<C, P> {
@@ -222,4 +228,5 @@
 	pass_method!(last_token_id(collection: CollectionId) -> TokenId);
 	pass_method!(collection_by_id(collection: CollectionId) -> Option<Collection<AccountId>>);
 	pass_method!(collection_stats() -> CollectionStats);
+	pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>);
 }
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -33,7 +33,7 @@
 	TokenId, Weight, WithdrawReasons, CollectionStats, MAX_TOKEN_OWNERSHIP, CollectionMode,
 	NFT_SPONSOR_TRANSFER_TIMEOUT, FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,
 	REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT, CUSTOM_DATA_LIMIT, CollectionLimits,
-	CustomDataLimit, CreateCollectionData, SponsorshipState, CreateItemExData,
+	CustomDataLimit, CreateCollectionData, SponsorshipState, CreateItemExData, SponsoringRateLimit
 };
 pub use pallet::*;
 use sp_core::H160;
@@ -421,6 +421,30 @@
 			alive: created.0 - destroyed.0,
 		}
 	}
+
+	pub fn effective_collection_limits(collection: CollectionId) -> Option<CollectionLimits> {
+		let collection = <CollectionById<T>>::get(collection);
+		if collection.is_none() {
+			return None;
+		}
+		
+		let limits = collection.unwrap().limits;
+		let effective_limits = CollectionLimits {
+			account_token_ownership_limit: Some(limits.account_token_ownership_limit()),
+			sponsored_data_size: Some(limits.sponsored_data_size()),
+			sponsored_data_rate_limit: Some(
+				limits.sponsored_data_rate_limit
+				.unwrap_or(SponsoringRateLimit::SponsoringDisabled)),
+			token_limit: Some(limits.token_limit()),
+			sponsor_transfer_timeout: Some(limits.sponsor_transfer_timeout(MAX_SPONSOR_TIMEOUT)),
+			sponsor_approve_timeout: Some(limits.sponsor_approve_timeout()),
+			owner_can_transfer: Some(limits.owner_can_transfer()),
+			owner_can_destroy: Some(limits.owner_can_destroy()),
+			transfers_enabled: Some(limits.transfers_enabled()),
+		};
+
+		Some(effective_limits)
+	}
 }
 
 impl<T: Config> Pallet<T> {
modifiedprimitives/rpc/src/lib.rsdiffbeforeafterboth
--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -16,7 +16,7 @@
 
 #![cfg_attr(not(feature = "std"), no_std)]
 
-use up_data_structs::{CollectionId, TokenId, Collection, CollectionStats};
+use up_data_structs::{CollectionId, TokenId, Collection, CollectionStats, CollectionLimits};
 use sp_std::vec::Vec;
 use sp_core::H160;
 use codec::Decode;
@@ -59,5 +59,6 @@
 		fn last_token_id(collection: CollectionId) -> Result<TokenId>;
 		fn collection_by_id(collection: CollectionId) -> Result<Option<Collection<AccountId>>>;
 		fn collection_stats() -> Result<CollectionStats>;
+		fn effective_collection_limits(collection_id: CollectionId) -> Result<Option<CollectionLimits>>;
 	}
 }
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -69,6 +69,10 @@
                 fn collection_stats() -> Result<CollectionStats, DispatchError> {
                     Ok(<pallet_common::Pallet<Runtime>>::collection_stats())
                 }
+
+                fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {
+                    Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))
+                }
             }
 
             impl sp_api::Core<Block> for Runtime {
modifiedtests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth
before · tests/src/interfaces/augment-api-errors.ts
1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit2/* eslint-disable */34import type { ApiTypes } from '@polkadot/api-base/types';56declare module '@polkadot/api-base/types/errors' {7  export interface AugmentedErrors<ApiType extends ApiTypes> {8    balances: {9      /**10       * Beneficiary account must pre-exist11       **/12      DeadAccount: AugmentedError<ApiType>;13      /**14       * Value too low to create account due to existential deposit15       **/16      ExistentialDeposit: AugmentedError<ApiType>;17      /**18       * A vesting schedule already exists for this account19       **/20      ExistingVestingSchedule: AugmentedError<ApiType>;21      /**22       * Balance too low to send value23       **/24      InsufficientBalance: AugmentedError<ApiType>;25      /**26       * Transfer/payment would kill account27       **/28      KeepAlive: AugmentedError<ApiType>;29      /**30       * Account liquidity restrictions prevent withdrawal31       **/32      LiquidityRestrictions: AugmentedError<ApiType>;33      /**34       * Number of named reserves exceed MaxReserves35       **/36      TooManyReserves: AugmentedError<ApiType>;37      /**38       * Vesting balance too high to send value39       **/40      VestingBalance: AugmentedError<ApiType>;41      /**42       * Generic error43       **/44      [key: string]: AugmentedError<ApiType>;45    };46    common: {47      /**48       * Account token limit exceeded per collection49       **/50      AccountTokenLimitExceeded: AugmentedError<ApiType>;51      /**52       * Can't transfer tokens to ethereum zero address53       **/54      AddressIsZero: AugmentedError<ApiType>;55      /**56       * Address is not in allow list.57       **/58      AddressNotInAllowlist: AugmentedError<ApiType>;59      /**60       * Requested value more than approved.61       **/62      ApprovedValueTooLow: AugmentedError<ApiType>;63      /**64       * Tried to approve more than owned65       **/66      CantApproveMoreThanOwned: AugmentedError<ApiType>;67      /**68       * Exceeded max admin count69       **/70      CollectionAdminCountExceeded: AugmentedError<ApiType>;71      /**72       * Collection description can not be longer than 255 char.73       **/74      CollectionDescriptionLimitExceeded: AugmentedError<ApiType>;75      /**76       * Collection limit bounds per collection exceeded77       **/78      CollectionLimitBoundsExceeded: AugmentedError<ApiType>;79      /**80       * Collection name can not be longer than 63 char.81       **/82      CollectionNameLimitExceeded: AugmentedError<ApiType>;83      /**84       * This collection does not exist.85       **/86      CollectionNotFound: AugmentedError<ApiType>;87      /**88       * Collection token limit exceeded89       **/90      CollectionTokenLimitExceeded: AugmentedError<ApiType>;91      /**92       * Token prefix can not be longer than 15 char.93       **/94      CollectionTokenPrefixLimitExceeded: AugmentedError<ApiType>;95      /**96       * Metadata flag frozen97       **/98      MetadataFlagFrozen: AugmentedError<ApiType>;99      /**100       * Sender parameter and item owner must be equal.101       **/102      MustBeTokenOwner: AugmentedError<ApiType>;103      /**104       * No permission to perform action105       **/106      NoPermission: AugmentedError<ApiType>;107      /**108       * Tried to enable permissions which are only permitted to be disabled109       **/110      OwnerPermissionsCantBeReverted: AugmentedError<ApiType>;111      /**112       * Collection is not in mint mode.113       **/114      PublicMintingNotAllowed: AugmentedError<ApiType>;115      /**116       * Item not exists.117       **/118      TokenNotFound: AugmentedError<ApiType>;119      /**120       * Item balance not enough.121       **/122      TokenValueTooLow: AugmentedError<ApiType>;123      /**124       * variable_data exceeded data limit.125       **/126      TokenVariableDataLimitExceeded: AugmentedError<ApiType>;127      /**128       * Total collections bound exceeded.129       **/130      TotalCollectionsLimitExceeded: AugmentedError<ApiType>;131      /**132       * Collection settings not allowing items transferring133       **/134      TransferNotAllowed: AugmentedError<ApiType>;135      /**136       * Target collection doesn't supports this operation137       **/138      UnsupportedOperation: AugmentedError<ApiType>;139      /**140       * Generic error141       **/142      [key: string]: AugmentedError<ApiType>;143    };144    cumulusXcm: {145      /**146       * Generic error147       **/148      [key: string]: AugmentedError<ApiType>;149    };150    dmpQueue: {151      /**152       * The amount of weight given is possibly not enough for executing the message.153       **/154      OverLimit: AugmentedError<ApiType>;155      /**156       * The message index given is unknown.157       **/158      Unknown: AugmentedError<ApiType>;159      /**160       * Generic error161       **/162      [key: string]: AugmentedError<ApiType>;163    };164    ethereum: {165      /**166       * Signature is invalid.167       **/168      InvalidSignature: AugmentedError<ApiType>;169      /**170       * Pre-log is present, therefore transact is not allowed.171       **/172      PreLogExists: AugmentedError<ApiType>;173      /**174       * Generic error175       **/176      [key: string]: AugmentedError<ApiType>;177    };178    evm: {179      /**180       * Not enough balance to perform action181       **/182      BalanceLow: AugmentedError<ApiType>;183      /**184       * Calculating total fee overflowed185       **/186      FeeOverflow: AugmentedError<ApiType>;187      /**188       * Gas price is too low.189       **/190      GasPriceTooLow: AugmentedError<ApiType>;191      /**192       * Nonce is invalid193       **/194      InvalidNonce: AugmentedError<ApiType>;195      /**196       * Calculating total payment overflowed197       **/198      PaymentOverflow: AugmentedError<ApiType>;199      /**200       * Withdraw fee failed201       **/202      WithdrawFailed: AugmentedError<ApiType>;203      /**204       * Generic error205       **/206      [key: string]: AugmentedError<ApiType>;207    };208    evmCoderSubstrate: {209      OutOfFund: AugmentedError<ApiType>;210      OutOfGas: AugmentedError<ApiType>;211      /**212       * Generic error213       **/214      [key: string]: AugmentedError<ApiType>;215    };216    evmContractHelpers: {217      /**218       * This method is only executable by owner219       **/220      NoPermission: AugmentedError<ApiType>;221      /**222       * Generic error223       **/224      [key: string]: AugmentedError<ApiType>;225    };226    evmMigration: {227      AccountIsNotMigrating: AugmentedError<ApiType>;228      AccountNotEmpty: AugmentedError<ApiType>;229      /**230       * Generic error231       **/232      [key: string]: AugmentedError<ApiType>;233    };234    fungible: {235      /**236       * Tried to set data for fungible item237       **/238      FungibleItemsDontHaveData: AugmentedError<ApiType>;239      /**240       * Not default id passed as TokenId argument241       **/242      FungibleItemsHaveNoId: AugmentedError<ApiType>;243      /**244       * Not Fungible item data used to mint in Fungible collection.245       **/246      NotFungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;247      /**248       * Generic error249       **/250      [key: string]: AugmentedError<ApiType>;251    };252    nonfungible: {253      /**254       * Used amount > 1 with NFT255       **/256      NonfungibleItemsHaveNoAmount: AugmentedError<ApiType>;257      /**258       * Not Nonfungible item data used to mint in Nonfungible collection.259       **/260      NotNonfungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;261      /**262       * Generic error263       **/264      [key: string]: AugmentedError<ApiType>;265    };266    parachainSystem: {267      /**268       * The inherent which supplies the host configuration did not run this block269       **/270      HostConfigurationNotAvailable: AugmentedError<ApiType>;271      /**272       * No code upgrade has been authorized.273       **/274      NothingAuthorized: AugmentedError<ApiType>;275      /**276       * No validation function upgrade is currently scheduled.277       **/278      NotScheduled: AugmentedError<ApiType>;279      /**280       * Attempt to upgrade validation function while existing upgrade pending281       **/282      OverlappingUpgrades: AugmentedError<ApiType>;283      /**284       * Polkadot currently prohibits this parachain from upgrading its validation function285       **/286      ProhibitedByPolkadot: AugmentedError<ApiType>;287      /**288       * The supplied validation function has compiled into a blob larger than Polkadot is289       * willing to run290       **/291      TooBig: AugmentedError<ApiType>;292      /**293       * The given code upgrade has not been authorized.294       **/295      Unauthorized: AugmentedError<ApiType>;296      /**297       * The inherent which supplies the validation data did not run this block298       **/299      ValidationDataNotAvailable: AugmentedError<ApiType>;300      /**301       * Generic error302       **/303      [key: string]: AugmentedError<ApiType>;304    };305    polkadotXcm: {306      /**307       * The location is invalid since it already has a subscription from us.308       **/309      AlreadySubscribed: AugmentedError<ApiType>;310      /**311       * The given location could not be used (e.g. because it cannot be expressed in the312       * desired version of XCM).313       **/314      BadLocation: AugmentedError<ApiType>;315      /**316       * The version of the `Versioned` value used is not able to be interpreted.317       **/318      BadVersion: AugmentedError<ApiType>;319      /**320       * Could not re-anchor the assets to declare the fees for the destination chain.321       **/322      CannotReanchor: AugmentedError<ApiType>;323      /**324       * The destination `MultiLocation` provided cannot be inverted.325       **/326      DestinationNotInvertible: AugmentedError<ApiType>;327      /**328       * The assets to be sent are empty.329       **/330      Empty: AugmentedError<ApiType>;331      /**332       * The message execution fails the filter.333       **/334      Filtered: AugmentedError<ApiType>;335      /**336       * Origin is invalid for sending.337       **/338      InvalidOrigin: AugmentedError<ApiType>;339      /**340       * The referenced subscription could not be found.341       **/342      NoSubscription: AugmentedError<ApiType>;343      /**344       * There was some other issue (i.e. not to do with routing) in sending the message. Perhaps345       * a lack of space for buffering the message.346       **/347      SendFailure: AugmentedError<ApiType>;348      /**349       * Too many assets have been attempted for transfer.350       **/351      TooManyAssets: AugmentedError<ApiType>;352      /**353       * The desired destination was unreachable, generally because there is a no way of routing354       * to it.355       **/356      Unreachable: AugmentedError<ApiType>;357      /**358       * The message's weight could not be determined.359       **/360      UnweighableMessage: AugmentedError<ApiType>;361      /**362       * Generic error363       **/364      [key: string]: AugmentedError<ApiType>;365    };366    refungible: {367      /**368       * Not Refungible item data used to mint in Refungible collection.369       **/370      NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;371      /**372       * Maximum refungibility exceeded373       **/374      WrongRefungiblePieces: AugmentedError<ApiType>;375      /**376       * Generic error377       **/378      [key: string]: AugmentedError<ApiType>;379    };380    sudo: {381      /**382       * Sender must be the Sudo account383       **/384      RequireSudo: AugmentedError<ApiType>;385      /**386       * Generic error387       **/388      [key: string]: AugmentedError<ApiType>;389    };390    system: {391      /**392       * The origin filter prevent the call to be dispatched.393       **/394      CallFiltered: AugmentedError<ApiType>;395      /**396       * Failed to extract the runtime version from the new runtime.397       * 398       * Either calling `Core_version` or decoding `RuntimeVersion` failed.399       **/400      FailedToExtractRuntimeVersion: AugmentedError<ApiType>;401      /**402       * The name of specification does not match between the current runtime403       * and the new runtime.404       **/405      InvalidSpecName: AugmentedError<ApiType>;406      /**407       * Suicide called when the account has non-default composite data.408       **/409      NonDefaultComposite: AugmentedError<ApiType>;410      /**411       * There is a non-zero reference count preventing the account from being purged.412       **/413      NonZeroRefCount: AugmentedError<ApiType>;414      /**415       * The specification version is not allowed to decrease between the current runtime416       * and the new runtime.417       **/418      SpecVersionNeedsToIncrease: AugmentedError<ApiType>;419      /**420       * Generic error421       **/422      [key: string]: AugmentedError<ApiType>;423    };424    treasury: {425      /**426       * Proposer's balance is too low.427       **/428      InsufficientProposersBalance: AugmentedError<ApiType>;429      /**430       * No proposal or bounty at that index.431       **/432      InvalidIndex: AugmentedError<ApiType>;433      /**434       * Too many approvals in the queue.435       **/436      TooManyApprovals: AugmentedError<ApiType>;437      /**438       * Generic error439       **/440      [key: string]: AugmentedError<ApiType>;441    };442    unique: {443      /**444       * Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.445       **/446      CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;447      /**448       * This address is not set as sponsor, use setCollectionSponsor first.449       **/450      ConfirmUnsetSponsorFail: AugmentedError<ApiType>;451      /**452       * Length of items properties must be greater than 0.453       **/454      EmptyArgument: AugmentedError<ApiType>;455      /**456       * Generic error457       **/458      [key: string]: AugmentedError<ApiType>;459    };460    vesting: {461      /**462       * The vested transfer amount is too low463       **/464      AmountLow: AugmentedError<ApiType>;465      /**466       * Insufficient amount of balance to lock467       **/468      InsufficientBalanceToLock: AugmentedError<ApiType>;469      /**470       * Failed because the maximum vesting schedules was exceeded471       **/472      MaxVestingSchedulesExceeded: AugmentedError<ApiType>;473      /**474       * This account have too many vesting schedules475       **/476      TooManyVestingSchedules: AugmentedError<ApiType>;477      /**478       * Vesting period is zero479       **/480      ZeroVestingPeriod: AugmentedError<ApiType>;481      /**482       * Number of vests is zero483       **/484      ZeroVestingPeriodCount: AugmentedError<ApiType>;485      /**486       * Generic error487       **/488      [key: string]: AugmentedError<ApiType>;489    };490    xcmpQueue: {491      /**492       * Bad overweight index.493       **/494      BadOverweightIndex: AugmentedError<ApiType>;495      /**496       * Bad XCM data.497       **/498      BadXcm: AugmentedError<ApiType>;499      /**500       * Bad XCM origin.501       **/502      BadXcmOrigin: AugmentedError<ApiType>;503      /**504       * Failed to send XCM message.505       **/506      FailedToSend: AugmentedError<ApiType>;507      /**508       * Provided weight is possibly not enough to execute the message.509       **/510      WeightOverLimit: AugmentedError<ApiType>;511      /**512       * Generic error513       **/514      [key: string]: AugmentedError<ApiType>;515    };516  } // AugmentedErrors517} // declare module
after · tests/src/interfaces/augment-api-errors.ts
1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit2/* eslint-disable */34import type { ApiTypes } from '@polkadot/api-base/types';56declare module '@polkadot/api-base/types/errors' {7  export interface AugmentedErrors<ApiType extends ApiTypes> {8    balances: {9      /**10       * Beneficiary account must pre-exist11       **/12      DeadAccount: AugmentedError<ApiType>;13      /**14       * Value too low to create account due to existential deposit15       **/16      ExistentialDeposit: AugmentedError<ApiType>;17      /**18       * A vesting schedule already exists for this account19       **/20      ExistingVestingSchedule: AugmentedError<ApiType>;21      /**22       * Balance too low to send value23       **/24      InsufficientBalance: AugmentedError<ApiType>;25      /**26       * Transfer/payment would kill account27       **/28      KeepAlive: AugmentedError<ApiType>;29      /**30       * Account liquidity restrictions prevent withdrawal31       **/32      LiquidityRestrictions: AugmentedError<ApiType>;33      /**34       * Number of named reserves exceed MaxReserves35       **/36      TooManyReserves: AugmentedError<ApiType>;37      /**38       * Vesting balance too high to send value39       **/40      VestingBalance: AugmentedError<ApiType>;41      /**42       * Generic error43       **/44      [key: string]: AugmentedError<ApiType>;45    };46    common: {47      /**48       * Account token limit exceeded per collection49       **/50      AccountTokenLimitExceeded: AugmentedError<ApiType>;51      /**52       * Can't transfer tokens to ethereum zero address53       **/54      AddressIsZero: AugmentedError<ApiType>;55      /**56       * Address is not in allow list.57       **/58      AddressNotInAllowlist: AugmentedError<ApiType>;59      /**60       * Requested value more than approved.61       **/62      ApprovedValueTooLow: AugmentedError<ApiType>;63      /**64       * Tried to approve more than owned65       **/66      CantApproveMoreThanOwned: AugmentedError<ApiType>;67      /**68       * Exceeded max admin count69       **/70      CollectionAdminCountExceeded: AugmentedError<ApiType>;71      /**72       * Collection description can not be longer than 255 char.73       **/74      CollectionDescriptionLimitExceeded: AugmentedError<ApiType>;75      /**76       * Collection limit bounds per collection exceeded77       **/78      CollectionLimitBoundsExceeded: AugmentedError<ApiType>;79      /**80       * Collection name can not be longer than 63 char.81       **/82      CollectionNameLimitExceeded: AugmentedError<ApiType>;83      /**84       * This collection does not exist.85       **/86      CollectionNotFound: AugmentedError<ApiType>;87      /**88       * Collection token limit exceeded89       **/90      CollectionTokenLimitExceeded: AugmentedError<ApiType>;91      /**92       * Token prefix can not be longer than 15 char.93       **/94      CollectionTokenPrefixLimitExceeded: AugmentedError<ApiType>;95      /**96       * Metadata flag frozen97       **/98      MetadataFlagFrozen: AugmentedError<ApiType>;99      /**100       * Sender parameter and item owner must be equal.101       **/102      MustBeTokenOwner: AugmentedError<ApiType>;103      /**104       * No permission to perform action105       **/106      NoPermission: AugmentedError<ApiType>;107      /**108       * Not sufficient founds to perform action109       **/110      NotSufficientFounds: AugmentedError<ApiType>;111      /**112       * Tried to enable permissions which are only permitted to be disabled113       **/114      OwnerPermissionsCantBeReverted: AugmentedError<ApiType>;115      /**116       * Collection is not in mint mode.117       **/118      PublicMintingNotAllowed: AugmentedError<ApiType>;119      /**120       * Item not exists.121       **/122      TokenNotFound: AugmentedError<ApiType>;123      /**124       * Item balance not enough.125       **/126      TokenValueTooLow: AugmentedError<ApiType>;127      /**128       * variable_data exceeded data limit.129       **/130      TokenVariableDataLimitExceeded: AugmentedError<ApiType>;131      /**132       * Total collections bound exceeded.133       **/134      TotalCollectionsLimitExceeded: AugmentedError<ApiType>;135      /**136       * Collection settings not allowing items transferring137       **/138      TransferNotAllowed: AugmentedError<ApiType>;139      /**140       * Target collection doesn't supports this operation141       **/142      UnsupportedOperation: AugmentedError<ApiType>;143      /**144       * Generic error145       **/146      [key: string]: AugmentedError<ApiType>;147    };148    cumulusXcm: {149      /**150       * Generic error151       **/152      [key: string]: AugmentedError<ApiType>;153    };154    dmpQueue: {155      /**156       * The amount of weight given is possibly not enough for executing the message.157       **/158      OverLimit: AugmentedError<ApiType>;159      /**160       * The message index given is unknown.161       **/162      Unknown: AugmentedError<ApiType>;163      /**164       * Generic error165       **/166      [key: string]: AugmentedError<ApiType>;167    };168    ethereum: {169      /**170       * Signature is invalid.171       **/172      InvalidSignature: AugmentedError<ApiType>;173      /**174       * Pre-log is present, therefore transact is not allowed.175       **/176      PreLogExists: AugmentedError<ApiType>;177      /**178       * Generic error179       **/180      [key: string]: AugmentedError<ApiType>;181    };182    evm: {183      /**184       * Not enough balance to perform action185       **/186      BalanceLow: AugmentedError<ApiType>;187      /**188       * Calculating total fee overflowed189       **/190      FeeOverflow: AugmentedError<ApiType>;191      /**192       * Gas price is too low.193       **/194      GasPriceTooLow: AugmentedError<ApiType>;195      /**196       * Nonce is invalid197       **/198      InvalidNonce: AugmentedError<ApiType>;199      /**200       * Calculating total payment overflowed201       **/202      PaymentOverflow: AugmentedError<ApiType>;203      /**204       * Withdraw fee failed205       **/206      WithdrawFailed: AugmentedError<ApiType>;207      /**208       * Generic error209       **/210      [key: string]: AugmentedError<ApiType>;211    };212    evmCoderSubstrate: {213      OutOfFund: AugmentedError<ApiType>;214      OutOfGas: AugmentedError<ApiType>;215      /**216       * Generic error217       **/218      [key: string]: AugmentedError<ApiType>;219    };220    evmContractHelpers: {221      /**222       * This method is only executable by owner223       **/224      NoPermission: AugmentedError<ApiType>;225      /**226       * Generic error227       **/228      [key: string]: AugmentedError<ApiType>;229    };230    evmMigration: {231      AccountIsNotMigrating: AugmentedError<ApiType>;232      AccountNotEmpty: AugmentedError<ApiType>;233      /**234       * Generic error235       **/236      [key: string]: AugmentedError<ApiType>;237    };238    fungible: {239      /**240       * Tried to set data for fungible item241       **/242      FungibleItemsDontHaveData: AugmentedError<ApiType>;243      /**244       * Not default id passed as TokenId argument245       **/246      FungibleItemsHaveNoId: AugmentedError<ApiType>;247      /**248       * Not Fungible item data used to mint in Fungible collection.249       **/250      NotFungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;251      /**252       * Generic error253       **/254      [key: string]: AugmentedError<ApiType>;255    };256    nonfungible: {257      /**258       * Used amount > 1 with NFT259       **/260      NonfungibleItemsHaveNoAmount: AugmentedError<ApiType>;261      /**262       * Not Nonfungible item data used to mint in Nonfungible collection.263       **/264      NotNonfungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;265      /**266       * Generic error267       **/268      [key: string]: AugmentedError<ApiType>;269    };270    parachainSystem: {271      /**272       * The inherent which supplies the host configuration did not run this block273       **/274      HostConfigurationNotAvailable: AugmentedError<ApiType>;275      /**276       * No code upgrade has been authorized.277       **/278      NothingAuthorized: AugmentedError<ApiType>;279      /**280       * No validation function upgrade is currently scheduled.281       **/282      NotScheduled: AugmentedError<ApiType>;283      /**284       * Attempt to upgrade validation function while existing upgrade pending285       **/286      OverlappingUpgrades: AugmentedError<ApiType>;287      /**288       * Polkadot currently prohibits this parachain from upgrading its validation function289       **/290      ProhibitedByPolkadot: AugmentedError<ApiType>;291      /**292       * The supplied validation function has compiled into a blob larger than Polkadot is293       * willing to run294       **/295      TooBig: AugmentedError<ApiType>;296      /**297       * The given code upgrade has not been authorized.298       **/299      Unauthorized: AugmentedError<ApiType>;300      /**301       * The inherent which supplies the validation data did not run this block302       **/303      ValidationDataNotAvailable: AugmentedError<ApiType>;304      /**305       * Generic error306       **/307      [key: string]: AugmentedError<ApiType>;308    };309    polkadotXcm: {310      /**311       * The location is invalid since it already has a subscription from us.312       **/313      AlreadySubscribed: AugmentedError<ApiType>;314      /**315       * The given location could not be used (e.g. because it cannot be expressed in the316       * desired version of XCM).317       **/318      BadLocation: AugmentedError<ApiType>;319      /**320       * The version of the `Versioned` value used is not able to be interpreted.321       **/322      BadVersion: AugmentedError<ApiType>;323      /**324       * Could not re-anchor the assets to declare the fees for the destination chain.325       **/326      CannotReanchor: AugmentedError<ApiType>;327      /**328       * The destination `MultiLocation` provided cannot be inverted.329       **/330      DestinationNotInvertible: AugmentedError<ApiType>;331      /**332       * The assets to be sent are empty.333       **/334      Empty: AugmentedError<ApiType>;335      /**336       * The message execution fails the filter.337       **/338      Filtered: AugmentedError<ApiType>;339      /**340       * Origin is invalid for sending.341       **/342      InvalidOrigin: AugmentedError<ApiType>;343      /**344       * The referenced subscription could not be found.345       **/346      NoSubscription: AugmentedError<ApiType>;347      /**348       * There was some other issue (i.e. not to do with routing) in sending the message. Perhaps349       * a lack of space for buffering the message.350       **/351      SendFailure: AugmentedError<ApiType>;352      /**353       * Too many assets have been attempted for transfer.354       **/355      TooManyAssets: AugmentedError<ApiType>;356      /**357       * The desired destination was unreachable, generally because there is a no way of routing358       * to it.359       **/360      Unreachable: AugmentedError<ApiType>;361      /**362       * The message's weight could not be determined.363       **/364      UnweighableMessage: AugmentedError<ApiType>;365      /**366       * Generic error367       **/368      [key: string]: AugmentedError<ApiType>;369    };370    refungible: {371      /**372       * Not Refungible item data used to mint in Refungible collection.373       **/374      NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;375      /**376       * Maximum refungibility exceeded377       **/378      WrongRefungiblePieces: AugmentedError<ApiType>;379      /**380       * Generic error381       **/382      [key: string]: AugmentedError<ApiType>;383    };384    sudo: {385      /**386       * Sender must be the Sudo account387       **/388      RequireSudo: AugmentedError<ApiType>;389      /**390       * Generic error391       **/392      [key: string]: AugmentedError<ApiType>;393    };394    system: {395      /**396       * The origin filter prevent the call to be dispatched.397       **/398      CallFiltered: AugmentedError<ApiType>;399      /**400       * Failed to extract the runtime version from the new runtime.401       * 402       * Either calling `Core_version` or decoding `RuntimeVersion` failed.403       **/404      FailedToExtractRuntimeVersion: AugmentedError<ApiType>;405      /**406       * The name of specification does not match between the current runtime407       * and the new runtime.408       **/409      InvalidSpecName: AugmentedError<ApiType>;410      /**411       * Suicide called when the account has non-default composite data.412       **/413      NonDefaultComposite: AugmentedError<ApiType>;414      /**415       * There is a non-zero reference count preventing the account from being purged.416       **/417      NonZeroRefCount: AugmentedError<ApiType>;418      /**419       * The specification version is not allowed to decrease between the current runtime420       * and the new runtime.421       **/422      SpecVersionNeedsToIncrease: AugmentedError<ApiType>;423      /**424       * Generic error425       **/426      [key: string]: AugmentedError<ApiType>;427    };428    treasury: {429      /**430       * Proposer's balance is too low.431       **/432      InsufficientProposersBalance: AugmentedError<ApiType>;433      /**434       * No proposal or bounty at that index.435       **/436      InvalidIndex: AugmentedError<ApiType>;437      /**438       * Too many approvals in the queue.439       **/440      TooManyApprovals: AugmentedError<ApiType>;441      /**442       * Generic error443       **/444      [key: string]: AugmentedError<ApiType>;445    };446    unique: {447      /**448       * Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.449       **/450      CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;451      /**452       * This address is not set as sponsor, use setCollectionSponsor first.453       **/454      ConfirmUnsetSponsorFail: AugmentedError<ApiType>;455      /**456       * Length of items properties must be greater than 0.457       **/458      EmptyArgument: AugmentedError<ApiType>;459      /**460       * Generic error461       **/462      [key: string]: AugmentedError<ApiType>;463    };464    vesting: {465      /**466       * The vested transfer amount is too low467       **/468      AmountLow: AugmentedError<ApiType>;469      /**470       * Insufficient amount of balance to lock471       **/472      InsufficientBalanceToLock: AugmentedError<ApiType>;473      /**474       * Failed because the maximum vesting schedules was exceeded475       **/476      MaxVestingSchedulesExceeded: AugmentedError<ApiType>;477      /**478       * This account have too many vesting schedules479       **/480      TooManyVestingSchedules: AugmentedError<ApiType>;481      /**482       * Vesting period is zero483       **/484      ZeroVestingPeriod: AugmentedError<ApiType>;485      /**486       * Number of vests is zero487       **/488      ZeroVestingPeriodCount: AugmentedError<ApiType>;489      /**490       * Generic error491       **/492      [key: string]: AugmentedError<ApiType>;493    };494    xcmpQueue: {495      /**496       * Bad overweight index.497       **/498      BadOverweightIndex: AugmentedError<ApiType>;499      /**500       * Bad XCM data.501       **/502      BadXcm: AugmentedError<ApiType>;503      /**504       * Bad XCM origin.505       **/506      BadXcmOrigin: AugmentedError<ApiType>;507      /**508       * Failed to send XCM message.509       **/510      FailedToSend: AugmentedError<ApiType>;511      /**512       * Provided weight is possibly not enough to execute the message.513       **/514      WeightOverLimit: AugmentedError<ApiType>;515      /**516       * Generic error517       **/518      [key: string]: AugmentedError<ApiType>;519    };520  } // AugmentedErrors521} // declare module
modifiedtests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -1,7 +1,7 @@
 // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
 /* eslint-disable */
 
-import type { PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsCollection, UpDataStructsCollectionStats } from './unique';
+import type { PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionStats } from './unique';
 import type { AugmentedRpc } from '@polkadot/rpc-core/types';
 import type { Metadata, StorageKey } from '@polkadot/types';
 import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec';
@@ -604,6 +604,10 @@
        **/
       constMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
       /**
+       * Get effective collection limits
+       **/
+      effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;
+      /**
        * Get last token id
        **/
       lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
modifiedtests/src/interfaces/augment-types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -1,7 +1,7 @@
 // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
 /* eslint-disable */
 
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonAccountBasicCrossAccountIdRepr, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1AbridgedHrmpChannel, PolkadotPrimitivesV1PersistedValidationData, PolkadotPrimitivesV1UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonAccountBasicCrossAccountIdRepr, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1AbridgedHrmpChannel, PolkadotPrimitivesV1PersistedValidationData, PolkadotPrimitivesV1UpgradeRestriction, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './unique';
 import type { Data, StorageKey } from '@polkadot/types';
 import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
 import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
@@ -18,7 +18,7 @@
 import type { StatementKind } from '@polkadot/types/interfaces/claims';
 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, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
+import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, 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, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, 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, 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 { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
@@ -198,6 +198,7 @@
     ClassMetadata: ClassMetadata;
     CodecHash: CodecHash;
     CodeHash: CodeHash;
+    CodeSource: CodeSource;
     CodeUploadRequest: CodeUploadRequest;
     CodeUploadResult: CodeUploadResult;
     CodeUploadResultValue: CodeUploadResultValue;
@@ -250,6 +251,7 @@
     ContractInfo: ContractInfo;
     ContractInstantiateResult: ContractInstantiateResult;
     ContractInstantiateResultTo267: ContractInstantiateResultTo267;
+    ContractInstantiateResultTo299: ContractInstantiateResultTo299;
     ContractLayoutArray: ContractLayoutArray;
     ContractLayoutCell: ContractLayoutCell;
     ContractLayoutEnum: ContractLayoutEnum;
@@ -591,7 +593,10 @@
     InstanceId: InstanceId;
     InstanceMetadata: InstanceMetadata;
     InstantiateRequest: InstantiateRequest;
+    InstantiateRequestV1: InstantiateRequestV1;
+    InstantiateRequestV2: InstantiateRequestV2;
     InstantiateReturnValue: InstantiateReturnValue;
+    InstantiateReturnValueOk: InstantiateReturnValueOk;
     InstantiateReturnValueTo267: InstantiateReturnValueTo267;
     InstructionV2: InstructionV2;
     InstructionWeights: InstructionWeights;
@@ -707,6 +712,7 @@
     OffchainAccuracyCompact: OffchainAccuracyCompact;
     OffenceDetails: OffenceDetails;
     Offender: Offender;
+    OpalRuntimeRuntime: OpalRuntimeRuntime;
     OpaqueCall: OpaqueCall;
     OpaqueMultiaddr: OpaqueMultiaddr;
     OpaqueNetworkState: OpaqueNetworkState;
@@ -1146,7 +1152,6 @@
     UnappliedSlash: UnappliedSlash;
     UnappliedSlashOther: UnappliedSlashOther;
     UncleEntryItem: UncleEntryItem;
-    UniqueRuntimeRuntime: UniqueRuntimeRuntime;
     UnknownTransaction: UnknownTransaction;
     UnlockChunk: UnlockChunk;
     UnrewardedRelayer: UnrewardedRelayer;
modifiedtests/src/interfaces/lookup.tsdiffbeforeafterboth
--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -1756,7 +1756,7 @@
     }
   },
   /**
-   * Lookup225: frame_system::EventRecord<unique_runtime::Event, primitive_types::H256>
+   * Lookup225: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
    **/
   FrameSystemEventRecord: {
     phase: 'FrameSystemPhase',
@@ -2240,7 +2240,7 @@
    * Lookup297: pallet_common::pallet::Error<T>
    **/
   PalletCommonError: {
-    _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'TokenVariableDataLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation']
+    _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'TokenVariableDataLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds']
   },
   /**
    * Lookup299: pallet_fungible::pallet::Error<T>
@@ -2417,11 +2417,11 @@
    **/
   FrameSystemExtensionsCheckWeight: 'Null',
   /**
-   * Lookup345: pallet_template_transaction_payment::ChargeTransactionPayment<unique_runtime::Runtime>
+   * Lookup345: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
    **/
   PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
   /**
-   * Lookup346: unique_runtime::Runtime
+   * Lookup346: opal_runtime::Runtime
    **/
-  UniqueRuntimeRuntime: 'Null'
+  OpalRuntimeRuntime: 'Null'
 };
modifiedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth
--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -2462,7 +2462,8 @@
     readonly isCantApproveMoreThanOwned: boolean;
     readonly isAddressIsZero: boolean;
     readonly isUnsupportedOperation: boolean;
-    readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'TokenVariableDataLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation';
+    readonly isNotSufficientFounds: boolean;
+    readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'TokenVariableDataLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds';
   }
 
   /** @name PalletFungibleError (299) */
@@ -2643,7 +2644,7 @@
   /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (345) */
   export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
 
-  /** @name UniqueRuntimeRuntime (346) */
-  export type UniqueRuntimeRuntime = Null;
+  /** @name OpalRuntimeRuntime (346) */
+  export type OpalRuntimeRuntime = Null;
 
 } // declare module
modifiedtests/src/interfaces/unique/definitions.tsdiffbeforeafterboth
--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -55,5 +55,6 @@
     collectionById: fun('Get collection by specified id', [collectionParam], 'Option<UpDataStructsCollection>'),
     collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'),
     allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),
+    effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option<UpDataStructsCollectionLimits>'),
   },
 };
modifiedtests/src/interfaces/unique/types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/unique/types.ts
+++ b/tests/src/interfaces/unique/types.ts
@@ -654,6 +654,9 @@
   readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';
 }
 
+/** @name OpalRuntimeRuntime */
+export interface OpalRuntimeRuntime extends Null {}
+
 /** @name OrmlVestingModuleCall */
 export interface OrmlVestingModuleCall extends Enum {
   readonly isClaim: boolean;
@@ -892,7 +895,8 @@
   readonly isCantApproveMoreThanOwned: boolean;
   readonly isAddressIsZero: boolean;
   readonly isUnsupportedOperation: boolean;
-  readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'TokenVariableDataLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation';
+  readonly isNotSufficientFounds: boolean;
+  readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'TokenVariableDataLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds';
 }
 
 /** @name PalletCommonEvent */
@@ -1721,9 +1725,6 @@
   readonly transactionVersion: u32;
   readonly stateVersion: u8;
 }
-
-/** @name UniqueRuntimeRuntime */
-export interface UniqueRuntimeRuntime extends Null {}
 
 /** @name UpDataStructsAccessMode */
 export interface UpDataStructsAccessMode extends Enum {
modifiedtests/src/limits.test.tsdiffbeforeafterboth
--- a/tests/src/limits.test.ts
+++ b/tests/src/limits.test.ts
@@ -396,3 +396,51 @@
     //expect(aliceBalanceAfterSponsoredTransaction1).to.be.lessThan(aliceBalanceBefore);
   });
 });
+
+describe.only('Effective collection limits', () => {
+  it('Test1', async () => {
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
+      
+      {
+        const collection = await api.rpc.unique.collectionById(collectionId);
+        expect(collection.isSome).to.be.true;
+        const limits = collection.unwrap().limits;
+        expect(limits).to.be.any;
+        
+        // Check that limits is undefined
+        expect(limits.accountTokenOwnershipLimit.isNone).to.be.true;
+        expect(limits.sponsoredDataSize.isNone).to.be.true;
+        expect(limits.sponsoredDataRateLimit.isNone).to.be.true;
+        expect(limits.tokenLimit.isNone).to.be.true;
+        expect(limits.sponsorTransferTimeout.isNone).to.be.true;
+        expect(limits.sponsorApproveTimeout.isNone).to.be.true;
+        expect(limits.ownerCanTransfer.isNone).to.be.true;
+        expect(limits.ownerCanDestroy.isNone).to.be.true;
+        expect(limits.transfersEnabled.isNone).to.be.true;
+      }
+
+      {
+        const limits = await api.rpc.unique.effectiveCollectionLimits(11111);
+        expect(limits.isNone).to.be.true;
+      }
+
+      {
+        const limitsOpt = await api.rpc.unique.effectiveCollectionLimits(collectionId);
+        expect(limitsOpt.isNone).to.be.false;
+        const limits = limitsOpt.unwrap();
+
+        console.log(limits);
+        expect(limits.accountTokenOwnershipLimit.isSome).to.be.true;
+        expect(limits.sponsoredDataSize.isSome).to.be.true;
+        expect(limits.sponsoredDataRateLimit.isSome).to.be.true;
+        expect(limits.tokenLimit.isSome).to.be.true;
+        expect(limits.sponsorTransferTimeout.isSome).to.be.true;
+        expect(limits.sponsorApproveTimeout.isSome).to.be.true;
+        expect(limits.ownerCanTransfer.isSome).to.be.true;
+        expect(limits.ownerCanDestroy.isSome).to.be.true;
+        expect(limits.transfersEnabled.isSome).to.be.true;
+      }
+    });
+  });
+});
\ No newline at end of file