git.delta.rocks / unique-network / refs/commits / d4f7a1e6b1bd

difftreelog

Merge pull request #427 from UniqueNetwork/doc/architectural-changes

Yaroslav Bolyukin2022-07-22parents: #281e817 #2bb23d8.patch.diff
in: master

19 files changed

modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
42#[rpc(server)]42#[rpc(server)]
43#[async_trait]43#[async_trait]
44pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {44pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {
45 /// Get tokens owned by account.
45 #[method(name = "unique_accountTokens")]46 #[method(name = "unique_accountTokens")]
46 fn account_tokens(47 fn account_tokens(
47 &self,48 &self,
50 at: Option<BlockHash>,51 at: Option<BlockHash>,
51 ) -> Result<Vec<TokenId>>;52 ) -> Result<Vec<TokenId>>;
53
54 /// Get tokens contained within a collection.
52 #[method(name = "unique_collectionTokens")]55 #[method(name = "unique_collectionTokens")]
53 fn collection_tokens(56 fn collection_tokens(
54 &self,57 &self,
55 collection: CollectionId,58 collection: CollectionId,
56 at: Option<BlockHash>,59 at: Option<BlockHash>,
57 ) -> Result<Vec<TokenId>>;60 ) -> Result<Vec<TokenId>>;
61
62 /// Check if the token exists.
58 #[method(name = "unique_tokenExists")]63 #[method(name = "unique_tokenExists")]
59 fn token_exists(64 fn token_exists(
60 &self,65 &self,
63 at: Option<BlockHash>,68 at: Option<BlockHash>,
64 ) -> Result<bool>;69 ) -> Result<bool>;
6570
71 /// Get the token owner.
66 #[method(name = "unique_tokenOwner")]72 #[method(name = "unique_tokenOwner")]
67 fn token_owner(73 fn token_owner(
68 &self,74 &self,
80 at: Option<BlockHash>,86 at: Option<BlockHash>,
81 ) -> Result<Vec<CrossAccountId>>;87 ) -> Result<Vec<CrossAccountId>>;
8288
89 /// Get the topmost token owner in the hierarchy of a possibly nested token.
83 #[method(name = "unique_topmostTokenOwner")]90 #[method(name = "unique_topmostTokenOwner")]
84 fn topmost_token_owner(91 fn topmost_token_owner(
85 &self,92 &self,
88 at: Option<BlockHash>,95 at: Option<BlockHash>,
89 ) -> Result<Option<CrossAccountId>>;96 ) -> Result<Option<CrossAccountId>>;
97
98 /// Get tokens nested directly into the token.
90 #[method(name = "unique_tokenChildren")]99 #[method(name = "unique_tokenChildren")]
91 fn token_children(100 fn token_children(
92 &self,101 &self,
95 at: Option<BlockHash>,104 at: Option<BlockHash>,
96 ) -> Result<Vec<TokenChild>>;105 ) -> Result<Vec<TokenChild>>;
97106
107 /// Get collection properties, optionally limited to the provided keys.
98 #[method(name = "unique_collectionProperties")]108 #[method(name = "unique_collectionProperties")]
99 fn collection_properties(109 fn collection_properties(
100 &self,110 &self,
103 at: Option<BlockHash>,113 at: Option<BlockHash>,
104 ) -> Result<Vec<Property>>;114 ) -> Result<Vec<Property>>;
105115
116 /// Get token properties, optionally limited to the provided keys.
106 #[method(name = "unique_tokenProperties")]117 #[method(name = "unique_tokenProperties")]
107 fn token_properties(118 fn token_properties(
108 &self,119 &self,
112 at: Option<BlockHash>,123 at: Option<BlockHash>,
113 ) -> Result<Vec<Property>>;124 ) -> Result<Vec<Property>>;
114125
126 /// Get property permissions, optionally limited to the provided keys.
115 #[method(name = "unique_propertyPermissions")]127 #[method(name = "unique_propertyPermissions")]
116 fn property_permissions(128 fn property_permissions(
117 &self,129 &self,
120 at: Option<BlockHash>,132 at: Option<BlockHash>,
121 ) -> Result<Vec<PropertyKeyPermission>>;133 ) -> Result<Vec<PropertyKeyPermission>>;
122134
135 /// Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT.
123 #[method(name = "unique_tokenData")]136 #[method(name = "unique_tokenData")]
124 fn token_data(137 fn token_data(
125 &self,138 &self,
129 at: Option<BlockHash>,142 at: Option<BlockHash>,
130 ) -> Result<TokenData<CrossAccountId>>;143 ) -> Result<TokenData<CrossAccountId>>;
131144
145 /// Get the amount of distinctive tokens present in a collection.
132 #[method(name = "unique_totalSupply")]146 #[method(name = "unique_totalSupply")]
133 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;147 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;
148
149 /// Get the amount of any user tokens owned by an account.
134 #[method(name = "unique_accountBalance")]150 #[method(name = "unique_accountBalance")]
135 fn account_balance(151 fn account_balance(
136 &self,152 &self,
139 at: Option<BlockHash>,155 at: Option<BlockHash>,
140 ) -> Result<u32>;156 ) -> Result<u32>;
157
158 /// Get the amount of a specific token owned by an account.
141 #[method(name = "unique_balance")]159 #[method(name = "unique_balance")]
142 fn balance(160 fn balance(
143 &self,161 &self,
147 at: Option<BlockHash>,165 at: Option<BlockHash>,
148 ) -> Result<String>;166 ) -> Result<String>;
167
168 /// Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor.
149 #[method(name = "unique_allowance")]169 #[method(name = "unique_allowance")]
150 fn allowance(170 fn allowance(
151 &self,171 &self,
156 at: Option<BlockHash>,176 at: Option<BlockHash>,
157 ) -> Result<String>;177 ) -> Result<String>;
158178
179 /// Get the list of admin accounts of a collection.
159 #[method(name = "unique_adminlist")]180 #[method(name = "unique_adminlist")]
160 fn adminlist(181 fn adminlist(
161 &self,182 &self,
162 collection: CollectionId,183 collection: CollectionId,
163 at: Option<BlockHash>,184 at: Option<BlockHash>,
164 ) -> Result<Vec<CrossAccountId>>;185 ) -> Result<Vec<CrossAccountId>>;
186
187 /// Get the list of accounts allowed to operate within a collection.
165 #[method(name = "unique_allowlist")]188 #[method(name = "unique_allowlist")]
166 fn allowlist(189 fn allowlist(
167 &self,190 &self,
168 collection: CollectionId,191 collection: CollectionId,
169 at: Option<BlockHash>,192 at: Option<BlockHash>,
170 ) -> Result<Vec<CrossAccountId>>;193 ) -> Result<Vec<CrossAccountId>>;
194
195 /// Check if a user is allowed to operate within a collection.
171 #[method(name = "unique_allowed")]196 #[method(name = "unique_allowed")]
172 fn allowed(197 fn allowed(
173 &self,198 &self,
176 at: Option<BlockHash>,201 at: Option<BlockHash>,
177 ) -> Result<bool>;202 ) -> Result<bool>;
203
204 /// Get the last token ID created in a collection.
178 #[method(name = "unique_lastTokenId")]205 #[method(name = "unique_lastTokenId")]
179 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;206 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;
207
208 /// Get collection info by the specified ID.
180 #[method(name = "unique_collectionById")]209 #[method(name = "unique_collectionById")]
181 fn collection_by_id(210 fn collection_by_id(
182 &self,211 &self,
183 collection: CollectionId,212 collection: CollectionId,
184 at: Option<BlockHash>,213 at: Option<BlockHash>,
185 ) -> Result<Option<RpcCollection<AccountId>>>;214 ) -> Result<Option<RpcCollection<AccountId>>>;
215
216 /// Get chain stats about collections.
186 #[method(name = "unique_collectionStats")]217 #[method(name = "unique_collectionStats")]
187 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;218 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;
188219
220 /// Get the number of blocks until sponsoring a transaction is available.
189 #[method(name = "unique_nextSponsored")]221 #[method(name = "unique_nextSponsored")]
190 fn next_sponsored(222 fn next_sponsored(
191 &self,223 &self,
195 at: Option<BlockHash>,227 at: Option<BlockHash>,
196 ) -> Result<Option<u64>>;228 ) -> Result<Option<u64>>;
197229
230 /// Get effective collection limits. If not explicitly set, get the chain defaults.
198 #[method(name = "unique_effectiveCollectionLimits")]231 #[method(name = "unique_effectiveCollectionLimits")]
199 fn effective_collection_limits(232 fn effective_collection_limits(
200 &self,233 &self,
201 collection_id: CollectionId,234 collection_id: CollectionId,
202 at: Option<BlockHash>,235 at: Option<BlockHash>,
203 ) -> Result<Option<CollectionLimits>>;236 ) -> Result<Option<CollectionLimits>>;
204237
238 /// Get the total amount of pieces of an RFT.
205 #[method(name = "unique_totalPieces")]239 #[method(name = "unique_totalPieces")]
206 fn total_pieces(240 fn total_pieces(
207 &self,241 &self,
228 Theme,262 Theme,
229 >263 >
230 {264 {
265 /// Get the latest created collection ID.
231 #[method(name = "rmrk_lastCollectionIdx")]266 #[method(name = "rmrk_lastCollectionIdx")]
232 /// Get the latest created collection id
233 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;267 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;
234268
269 /// Get collection info by ID.
235 #[method(name = "rmrk_collectionById")]270 #[method(name = "rmrk_collectionById")]
236 /// Get collection by id
237 fn collection_by_id(271 fn collection_by_id(
238 &self,272 &self,
239 id: RmrkCollectionId,273 id: RmrkCollectionId,
240 at: Option<BlockHash>,274 at: Option<BlockHash>,
241 ) -> Result<Option<CollectionInfo>>;275 ) -> Result<Option<CollectionInfo>>;
242276
277 /// Get NFT info by collection and NFT IDs.
243 #[method(name = "rmrk_nftById")]278 #[method(name = "rmrk_nftById")]
244 /// Get NFT by collection id and NFT id
245 fn nft_by_id(279 fn nft_by_id(
246 &self,280 &self,
247 collection_id: RmrkCollectionId,281 collection_id: RmrkCollectionId,
248 nft_id: RmrkNftId,282 nft_id: RmrkNftId,
249 at: Option<BlockHash>,283 at: Option<BlockHash>,
250 ) -> Result<Option<NftInfo>>;284 ) -> Result<Option<NftInfo>>;
251285
286 /// Get tokens owned by an account in a collection.
252 #[method(name = "rmrk_accountTokens")]287 #[method(name = "rmrk_accountTokens")]
253 /// Get tokens owned by an account in a collection
254 fn account_tokens(288 fn account_tokens(
255 &self,289 &self,
256 account_id: AccountId,290 account_id: AccountId,
257 collection_id: RmrkCollectionId,291 collection_id: RmrkCollectionId,
258 at: Option<BlockHash>,292 at: Option<BlockHash>,
259 ) -> Result<Vec<RmrkNftId>>;293 ) -> Result<Vec<RmrkNftId>>;
260294
295 /// Get tokens nested in an NFT - its direct children (not the children's children).
261 #[method(name = "rmrk_nftChildren")]296 #[method(name = "rmrk_nftChildren")]
262 /// Get NFT children
263 fn nft_children(297 fn nft_children(
264 &self,298 &self,
265 collection_id: RmrkCollectionId,299 collection_id: RmrkCollectionId,
266 nft_id: RmrkNftId,300 nft_id: RmrkNftId,
267 at: Option<BlockHash>,301 at: Option<BlockHash>,
268 ) -> Result<Vec<RmrkNftChild>>;302 ) -> Result<Vec<RmrkNftChild>>;
269303
304 /// Get collection properties, created by the user - not the proxy-specific properties.
270 #[method(name = "rmrk_collectionProperties")]305 #[method(name = "rmrk_collectionProperties")]
271 /// Get collection properties
272 fn collection_properties(306 fn collection_properties(
273 &self,307 &self,
274 collection_id: RmrkCollectionId,308 collection_id: RmrkCollectionId,
275 filter_keys: Option<Vec<String>>,309 filter_keys: Option<Vec<String>>,
276 at: Option<BlockHash>,310 at: Option<BlockHash>,
277 ) -> Result<Vec<PropertyInfo>>;311 ) -> Result<Vec<PropertyInfo>>;
278312
313 /// Get NFT properties, created by the user - not the proxy-specific properties.
279 #[method(name = "rmrk_nftProperties")]314 #[method(name = "rmrk_nftProperties")]
280 /// Get NFT properties
281 fn nft_properties(315 fn nft_properties(
282 &self,316 &self,
283 collection_id: RmrkCollectionId,317 collection_id: RmrkCollectionId,
286 at: Option<BlockHash>,320 at: Option<BlockHash>,
287 ) -> Result<Vec<PropertyInfo>>;321 ) -> Result<Vec<PropertyInfo>>;
288322
323 /// Get data of resources of an NFT.
289 #[method(name = "rmrk_nftResources")]324 #[method(name = "rmrk_nftResources")]
290 /// Get NFT resources
291 fn nft_resources(325 fn nft_resources(
292 &self,326 &self,
293 collection_id: RmrkCollectionId,327 collection_id: RmrkCollectionId,
294 nft_id: RmrkNftId,328 nft_id: RmrkNftId,
295 at: Option<BlockHash>,329 at: Option<BlockHash>,
296 ) -> Result<Vec<ResourceInfo>>;330 ) -> Result<Vec<ResourceInfo>>;
297331
332 /// Get the priority of a resource in an NFT.
298 #[method(name = "rmrk_nftResourcePriority")]333 #[method(name = "rmrk_nftResourcePriority")]
299 /// Get NFT resource priority
300 fn nft_resource_priority(334 fn nft_resource_priority(
301 &self,335 &self,
302 collection_id: RmrkCollectionId,336 collection_id: RmrkCollectionId,
305 at: Option<BlockHash>,339 at: Option<BlockHash>,
306 ) -> Result<Option<u32>>;340 ) -> Result<Option<u32>>;
307341
342 /// Get base info by its ID.
308 #[method(name = "rmrk_base")]343 #[method(name = "rmrk_base")]
309 /// Get base info
310 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;344 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;
311345
346 /// Get all parts of a base.
312 #[method(name = "rmrk_baseParts")]347 #[method(name = "rmrk_baseParts")]
313 /// Get all Base's parts
314 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;348 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;
315349
350 /// Get the theme names belonging to a base.
316 #[method(name = "rmrk_themeNames")]351 #[method(name = "rmrk_themeNames")]
317 fn theme_names(352 fn theme_names(
318 &self,353 &self,
319 base_id: RmrkBaseId,354 base_id: RmrkBaseId,
320 at: Option<BlockHash>,355 at: Option<BlockHash>,
321 ) -> Result<Vec<RmrkThemeName>>;356 ) -> Result<Vec<RmrkThemeName>>;
322357
358 /// Get theme info, including properties, optionally limited to the provided keys.
323 #[method(name = "rmrk_themes")]359 #[method(name = "rmrk_themes")]
324 fn theme(360 fn theme(
325 &self,361 &self,
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
441 u128,441 u128,
442 ),442 ),
443443
444 /// The colletion property has been set.444 /// The colletion property has been added or edited.
445 CollectionPropertySet(445 CollectionPropertySet(
446 /// Id of collection to which property has been set.446 /// Id of collection to which property has been set.
447 CollectionId,447 CollectionId,
457 PropertyKey,457 PropertyKey,
458 ),458 ),
459459
460 /// The token property has been set.460 /// The token property has been added or edited.
461 TokenPropertySet(461 TokenPropertySet(
462 /// Identifier of the collection whose token has the property set.462 /// Identifier of the collection whose token has the property set.
463 CollectionId,463 CollectionId,
477 PropertyKey,477 PropertyKey,
478 ),478 ),
479479
480 /// The colletion property permission has been set.480 /// The token property permission of a collection has been set.
481 PropertyPermissionSet(481 PropertyPermissionSet(
482 /// Id of collection to which property permission has been set.482 /// ID of collection to which property permission has been set.
483 CollectionId,483 CollectionId,
484 /// The property permission that was set.484 /// The property permission that was set.
485 PropertyKey,485 PropertyKey,
524 /// Metadata flag frozen524 /// Metadata flag frozen
525 MetadataFlagFrozen,525 MetadataFlagFrozen,
526526
527 /// Item not exists.527 /// Item does not exist
528 TokenNotFound,528 TokenNotFound,
529 /// Item balance not enough.529 /// Item is balance not enough
530 TokenValueTooLow,530 TokenValueTooLow,
531 /// Requested value more than approved.531 /// Requested value is more than the approved
532 ApprovedValueTooLow,532 ApprovedValueTooLow,
533 /// Tried to approve more than owned533 /// Tried to approve more than owned
534 CantApproveMoreThanOwned,534 CantApproveMoreThanOwned,
535535
536 /// Can't transfer tokens to ethereum zero address536 /// Can't transfer tokens to ethereum zero address
537 AddressIsZero,537 AddressIsZero,
538 /// Target collection doesn't supports this operation538 /// Target collection doesn't support this operation
539 UnsupportedOperation,539 UnsupportedOperation,
540540
541 /// Not sufficient funds to perform action541 /// Insufficient funds to perform an action
542 NotSufficientFounds,542 NotSufficientFounds,
543543
544 /// User not passed nesting rule544 /// User does not satisfy the nesting rule
545 UserIsNotAllowedToNest,545 UserIsNotAllowedToNest,
546 /// Only tokens from specific collections may nest tokens under this546 /// Only tokens from specific collections may nest tokens under this one
547 SourceCollectionIsNotAllowedToNest,547 SourceCollectionIsNotAllowedToNest,
548548
549 /// Tried to store more data than allowed in collection field549 /// Tried to store more data than allowed in collection field
558 /// Property key is too long558 /// Property key is too long
559 PropertyKeyIsTooLong,559 PropertyKeyIsTooLong,
560560
561 /// Only ASCII letters, digits, and '_', '-' are allowed561 /// Only ASCII letters, digits, and symbols `_`, `-`, and `.` are allowed
562 InvalidCharacterInPropertyKey,562 InvalidCharacterInPropertyKey,
563563
564 /// Empty property keys are forbidden564 /// Empty property keys are forbidden
571 CollectionIsInternal,571 CollectionIsInternal,
572 }572 }
573573
574 /// Storage of the count of created collections.574 /// Storage of the count of created collections. Essentially contains the last collection ID.
575 #[pallet::storage]575 #[pallet::storage]
576 pub type CreatedCollectionCount<T> = StorageValue<Value = CollectionId, QueryKind = ValueQuery>;576 pub type CreatedCollectionCount<T> = StorageValue<Value = CollectionId, QueryKind = ValueQuery>;
577577
600 OnEmpty = up_data_structs::CollectionProperties,600 OnEmpty = up_data_structs::CollectionProperties,
601 >;601 >;
602602
603 /// Storage of collection properties permissions.603 /// Storage of token property permissions of a collection.
604 #[pallet::storage]604 #[pallet::storage]
605 #[pallet::getter(fn property_permissions)]605 #[pallet::getter(fn property_permissions)]
606 pub type CollectionPropertyPermissions<T> = StorageMap<606 pub type CollectionPropertyPermissions<T> = StorageMap<
610 QueryKind = ValueQuery,610 QueryKind = ValueQuery,
611 >;611 >;
612612
613 /// Storage of collection admins count.613 /// Storage of the amount of collection admins.
614 #[pallet::storage]614 #[pallet::storage]
615 pub type AdminAmount<T> = StorageMap<615 pub type AdminAmount<T> = StorageMap<
616 Hasher = Blake2_128Concat,616 Hasher = Blake2_128Concat,
619 QueryKind = ValueQuery,619 QueryKind = ValueQuery,
620 >;620 >;
621621
622 /// List of collection admins622 /// List of collection admins.
623 #[pallet::storage]623 #[pallet::storage]
624 pub type IsAdmin<T: Config> = StorageNMap<624 pub type IsAdmin<T: Config> = StorageNMap<
625 Key = (625 Key = (
630 QueryKind = ValueQuery,630 QueryKind = ValueQuery,
631 >;631 >;
632632
633 /// Allowlisted collection users633 /// Allowlisted collection users.
634 #[pallet::storage]634 #[pallet::storage]
635 pub type Allowlist<T: Config> = StorageNMap<635 pub type Allowlist<T: Config> = StorageNMap<
636 Key = (636 Key = (
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
119 pub enum Error<T> {119 pub enum Error<T> {
120 /// Not Fungible item data used to mint in Fungible collection.120 /// Not Fungible item data used to mint in Fungible collection.
121 NotFungibleDataUsedToMintFungibleCollectionToken,121 NotFungibleDataUsedToMintFungibleCollectionToken,
122 /// Not default id passed as TokenId argument.
123 /// The default value of TokenId for Fungible collection is 0.122 /// Fungible tokens hold no ID, and the default value of TokenId for Fungible collection is 0.
124 FungibleItemsHaveNoId,123 FungibleItemsHaveNoId,
125 /// Tried to set data for fungible item.124 /// Tried to set data for fungible item.
126 FungibleItemsDontHaveData,125 FungibleItemsDontHaveData,
157 QueryKind = ValueQuery,156 QueryKind = ValueQuery,
158 >;157 >;
159158
160 /// Storage for delegated assets.159 /// Storage for assets delegated to a limited extent to other users.
161 #[pallet::storage]160 #[pallet::storage]
162 pub type Allowance<T: Config> = StorageNMap<161 pub type Allowance<T: Config> = StorageNMap<
163 Key = (162 Key = (
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
21//! - [`Config`]21//! - [`Config`]
22//! - [`NonfungibleHandle`]22//! - [`NonfungibleHandle`]
23//! - [`Pallet`]23//! - [`Pallet`]
24//! - [`CommonWeights`]24//! - [`CommonWeights`](common::CommonWeights)
25//!25//!
26//! ## Overview26//! ## Overview
27//!27//!
130pub type CreateItemData<T> = CreateNftExData<<T as pallet_evm::account::Config>::CrossAccountId>;130pub type CreateItemData<T> = CreateNftExData<<T as pallet_evm::account::Config>::CrossAccountId>;
131pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;131pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;
132132
133/// Token data, stored independently from other data used to describe it
134/// for the convenience of database access. Notably contains the owner account address.
133#[struct_versioning::versioned(version = 2, upper)]135#[struct_versioning::versioned(version = 2, upper)]
134#[derive(Encode, Decode, TypeInfo, MaxEncodedLen)]136#[derive(Encode, Decode, TypeInfo, MaxEncodedLen)]
135pub struct ItemData<CrossAccountId> {137pub struct ItemData<CrossAccountId> {
176 #[pallet::generate_store(pub(super) trait Store)]178 #[pallet::generate_store(pub(super) trait Store)]
177 pub struct Pallet<T>(_);179 pub struct Pallet<T>(_);
178180
179 /// Amount of tokens minted for collection.181 /// Total amount of minted tokens in a collection.
180 #[pallet::storage]182 #[pallet::storage]
181 pub type TokensMinted<T: Config> =183 pub type TokensMinted<T: Config> =
182 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;184 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;
183185
184 /// Amount of burnt tokens for collection.186 /// Amount of burnt tokens in a collection.
185 #[pallet::storage]187 #[pallet::storage]
186 pub type TokensBurnt<T: Config> =188 pub type TokensBurnt<T: Config> =
187 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;189 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;
188190
189 /// Custom data serialized to bytes for token.191 /// Token data, used to partially describe a token.
190 #[pallet::storage]192 #[pallet::storage]
191 pub type TokenData<T: Config> = StorageNMap<193 pub type TokenData<T: Config> = StorageNMap<
192 Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),194 Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),
193 Value = ItemData<T::CrossAccountId>,195 Value = ItemData<T::CrossAccountId>,
194 QueryKind = OptionQuery,196 QueryKind = OptionQuery,
195 >;197 >;
196198
197 /// Key-Value map stored for token.199 /// Map of key-value pairs, describing the metadata of a token.
198 #[pallet::storage]200 #[pallet::storage]
199 #[pallet::getter(fn token_properties)]201 #[pallet::getter(fn token_properties)]
200 pub type TokenProperties<T: Config> = StorageNMap<202 pub type TokenProperties<T: Config> = StorageNMap<
204 OnEmpty = up_data_structs::TokenProperties,206 OnEmpty = up_data_structs::TokenProperties,
205 >;207 >;
206208
207 /// Custom data that is serialized to bytes and attached to a token property.209 /// Custom data of a token that is serialized to bytes,
210 /// primarily reserved for on-chain operations,
211 /// normally obscured from the external users.
212 ///
213 /// Auxiliary properties are slightly different from
214 /// usual [`TokenProperties`] due to an unlimited number
215 /// and separately stored and written-to key-value pairs.
216 ///
208 /// Currently used to store RMRK data.217 /// Currently used to store RMRK data.
209 #[pallet::storage]218 #[pallet::storage]
210 #[pallet::getter(fn token_aux_property)]219 #[pallet::getter(fn token_aux_property)]
244 QueryKind = ValueQuery,253 QueryKind = ValueQuery,
245 >;254 >;
246255
247 /// Amount of tokens owned by account.256 /// Amount of tokens owned by an account in a collection.
248 #[pallet::storage]257 #[pallet::storage]
249 pub type AccountBalance<T: Config> = StorageNMap<258 pub type AccountBalance<T: Config> = StorageNMap<
250 Key = (259 Key = (
255 QueryKind = ValueQuery,264 QueryKind = ValueQuery,
256 >;265 >;
257266
258 /// Allowance set by an owner for a spender for a token.267 /// Allowance set by a token owner for another user to perform one of certain transactions on a token.
259 #[pallet::storage]268 #[pallet::storage]
260 pub type Allowance<T: Config> = StorageNMap<269 pub type Allowance<T: Config> = StorageNMap<
261 Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),270 Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),
262 Value = T::CrossAccountId,271 Value = T::CrossAccountId,
263 QueryKind = OptionQuery,272 QueryKind = OptionQuery,
264 >;273 >;
265274
275 /// Upgrade from the old schema to properties.
266 #[pallet::hooks]276 #[pallet::hooks]
267 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {277 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
268 fn on_runtime_upgrade() -> Weight {278 fn on_runtime_upgrade() -> Weight {
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
21//! - [`Config`]21//! - [`Config`]
22//! - [`RefungibleHandle`]22//! - [`RefungibleHandle`]
23//! - [`Pallet`]23//! - [`Pallet`]
24//! - [`CommonWeights`]24//! - [`CommonWeights`](common::CommonWeights)
25//!25//!
26//! ## Overview26//! ## Overview
27//!27//!
119pub mod weights;119pub mod weights;
120pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;120pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;
121121
122/// Token data, stored independently from other data used to describe it
123/// for the convenience of database access. Notably contains the token metadata.
122#[struct_versioning::versioned(version = 2, upper)]124#[struct_versioning::versioned(version = 2, upper)]
123#[derive(Encode, Decode, Default, TypeInfo, MaxEncodedLen)]125#[derive(Encode, Decode, Default, TypeInfo, MaxEncodedLen)]
124pub struct ItemData {126pub struct ItemData {
143 pub enum Error<T> {145 pub enum Error<T> {
144 /// Not Refungible item data used to mint in Refungible collection.146 /// Not Refungible item data used to mint in Refungible collection.
145 NotRefungibleDataUsedToMintFungibleCollectionToken,147 NotRefungibleDataUsedToMintFungibleCollectionToken,
146 /// Maximum refungibility exceeded148 /// Maximum refungibility exceeded.
147 WrongRefungiblePieces,149 WrongRefungiblePieces,
148 /// Refungible token can't be repartitioned by user who isn't owns all pieces150 /// Refungible token can't be repartitioned by user who isn't owns all pieces.
149 RepartitionWhileNotOwningAllPieces,151 RepartitionWhileNotOwningAllPieces,
150 /// Refungible token can't nest other tokens152 /// Refungible token can't nest other tokens.
151 RefungibleDisallowsNesting,153 RefungibleDisallowsNesting,
152 /// Setting item properties is not allowed154 /// Setting item properties is not allowed.
153 SettingPropertiesNotAllowed,155 SettingPropertiesNotAllowed,
154 }156 }
155157
167 #[pallet::generate_store(pub(super) trait Store)]169 #[pallet::generate_store(pub(super) trait Store)]
168 pub struct Pallet<T>(_);170 pub struct Pallet<T>(_);
169171
170 /// Amount of tokens minted for collection172 /// Total amount of minted tokens in a collection.
171 #[pallet::storage]173 #[pallet::storage]
172 pub type TokensMinted<T: Config> =174 pub type TokensMinted<T: Config> =
173 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;175 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;
174176
175 /// Amount of burnt tokens for collection177 /// Amount of tokens burnt in a collection.
176 #[pallet::storage]178 #[pallet::storage]
177 pub type TokensBurnt<T: Config> =179 pub type TokensBurnt<T: Config> =
178 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;180 StorageMap<Hasher = Twox64Concat, Key = CollectionId, Value = u32, QueryKind = ValueQuery>;
179181
180 /// Custom data serialized to bytes for token182 /// Token data, used to partially describe a token.
181 #[pallet::storage]183 #[pallet::storage]
182 pub type TokenData<T: Config> = StorageNMap<184 pub type TokenData<T: Config> = StorageNMap<
183 Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),185 Key = (Key<Twox64Concat, CollectionId>, Key<Twox64Concat, TokenId>),
184 Value = ItemData,186 Value = ItemData,
185 QueryKind = ValueQuery,187 QueryKind = ValueQuery,
186 >;188 >;
187189
190 /// Amount of pieces a refungible token is split into.
188 #[pallet::storage]191 #[pallet::storage]
189 #[pallet::getter(fn token_properties)]192 #[pallet::getter(fn token_properties)]
190 pub type TokenProperties<T: Config> = StorageNMap<193 pub type TokenProperties<T: Config> = StorageNMap<
202 QueryKind = ValueQuery,205 QueryKind = ValueQuery,
203 >;206 >;
204207
205 /// Used to enumerate tokens owned by account208 /// Used to enumerate tokens owned by account.
206 #[pallet::storage]209 #[pallet::storage]
207 pub type Owned<T: Config> = StorageNMap<210 pub type Owned<T: Config> = StorageNMap<
208 Key = (211 Key = (
214 QueryKind = ValueQuery,217 QueryKind = ValueQuery,
215 >;218 >;
216219
217 /// Amount of tokens owned by account220 /// Amount of tokens (not pieces) partially owned by an account within a collection.
218 #[pallet::storage]221 #[pallet::storage]
219 pub type AccountBalance<T: Config> = StorageNMap<222 pub type AccountBalance<T: Config> = StorageNMap<
220 Key = (223 Key = (
226 QueryKind = ValueQuery,229 QueryKind = ValueQuery,
227 >;230 >;
228231
229 /// Amount of token pieces owned by account232 /// Amount of token pieces owned by account.
230 #[pallet::storage]233 #[pallet::storage]
231 pub type Balance<T: Config> = StorageNMap<234 pub type Balance<T: Config> = StorageNMap<
232 Key = (235 Key = (
239 QueryKind = ValueQuery,242 QueryKind = ValueQuery,
240 >;243 >;
241244
242 /// Allowance set by an owner for a spender for a token245 /// Allowance set by a token owner for another user to perform one of certain transactions on a number of pieces of a token.
243 #[pallet::storage]246 #[pallet::storage]
244 pub type Allowance<T: Config> = StorageNMap<247 pub type Allowance<T: Config> = StorageNMap<
245 Key = (248 Key = (
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
24// you may not use this file except in compliance with the License.24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at25// You may obtain a copy of the License at
26//26//
27// http://www.apache.org/licenses/LICENSE-2.027// <http://www.apache.org/licenses/LICENSE-2.0>
28//28//
29// Unless required by applicable law or agreed to in writing, software29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,30// distributed under the License is distributed on an "AS IS" BASIS,
50//! Also possible to book a call with a certain frequency.50//! Also possible to book a call with a certain frequency.
51//!51//!
52//! Key differences from the original pallet:52//! Key differences from the original pallet:
53//! https://crates.io/crates/pallet-scheduler53//! <https://crates.io/crates/pallet-scheduler>
54//! Schedule Id restricted by 16 bytes. Identificator for booked call.54//! Schedule Id restricted by 16 bytes. Identificator for booked call.
55//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block.55//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block.
56//! The maximum weight that may be scheduled per block for any dispatchables of less priority than `schedule::HARD_DEADLINE`.56//! The maximum weight that may be scheduled per block for any dispatchables of less priority than `schedule::HARD_DEADLINE`.
267267
268 /// A Scheduler-Runtime interface for finer payment handling.268 /// A Scheduler-Runtime interface for finer payment handling.
269 pub trait DispatchCall<T: frame_system::Config + Config, SelfContainedSignedInfo> {269 pub trait DispatchCall<T: frame_system::Config + Config, SelfContainedSignedInfo> {
270 /// Reserve (lock) the maximum spendings on a call, calculated from its weight and the repetition count.
270 fn reserve_balance(271 fn reserve_balance(
271 id: ScheduledId,272 id: ScheduledId,
272 sponsor: <T as frame_system::Config>::AccountId,273 sponsor: <T as frame_system::Config>::AccountId,
273 call: <T as Config>::Call,274 call: <T as Config>::Call,
274 count: u32,275 count: u32,
275 ) -> Result<(), DispatchError>;276 ) -> Result<(), DispatchError>;
276277
277 /// Unlock centain amount from payer278 /// Unreserve (unlock) a certain amount from the payer's reserved funds, returning the change.
278 fn pay_for_call(279 fn pay_for_call(
279 id: ScheduledId,280 id: ScheduledId,
280 sponsor: <T as frame_system::Config>::AccountId,281 sponsor: <T as frame_system::Config>::AccountId,
290 TransactionValidityError,291 TransactionValidityError,
291 >;292 >;
292293
294 /// Release unspent reserved funds in case of a schedule cancel.
293 fn cancel_reserve(295 fn cancel_reserve(
294 id: ScheduledId,296 id: ScheduledId,
295 sponsor: <T as frame_system::Config>::AccountId,297 sponsor: <T as frame_system::Config>::AccountId,
494 Agenda::<T>::append(wake, Some(s));496 Agenda::<T>::append(wake, Some(s));
495 }497 }
496 }498 }
497 /// Weight should be 0, because transaction already paid499 // Total weight should be 0, because the transaction is already paid for
498 0500 0
499 //total_weight
500 }501 }
501 }502 }
502503
modifiedpallets/structure/src/lib.rsdiffbeforeafterboth
7878
79 #[pallet::error]79 #[pallet::error]
80 pub enum Error<T> {80 pub enum Error<T> {
81 /// While searched for owner, got already checked account81 /// While nesting, encountered an already checked account, detecting a loop.
82 OuroborosDetected,82 OuroborosDetected,
83 /// While searched for owner, encountered depth limit83 /// While nesting, reached the depth limit of nesting, exceeding the provided budget.
84 DepthLimit,84 DepthLimit,
85 /// While iterating over children, encountered breadth limit85 /// While nesting, reached the breadth limit of nesting, exceeding the provided budget.
86 BreadthLimit,86 BreadthLimit,
87 /// While searched for owner, found token owner by not-yet-existing token87 /// Couldn't find the token owner that is itself a token.
88 TokenNotFound,88 TokenNotFound,
89 }89 }
9090
91 #[pallet::event]91 #[pallet::event]
92 pub enum Event<T> {92 pub enum Event<T> {
93 /// Executed call on behalf of token93 /// Executed call on behalf of the token.
94 Executed(DispatchResult),94 Executed(DispatchResult),
95 }95 }
9696
126126
127#[derive(PartialEq)]127#[derive(PartialEq)]
128pub enum Parent<CrossAccountId> {128pub enum Parent<CrossAccountId> {
129 /// Token owned by normal account129 /// Token owned by a normal account.
130 User(CrossAccountId),130 User(CrossAccountId),
131 /// Passed token not found131 /// Could not find the token provided as the owner.
132 TokenNotFound,132 TokenNotFound,
133 /// Token owner is another token (target token still may not exist)133 /// Token owner is another token (still, the target token may not exist).
134 Token(CollectionId, TokenId),134 Token(CollectionId, TokenId),
135}135}
136136
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
16
17//! Implementation of CollectionHelpers contract.
1618
17use core::marker::PhantomData;19use core::marker::PhantomData;
18use evm_coder::{execution::*, generate_stubgen, solidity_interface, weight, types::*};20use evm_coder::{execution::*, generate_stubgen, solidity_interface, weight, types::*};
33use sp_std::vec::Vec;35use sp_std::vec::Vec;
34use alloc::format;36use alloc::format;
3537
38/// See [`CollectionHelpersCall`]
36struct EvmCollectionHelpers<T: Config>(SubstrateRecorder<T>);39pub struct EvmCollectionHelpers<T: Config>(SubstrateRecorder<T>);
37impl<T: Config> WithRecorder<T> for EvmCollectionHelpers<T> {40impl<T: Config> WithRecorder<T> for EvmCollectionHelpers<T> {
38 fn recorder(&self) -> &SubstrateRecorder<T> {41 fn recorder(&self) -> &SubstrateRecorder<T> {
39 &self.042 &self.0
44 }47 }
45}48}
4649
50/// @title Contract, which allows users to operate with collections
47#[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))]51#[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))]
48impl<T: Config + pallet_nonfungible::Config> EvmCollectionHelpers<T> {52impl<T: Config + pallet_nonfungible::Config> EvmCollectionHelpers<T> {
53 /// Create an NFT collection
54 /// @param name Name of the collection
55 /// @param description Informative description of the collection
56 /// @param token_prefix Token prefix to represent the collection tokens in UI and user applications
57 /// @return address Address of the newly created collection
49 #[weight(<SelfWeightOf<T>>::create_collection())]58 #[weight(<SelfWeightOf<T>>::create_collection())]
50 fn create_nonfungible_collection(59 fn create_nonfungible_collection(
51 &mut self,60 &mut self,
100 Ok(address)109 Ok(address)
101 }110 }
102111
112 /// Check if a collection exists
113 /// @param collection_address Address of the collection in question
114 /// @return bool Does the collection exist?
103 fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result<bool> {115 fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result<bool> {
104 if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {116 if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {
105 let collection_id = id;117 let collection_id = id;
110 }122 }
111}123}
112124
125/// Implements [`OnMethodCall`], which delegates call to [`EvmCollectionHelpers`]
113pub struct CollectionHelpersOnMethodCall<T: Config>(PhantomData<*const T>);126pub struct CollectionHelpersOnMethodCall<T: Config>(PhantomData<*const T>);
114impl<T: Config + pallet_nonfungible::Config> OnMethodCall<T> for CollectionHelpersOnMethodCall<T> {127impl<T: Config + pallet_nonfungible::Config> OnMethodCall<T> for CollectionHelpersOnMethodCall<T> {
115 fn is_reserved(contract: &sp_core::H160) -> bool {128 fn is_reserved(contract: &sp_core::H160) -> bool {
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
16
17//! # Unique Pallet
18//!
19//! A pallet governing Unique transactions.
20//!
21//! - [`Config`]
22//! - [`Call`]
23//! - [`Pallet`]
24//!
25//! ## Overview
26//!
27//! The Unique pallet's purpose is to be the primary interface between
28//! external users and the inner structure of the Unique chains.
29//!
30//! It also contains an implementation of [`CollectionHelpers`][`eth`],
31//! an Ethereum contract dealing with collection operations.
32//!
33//! ## Interface
34//!
35//! ### Dispatchables
36//!
37//! - `create_collection` - Create a collection of tokens. **Deprecated**, use `create_collection_ex`.
38//! - `create_collection_ex` - Create a collection of tokens with explicit parameters.
39//! - `destroy_collection` - Destroy a collection if no tokens exist within.
40//! - `add_to_allow_list` - Add an address to allow list.
41//! - `remove_from_allow_list` - Remove an address from allow list.
42//! - `change_collection_owner` - Change the owner of the collection.
43//! - `add_collection_admin` - Add an admin to a collection.
44//! - `remove_collection_admin` - Remove admin of a collection.
45//! - `set_collection_sponsor` - Invite a new collection sponsor.
46//! - `confirm_sponsorship` - Confirm own sponsorship of a collection, becoming the sponsor.
47//! - `remove_collection_sponsor` - Remove a sponsor from a collection.
48//! - `create_item` - Create an item within a collection.
49//! - `create_multiple_items` - Create multiple items within a collection.
50//! - `set_collection_properties` - Add or change collection properties.
51//! - `delete_collection_properties` - Delete specified collection properties.
52//! - `set_token_properties` - Add or change token properties.
53//! - `delete_token_properties` - Delete token properties.
54//! - `set_token_property_permissions` - Add or change token property permissions of a collection.
55//! - `create_multiple_items_ex` - Create multiple items within a collection with explicitly specified initial parameters.
56//! - `set_transfers_enabled_flag` - Completely allow or disallow transfers for a particular collection.
57//! - `burn_item` - Destroy an item.
58//! - `burn_from` - Destroy an item on behalf of the owner as a non-owner account.
59//! - `transfer` - Change ownership of the token.
60//! - `transfer_from` - Change ownership of the token on behalf of the owner as a non-owner account.
61//! - `approve` - Allow a non-permissioned address to transfer or burn an item.
62//! - `set_collection_limits` - Set specific limits of a collection.
63//! - `set_collection_permissions` - Set specific permissions of a collection.
64//! - `repartition` - Re-partition a refungible token, while owning all of its parts.
1665
17#![recursion_limit = "1024"]66#![recursion_limit = "1024"]
18#![cfg_attr(not(feature = "std"), no_std)]67#![cfg_attr(not(feature = "std"), no_std)]
54pub mod weights;103pub mod weights;
55use weights::WeightInfo;104use weights::WeightInfo;
56105
106/// Maximum number of levels of depth in the token nesting tree.
57const NESTING_BUDGET: u32 = 5;107pub const NESTING_BUDGET: u32 = 5;
58108
59decl_error! {109decl_error! {
60 /// Error for non-fungible-token module.110 /// Errors for the common Unique transactions.
61 pub enum Error for Module<T: Config> {111 pub enum Error for Module<T: Config> {
62 /// Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.112 /// Decimal_points parameter must be lower than [`up_data_structs::MAX_DECIMAL_POINTS`].
63 CollectionDecimalPointLimitExceeded,113 CollectionDecimalPointLimitExceeded,
64 /// This address is not set as sponsor, use setCollectionSponsor first.114 /// This address is not set as sponsor, use setCollectionSponsor first.
65 ConfirmUnsetSponsorFail,115 ConfirmUnsetSponsorFail,
66 /// Length of items properties must be greater than 0.116 /// Length of items properties must be greater than 0.
67 EmptyArgument,117 EmptyArgument,
68 /// Repertition is only supported by refungible collection118 /// Repertition is only supported by refungible collection.
69 RepartitionCalledOnNonRefungibleCollection,119 RepartitionCalledOnNonRefungibleCollection,
70 }120 }
71}121}
72122
123/// Configuration trait of this pallet.
73pub trait Config: system::Config + pallet_common::Config + Sized + TypeInfo {124pub trait Config: system::Config + pallet_common::Config + Sized + TypeInfo {
125 /// Overarching event type.
74 type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;126 type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
75127
76 /// Weight information for extrinsics in this pallet.128 /// Weight information for extrinsics in this pallet.
77 type WeightInfo: WeightInfo;129 type WeightInfo: WeightInfo;
130
131 /// Weight information for common pallet operations.
78 type CommonWeightInfo: CommonWeightInfo<Self::CrossAccountId>;132 type CommonWeightInfo: CommonWeightInfo<Self::CrossAccountId>;
133
134 /// Weight info information for extra refungible pallet operations.
79 type RefungibleExtensionsWeightInfo: RefungibleExtensionsWeightInfo;135 type RefungibleExtensionsWeightInfo: RefungibleExtensionsWeightInfo;
80}136}
81137
88 /// Collection sponsor was removed144 /// Collection sponsor was removed
89 ///145 ///
90 /// # Arguments146 /// # Arguments
91 ///
92 /// * collection_id: Globally unique collection identifier.147 /// * collection_id: ID of the affected collection.
93 CollectionSponsorRemoved(CollectionId),148 CollectionSponsorRemoved(CollectionId),
94149
95 /// Collection admin was added150 /// Collection admin was added
96 ///151 ///
97 /// # Arguments152 /// # Arguments
98 ///
99 /// * collection_id: Globally unique collection identifier.153 /// * collection_id: ID of the affected collection.
100 ///
101 /// * admin: Admin address.154 /// * admin: Admin address.
102 CollectionAdminAdded(CollectionId, CrossAccountId),155 CollectionAdminAdded(CollectionId, CrossAccountId),
103156
104 /// Collection owned was change157 /// Collection owned was changed
105 ///158 ///
106 /// # Arguments159 /// # Arguments
107 ///
108 /// * collection_id: Globally unique collection identifier.160 /// * collection_id: ID of the affected collection.
109 ///
110 /// * owner: New owner address.161 /// * owner: New owner address.
111 CollectionOwnedChanged(CollectionId, AccountId),162 CollectionOwnedChanged(CollectionId, AccountId),
112163
113 /// Collection sponsor was set164 /// Collection sponsor was set
114 ///165 ///
115 /// # Arguments166 /// # Arguments
116 ///
117 /// * collection_id: Globally unique collection identifier.167 /// * collection_id: ID of the affected collection.
118 ///
119 /// * owner: New sponsor address.168 /// * owner: New sponsor address.
120 CollectionSponsorSet(CollectionId, AccountId),169 CollectionSponsorSet(CollectionId, AccountId),
121170
122 /// New sponsor was confirm171 /// New sponsor was confirm
123 ///172 ///
124 /// # Arguments173 /// # Arguments
125 ///
126 /// * collection_id: Globally unique collection identifier.174 /// * collection_id: ID of the affected collection.
127 ///
128 /// * sponsor: New sponsor address.175 /// * sponsor: New sponsor address.
129 SponsorshipConfirmed(CollectionId, AccountId),176 SponsorshipConfirmed(CollectionId, AccountId),
130177
131 /// Collection admin was removed178 /// Collection admin was removed
132 ///179 ///
133 /// # Arguments180 /// # Arguments
134 ///
135 /// * collection_id: Globally unique collection identifier.181 /// * collection_id: ID of the affected collection.
136 ///
137 /// * admin: Admin address.182 /// * admin: Removed admin address.
138 CollectionAdminRemoved(CollectionId, CrossAccountId),183 CollectionAdminRemoved(CollectionId, CrossAccountId),
139184
140 /// Address was remove from allow list185 /// Address was removed from the allow list
141 ///186 ///
142 /// # Arguments187 /// # Arguments
143 ///
144 /// * collection_id: Globally unique collection identifier.188 /// * collection_id: ID of the affected collection.
145 ///
146 /// * user: Address.189 /// * user: Address of the removed account.
147 AllowListAddressRemoved(CollectionId, CrossAccountId),190 AllowListAddressRemoved(CollectionId, CrossAccountId),
148191
149 /// Address was add to allow list192 /// Address was added to the allow list
150 ///193 ///
151 /// # Arguments194 /// # Arguments
152 ///
153 /// * collection_id: Globally unique collection identifier.195 /// * collection_id: ID of the affected collection.
154 ///
155 /// * user: Address.196 /// * user: Address of the added account.
156 AllowListAddressAdded(CollectionId, CrossAccountId),197 AllowListAddressAdded(CollectionId, CrossAccountId),
157198
158 /// Collection limits was set199 /// Collection limits were set
159 ///200 ///
160 /// # Arguments201 /// # Arguments
161 ///
162 /// * collection_id: Globally unique collection identifier.202 /// * collection_id: ID of the affected collection.
163 CollectionLimitSet(CollectionId),203 CollectionLimitSet(CollectionId),
164204
205 /// Collection permissions were set
206 ///
207 /// # Arguments
208 /// * collection_id: ID of the affected collection.
165 CollectionPermissionSet(CollectionId),209 CollectionPermissionSet(CollectionId),
166 }210 }
167}211}
198 ChainVersion: u64;242 ChainVersion: u64;
199 //#endregion243 //#endregion
200244
201 //#region Tokens transfer rate limit baskets245 //#region Tokens transfer sponosoring rate limit baskets
202 /// (Collection id (controlled?2), who created (real))246 /// (Collection id (controlled?2), who created (real))
203 /// TODO: Off chain worker should remove from this map when collection gets removed247 /// TODO: Off chain worker should remove from this map when collection gets removed
204 pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => Option<T::BlockNumber>;248 pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => Option<T::BlockNumber>;
214 /// Collection id (controlled?2), token id (controlled?2)258 /// Collection id (controlled?2), token id (controlled?2)
215 #[deprecated]259 #[deprecated]
216 pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber>;260 pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber>;
261 /// Last sponsoring of token property setting // todo:doc rephrase this and the following
217 pub TokenPropertyBasket get(fn token_property_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber>;262 pub TokenPropertyBasket get(fn token_property_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber>;
218263
219 /// Approval sponsoring264 /// Last sponsoring of NFT approval in a collection
220 pub NftApproveBasket get(fn nft_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber>;265 pub NftApproveBasket get(fn nft_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber>;
266 /// Last sponsoring of fungible tokens approval in a collection
221 pub FungibleApproveBasket get(fn fungible_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => Option<T::BlockNumber>;267 pub FungibleApproveBasket get(fn fungible_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => Option<T::BlockNumber>;
268 /// Last sponsoring of RFT approval in a collection
222 pub RefungibleApproveBasket get(fn refungible_approve_basket): nmap hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId, hasher(twox_64_concat) T::AccountId => Option<T::BlockNumber>;269 pub RefungibleApproveBasket get(fn refungible_approve_basket): nmap hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId, hasher(twox_64_concat) T::AccountId => Option<T::BlockNumber>;
223 }270 }
224}271}
225272
226decl_module! {273decl_module! {
274 /// Type alias to Pallet, to be used by construct_runtime.
227 pub struct Module<T: Config> for enum Call275 pub struct Module<T: Config> for enum Call
228 where276 where
229 origin: T::Origin277 origin: T::Origin
244 0292 0
245 }293 }
246294
247 /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner of the collection is set to the address that signed the transaction and can be changed later.295 /// Create a collection of tokens.
296 ///
297 /// Each Token may have multiple properties encoded as an array of bytes
298 /// of certain length. The initial owner of the collection is set
299 /// to the address that signed the transaction and can be changed later.
300 ///
301 /// Prefer the more advanced [`create_collection_ex`][`Pallet::create_collection_ex`] instead.
248 ///302 ///
249 /// # Permissions303 /// # Permissions
250 ///304 ///
251 /// * Anyone.305 /// * Anyone - becomes the owner of the new collection.
252 ///306 ///
253 /// # Arguments307 /// # Arguments
254 ///308 ///
255 /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.309 /// * `collection_name`: Wide-character string with collection name
256 ///310 /// (limit [`MAX_COLLECTION_NAME_LENGTH`]).
257 /// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.311 /// * `collection_description`: Wide-character string with collection description
258 ///312 /// (limit [`MAX_COLLECTION_DESCRIPTION_LENGTH`]).
259 /// * token_prefix: UTF-8 string with token prefix.313 /// * `token_prefix`: Byte string containing the token prefix to mark a collection
260 ///314 /// to which a token belongs (limit [`MAX_TOKEN_PREFIX_LENGTH`]).
261 /// * mode: [CollectionMode] collection type and type dependent data.315 /// * `mode`: Type of items stored in the collection and type dependent data.
262 // returns collection ID316 // returns collection ID
263 #[weight = <SelfWeightOf<T>>::create_collection()]317 #[weight = <SelfWeightOf<T>>::create_collection()]
264 #[transactional]318 #[transactional]
265 #[deprecated]319 #[deprecated(note = "`create_collection_ex` is more up-to-date and advanced, prefer it instead")]
266 pub fn create_collection(origin,320 pub fn create_collection(
321 origin,
267 collection_name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,322 collection_name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,
278 Self::create_collection_ex(origin, data)334 Self::create_collection_ex(origin, data)
279 }335 }
280336
281 /// This method creates a collection337 /// Create a collection with explicit parameters.
282 ///338 ///
283 /// Prefer it to deprecated [`created_collection`] method339 /// Prefer it to the deprecated [`create_collection`][`Pallet::create_collection`] method.
340 ///
341 /// # Permissions
342 ///
343 /// * Anyone - becomes the owner of the new collection.
344 ///
345 /// # Arguments
346 ///
347 /// * `data`: Explicit data of a collection used for its creation.
284 #[weight = <SelfWeightOf<T>>::create_collection()]348 #[weight = <SelfWeightOf<T>>::create_collection()]
285 #[transactional]349 #[transactional]
286 pub fn create_collection_ex(origin, data: CreateCollectionData<T::AccountId>) -> DispatchResult {350 pub fn create_collection_ex(origin, data: CreateCollectionData<T::AccountId>) -> DispatchResult {
293 Ok(())357 Ok(())
294 }358 }
295359
296 /// Destroys collection if no tokens within this collection360 /// Destroy a collection if no tokens exist within.
297 ///361 ///
298 /// # Permissions362 /// # Permissions
299 ///363 ///
300 /// * Collection Owner.364 /// * Collection owner
301 ///365 ///
302 /// # Arguments366 /// # Arguments
303 ///367 ///
304 /// * collection_id: collection to destroy.368 /// * `collection_id`: Collection to destroy.
305 #[weight = <SelfWeightOf<T>>::destroy_collection()]369 #[weight = <SelfWeightOf<T>>::destroy_collection()]
306 #[transactional]370 #[transactional]
307 pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {371 pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {
328 ///392 ///
329 /// # Permissions393 /// # Permissions
330 ///394 ///
331 /// * Collection Owner395 /// * Collection owner
332 /// * Collection Admin396 /// * Collection admin
333 ///397 ///
334 /// # Arguments398 /// # Arguments
335 ///399 ///
336 /// * collection_id.400 /// * `collection_id`: ID of the modified collection.
337 ///401 /// * `address`: ID of the address to be added to the allowlist.
338 /// * address.
339 #[weight = <SelfWeightOf<T>>::add_to_allow_list()]402 #[weight = <SelfWeightOf<T>>::add_to_allow_list()]
340 #[transactional]403 #[transactional]
341 pub fn add_to_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{404 pub fn add_to_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
363 ///426 ///
364 /// # Permissions427 /// # Permissions
365 ///428 ///
366 /// * Collection Owner429 /// * Collection owner
367 /// * Collection Admin430 /// * Collection admin
368 ///431 ///
369 /// # Arguments432 /// # Arguments
370 ///433 ///
371 /// * collection_id.434 /// * `collection_id`: ID of the modified collection.
372 ///435 /// * `address`: ID of the address to be removed from the allowlist.
373 /// * address.
374 #[weight = <SelfWeightOf<T>>::remove_from_allow_list()]436 #[weight = <SelfWeightOf<T>>::remove_from_allow_list()]
375 #[transactional]437 #[transactional]
376 pub fn remove_from_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{438 pub fn remove_from_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
398 ///460 ///
399 /// # Permissions461 /// # Permissions
400 ///462 ///
401 /// * Collection Owner.463 /// * Collection owner
402 ///464 ///
403 /// # Arguments465 /// # Arguments
404 ///466 ///
405 /// * collection_id.467 /// * `collection_id`: ID of the modified collection.
406 ///468 /// * `new_owner`: ID of the account that will become the owner.
407 /// * new_owner.
408 #[weight = <SelfWeightOf<T>>::change_collection_owner()]469 #[weight = <SelfWeightOf<T>>::change_collection_owner()]
409 #[transactional]470 #[transactional]
410 pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {471 pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {
424 target_collection.save()485 target_collection.save()
425 }486 }
426487
427 /// Adds an admin of the Collection.488 /// Add an admin to a collection.
428 /// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.489 ///
490 /// NFT Collection can be controlled by multiple admin addresses
491 /// (some which can also be servers, for example). Admins can issue
492 /// and burn NFTs, as well as add and remove other admins,
493 /// but cannot change NFT or Collection ownership.
429 ///494 ///
430 /// # Permissions495 /// # Permissions
431 ///496 ///
432 /// * Collection Owner.497 /// * Collection owner
433 /// * Collection Admin.498 /// * Collection admin
434 ///499 ///
435 /// # Arguments500 /// # Arguments
436 ///501 ///
437 /// * collection_id: ID of the Collection to add admin for.502 /// * `collection_id`: ID of the Collection to add an admin for.
438 ///
439 /// * new_admin_id: Address of new admin to add.503 /// * `new_admin`: Address of new admin to add.
440 #[weight = <SelfWeightOf<T>>::add_collection_admin()]504 #[weight = <SelfWeightOf<T>>::add_collection_admin()]
441 #[transactional]505 #[transactional]
442 pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult {506 pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult {
443 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);507 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
444 let collection = <CollectionHandle<T>>::try_get(collection_id)?;508 let collection = <CollectionHandle<T>>::try_get(collection_id)?;
445 collection.check_is_internal()?;509 collection.check_is_internal()?;
446510
447 <Pallet<T>>::deposit_event(Event::<T>::CollectionAdminAdded(511 <Pallet<T>>::deposit_event(Event::<T>::CollectionAdminAdded(
448 collection_id,512 collection_id,
449 new_admin_id.clone()513 new_admin.clone()
450 ));514 ));
451515
452 <PalletCommon<T>>::toggle_admin(&collection, &sender, &new_admin_id, true)516 <PalletCommon<T>>::toggle_admin(&collection, &sender, &new_admin, true)
453 }517 }
454518
455 /// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.519 /// Remove admin of a collection.
520 ///
521 /// An admin address can remove itself. List of admins may become empty,
522 /// in which case only Collection Owner will be able to add an Admin.
456 ///523 ///
457 /// # Permissions524 /// # Permissions
458 ///525 ///
459 /// * Collection Owner.526 /// * Collection owner
460 /// * Collection Admin.527 /// * Collection admin
461 ///528 ///
462 /// # Arguments529 /// # Arguments
463 ///530 ///
464 /// * collection_id: ID of the Collection to remove admin for.531 /// * `collection_id`: ID of the collection to remove the admin for.
465 ///
466 /// * account_id: Address of admin to remove.532 /// * `account_id`: Address of the admin to remove.
467 #[weight = <SelfWeightOf<T>>::remove_collection_admin()]533 #[weight = <SelfWeightOf<T>>::remove_collection_admin()]
468 #[transactional]534 #[transactional]
469 pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {535 pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {
479 <PalletCommon<T>>::toggle_admin(&collection, &sender, &account_id, false)545 <PalletCommon<T>>::toggle_admin(&collection, &sender, &account_id, false)
480 }546 }
481547
548 /// Set (invite) a new collection sponsor.
549 ///
550 /// If successful, confirmation from the sponsor-to-be will be pending.
551 ///
482 /// # Permissions552 /// # Permissions
483 ///553 ///
484 /// * Collection Owner554 /// * Collection owner
555 /// * Collection admin
485 ///556 ///
486 /// # Arguments557 /// # Arguments
487 ///558 ///
488 /// * collection_id.559 /// * `collection_id`: ID of the modified collection.
489 ///560 /// * `new_sponsor`: ID of the account of the sponsor-to-be.
490 /// * new_sponsor.
491 #[weight = <SelfWeightOf<T>>::set_collection_sponsor()]561 #[weight = <SelfWeightOf<T>>::set_collection_sponsor()]
492 #[transactional]562 #[transactional]
493 pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {563 pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {
507 target_collection.save()577 target_collection.save()
508 }578 }
509579
580 /// Confirm own sponsorship of a collection, becoming the sponsor.
581 ///
582 /// An invitation must be pending, see [`set_collection_sponsor`][`Pallet::set_collection_sponsor`].
583 /// Sponsor can pay the fees of a transaction instead of the sender,
584 /// but only within specified limits.
585 ///
510 /// # Permissions586 /// # Permissions
511 ///587 ///
512 /// * Sponsor.588 /// * Sponsor-to-be
513 ///589 ///
514 /// # Arguments590 /// # Arguments
515 ///591 ///
516 /// * collection_id.592 /// * `collection_id`: ID of the collection with the pending sponsor.
517 #[weight = <SelfWeightOf<T>>::confirm_sponsorship()]593 #[weight = <SelfWeightOf<T>>::confirm_sponsorship()]
518 #[transactional]594 #[transactional]
519 pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {595 pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {
534 target_collection.save()610 target_collection.save()
535 }611 }
536612
537 /// Switch back to pay-per-own-transaction model.613 /// Remove a collection's a sponsor, making everyone pay for their own transactions.
538 ///614 ///
539 /// # Permissions615 /// # Permissions
540 ///616 ///
541 /// * Collection owner.617 /// * Collection owner
542 ///618 ///
543 /// # Arguments619 /// # Arguments
544 ///620 ///
545 /// * collection_id.621 /// * `collection_id`: ID of the collection with the sponsor to remove.
546 #[weight = <SelfWeightOf<T>>::remove_collection_sponsor()]622 #[weight = <SelfWeightOf<T>>::remove_collection_sponsor()]
547 #[transactional]623 #[transactional]
548 pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {624 pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {
560 target_collection.save()636 target_collection.save()
561 }637 }
562638
563 /// This method creates a concrete instance of NFT Collection created with CreateCollection method.639 /// Mint an item within a collection.
640 ///
641 /// A collection must exist first, see [`create_collection_ex`][`Pallet::create_collection_ex`].
564 ///642 ///
565 /// # Permissions643 /// # Permissions
566 ///644 ///
567 /// * Collection Owner.645 /// * Collection owner
568 /// * Collection Admin.646 /// * Collection admin
569 /// * Anyone if647 /// * Anyone if
570 /// * Allow List is enabled, and648 /// * Allow List is enabled, and
571 /// * Address is added to allow list, and649 /// * Address is added to allow list, and
572 /// * MintPermission is enabled (see SetMintPermission method)650 /// * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`])
573 ///651 ///
574 /// # Arguments652 /// # Arguments
575 ///653 ///
576 /// * collection_id: ID of the collection.654 /// * `collection_id`: ID of the collection to which an item would belong.
577 ///
578 /// * owner: Address, initial owner of the NFT.655 /// * `owner`: Address of the initial owner of the item.
579 ///
580 /// * data: Token data to store on chain.656 /// * `data`: Token data describing the item to store on chain.
581 #[weight = T::CommonWeightInfo::create_item()]657 #[weight = T::CommonWeightInfo::create_item()]
582 #[transactional]658 #[transactional]
583 pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo {659 pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo {
587 dispatch_tx::<T, _>(collection_id, |d| d.create_item(sender, owner, data, &budget))663 dispatch_tx::<T, _>(collection_id, |d| d.create_item(sender, owner, data, &budget))
588 }664 }
589665
590 /// This method creates multiple items in a collection created with CreateCollection method.666 /// Create multiple items within a collection.
667 ///
668 /// A collection must exist first, see [`create_collection_ex`][`Pallet::create_collection_ex`].
591 ///669 ///
592 /// # Permissions670 /// # Permissions
593 ///671 ///
594 /// * Collection Owner.672 /// * Collection owner
595 /// * Collection Admin.673 /// * Collection admin
596 /// * Anyone if674 /// * Anyone if
597 /// * Allow List is enabled, and675 /// * Allow List is enabled, and
598 /// * Address is added to allow list, and676 /// * Address is added to the allow list, and
599 /// * MintPermission is enabled (see SetMintPermission method)677 /// * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`])
600 ///678 ///
601 /// # Arguments679 /// # Arguments
602 ///680 ///
603 /// * collection_id: ID of the collection.681 /// * `collection_id`: ID of the collection to which the tokens would belong.
604 ///
605 /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
606 ///
607 /// * owner: Address, initial owner of the NFT.682 /// * `owner`: Address of the initial owner of the tokens.
683 /// * `items_data`: Vector of data describing each item to be created.
608 #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)]684 #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)]
609 #[transactional]685 #[transactional]
610 pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResultWithPostInfo {686 pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResultWithPostInfo {
615 dispatch_tx::<T, _>(collection_id, |d| d.create_multiple_items(sender, owner, items_data, &budget))691 dispatch_tx::<T, _>(collection_id, |d| d.create_multiple_items(sender, owner, items_data, &budget))
616 }692 }
617693
694 /// Add or change collection properties.
695 ///
696 /// # Permissions
697 ///
698 /// * Collection owner
699 /// * Collection admin
700 ///
701 /// # Arguments
702 ///
703 /// * `collection_id`: ID of the modified collection.
704 /// * `properties`: Vector of key-value pairs stored as the collection's metadata.
705 /// Keys support Latin letters, `-`, `_`, and `.` as symbols.
618 #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)]706 #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)]
619 #[transactional]707 #[transactional]
620 pub fn set_collection_properties(708 pub fn set_collection_properties(
629 dispatch_tx::<T, _>(collection_id, |d| d.set_collection_properties(sender, properties))717 dispatch_tx::<T, _>(collection_id, |d| d.set_collection_properties(sender, properties))
630 }718 }
631719
720 /// Delete specified collection properties.
721 ///
722 /// # Permissions
723 ///
724 /// * Collection Owner
725 /// * Collection Admin
726 ///
727 /// # Arguments
728 ///
729 /// * `collection_id`: ID of the modified collection.
730 /// * `property_keys`: Vector of keys of the properties to be deleted.
731 /// Keys support Latin letters, `-`, `_`, and `.` as symbols.
632 #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)]732 #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)]
633 #[transactional]733 #[transactional]
634 pub fn delete_collection_properties(734 pub fn delete_collection_properties(
643 dispatch_tx::<T, _>(collection_id, |d| d.delete_collection_properties(&sender, property_keys))743 dispatch_tx::<T, _>(collection_id, |d| d.delete_collection_properties(&sender, property_keys))
644 }744 }
645745
746 /// Add or change token properties according to collection's permissions.
747 /// Currently properties only work with NFTs.
748 ///
749 /// # Permissions
750 ///
751 /// * Depends on collection's token property permissions and specified property mutability:
752 /// * Collection owner
753 /// * Collection admin
754 /// * Token owner
755 ///
756 /// See [`set_token_property_permissions`][`Pallet::set_token_property_permissions`].
757 ///
758 /// # Arguments
759 ///
760 /// * `collection_id: ID of the collection to which the token belongs.
761 /// * `token_id`: ID of the modified token.
762 /// * `properties`: Vector of key-value pairs stored as the token's metadata.
763 /// Keys support Latin letters, `-`, `_`, and `.` as symbols.
646 #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)]764 #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)]
647 #[transactional]765 #[transactional]
648 pub fn set_token_properties(766 pub fn set_token_properties(
659 dispatch_tx::<T, _>(collection_id, |d| d.set_token_properties(sender, token_id, properties, &budget))777 dispatch_tx::<T, _>(collection_id, |d| d.set_token_properties(sender, token_id, properties, &budget))
660 }778 }
661779
780 /// Delete specified token properties. Currently properties only work with NFTs.
781 ///
782 /// # Permissions
783 ///
784 /// * Depends on collection's token property permissions and specified property mutability:
785 /// * Collection owner
786 /// * Collection admin
787 /// * Token owner
788 ///
789 /// # Arguments
790 ///
791 /// * `collection_id`: ID of the collection to which the token belongs.
792 /// * `token_id`: ID of the modified token.
793 /// * `property_keys`: Vector of keys of the properties to be deleted.
794 /// Keys support Latin letters, `-`, `_`, and `.` as symbols.
662 #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)]795 #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)]
663 #[transactional]796 #[transactional]
664 pub fn delete_token_properties(797 pub fn delete_token_properties(
675 dispatch_tx::<T, _>(collection_id, |d| d.delete_token_properties(sender, token_id, property_keys, &budget))808 dispatch_tx::<T, _>(collection_id, |d| d.delete_token_properties(sender, token_id, property_keys, &budget))
676 }809 }
677810
811 /// Add or change token property permissions of a collection.
812 ///
813 /// Without a permission for a particular key, a property with that key
814 /// cannot be created in a token.
815 ///
816 /// # Permissions
817 ///
818 /// * Collection owner
819 /// * Collection admin
820 ///
821 /// # Arguments
822 ///
823 /// * `collection_id`: ID of the modified collection.
824 /// * `property_permissions`: Vector of permissions for property keys.
825 /// Keys support Latin letters, `-`, `_`, and `.` as symbols.
678 #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)]826 #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)]
679 #[transactional]827 #[transactional]
680 pub fn set_token_property_permissions(828 pub fn set_token_property_permissions(
689 dispatch_tx::<T, _>(collection_id, |d| d.set_token_property_permissions(&sender, property_permissions))837 dispatch_tx::<T, _>(collection_id, |d| d.set_token_property_permissions(&sender, property_permissions))
690 }838 }
691839
840 /// Create multiple items within a collection with explicitly specified initial parameters.
841 ///
842 /// # Permissions
843 ///
844 /// * Collection owner
845 /// * Collection admin
846 /// * Anyone if
847 /// * Allow List is enabled, and
848 /// * Address is added to allow list, and
849 /// * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`])
850 ///
851 /// # Arguments
852 ///
853 /// * `collection_id`: ID of the collection to which the tokens would belong.
854 /// * `data`: Explicit item creation data.
692 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]855 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]
693 #[transactional]856 #[transactional]
694 pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData<T::CrossAccountId>) -> DispatchResultWithPostInfo {857 pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData<T::CrossAccountId>) -> DispatchResultWithPostInfo {
698 dispatch_tx::<T, _>(collection_id, |d| d.create_multiple_items_ex(sender, data, &budget))861 dispatch_tx::<T, _>(collection_id, |d| d.create_multiple_items_ex(sender, data, &budget))
699 }862 }
700863
701 /// Set transfers_enabled value for particular collection864 /// Completely allow or disallow transfers for a particular collection.
702 ///865 ///
703 /// # Permissions866 /// # Permissions
704 ///867 ///
705 /// * Collection Owner.868 /// * Collection owner
706 ///869 ///
707 /// # Arguments870 /// # Arguments
708 ///871 ///
709 /// * collection_id: ID of the collection.872 /// * `collection_id`: ID of the collection.
710 ///873 /// * `value`: New value of the flag, are transfers allowed?
711 /// * value: New flag value.
712 #[weight = <SelfWeightOf<T>>::set_transfers_enabled_flag()]874 #[weight = <SelfWeightOf<T>>::set_transfers_enabled_flag()]
713 #[transactional]875 #[transactional]
714 pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {876 pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {
723 target_collection.save()885 target_collection.save()
724 }886 }
725887
726 /// Destroys a concrete instance of NFT.888 /// Destroy an item.
727 ///889 ///
728 /// # Permissions890 /// # Permissions
729 ///891 ///
730 /// * Collection Owner.892 /// * Collection owner
731 /// * Collection Admin.893 /// * Collection admin
732 /// * Current NFT Owner.894 /// * Current item owner
733 ///895 ///
734 /// # Arguments896 /// # Arguments
735 ///897 ///
736 /// * collection_id: ID of the collection.898 /// * `collection_id`: ID of the collection to which the item belongs.
737 ///
738 /// * item_id: ID of NFT to burn.899 /// * `item_id`: ID of item to burn.
900 /// * `value`: Number of pieces of the item to destroy.
901 /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
902 /// * Fungible Mode: The desired number of pieces to burn.
903 /// * Re-Fungible Mode: The desired number of pieces to burn.
739 #[weight = T::CommonWeightInfo::burn_item()]904 #[weight = T::CommonWeightInfo::burn_item()]
740 #[transactional]905 #[transactional]
741 pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {906 pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {
752 Ok(post_info)917 Ok(post_info)
753 }918 }
754919
755 /// Destroys a concrete instance of NFT on behalf of the owner920 /// Destroy a token on behalf of the owner as a non-owner account.
921 ///
756 /// See also: [`approve`]922 /// See also: [`approve`][`Pallet::approve`].
923 ///
924 /// After this method executes, one approval is removed from the total so that
925 /// the approved address will not be able to transfer this item again from this owner.
757 ///926 ///
758 /// # Permissions927 /// # Permissions
759 ///928 ///
760 /// * Collection Owner.929 /// * Collection owner
761 /// * Collection Admin.930 /// * Collection admin
762 /// * Current NFT Owner.931 /// * Current token owner
932 /// * Address approved by current item owner
763 ///933 ///
764 /// # Arguments934 /// # Arguments
765 ///935 ///
936 /// * `from`: The owner of the burning item.
766 /// * collection_id: ID of the collection.937 /// * `collection_id`: ID of the collection to which the item belongs.
767 ///
768 /// * item_id: ID of NFT to burn.938 /// * `item_id`: ID of item to burn.
769 ///939 /// * `value`: Number of pieces to burn.
770 /// * from: owner of item940 /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
941 /// * Fungible Mode: The desired number of pieces to burn.
942 /// * Re-Fungible Mode: The desired number of pieces to burn.
771 #[weight = T::CommonWeightInfo::burn_from()]943 #[weight = T::CommonWeightInfo::burn_from()]
772 #[transactional]944 #[transactional]
773 pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {945 pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {
781 ///953 ///
782 /// # Permissions954 /// # Permissions
783 ///955 ///
784 /// * Collection Owner956 /// * Collection owner
785 /// * Collection Admin957 /// * Collection admin
786 /// * Current NFT owner958 /// * Current token owner
787 ///959 ///
788 /// # Arguments960 /// # Arguments
789 ///961 ///
790 /// * recipient: Address of token recipient.962 /// * `recipient`: Address of token recipient.
791 ///963 /// * `collection_id`: ID of the collection the item belongs to.
792 /// * collection_id.
793 ///
794 /// * item_id: ID of the item964 /// * `item_id`: ID of the item.
795 /// * Non-Fungible Mode: Required.965 /// * Non-Fungible Mode: Required.
796 /// * Fungible Mode: Ignored.966 /// * Fungible Mode: Ignored.
797 /// * Re-Fungible Mode: Required.967 /// * Re-Fungible Mode: Required.
798 ///968 ///
799 /// * value: Amount to transfer.969 /// * `value`: Amount to transfer.
800 /// * Non-Fungible Mode: Ignored970 /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
801 /// * Fungible Mode: Must specify transferred amount971 /// * Fungible Mode: The desired number of pieces to transfer.
802 /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)972 /// * Re-Fungible Mode: The desired number of pieces to transfer.
803 #[weight = T::CommonWeightInfo::transfer()]973 #[weight = T::CommonWeightInfo::transfer()]
804 #[transactional]974 #[transactional]
805 pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {975 pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {
809 dispatch_tx::<T, _>(collection_id, |d| d.transfer(sender, recipient, item_id, value, &budget))979 dispatch_tx::<T, _>(collection_id, |d| d.transfer(sender, recipient, item_id, value, &budget))
810 }980 }
811981
812 /// Set, change, or remove approved address to transfer the ownership of the NFT.982 /// Allow a non-permissioned address to transfer or burn an item.
813 ///983 ///
814 /// # Permissions984 /// # Permissions
815 ///985 ///
816 /// * Collection Owner986 /// * Collection owner
817 /// * Collection Admin987 /// * Collection admin
818 /// * Current NFT owner988 /// * Current item owner
819 ///989 ///
820 /// # Arguments990 /// # Arguments
821 ///991 ///
822 /// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).992 /// * `spender`: Account to be approved to make specific transactions on non-owned tokens.
823 ///993 /// * `collection_id`: ID of the collection the item belongs to.
824 /// * collection_id.
825 ///
826 /// * item_id: ID of the item.994 /// * `item_id`: ID of the item transactions on which are now approved.
995 /// * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs).
996 /// Set to 0 to revoke the approval.
827 #[weight = T::CommonWeightInfo::approve()]997 #[weight = T::CommonWeightInfo::approve()]
828 #[transactional]998 #[transactional]
829 pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo {999 pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo {
832 dispatch_tx::<T, _>(collection_id, |d| d.approve(sender, spender, item_id, amount))1002 dispatch_tx::<T, _>(collection_id, |d| d.approve(sender, spender, item_id, amount))
833 }1003 }
8341004
835 /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.1005 /// Change ownership of an item on behalf of the owner as a non-owner account.
836 ///1006 ///
837 /// # Permissions1007 /// See the [`approve`][`Pallet::approve`] method for additional information.
838 /// * Collection Owner
839 /// * Collection Admin
840 /// * Current NFT owner
841 /// * Address approved by current NFT owner
842 ///1008 ///
843 /// # Arguments1009 /// After this method executes, one approval is removed from the total so that
1010 /// the approved address will not be able to transfer this item again from this owner.
844 ///1011 ///
845 /// * from: Address that owns token.1012 /// # Permissions
846 ///1013 ///
847 /// * recipient: Address of token recipient.1014 /// * Collection owner
848 ///
849 /// * collection_id.1015 /// * Collection admin
1016 /// * Current item owner
1017 /// * Address approved by current item owner
850 ///1018 ///
851 /// * item_id: ID of the item.1019 /// # Arguments
852 ///1020 ///
1021 /// * `from`: Address that currently owns the token.
1022 /// * `recipient`: Address of the new token-owner-to-be.
1023 /// * `collection_id`: ID of the collection the item.
1024 /// * `item_id`: ID of the item to be transferred.
853 /// * value: Amount to transfer.1025 /// * `value`: Amount to transfer.
1026 /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
1027 /// * Fungible Mode: The desired number of pieces to transfer.
1028 /// * Re-Fungible Mode: The desired number of pieces to transfer.
854 #[weight = T::CommonWeightInfo::transfer_from()]1029 #[weight = T::CommonWeightInfo::transfer_from()]
855 #[transactional]1030 #[transactional]
856 pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo {1031 pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo {
860 dispatch_tx::<T, _>(collection_id, |d| d.transfer_from(sender, from, recipient, item_id, value, &budget))1035 dispatch_tx::<T, _>(collection_id, |d| d.transfer_from(sender, from, recipient, item_id, value, &budget))
861 }1036 }
8621037
1038 /// Set specific limits of a collection. Empty, or None fields mean chain default.
1039 ///
1040 /// # Permissions
1041 ///
1042 /// * Collection owner
1043 /// * Collection admin
1044 ///
1045 /// # Arguments
1046 ///
1047 /// * `collection_id`: ID of the modified collection.
1048 /// * `new_limit`: New limits of the collection. Fields that are not set (None)
1049 /// will not overwrite the old ones.
863 #[weight = <SelfWeightOf<T>>::set_collection_limits()]1050 #[weight = <SelfWeightOf<T>>::set_collection_limits()]
864 #[transactional]1051 #[transactional]
865 pub fn set_collection_limits(1052 pub fn set_collection_limits(
882 target_collection.save()1069 target_collection.save()
883 }1070 }
8841071
1072 /// Set specific permissions of a collection. Empty, or None fields mean chain default.
1073 ///
1074 /// # Permissions
1075 ///
1076 /// * Collection owner
1077 /// * Collection admin
1078 ///
1079 /// # Arguments
1080 ///
1081 /// * `collection_id`: ID of the modified collection.
1082 /// * `new_permission`: New permissions of the collection. Fields that are not set (None)
1083 /// will not overwrite the old ones.
885 #[weight = <SelfWeightOf<T>>::set_collection_limits()]1084 #[weight = <SelfWeightOf<T>>::set_collection_limits()]
886 #[transactional]1085 #[transactional]
887 pub fn set_collection_permissions(1086 pub fn set_collection_permissions(
888 origin,1087 origin,
889 collection_id: CollectionId,1088 collection_id: CollectionId,
890 new_limit: CollectionPermissions,1089 new_permission: CollectionPermissions,
891 ) -> DispatchResult {1090 ) -> DispatchResult {
892 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);1091 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
893 let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;1092 let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
894 target_collection.check_is_internal()?;1093 target_collection.check_is_internal()?;
895 target_collection.check_is_owner_or_admin(&sender)?;1094 target_collection.check_is_owner_or_admin(&sender)?;
896 let old_limit = &target_collection.permissions;1095 let old_limit = &target_collection.permissions;
8971096
898 target_collection.permissions = <PalletCommon<T>>::clamp_permissions(target_collection.mode.clone(), &old_limit, new_limit)?;1097 target_collection.permissions = <PalletCommon<T>>::clamp_permissions(target_collection.mode.clone(), &old_limit, new_permission)?;
8991098
900 <Pallet<T>>::deposit_event(Event::<T>::CollectionPermissionSet(1099 <Pallet<T>>::deposit_event(Event::<T>::CollectionPermissionSet(
901 collection_id1100 collection_id
904 target_collection.save()1103 target_collection.save()
905 }1104 }
9061105
1106 /// Re-partition a refungible token, while owning all of its parts/pieces.
1107 ///
1108 /// # Permissions
1109 ///
1110 /// * Token owner (must own every part)
1111 ///
1112 /// # Arguments
1113 ///
1114 /// * `collection_id`: ID of the collection the RFT belongs to.
1115 /// * `token_id`: ID of the RFT.
1116 /// * `amount`: New number of parts/pieces into which the token shall be partitioned.
907 #[weight = T::RefungibleExtensionsWeightInfo::repartition()]1117 #[weight = T::RefungibleExtensionsWeightInfo::repartition()]
908 #[transactional]1118 #[transactional]
909 pub fn repartition(1119 pub fn repartition(
910 origin,1120 origin,
911 collection_id: CollectionId,1121 collection_id: CollectionId,
912 token: TokenId,1122 token_id: TokenId,
913 amount: u128,1123 amount: u128,
914 ) -> DispatchResultWithPostInfo {1124 ) -> DispatchResultWithPostInfo {
915 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);1125 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
916 dispatch_tx::<T, _>(collection_id, |d| {1126 dispatch_tx::<T, _>(collection_id, |d| {
917 if let Some(refungible_extensions) = d.refungible_extensions() {1127 if let Some(refungible_extensions) = d.refungible_extensions() {
918 refungible_extensions.repartition(&sender, token, amount)1128 refungible_extensions.repartition(&sender, token_id, amount)
919 } else {1129 } else {
920 fail!(<Error<T>>::RepartitionCalledOnNonRefungibleCollection)1130 fail!(<Error<T>>::RepartitionCalledOnNonRefungibleCollection)
921 }1131 }
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
197#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]197#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
198pub enum CollectionMode {198pub enum CollectionMode {
199 NFT,199 NFT,
200 // decimal points
201 Fungible(DecimalPoints),200 Fungible(DecimalPoints),
202 ReFungible,201 ReFungible,
203}202}
252pub enum SponsorshipState<AccountId> {251pub enum SponsorshipState<AccountId> {
253 /// The fees are applied to the transaction sender252 /// The fees are applied to the transaction sender
254 Disabled,253 Disabled,
254 /// Pending confirmation from a sponsor-to-be
255 Unconfirmed(AccountId),255 Unconfirmed(AccountId),
256 /// Transactions are sponsored by specified account256 /// Transactions are sponsored by specified account
257 Confirmed(AccountId),257 Confirmed(AccountId),
258}258}
259259
260impl<AccountId> SponsorshipState<AccountId> {260impl<AccountId> SponsorshipState<AccountId> {
261 /// Get the acting sponsor account, if present
261 pub fn sponsor(&self) -> Option<&AccountId> {262 pub fn sponsor(&self) -> Option<&AccountId> {
262 match self {263 match self {
263 Self::Confirmed(sponsor) => Some(sponsor),264 Self::Confirmed(sponsor) => Some(sponsor),
264 _ => None,265 _ => None,
265 }266 }
266 }267 }
267268
269 /// Get the sponsor account currently pending confirmation, if present
268 pub fn pending_sponsor(&self) -> Option<&AccountId> {270 pub fn pending_sponsor(&self) -> Option<&AccountId> {
269 match self {271 match self {
270 Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),272 Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),
271 _ => None,273 _ => None,
272 }274 }
273 }275 }
274276
277 /// Is sponsorship set and acting
275 pub fn confirmed(&self) -> bool {278 pub fn confirmed(&self) -> bool {
276 matches!(self, Self::Confirmed(_))279 matches!(self, Self::Confirmed(_))
277 }280 }
283 }286 }
284}287}
285288
286/// Used in storage289/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version).
287#[struct_versioning::versioned(version = 2, upper)]290#[struct_versioning::versioned(version = 2, upper)]
288#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)]291#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
289pub struct Collection<AccountId> {292pub struct Collection<AccountId> {
324 pub meta_update_permission: MetaUpdatePermission,327 pub meta_update_permission: MetaUpdatePermission,
325}328}
326329
327/// Used in RPC calls330/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version).
328#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]331#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]
329#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]332#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
330pub struct RpcCollection<AccountId> {333pub struct RpcCollection<AccountId> {
362365
363pub type CollectionPropertiesVec = BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;366pub type CollectionPropertiesVec = BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;
364367
368/// Limits and restrictions of a collection.
365/// All fields are wrapped in `Option`s, where None means chain default369/// All fields are wrapped in `Option`s, where None means chain default.
370///
371/// todo:doc links to chain defaults
366// When adding/removing fields from this struct - don't forget to also update clamp_limits372// IMPORTANT: When adding/removing fields from this struct - don't forget to also
373// update clamp_limits() in pallet-common.
367#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]374#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
368#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]375#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
369pub struct CollectionLimits {376pub struct CollectionLimits {
377 /// Maximum number of owned tokens per account. Chain default: [`ACCOUNT_TOKEN_OWNERSHIP_LIMIT`]
370 pub account_token_ownership_limit: Option<u32>,378 pub account_token_ownership_limit: Option<u32>,
379 /// Maximum size of data in bytes of a sponsored transaction. Chain default: [`CUSTOM_DATA_LIMIT`]
371 pub sponsored_data_size: Option<u32>,380 pub sponsored_data_size: Option<u32>,
372381
373 /// FIXME should we delete this or repurpose it?382 /// FIXME should we delete this or repurpose it?
374 /// None - setVariableMetadata is not sponsored383 /// None - setVariableMetadata is not sponsored
375 /// Some(v) - setVariableMetadata is sponsored384 /// Some(v) - setVariableMetadata is sponsored
376 /// if there is v block between txs385 /// if there is v block between txs
386 ///
387 /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
377 pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,388 pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,
389 /// Maximum amount of tokens inside the collection. Chain default: [`COLLECTION_TOKEN_LIMIT`]
378 pub token_limit: Option<u32>,390 pub token_limit: Option<u32>,
379391
380 // Timeouts for item types in passed blocks392 /// Timeout for sponsoring a token transfer in passed blocks. Chain default:
393 /// either [`NFT_SPONSOR_TRANSFER_TIMEOUT`], [`FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`], or [`REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`],
394 /// depending on the collection type.
381 pub sponsor_transfer_timeout: Option<u32>,395 pub sponsor_transfer_timeout: Option<u32>,
396 /// Timeout for sponsoring an approval in passed blocks. Chain default: [`SPONSOR_APPROVE_TIMEOUT`]
382 pub sponsor_approve_timeout: Option<u32>,397 pub sponsor_approve_timeout: Option<u32>,
398 /// Can a token be transferred by the owner. Chain default: `false`
383 pub owner_can_transfer: Option<bool>,399 pub owner_can_transfer: Option<bool>,
400 /// Can a token be burned by the owner. Chain default: `true`
384 pub owner_can_destroy: Option<bool>,401 pub owner_can_destroy: Option<bool>,
402 /// Can a token be transferred at all. Chain default: `true`
385 pub transfers_enabled: Option<bool>,403 pub transfers_enabled: Option<bool>,
386}404}
387405
434 }452 }
435}453}
436454
437// When adding/removing fields from this struct - don't forget to also update clamp_limits455/// Permissions on certain operations within a collection.
456/// All fields are wrapped in `Option`s, where None means chain default.
457// IMPORTANT: When adding/removing fields from this struct - don't forget to also
458// update clamp_limits() in pallet-common.
438#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]459#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
439#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]460#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
440pub struct CollectionPermissions {461pub struct CollectionPermissions {
489 }510 }
490}511}
491512
513/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens.
492#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]514#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]
493#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]515#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
494#[derivative(Debug)]516#[derivative(Debug)]
505 pub permissive: bool,527 pub permissive: bool,
506}528}
507529
530/// Enum denominating how often can sponsoring occur if it is enabled.
508#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]531#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]
509#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]532#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
510pub enum SponsoringRateLimit {533pub enum SponsoringRateLimit {
534 /// Sponsoring is disabled, and the collection sponsor will not pay for transactions
511 SponsoringDisabled,535 SponsoringDisabled,
536 /// Once per how many blocks can sponsorship of a transaction type occur
512 Blocks(u32),537 Blocks(u32),
513}538}
514539
540/// Data used to describe an NFT at creation.
515#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]541#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]
516#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]542#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
517#[derivative(Debug)]543#[derivative(Debug)]
518pub struct CreateNftData {544pub struct CreateNftData {
545 /// Key-value pairs used to describe the token as metadata
519 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]546 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]
520 #[derivative(Debug(format_with = "bounded::vec_debug"))]547 #[derivative(Debug(format_with = "bounded::vec_debug"))]
521 pub properties: CollectionPropertiesVec,548 pub properties: CollectionPropertiesVec,
522}549}
523550
551/// Data used to describe a Fungible token at creation.
524#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]552#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]
525#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]553#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
526pub struct CreateFungibleData {554pub struct CreateFungibleData {
555 /// Number of fungible coins minted
527 pub value: u128,556 pub value: u128,
528}557}
529558
559/// Data used to describe a Refungible token at creation.
530#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]560#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]
531#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]561#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
532#[derivative(Debug)]562#[derivative(Debug)]
533pub struct CreateReFungibleData {563pub struct CreateReFungibleData {
564 /// Immutable metadata of the token
534 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]565 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]
535 #[derivative(Debug(format_with = "bounded::vec_debug"))]566 #[derivative(Debug(format_with = "bounded::vec_debug"))]
536 pub const_data: BoundedVec<u8, CustomDataLimit>,567 pub const_data: BoundedVec<u8, CustomDataLimit>,
537568
569 /// Number of pieces the RFT is split into
538 pub pieces: u128,570 pub pieces: u128,
539571
572 /// Key-value pairs used to describe the token as metadata
540 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]573 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]
541 #[derivative(Debug(format_with = "bounded::vec_debug"))]574 #[derivative(Debug(format_with = "bounded::vec_debug"))]
542 pub properties: CollectionPropertiesVec,575 pub properties: CollectionPropertiesVec,
550 None,583 None,
551}584}
552585
586/// Enum holding data used for creation of all three item types.
553#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]587#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
554#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]588#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
555pub enum CreateItemData {589pub enum CreateItemData {
558 ReFungible(CreateReFungibleData),592 ReFungible(CreateReFungibleData),
559}593}
560594
595/// Explicit NFT creation data with meta parameters.
561#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]596#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]
562#[derivative(Debug)]597#[derivative(Debug)]
563pub struct CreateNftExData<CrossAccountId> {598pub struct CreateNftExData<CrossAccountId> {
566 pub owner: CrossAccountId,601 pub owner: CrossAccountId,
567}602}
568603
604/// Explicit RFT creation data with meta parameters.
569#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]605#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]
570#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]606#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]
571pub struct CreateRefungibleExData<CrossAccountId> {607pub struct CreateRefungibleExData<CrossAccountId> {
577 pub properties: CollectionPropertiesVec,613 pub properties: CollectionPropertiesVec,
578}614}
579615
616/// Explicit item creation data with meta parameters, namely the owner.
580#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]617#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)]
581#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]618#[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))]
582pub enum CreateItemExData<CrossAccountId> {619pub enum CreateItemExData<CrossAccountId> {
624 }661 }
625}662}
626663
664/// Token's address, dictated by its collection and token IDs.
627#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]665#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
628#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]666#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
629// todo possibly rename to be used generally as an address pair667// todo possibly rename to be used generally as an address pair
modifiedtests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth
56 * Address is not in allow list.56 * Address is not in allow list.
57 **/57 **/
58 AddressNotInAllowlist: AugmentedError<ApiType>;58 AddressNotInAllowlist: AugmentedError<ApiType>;
59 /**59 /**
60 * Requested value more than approved.60 * Requested value is more than the approved
61 **/61 **/
62 ApprovedValueTooLow: AugmentedError<ApiType>;62 ApprovedValueTooLow: AugmentedError<ApiType>;
63 /**63 /**
64 * Tried to approve more than owned64 * Tried to approve more than owned
112 * Empty property keys are forbidden112 * Empty property keys are forbidden
113 **/113 **/
114 EmptyPropertyKey: AugmentedError<ApiType>;114 EmptyPropertyKey: AugmentedError<ApiType>;
115 /**115 /**
116 * Only ASCII letters, digits, and '_', '-' are allowed116 * Only ASCII letters, digits, and symbols `_`, `-`, and `.` are allowed
117 **/117 **/
118 InvalidCharacterInPropertyKey: AugmentedError<ApiType>;118 InvalidCharacterInPropertyKey: AugmentedError<ApiType>;
119 /**119 /**
120 * Metadata flag frozen120 * Metadata flag frozen
132 * Tried to store more property data than allowed132 * Tried to store more property data than allowed
133 **/133 **/
134 NoSpaceForProperty: AugmentedError<ApiType>;134 NoSpaceForProperty: AugmentedError<ApiType>;
135 /**135 /**
136 * Not sufficient funds to perform action136 * Insufficient funds to perform an action
137 **/137 **/
138 NotSufficientFounds: AugmentedError<ApiType>;138 NotSufficientFounds: AugmentedError<ApiType>;
139 /**139 /**
140 * Tried to enable permissions which are only permitted to be disabled140 * Tried to enable permissions which are only permitted to be disabled
152 * Collection is not in mint mode.152 * Collection is not in mint mode.
153 **/153 **/
154 PublicMintingNotAllowed: AugmentedError<ApiType>;154 PublicMintingNotAllowed: AugmentedError<ApiType>;
155 /**155 /**
156 * Only tokens from specific collections may nest tokens under this156 * Only tokens from specific collections may nest tokens under this one
157 **/157 **/
158 SourceCollectionIsNotAllowedToNest: AugmentedError<ApiType>;158 SourceCollectionIsNotAllowedToNest: AugmentedError<ApiType>;
159 /**159 /**
160 * Item not exists.160 * Item does not exist
161 **/161 **/
162 TokenNotFound: AugmentedError<ApiType>;162 TokenNotFound: AugmentedError<ApiType>;
163 /**163 /**
164 * Item balance not enough.164 * Item is balance not enough
165 **/165 **/
166 TokenValueTooLow: AugmentedError<ApiType>;166 TokenValueTooLow: AugmentedError<ApiType>;
167 /**167 /**
168 * Total collections bound exceeded.168 * Total collections bound exceeded.
172 * Collection settings not allowing items transferring172 * Collection settings not allowing items transferring
173 **/173 **/
174 TransferNotAllowed: AugmentedError<ApiType>;174 TransferNotAllowed: AugmentedError<ApiType>;
175 /**175 /**
176 * Target collection doesn't supports this operation176 * Target collection doesn't support this operation
177 **/177 **/
178 UnsupportedOperation: AugmentedError<ApiType>;178 UnsupportedOperation: AugmentedError<ApiType>;
179 /**179 /**
180 * User not passed nesting rule180 * User does not satisfy the nesting rule
181 **/181 **/
182 UserIsNotAllowedToNest: AugmentedError<ApiType>;182 UserIsNotAllowedToNest: AugmentedError<ApiType>;
183 /**183 /**
184 * Generic error184 * Generic error
284 * Tried to set data for fungible item.284 * Tried to set data for fungible item.
285 **/285 **/
286 FungibleItemsDontHaveData: AugmentedError<ApiType>;286 FungibleItemsDontHaveData: AugmentedError<ApiType>;
287 /**287 /**
288 * Not default id passed as TokenId argument.288 * Fungible tokens hold no ID, and the default value of TokenId for Fungible collection is 0.
289 * The default value of TokenId for Fungible collection is 0.289 **/
290 **/
291 FungibleItemsHaveNoId: AugmentedError<ApiType>;290 FungibleItemsHaveNoId: AugmentedError<ApiType>;
292 /**291 /**
293 * Not Fungible item data used to mint in Fungible collection.292 * Not Fungible item data used to mint in Fungible collection.
425 * Not Refungible item data used to mint in Refungible collection.424 * Not Refungible item data used to mint in Refungible collection.
426 **/425 **/
427 NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;426 NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;
428 /**427 /**
429 * Refungible token can't nest other tokens428 * Refungible token can't nest other tokens.
430 **/429 **/
431 RefungibleDisallowsNesting: AugmentedError<ApiType>;430 RefungibleDisallowsNesting: AugmentedError<ApiType>;
432 /**431 /**
433 * Refungible token can't be repartitioned by user who isn't owns all pieces432 * Refungible token can't be repartitioned by user who isn't owns all pieces.
434 **/433 **/
435 RepartitionWhileNotOwningAllPieces: AugmentedError<ApiType>;434 RepartitionWhileNotOwningAllPieces: AugmentedError<ApiType>;
436 /**435 /**
437 * Setting item properties is not allowed436 * Setting item properties is not allowed.
438 **/437 **/
439 SettingPropertiesNotAllowed: AugmentedError<ApiType>;438 SettingPropertiesNotAllowed: AugmentedError<ApiType>;
440 /**439 /**
441 * Maximum refungibility exceeded440 * Maximum refungibility exceeded.
442 **/441 **/
443 WrongRefungiblePieces: AugmentedError<ApiType>;442 WrongRefungiblePieces: AugmentedError<ApiType>;
444 /**443 /**
445 * Generic error444 * Generic error
508 [key: string]: AugmentedError<ApiType>;507 [key: string]: AugmentedError<ApiType>;
509 };508 };
510 structure: {509 structure: {
511 /**510 /**
512 * While iterating over children, encountered breadth limit511 * While iterating over children, reached the breadth limit.
513 **/512 **/
514 BreadthLimit: AugmentedError<ApiType>;513 BreadthLimit: AugmentedError<ApiType>;
515 /**514 /**
516 * While searched for owner, encountered depth limit515 * While searching for the owner, reached the depth limit.
517 **/516 **/
518 DepthLimit: AugmentedError<ApiType>;517 DepthLimit: AugmentedError<ApiType>;
519 /**518 /**
520 * While searched for owner, got already checked account519 * While searching for the owner, encountered an already checked account, detecting a loop.
521 **/520 **/
522 OuroborosDetected: AugmentedError<ApiType>;521 OuroborosDetected: AugmentedError<ApiType>;
523 /**522 /**
524 * While searched for owner, found token owner by not-yet-existing token523 * Couldn't find the token owner that is itself a token.
525 **/524 **/
526 TokenNotFound: AugmentedError<ApiType>;525 TokenNotFound: AugmentedError<ApiType>;
527 /**526 /**
528 * Generic error527 * Generic error
596 [key: string]: AugmentedError<ApiType>;595 [key: string]: AugmentedError<ApiType>;
597 };596 };
598 unique: {597 unique: {
599 /**598 /**
600 * Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.599 * Decimal_points parameter must be lower than [`up_data_structs::MAX_DECIMAL_POINTS`].
601 **/600 **/
602 CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;601 CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;
603 /**602 /**
604 * This address is not set as sponsor, use setCollectionSponsor first.603 * This address is not set as sponsor, use setCollectionSponsor first.
608 * Length of items properties must be greater than 0.607 * Length of items properties must be greater than 0.
609 **/608 **/
610 EmptyArgument: AugmentedError<ApiType>;609 EmptyArgument: AugmentedError<ApiType>;
611 /**610 /**
612 * Repertition is only supported by refungible collection611 * Repertition is only supported by refungible collection.
613 **/612 **/
614 RepartitionCalledOnNonRefungibleCollection: AugmentedError<ApiType>;613 RepartitionCalledOnNonRefungibleCollection: AugmentedError<ApiType>;
615 /**614 /**
616 * Generic error615 * Generic error
modifiedtests/src/interfaces/augment-api-events.tsdiffbeforeafterboth
74 * The property has been deleted.74 * The property has been deleted.
75 **/75 **/
76 CollectionPropertyDeleted: AugmentedEvent<ApiType, [u32, Bytes]>;76 CollectionPropertyDeleted: AugmentedEvent<ApiType, [u32, Bytes]>;
77 /**77 /**
78 * The colletion property has been set.78 * The colletion property has been added or edited.
79 **/79 **/
80 CollectionPropertySet: AugmentedEvent<ApiType, [u32, Bytes]>;80 CollectionPropertySet: AugmentedEvent<ApiType, [u32, Bytes]>;
81 /**81 /**
82 * New item was created.82 * New item was created.
86 * Collection item was burned.86 * Collection item was burned.
87 **/87 **/
88 ItemDestroyed: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;88 ItemDestroyed: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;
89 /**89 /**
90 * The colletion property permission has been set.90 * The token property permission of a collection has been set.
91 **/91 **/
92 PropertyPermissionSet: AugmentedEvent<ApiType, [u32, Bytes]>;92 PropertyPermissionSet: AugmentedEvent<ApiType, [u32, Bytes]>;
93 /**93 /**
94 * The token property has been deleted.94 * The token property has been deleted.
95 **/95 **/
96 TokenPropertyDeleted: AugmentedEvent<ApiType, [u32, u32, Bytes]>;96 TokenPropertyDeleted: AugmentedEvent<ApiType, [u32, u32, Bytes]>;
97 /**97 /**
98 * The token property has been set.98 * The token property has been added or edited.
99 **/99 **/
100 TokenPropertySet: AugmentedEvent<ApiType, [u32, u32, Bytes]>;100 TokenPropertySet: AugmentedEvent<ApiType, [u32, u32, Bytes]>;
101 /**101 /**
102 * Item was transferred102 * Item was transferred
406 [key: string]: AugmentedEvent<ApiType>;406 [key: string]: AugmentedEvent<ApiType>;
407 };407 };
408 structure: {408 structure: {
409 /**409 /**
410 * Executed call on behalf of token410 * Executed call on behalf of the token.
411 **/411 **/
412 Executed: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;412 Executed: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
413 /**413 /**
414 * Generic event414 * Generic event
498 [key: string]: AugmentedEvent<ApiType>;498 [key: string]: AugmentedEvent<ApiType>;
499 };499 };
500 unique: {500 unique: {
501 /**501 /**
502 * Address was add to allow list502 * Address was added to the allow list
503 * 503 *
504 * # Arguments504 * # Arguments
505 * 505 * * collection_id: ID of the affected collection.
506 * * collection_id: Globally unique collection identifier.506 * * user: Address of the added account.
507 *
508 * * user: Address.507 **/
509 **/
510 AllowListAddressAdded: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;508 AllowListAddressAdded: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
511 /**509 /**
512 * Address was remove from allow list510 * Address was removed from the allow list
513 * 511 *
514 * # Arguments512 * # Arguments
515 * 513 * * collection_id: ID of the affected collection.
516 * * collection_id: Globally unique collection identifier.514 * * user: Address of the removed account.
517 *
518 * * user: Address.515 **/
519 **/
520 AllowListAddressRemoved: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;516 AllowListAddressRemoved: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
521 /**517 /**
522 * Collection admin was added518 * Collection admin was added
523 * 519 *
524 * # Arguments520 * # Arguments
525 * 521 * * collection_id: ID of the affected collection.
526 * * collection_id: Globally unique collection identifier.522 * * admin: Admin address.
527 *
528 * * admin: Admin address.523 **/
529 **/
530 CollectionAdminAdded: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;524 CollectionAdminAdded: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
531 /**525 /**
532 * Collection admin was removed526 * Collection admin was removed
533 * 527 *
534 * # Arguments528 * # Arguments
535 * 529 * * collection_id: ID of the affected collection.
536 * * collection_id: Globally unique collection identifier.530 * * admin: Removed admin address.
537 *
538 * * admin: Admin address.531 **/
539 **/
540 CollectionAdminRemoved: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;532 CollectionAdminRemoved: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
541 /**533 /**
542 * Collection limits was set534 * Collection limits were set
543 * 535 *
544 * # Arguments536 * # Arguments
545 * 537 * * collection_id: ID of the affected collection.
546 * * collection_id: Globally unique collection identifier.538 **/
547 **/
548 CollectionLimitSet: AugmentedEvent<ApiType, [u32]>;539 CollectionLimitSet: AugmentedEvent<ApiType, [u32]>;
549 /**540 /**
550 * Collection owned was change541 * Collection owned was changed
551 * 542 *
552 * # Arguments543 * # Arguments
553 * 544 * * collection_id: ID of the affected collection.
554 * * collection_id: Globally unique collection identifier.545 * * owner: New owner address.
555 *
556 * * owner: New owner address.546 **/
557 **/
558 CollectionOwnedChanged: AugmentedEvent<ApiType, [u32, AccountId32]>;547 CollectionOwnedChanged: AugmentedEvent<ApiType, [u32, AccountId32]>;
548 /**
549 * Collection permissions were set
550 *
551 * # Arguments
552 * * collection_id: ID of the affected collection.
553 **/
559 CollectionPermissionSet: AugmentedEvent<ApiType, [u32]>;554 CollectionPermissionSet: AugmentedEvent<ApiType, [u32]>;
560 /**555 /**
561 * Collection sponsor was removed556 * Collection sponsor was removed
562 * 557 *
563 * # Arguments558 * # Arguments
564 * 559 * * collection_id: ID of the affected collection.
565 * * collection_id: Globally unique collection identifier.560 **/
566 **/
567 CollectionSponsorRemoved: AugmentedEvent<ApiType, [u32]>;561 CollectionSponsorRemoved: AugmentedEvent<ApiType, [u32]>;
568 /**562 /**
569 * Collection sponsor was set563 * Collection sponsor was set
570 * 564 *
571 * # Arguments565 * # Arguments
572 * 566 * * collection_id: ID of the affected collection.
573 * * collection_id: Globally unique collection identifier.567 * * owner: New sponsor address.
574 *
575 * * owner: New sponsor address.568 **/
576 **/
577 CollectionSponsorSet: AugmentedEvent<ApiType, [u32, AccountId32]>;569 CollectionSponsorSet: AugmentedEvent<ApiType, [u32, AccountId32]>;
578 /**570 /**
579 * New sponsor was confirm571 * New sponsor was confirm
580 * 572 *
581 * # Arguments573 * # Arguments
582 * 574 * * collection_id: ID of the affected collection.
583 * * collection_id: Globally unique collection identifier.575 * * sponsor: New sponsor address.
584 *
585 * * sponsor: New sponsor address.576 **/
586 **/
587 SponsorshipConfirmed: AugmentedEvent<ApiType, [u32, AccountId32]>;577 SponsorshipConfirmed: AugmentedEvent<ApiType, [u32, AccountId32]>;
588 /**578 /**
589 * Generic event579 * Generic event
modifiedtests/src/interfaces/augment-api-query.tsdiffbeforeafterboth
69 [key: string]: QueryableStorageEntry<ApiType>;69 [key: string]: QueryableStorageEntry<ApiType>;
70 };70 };
71 common: {71 common: {
72 /**72 /**
73 * Storage of collection admins count.73 * Storage of the amount of collection admins.
74 **/74 **/
75 adminAmount: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;75 adminAmount: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
76 /**76 /**
77 * Allowlisted collection users77 * Allowlisted collection users.
78 **/78 **/
79 allowlist: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;79 allowlist: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
80 /**80 /**
81 * Storage of collection info.81 * Storage of collection info.
85 * Storage of collection properties.85 * Storage of collection properties.
86 **/86 **/
87 collectionProperties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;87 collectionProperties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
88 /**88 /**
89 * Storage of collection properties permissions.89 * Storage of token property permissions of a collection.
90 **/90 **/
91 collectionPropertyPermissions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<BTreeMap<Bytes, UpDataStructsPropertyPermission>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;91 collectionPropertyPermissions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<BTreeMap<Bytes, UpDataStructsPropertyPermission>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
92 /**92 /**
93 * Storage of the count of created collections.93 * Storage of the count of created collections. Essentially contains the last collection ID.
94 **/94 **/
95 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;95 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
96 /**96 /**
97 * Storage of the count of deleted collections.97 * Storage of the count of deleted collections.
101 * Not used by code, exists only to provide some types to metadata.101 * Not used by code, exists only to provide some types to metadata.
102 **/102 **/
103 dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32, UpDataStructsTokenChild, PhantomTypeUpDataStructs]>>>, []> & QueryableStorageEntry<ApiType, []>;103 dummyStorageValue: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[UpDataStructsCollectionStats, u32, u32, UpDataStructsTokenChild, PhantomTypeUpDataStructs]>>>, []> & QueryableStorageEntry<ApiType, []>;
104 /**104 /**
105 * List of collection admins105 * List of collection admins.
106 **/106 **/
107 isAdmin: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;107 isAdmin: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
108 /**108 /**
109 * Generic query109 * Generic query
199 [key: string]: QueryableStorageEntry<ApiType>;199 [key: string]: QueryableStorageEntry<ApiType>;
200 };200 };
201 fungible: {201 fungible: {
202 /**202 /**
203 * Storage for delegated assets.203 * Storage for assets delegated to a limited extent to other users.
204 **/204 **/
205 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;205 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;
206 /**206 /**
207 * Amount of tokens owned by an account inside a collection.207 * Amount of tokens owned by an account inside a collection.
243 [key: string]: QueryableStorageEntry<ApiType>;243 [key: string]: QueryableStorageEntry<ApiType>;
244 };244 };
245 nonfungible: {245 nonfungible: {
246 /**246 /**
247 * Amount of tokens owned by account.247 * Amount of tokens owned by an account in a collection.
248 **/248 **/
249 accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;249 accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
250 /**250 /**
251 * Allowance set by an owner for a spender for a token.251 * Allowance set by a token owner for another user to perform one of certain transactions on a token.
252 **/252 **/
253 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;253 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
254 /**254 /**
255 * Used to enumerate tokens owned by account.255 * Used to enumerate tokens owned by account.
256 **/256 **/
257 owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;257 owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;
258 /**258 /**
259 * Custom data that is serialized to bytes and attached to a token property.259 * Custom data of a token that is serialized to bytes,
260 * Currently used to store RMRK data.260 * primarily reserved for on-chain operations,
261 **/261 * normally obscured from the external users.
262 *
263 * Auxiliary properties are slightly different from
264 * usual [`TokenProperties`] due to an unlimited number
265 * and separately stored and written-to key-value pairs.
266 *
267 * Currently used to store RMRK data.
268 **/
262 tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;269 tokenAuxProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: UpDataStructsPropertyScope | 'None' | 'Rmrk' | number | Uint8Array, arg4: Bytes | string | Uint8Array) => Observable<Option<Bytes>>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry<ApiType, [u32, u32, UpDataStructsPropertyScope, Bytes]>;
263 /**270 /**
264 * Used to enumerate token's children.271 * Used to enumerate token's children.
265 **/272 **/
266 tokenChildren: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<bool>, [u32, u32, ITuple<[u32, u32]>]> & QueryableStorageEntry<ApiType, [u32, u32, ITuple<[u32, u32]>]>;273 tokenChildren: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<bool>, [u32, u32, ITuple<[u32, u32]>]> & QueryableStorageEntry<ApiType, [u32, u32, ITuple<[u32, u32]>]>;
267 /**274 /**
268 * Custom data serialized to bytes for token.275 * Token data, used to partially describe a token.
269 **/276 **/
270 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNonfungibleItemData>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;277 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNonfungibleItemData>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
271 /**278 /**
272 * Key-Value map stored for token.279 * Map of key-value pairs, describing the metadata of a token.
273 **/280 **/
274 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;281 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
275 /**282 /**
276 * Amount of burnt tokens for collection.283 * Amount of burnt tokens in a collection.
277 **/284 **/
278 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;285 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
279 /**286 /**
280 * Amount of tokens minted for collection.287 * Total amount of minted tokens in a collection.
281 **/288 **/
282 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;289 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
283 /**290 /**
284 * Generic query291 * Generic query
443 [key: string]: QueryableStorageEntry<ApiType>;450 [key: string]: QueryableStorageEntry<ApiType>;
444 };451 };
445 refungible: {452 refungible: {
446 /**453 /**
447 * Amount of tokens owned by account454 * Amount of tokens (not pieces) partially owned by an account within a collection.
448 **/455 **/
449 accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;456 accountBalance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u32>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
450 /**457 /**
451 * Allowance set by an owner for a spender for a token458 * Allowance set by a token owner for another user to perform one of certain transactions on a number of pieces of a token.
452 **/459 **/
453 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg4: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;460 allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg4: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;
454 /**461 /**
455 * Amount of token pieces owned by account462 * Amount of token pieces owned by account.
456 **/463 **/
457 balance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]>;464 balance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
458 /**465 /**
459 * Used to enumerate tokens owned by account466 * Used to enumerate tokens owned by account.
460 **/467 **/
461 owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;468 owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;
462 /**469 /**
463 * Custom data serialized to bytes for token470 * Token data, used to partially describe a token.
464 **/471 **/
465 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<PalletRefungibleItemData>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;472 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<PalletRefungibleItemData>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
473 /**
474 * Amount of pieces a refungible token is split into.
475 **/
466 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;476 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
467 /**477 /**
468 * Amount of burnt tokens for collection478 * Amount of tokens burnt in a collection.
469 **/479 **/
470 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;480 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
471 /**481 /**
472 * Amount of tokens minted for collection482 * Total amount of minted tokens in a collection.
473 **/483 **/
474 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;484 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
475 /**485 /**
476 * Total amount of pieces for token486 * Total amount of pieces for token
663 * TODO: Off chain worker should remove from this map when collection gets removed673 * TODO: Off chain worker should remove from this map when collection gets removed
664 **/674 **/
665 createItemBasket: AugmentedQuery<ApiType, (arg: ITuple<[u32, AccountId32]> | [u32 | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => Observable<Option<u32>>, [ITuple<[u32, AccountId32]>]> & QueryableStorageEntry<ApiType, [ITuple<[u32, AccountId32]>]>;675 createItemBasket: AugmentedQuery<ApiType, (arg: ITuple<[u32, AccountId32]> | [u32 | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => Observable<Option<u32>>, [ITuple<[u32, AccountId32]>]> & QueryableStorageEntry<ApiType, [ITuple<[u32, AccountId32]>]>;
676 /**
677 * Last sponsoring of fungible tokens approval in a collection
678 **/
666 fungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;679 fungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
667 /**680 /**
668 * Collection id (controlled?2), owning user (real)681 * Collection id (controlled?2), owning user (real)
669 **/682 **/
670 fungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;683 fungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
671 /**684 /**
672 * Approval sponsoring685 * Last sponsoring of NFT approval in a collection
673 **/686 **/
674 nftApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;687 nftApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
675 /**688 /**
676 * Collection id (controlled?2), token id (controlled?2)689 * Collection id (controlled?2), token id (controlled?2)
677 **/690 **/
678 nftTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;691 nftTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
692 /**
693 * Last sponsoring of RFT approval in a collection
694 **/
679 refungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;695 refungibleApproveBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;
680 /**696 /**
681 * Collection id (controlled?2), token id (controlled?2)697 * Collection id (controlled?2), token id (controlled?2)
682 **/698 **/
683 reFungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;699 reFungibleTransferBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u32, u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, u32, AccountId32]>;
700 /**
701 * Last sponsoring of token property setting // todo:doc rephrase this and the following
702 **/
684 tokenPropertyBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;703 tokenPropertyBasket: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
685 /**704 /**
686 * Variable metadata sponsoring705 * Variable metadata sponsoring
modifiedtests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth
628 version: AugmentedRpc<() => Observable<Text>>;628 version: AugmentedRpc<() => Observable<Text>>;
629 };629 };
630 unique: {630 unique: {
631 /**631 /**
632 * Get amount of different user tokens632 * Get the amount of any user tokens owned by an account
633 **/633 **/
634 accountBalance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;634 accountBalance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
635 /**635 /**
636 * Get tokens owned by account636 * Get tokens owned by an account in a collection
637 **/637 **/
638 accountTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;638 accountTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;
639 /**639 /**
640 * Get admin list640 * Get the list of admin accounts of a collection
641 **/641 **/
642 adminlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;642 adminlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;
643 /**643 /**
644 * Get allowed amount644 * Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor
645 **/645 **/
646 allowance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, sender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;646 allowance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, sender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
647 /**647 /**
648 * Check if user is allowed to use collection648 * Check if a user is allowed to operate within a collection
649 **/649 **/
650 allowed: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;650 allowed: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
651 /**651 /**
652 * Get allowlist652 * Get the list of accounts allowed to operate within a collection
653 **/653 **/
654 allowlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;654 allowlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;
655 /**655 /**
656 * Get amount of specific account token656 * Get the amount of a specific token owned by an account
657 **/657 **/
658 balance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;658 balance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
659 /**659 /**
660 * Get collection by specified id660 * Get a collection by the specified ID
661 **/661 **/
662 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;662 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;
663 /**663 /**
664 * Get collection properties664 * Get collection properties, optionally limited to the provided keys
665 **/665 **/
666 collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;666 collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;
667 /**667 /**
668 * Get collection stats668 * Get chain stats about collections
669 **/669 **/
670 collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;670 collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;
671 /**671 /**
672 * Get tokens contained in collection672 * Get tokens contained within a collection
673 **/673 **/
674 collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;674 collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;
675 /**675 /**
676 * Get token constant metadata676 * Get token constant metadata
680 * Get effective collection limits680 * Get effective collection limits
681 **/681 **/
682 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;682 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;
683 /**683 /**
684 * Get last token id684 * Get the last token ID created in a collection
685 **/685 **/
686 lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;686 lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
687 /**687 /**
688 * Get number of blocks when sponsored transaction is available688 * Get the number of blocks until sponsoring a transaction is available
689 **/689 **/
690 nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;690 nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;
691 /**691 /**
692 * Get property permissions692 * Get property permissions, optionally limited to the provided keys
693 **/693 **/
694 propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;694 propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;
695 /**695 /**
696 * Get tokens nested directly into the token696 * Get tokens nested directly into the token
697 **/697 **/
698 tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenChild>>>;698 tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenChild>>>;
699 /**699 /**
700 * Get token data700 * Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT
701 **/701 **/
702 tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenData>>;702 tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenData>>;
703 /**703 /**
704 * Check if token exists704 * Check if the token exists
705 **/705 **/
706 tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;706 tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
707 /**707 /**
708 * Get token owner708 * Get the token owner
709 **/709 **/
710 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;710 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;
711 /**711 /**
712 * Returns 10 tokens owners in no particular order712 * Returns 10 tokens owners in no particular order
713 **/713 **/
714 tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;714 tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;
715 /**715 /**
716 * Get token properties716 * Get token properties, optionally limited to the provided keys
717 **/717 **/
718 tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;718 tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;
719 /**719 /**
720 * Get token owner, in case of nested token - find parent recursive720 * Get the topmost token owner in the hierarchy of a possibly nested token
721 **/721 **/
722 topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;722 topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;
723 /**723 /**
724 * Get total pieces of token724 * Get the total amount of pieces of an RFT
725 **/725 **/
726 totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u128>>>;726 totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u128>>>;
727 /**727 /**
728 * Get amount of unique collection tokens728 * Get the amount of distinctive tokens present in a collection
729 **/729 **/
730 totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;730 totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
731 /**731 /**
732 * Get token variable metadata732 * Get token variable metadata
modifiedtests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth
729 [key: string]: SubmittableExtrinsicFunction<ApiType>;729 [key: string]: SubmittableExtrinsicFunction<ApiType>;
730 };730 };
731 unique: {731 unique: {
732 /**732 /**
733 * Adds an admin of the Collection.733 * Add an admin to a collection.
734 * NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.734 *
735 * NFT Collection can be controlled by multiple admin addresses
736 * (some which can also be servers, for example). Admins can issue
737 * and burn NFTs, as well as add and remove other admins,
738 * but cannot change NFT or Collection ownership.
735 * 739 *
736 * # Permissions740 * # Permissions
737 * 741 *
738 * * Collection Owner.742 * * Collection owner
739 * * Collection Admin.743 * * Collection admin
740 * 744 *
741 * # Arguments745 * # Arguments
742 * 746 *
743 * * collection_id: ID of the Collection to add admin for.747 * * `collection_id`: ID of the Collection to add an admin for.
744 * 748 * * `new_admin`: Address of new admin to add.
745 * * new_admin_id: Address of new admin to add.749 **/
746 **/
747 addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdminId: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;750 addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdmin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
748 /**751 /**
749 * Add an address to allow list.752 * Add an address to allow list.
750 * 753 *
751 * # Permissions754 * # Permissions
752 * 755 *
753 * * Collection Owner756 * * Collection owner
754 * * Collection Admin757 * * Collection admin
755 * 758 *
756 * # Arguments759 * # Arguments
757 * 760 *
758 * * collection_id.761 * * `collection_id`: ID of the modified collection.
759 * 762 * * `address`: ID of the address to be added to the allowlist.
760 * * address.763 **/
761 **/
762 addToAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;764 addToAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
763 /**765 /**
764 * Set, change, or remove approved address to transfer the ownership of the NFT.766 * Allow a non-permissioned address to transfer or burn an item.
765 * 767 *
766 * # Permissions768 * # Permissions
767 * 769 *
768 * * Collection Owner770 * * Collection owner
769 * * Collection Admin771 * * Collection admin
770 * * Current NFT owner772 * * Current item owner
771 * 773 *
772 * # Arguments774 * # Arguments
773 * 775 *
774 * * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).776 * * `spender`: Account to be approved to make specific transactions on non-owned tokens.
775 * 777 * * `collection_id`: ID of the collection the item belongs to.
776 * * collection_id.778 * * `item_id`: ID of the item transactions on which are now approved.
777 * 779 * * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs).
778 * * item_id: ID of the item.780 * Set to 0 to revoke the approval.
779 **/781 **/
780 approve: AugmentedSubmittable<(spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>;782 approve: AugmentedSubmittable<(spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
781 /**783 /**
782 * Destroys a concrete instance of NFT on behalf of the owner784 * Destroy a token on behalf of the owner as a non-owner account.
783 * See also: [`approve`]785 *
784 * 786 * See also: [`approve`][`Pallet::approve`].
785 * # Permissions787 *
786 * 788 * After this method executes, one approval is removed from the total so that
787 * * Collection Owner.789 * the approved address will not be able to transfer this item again from this owner.
788 * * Collection Admin.790 *
789 * * Current NFT Owner.791 * # Permissions
790 * 792 *
791 * # Arguments793 * * Collection owner
792 * 794 * * Collection admin
793 * * collection_id: ID of the collection.795 * * Current token owner
794 * 796 * * Address approved by current item owner
795 * * item_id: ID of NFT to burn.797 *
796 * 798 * # Arguments
797 * * from: owner of item799 *
798 **/800 * * `from`: The owner of the burning item.
801 * * `collection_id`: ID of the collection to which the item belongs.
802 * * `item_id`: ID of item to burn.
803 * * `value`: Number of pieces to burn.
804 * * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
805 * * Fungible Mode: The desired number of pieces to burn.
806 * * Re-Fungible Mode: The desired number of pieces to burn.
807 **/
799 burnFrom: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, from: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32, u128]>;808 burnFrom: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, from: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32, u128]>;
800 /**809 /**
801 * Destroys a concrete instance of NFT.810 * Destroy an item.
802 * 811 *
803 * # Permissions812 * # Permissions
804 * 813 *
805 * * Collection Owner.814 * * Collection owner
806 * * Collection Admin.815 * * Collection admin
807 * * Current NFT Owner.816 * * Current item owner
808 * 817 *
809 * # Arguments818 * # Arguments
810 * 819 *
811 * * collection_id: ID of the collection.820 * * `collection_id`: ID of the collection to which the item belongs.
812 * 821 * * `item_id`: ID of item to burn.
813 * * item_id: ID of NFT to burn.822 * * `value`: Number of pieces of the item to destroy.
814 **/823 * * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
824 * * Fungible Mode: The desired number of pieces to burn.
825 * * Re-Fungible Mode: The desired number of pieces to burn.
826 **/
815 burnItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;827 burnItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;
816 /**828 /**
817 * Change the owner of the collection.829 * Change the owner of the collection.
818 * 830 *
819 * # Permissions831 * # Permissions
820 * 832 *
821 * * Collection Owner.833 * * Collection owner
822 * 834 *
823 * # Arguments835 * # Arguments
824 * 836 *
825 * * collection_id.837 * * `collection_id`: ID of the modified collection.
826 * 838 * * `new_owner`: ID of the account that will become the owner.
827 * * new_owner.839 **/
828 **/
829 changeCollectionOwner: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newOwner: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;840 changeCollectionOwner: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newOwner: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;
830 /**841 /**
831 * # Permissions842 * Confirm own sponsorship of a collection, becoming the sponsor.
832 * 843 *
833 * * Sponsor.844 * An invitation must be pending, see [`set_collection_sponsor`][`Pallet::set_collection_sponsor`].
834 * 845 * Sponsor can pay the fees of a transaction instead of the sender,
835 * # Arguments846 * but only within specified limits.
836 * 847 *
837 * * collection_id.848 * # Permissions
838 **/849 *
850 * * Sponsor-to-be
851 *
852 * # Arguments
853 *
854 * * `collection_id`: ID of the collection with the pending sponsor.
855 **/
839 confirmSponsorship: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;856 confirmSponsorship: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
840 /**857 /**
841 * This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner of the collection is set to the address that signed the transaction and can be changed later.858 * Create a collection of tokens.
842 * 859 *
843 * # Permissions860 * Each Token may have multiple properties encoded as an array of bytes
844 * 861 * of certain length. The initial owner of the collection is set
845 * * Anyone.862 * to the address that signed the transaction and can be changed later.
846 * 863 *
847 * # Arguments864 * Prefer the more advanced [`create_collection_ex`][`Pallet::create_collection_ex`] instead.
848 * 865 *
849 * * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.866 * # Permissions
850 * 867 *
851 * * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.868 * * Anyone - becomes the owner of the new collection.
852 * 869 *
853 * * token_prefix: UTF-8 string with token prefix.870 * # Arguments
854 * 871 *
855 * * mode: [CollectionMode] collection type and type dependent data.872 * * `collection_name`: Wide-character string with collection name
856 **/873 * (limit [`MAX_COLLECTION_NAME_LENGTH`]).
874 * * `collection_description`: Wide-character string with collection description
875 * (limit [`MAX_COLLECTION_DESCRIPTION_LENGTH`]).
876 * * `token_prefix`: Byte string containing the token prefix to mark a collection
877 * to which a token belongs (limit [`MAX_TOKEN_PREFIX_LENGTH`]).
878 * * `mode`: Type of items stored in the collection and type dependent data.
879 **/
857 createCollection: AugmentedSubmittable<(collectionName: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], collectionDescription: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], tokenPrefix: Bytes | string | Uint8Array, mode: UpDataStructsCollectionMode | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<u16>, Vec<u16>, Bytes, UpDataStructsCollectionMode]>;880 createCollection: AugmentedSubmittable<(collectionName: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], collectionDescription: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], tokenPrefix: Bytes | string | Uint8Array, mode: UpDataStructsCollectionMode | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<u16>, Vec<u16>, Bytes, UpDataStructsCollectionMode]>;
858 /**881 /**
859 * This method creates a collection882 * Create a collection with explicit parameters.
860 * 883 *
861 * Prefer it to deprecated [`created_collection`] method884 * Prefer it to the deprecated [`create_collection`][`Pallet::create_collection`] method.
862 **/885 *
886 * # Permissions
887 *
888 * * Anyone - becomes the owner of the new collection.
889 *
890 * # Arguments
891 *
892 * * `data`: Explicit data of a collection used for its creation.
893 **/
863 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]>;894 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]>;
864 /**895 /**
865 * This method creates a concrete instance of NFT Collection created with CreateCollection method.896 * Mint an item within a collection.
897 *
898 * A collection must exist first, see [`create_collection_ex`][`Pallet::create_collection_ex`].
866 * 899 *
867 * # Permissions900 * # Permissions
868 * 901 *
869 * * Collection Owner.902 * * Collection owner
870 * * Collection Admin.903 * * Collection admin
871 * * Anyone if904 * * Anyone if
872 * * Allow List is enabled, and905 * * Allow List is enabled, and
873 * * Address is added to allow list, and906 * * Address is added to allow list, and
874 * * MintPermission is enabled (see SetMintPermission method)907 * * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`])
875 * 908 *
876 * # Arguments909 * # Arguments
877 * 910 *
878 * * collection_id: ID of the collection.911 * * `collection_id`: ID of the collection to which an item would belong.
879 * 912 * * `owner`: Address of the initial owner of the item.
880 * * owner: Address, initial owner of the NFT.913 * * `data`: Token data describing the item to store on chain.
881 *
882 * * data: Token data to store on chain.914 **/
883 **/
884 createItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, data: UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCreateItemData]>;915 createItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, data: UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCreateItemData]>;
885 /**916 /**
886 * This method creates multiple items in a collection created with CreateCollection method.917 * Create multiple items within a collection.
918 *
919 * A collection must exist first, see [`create_collection_ex`][`Pallet::create_collection_ex`].
887 * 920 *
888 * # Permissions921 * # Permissions
889 * 922 *
890 * * Collection Owner.923 * * Collection owner
891 * * Collection Admin.924 * * Collection admin
892 * * Anyone if925 * * Anyone if
893 * * Allow List is enabled, and926 * * Allow List is enabled, and
894 * * Address is added to allow list, and927 * * Address is added to the allow list, and
895 * * MintPermission is enabled (see SetMintPermission method)928 * * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`])
896 * 929 *
897 * # Arguments930 * # Arguments
898 * 931 *
899 * * collection_id: ID of the collection.932 * * `collection_id`: ID of the collection to which the tokens would belong.
900 * 933 * * `owner`: Address of the initial owner of the tokens.
901 * * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].934 * * `items_data`: Vector of data describing each item to be created.
902 *
903 * * owner: Address, initial owner of the NFT.935 **/
904 **/
905 createMultipleItems: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemsData: Vec<UpDataStructsCreateItemData> | (UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, Vec<UpDataStructsCreateItemData>]>;936 createMultipleItems: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemsData: Vec<UpDataStructsCreateItemData> | (UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, Vec<UpDataStructsCreateItemData>]>;
937 /**
938 * Create multiple items within a collection with explicitly specified initial parameters.
939 *
940 * # Permissions
941 *
942 * * Collection owner
943 * * Collection admin
944 * * Anyone if
945 * * Allow List is enabled, and
946 * * Address is added to allow list, and
947 * * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`])
948 *
949 * # Arguments
950 *
951 * * `collection_id`: ID of the collection to which the tokens would belong.
952 * * `data`: Explicit item creation data.
953 **/
906 createMultipleItemsEx: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, data: UpDataStructsCreateItemExData | { NFT: any } | { Fungible: any } | { RefungibleMultipleItems: any } | { RefungibleMultipleOwners: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCreateItemExData]>;954 createMultipleItemsEx: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, data: UpDataStructsCreateItemExData | { NFT: any } | { Fungible: any } | { RefungibleMultipleItems: any } | { RefungibleMultipleOwners: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCreateItemExData]>;
955 /**
956 * Delete specified collection properties.
957 *
958 * # Permissions
959 *
960 * * Collection Owner
961 * * Collection Admin
962 *
963 * # Arguments
964 *
965 * * `collection_id`: ID of the modified collection.
966 * * `property_keys`: Vector of keys of the properties to be deleted.
967 * Keys support Latin letters, `-`, `_`, and `.` as symbols.
968 **/
907 deleteCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<Bytes>]>;969 deleteCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<Bytes>]>;
970 /**
971 * Delete specified token properties. Currently properties only work with NFTs.
972 *
973 * # Permissions
974 *
975 * * Depends on collection's token property permissions and specified property mutability:
976 * * Collection owner
977 * * Collection admin
978 * * Token owner
979 *
980 * # Arguments
981 *
982 * * `collection_id`: ID of the collection to which the token belongs.
983 * * `token_id`: ID of the modified token.
984 * * `property_keys`: Vector of keys of the properties to be deleted.
985 * Keys support Latin letters, `-`, `_`, and `.` as symbols.
986 **/
908 deleteTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, u32, Vec<Bytes>]>;987 deleteTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, u32, Vec<Bytes>]>;
909 /**988 /**
910 * Destroys collection if no tokens within this collection989 * Destroy a collection if no tokens exist within.
911 * 990 *
912 * # Permissions991 * # Permissions
913 * 992 *
914 * * Collection Owner.993 * * Collection owner
915 * 994 *
916 * # Arguments995 * # Arguments
917 * 996 *
918 * * collection_id: collection to destroy.997 * * `collection_id`: Collection to destroy.
919 **/998 **/
920 destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;999 destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
921 /**1000 /**
922 * Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.1001 * Remove admin of a collection.
1002 *
1003 * An admin address can remove itself. List of admins may become empty,
1004 * in which case only Collection Owner will be able to add an Admin.
923 * 1005 *
924 * # Permissions1006 * # Permissions
925 * 1007 *
926 * * Collection Owner.1008 * * Collection owner
927 * * Collection Admin.1009 * * Collection admin
928 * 1010 *
929 * # Arguments1011 * # Arguments
930 * 1012 *
931 * * collection_id: ID of the Collection to remove admin for.1013 * * `collection_id`: ID of the collection to remove the admin for.
932 * 1014 * * `account_id`: Address of the admin to remove.
933 * * account_id: Address of admin to remove.1015 **/
934 **/
935 removeCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, accountId: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1016 removeCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, accountId: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
936 /**1017 /**
937 * Switch back to pay-per-own-transaction model.1018 * Remove a collection's a sponsor, making everyone pay for their own transactions.
938 * 1019 *
939 * # Permissions1020 * # Permissions
940 * 1021 *
941 * * Collection owner.1022 * * Collection owner
942 * 1023 *
943 * # Arguments1024 * # Arguments
944 * 1025 *
945 * * collection_id.1026 * * `collection_id`: ID of the collection with the sponsor to remove.
946 **/1027 **/
947 removeCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;1028 removeCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
948 /**1029 /**
949 * Remove an address from allow list.1030 * Remove an address from allow list.
950 * 1031 *
951 * # Permissions1032 * # Permissions
952 * 1033 *
953 * * Collection Owner1034 * * Collection owner
954 * * Collection Admin1035 * * Collection admin
955 * 1036 *
956 * # Arguments1037 * # Arguments
957 * 1038 *
958 * * collection_id.1039 * * `collection_id`: ID of the modified collection.
959 * 1040 * * `address`: ID of the address to be removed from the allowlist.
960 * * address.1041 **/
961 **/
962 removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1042 removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
1043 /**
1044 * Re-partition a refungible token, while owning all of its parts/pieces.
1045 *
1046 * # Permissions
1047 *
1048 * * Token owner (must own every part)
1049 *
1050 * # Arguments
1051 *
1052 * * `collection_id`: ID of the collection the RFT belongs to.
1053 * * `token_id`: ID of the RFT.
1054 * * `amount`: New number of parts/pieces into which the token shall be partitioned.
1055 **/
963 repartition: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, token: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;1056 repartition: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;
1057 /**
1058 * Set specific limits of a collection. Empty, or None fields mean chain default.
1059 *
1060 * # Permissions
1061 *
1062 * * Collection owner
1063 * * Collection admin
1064 *
1065 * # Arguments
1066 *
1067 * * `collection_id`: ID of the modified collection.
1068 * * `new_limit`: New limits of the collection. Fields that are not set (None)
1069 * will not overwrite the old ones.
1070 **/
964 setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionLimits | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; sponsorApproveTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionLimits]>;1071 setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionLimits | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; sponsorApproveTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionLimits]>;
1072 /**
1073 * Set specific permissions of a collection. Empty, or None fields mean chain default.
1074 *
1075 * # Permissions
1076 *
1077 * * Collection owner
1078 * * Collection admin
1079 *
1080 * # Arguments
1081 *
1082 * * `collection_id`: ID of the modified collection.
1083 * * `new_permission`: New permissions of the collection. Fields that are not set (None)
1084 * will not overwrite the old ones.
1085 **/
965 setCollectionPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionPermissions | { access?: any; mintMode?: any; nesting?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionPermissions]>;1086 setCollectionPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newPermission: UpDataStructsCollectionPermissions | { access?: any; mintMode?: any; nesting?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, UpDataStructsCollectionPermissions]>;
1087 /**
1088 * Add or change collection properties.
1089 *
1090 * # Permissions
1091 *
1092 * * Collection owner
1093 * * Collection admin
1094 *
1095 * # Arguments
1096 *
1097 * * `collection_id`: ID of the modified collection.
1098 * * `properties`: Vector of key-value pairs stored as the collection's metadata.
1099 * Keys support Latin letters, `-`, `_`, and `.` as symbols.
1100 **/
966 setCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, properties: Vec<UpDataStructsProperty> | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<UpDataStructsProperty>]>;1101 setCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, properties: Vec<UpDataStructsProperty> | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<UpDataStructsProperty>]>;
967 /**1102 /**
968 * # Permissions1103 * Set (invite) a new collection sponsor.
969 * 1104 *
970 * * Collection Owner1105 * If successful, confirmation from the sponsor-to-be will be pending.
971 * 1106 *
972 * # Arguments1107 * # Permissions
973 * 1108 *
974 * * collection_id.1109 * * Collection owner
975 * 1110 * * Collection admin
976 * * new_sponsor.1111 *
977 **/1112 * # Arguments
1113 *
1114 * * `collection_id`: ID of the modified collection.
1115 * * `new_sponsor`: ID of the account of the sponsor-to-be.
1116 **/
978 setCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newSponsor: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;1117 setCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newSponsor: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, AccountId32]>;
1118 /**
1119 * Add or change token properties according to collection's permissions.
1120 * Currently properties only work with NFTs.
1121 *
1122 * # Permissions
1123 *
1124 * * Depends on collection's token property permissions and specified property mutability:
1125 * * Collection owner
1126 * * Collection admin
1127 * * Token owner
1128 *
1129 * See [`set_token_property_permissions`][`Pallet::set_token_property_permissions`].
1130 *
1131 * # Arguments
1132 *
1133 * * `collection_id: ID of the collection to which the token belongs.
1134 * * `token_id`: ID of the modified token.
1135 * * `properties`: Vector of key-value pairs stored as the token's metadata.
1136 * Keys support Latin letters, `-`, `_`, and `.` as symbols.
1137 **/
979 setTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, properties: Vec<UpDataStructsProperty> | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, u32, Vec<UpDataStructsProperty>]>;1138 setTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, properties: Vec<UpDataStructsProperty> | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, u32, Vec<UpDataStructsProperty>]>;
1139 /**
1140 * Add or change token property permissions of a collection.
1141 *
1142 * Without a permission for a particular key, a property with that key
1143 * cannot be created in a token.
1144 *
1145 * # Permissions
1146 *
1147 * * Collection owner
1148 * * Collection admin
1149 *
1150 * # Arguments
1151 *
1152 * * `collection_id`: ID of the modified collection.
1153 * * `property_permissions`: Vector of permissions for property keys.
1154 * Keys support Latin letters, `-`, `_`, and `.` as symbols.
1155 **/
980 setTokenPropertyPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyPermissions: Vec<UpDataStructsPropertyKeyPermission> | (UpDataStructsPropertyKeyPermission | { key?: any; permission?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<UpDataStructsPropertyKeyPermission>]>;1156 setTokenPropertyPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyPermissions: Vec<UpDataStructsPropertyKeyPermission> | (UpDataStructsPropertyKeyPermission | { key?: any; permission?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<UpDataStructsPropertyKeyPermission>]>;
981 /**1157 /**
982 * Set transfers_enabled value for particular collection1158 * Completely allow or disallow transfers for a particular collection.
983 * 1159 *
984 * # Permissions1160 * # Permissions
985 * 1161 *
986 * * Collection Owner.1162 * * Collection owner
987 * 1163 *
988 * # Arguments1164 * # Arguments
989 * 1165 *
990 * * collection_id: ID of the collection.1166 * * `collection_id`: ID of the collection.
991 * 1167 * * `value`: New value of the flag, are transfers allowed?
992 * * value: New flag value.1168 **/
993 **/
994 setTransfersEnabledFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;1169 setTransfersEnabledFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;
995 /**1170 /**
996 * Change ownership of the token.1171 * Change ownership of the token.
997 * 1172 *
998 * # Permissions1173 * # Permissions
999 * 1174 *
1000 * * Collection Owner1175 * * Collection owner
1001 * * Collection Admin1176 * * Collection admin
1002 * * Current NFT owner1177 * * Current token owner
1003 * 1178 *
1004 * # Arguments1179 * # Arguments
1005 * 1180 *
1006 * * recipient: Address of token recipient.1181 * * `recipient`: Address of token recipient.
1007 * 1182 * * `collection_id`: ID of the collection the item belongs to.
1008 * * collection_id.
1009 * 1183 * * `item_id`: ID of the item.
1010 * * item_id: ID of the item1184 * * Non-Fungible Mode: Required.
1011 * * Non-Fungible Mode: Required.1185 * * Fungible Mode: Ignored.
1012 * * Fungible Mode: Ignored.1186 * * Re-Fungible Mode: Required.
1013 * * Re-Fungible Mode: Required.1187 *
1014 * 1188 * * `value`: Amount to transfer.
1015 * * value: Amount to transfer.1189 * * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
1016 * * Non-Fungible Mode: Ignored1190 * * Fungible Mode: The desired number of pieces to transfer.
1017 * * Fungible Mode: Must specify transferred amount1191 * * Re-Fungible Mode: The desired number of pieces to transfer.
1018 * * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)1192 **/
1019 **/
1020 transfer: AugmentedSubmittable<(recipient: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>;1193 transfer: AugmentedSubmittable<(recipient: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
1021 /**1194 /**
1022 * Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.1195 * Change ownership of an item on behalf of the owner as a non-owner account.
1023 * 1196 *
1024 * # Permissions1197 * See the [`approve`][`Pallet::approve`] method for additional information.
1025 * * Collection Owner1198 *
1026 * * Collection Admin1199 * After this method executes, one approval is removed from the total so that
1027 * * Current NFT owner1200 * the approved address will not be able to transfer this item again from this owner.
1028 * * Address approved by current NFT owner1201 *
1029 * 1202 * # Permissions
1030 * # Arguments1203 *
1031 * 1204 * * Collection owner
1032 * * from: Address that owns token.1205 * * Collection admin
1033 * 1206 * * Current item owner
1034 * * recipient: Address of token recipient.1207 * * Address approved by current item owner
1035 * 1208 *
1036 * * collection_id.1209 * # Arguments
1037 * 1210 *
1038 * * item_id: ID of the item.1211 * * `from`: Address that currently owns the token.
1039 * 1212 * * `recipient`: Address of the new token-owner-to-be.
1040 * * value: Amount to transfer.1213 * * `collection_id`: ID of the collection the item.
1041 **/1214 * * `item_id`: ID of the item to be transferred.
1215 * * `value`: Amount to transfer.
1216 * * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID.
1217 * * Fungible Mode: The desired number of pieces to transfer.
1218 * * Re-Fungible Mode: The desired number of pieces to transfer.
1219 **/
1042 transferFrom: AugmentedSubmittable<(from: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, recipient: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>;1220 transferFrom: AugmentedSubmittable<(from: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, recipient: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>;
1043 /**1221 /**
1044 * Generic tx1222 * Generic tx
modifiedtests/src/interfaces/default/types.tsdiffbeforeafterboth
1672 readonly isAddCollectionAdmin: boolean;1672 readonly isAddCollectionAdmin: boolean;
1673 readonly asAddCollectionAdmin: {1673 readonly asAddCollectionAdmin: {
1674 readonly collectionId: u32;1674 readonly collectionId: u32;
1675 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;1675 readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr;
1676 } & Struct;1676 } & Struct;
1677 readonly isRemoveCollectionAdmin: boolean;1677 readonly isRemoveCollectionAdmin: boolean;
1678 readonly asRemoveCollectionAdmin: {1678 readonly asRemoveCollectionAdmin: {
1784 readonly isSetCollectionPermissions: boolean;1784 readonly isSetCollectionPermissions: boolean;
1785 readonly asSetCollectionPermissions: {1785 readonly asSetCollectionPermissions: {
1786 readonly collectionId: u32;1786 readonly collectionId: u32;
1787 readonly newLimit: UpDataStructsCollectionPermissions;1787 readonly newPermission: UpDataStructsCollectionPermissions;
1788 } & Struct;1788 } & Struct;
1789 readonly isRepartition: boolean;1789 readonly isRepartition: boolean;
1790 readonly asRepartition: {1790 readonly asRepartition: {
1791 readonly collectionId: u32;1791 readonly collectionId: u32;
1792 readonly token: u32;1792 readonly tokenId: u32;
1793 readonly amount: u128;1793 readonly amount: u128;
1794 } & Struct;1794 } & Struct;
1795 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';1795 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';
modifiedtests/src/interfaces/lookup.tsdiffbeforeafterboth
1269 },1269 },
1270 add_collection_admin: {1270 add_collection_admin: {
1271 collectionId: 'u32',1271 collectionId: 'u32',
1272 newAdminId: 'PalletEvmAccountBasicCrossAccountIdRepr',1272 newAdmin: 'PalletEvmAccountBasicCrossAccountIdRepr',
1273 },1273 },
1274 remove_collection_admin: {1274 remove_collection_admin: {
1275 collectionId: 'u32',1275 collectionId: 'u32',
1361 },1361 },
1362 set_collection_permissions: {1362 set_collection_permissions: {
1363 collectionId: 'u32',1363 collectionId: 'u32',
1364 newLimit: 'UpDataStructsCollectionPermissions',1364 newPermission: 'UpDataStructsCollectionPermissions',
1365 },1365 },
1366 repartition: {1366 repartition: {
1367 collectionId: 'u32',1367 collectionId: 'u32',
1368 token: 'u32',1368 tokenId: 'u32',
1369 amount: 'u128'1369 amount: 'u128'
1370 }1370 }
1371 }1371 }
modifiedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth
1385 readonly isAddCollectionAdmin: boolean;1385 readonly isAddCollectionAdmin: boolean;
1386 readonly asAddCollectionAdmin: {1386 readonly asAddCollectionAdmin: {
1387 readonly collectionId: u32;1387 readonly collectionId: u32;
1388 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;1388 readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr;
1389 } & Struct;1389 } & Struct;
1390 readonly isRemoveCollectionAdmin: boolean;1390 readonly isRemoveCollectionAdmin: boolean;
1391 readonly asRemoveCollectionAdmin: {1391 readonly asRemoveCollectionAdmin: {
1497 readonly isSetCollectionPermissions: boolean;1497 readonly isSetCollectionPermissions: boolean;
1498 readonly asSetCollectionPermissions: {1498 readonly asSetCollectionPermissions: {
1499 readonly collectionId: u32;1499 readonly collectionId: u32;
1500 readonly newLimit: UpDataStructsCollectionPermissions;1500 readonly newPermission: UpDataStructsCollectionPermissions;
1501 } & Struct;1501 } & Struct;
1502 readonly isRepartition: boolean;1502 readonly isRepartition: boolean;
1503 readonly asRepartition: {1503 readonly asRepartition: {
1504 readonly collectionId: u32;1504 readonly collectionId: u32;
1505 readonly token: u32;1505 readonly tokenId: u32;
1506 readonly amount: u128;1506 readonly amount: u128;
1507 } & Struct;1507 } & Struct;
1508 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';1508 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';
modifiedtests/src/interfaces/unique/definitions.tsdiffbeforeafterboth
37export default {37export default {
38 types: {},38 types: {},
39 rpc: {39 rpc: {
40 adminlist: fun('Get admin list', [collectionParam], 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>'),
41 allowlist: fun('Get allowlist', [collectionParam], 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>'),
42
43 accountTokens: fun('Get tokens owned by account', [collectionParam, crossAccountParam()], 'Vec<u32>'),40 accountTokens: fun(
41 'Get tokens owned by an account in a collection',
42 [collectionParam, crossAccountParam()],
43 'Vec<u32>',
44 ),
44 collectionTokens: fun('Get tokens contained in collection', [collectionParam], 'Vec<u32>'),45 collectionTokens: fun(
4546 'Get tokens contained within a collection',
47 [collectionParam],
48 'Vec<u32>',
49 ),
46 lastTokenId: fun('Get last token id', [collectionParam], 'u32'),50 tokenExists: fun(
47 totalSupply: fun('Get amount of unique collection tokens', [collectionParam], 'u32'),51 'Check if the token exists',
52 [collectionParam, tokenParam],
53 'bool',
54 ),
55
48 accountBalance: fun('Get amount of different user tokens', [collectionParam, crossAccountParam()], 'u32'),56 tokenOwner: fun(
57 'Get the token owner',
58 [collectionParam, tokenParam],
59 `Option<${CROSS_ACCOUNT_ID_TYPE}>`,
60 ),
49 balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),61 topmostTokenOwner: fun(
62 'Get the topmost token owner in the hierarchy of a possibly nested token',
63 [collectionParam, tokenParam],
64 `Option<${CROSS_ACCOUNT_ID_TYPE}>`,
65 ),
50 allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),66 tokenOwners: fun(
67 'Returns 10 tokens owners in no particular order',
68 [collectionParam, tokenParam],
69 `Vec<${CROSS_ACCOUNT_ID_TYPE}>`,
70 ),
51 tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),71 tokenChildren: fun(
72 'Get tokens nested directly into the token',
73 [collectionParam, tokenParam],
74 'Vec<UpDataStructsTokenChild>',
75 ),
76
52 tokenOwners: fun('Returns 10 tokens owners in no particular order', [collectionParam, tokenParam], `Vec<${CROSS_ACCOUNT_ID_TYPE}>`),77 collectionProperties: fun(
78 'Get collection properties, optionally limited to the provided keys',
79 [collectionParam, propertyKeysParam],
80 'Vec<UpDataStructsProperty>',
81 ),
53 topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),82 tokenProperties: fun(
83 'Get token properties, optionally limited to the provided keys',
84 [collectionParam, tokenParam, propertyKeysParam],
85 'Vec<UpDataStructsProperty>',
86 ),
54 tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec<UpDataStructsTokenChild>'),87 propertyPermissions: fun(
88 'Get property permissions, optionally limited to the provided keys',
89 [collectionParam, propertyKeysParam],
90 'Vec<UpDataStructsPropertyKeyPermission>',
91 ),
92
55 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),93 constMetadata: fun(
94 'Get token constant metadata',
95 [collectionParam, tokenParam],
96 'Vec<u8>',
97 ),
56 variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),98 variableMetadata: fun(
99 'Get token variable metadata',
100 [collectionParam, tokenParam],
101 'Vec<u8>',
102 ),
103
57 collectionProperties: fun(104 tokenData: fun(
58 'Get collection properties',105 'Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT',
59 [collectionParam, propertyKeysParam],106 [collectionParam, tokenParam, propertyKeysParam],
60 'Vec<UpDataStructsProperty>',107 'UpDataStructsTokenData',
61 ),108 ),
62 tokenProperties: fun(109 totalSupply: fun(
63 'Get token properties',110 'Get the amount of distinctive tokens present in a collection',
64 [collectionParam, tokenParam, propertyKeysParam],111 [collectionParam],
65 'Vec<UpDataStructsProperty>',112 'u32',
66 ),113 ),
114
67 propertyPermissions: fun(115 accountBalance: fun(
68 'Get property permissions',116 'Get the amount of any user tokens owned by an account',
69 [collectionParam, propertyKeysParam],117 [collectionParam, crossAccountParam()],
70 'Vec<UpDataStructsPropertyKeyPermission>',118 'u32',
71 ),119 ),
72 tokenData: fun(120 balance: fun(
73 'Get token data',121 'Get the amount of a specific token owned by an account',
74 [collectionParam, tokenParam, propertyKeysParam],122 [collectionParam, crossAccountParam(), tokenParam],
75 'UpDataStructsTokenData',123 'u128',
76 ),124 ),
77 tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),125 allowance: fun(
126 'Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor',
127 [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam],
128 'u128',
129 ),
130
78 collectionById: fun('Get collection by specified id', [collectionParam], 'Option<UpDataStructsRpcCollection>'),131 adminlist: fun(
132 'Get the list of admin accounts of a collection',
133 [collectionParam],
134 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>',
135 ),
79 collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'),136 allowlist: fun(
137 'Get the list of accounts allowed to operate within a collection',
138 [collectionParam],
139 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>',
140 ),
80 allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),141 allowed: fun(
142 'Check if a user is allowed to operate within a collection',
143 [collectionParam, crossAccountParam()],
144 'bool',
145 ),
146
147 lastTokenId: fun(
148 'Get the last token ID created in a collection',
149 [collectionParam],
150 'u32',
151 ),
152 collectionById: fun(
153 'Get a collection by the specified ID',
154 [collectionParam],
155 'Option<UpDataStructsRpcCollection>',
156 ),
157 collectionStats: fun(
158 'Get chain stats about collections',
159 [],
160 'UpDataStructsCollectionStats',
161 ),
162
81 nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),163 nextSponsored: fun(
164 'Get the number of blocks until sponsoring a transaction is available',
165 [collectionParam, crossAccountParam(), tokenParam],
166 'Option<u64>',
167 ),
82 effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option<UpDataStructsCollectionLimits>'),168 effectiveCollectionLimits: fun(
169 'Get effective collection limits',
170 [collectionParam],
171 'Option<UpDataStructsCollectionLimits>',
172 ),
83 totalPieces: fun('Get total pieces of token', [collectionParam, tokenParam], 'Option<u128>'),173 totalPieces: fun(
174 'Get the total amount of pieces of an RFT',
175 [collectionParam, tokenParam],
176 'Option<u128>',
177 ),
84 },178 },
85};179};