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

difftreelog

doc: clarifications to primitives and rpcs

Farhad Hakimov2022-07-15parent: #6fe077c.patch.diff
in: master

3 files changed

modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -42,7 +42,7 @@
 #[rpc(server)]
 #[async_trait]
 pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {
-	/// Get tokens owned by account
+	/// Get tokens owned by account.
 	#[method(name = "unique_accountTokens")]
 	fn account_tokens(
 		&self,
@@ -51,7 +51,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<TokenId>>;
 
-	/// Get tokens contained in collection
+	/// Get tokens contained within a collection.
 	#[method(name = "unique_collectionTokens")]
 	fn collection_tokens(
 		&self,
@@ -59,7 +59,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<TokenId>>;
 
-	/// Check if token exists
+	/// Check if the token exists.
 	#[method(name = "unique_tokenExists")]
 	fn token_exists(
 		&self,
@@ -68,7 +68,7 @@
 		at: Option<BlockHash>,
 	) -> Result<bool>;
 
-	/// Get token owner
+	/// Get the token owner.
 	#[method(name = "unique_tokenOwner")]
 	fn token_owner(
 		&self,
@@ -77,7 +77,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Option<CrossAccountId>>;
 
-	/// Get token owner, in case of nested token - find the parent recursively
+	/// Get the topmost token owner in the hierarchy of a possibly nested token.
 	#[method(name = "unique_topmostTokenOwner")]
 	fn topmost_token_owner(
 		&self,
@@ -86,7 +86,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Option<CrossAccountId>>;
 
-	/// Get tokens nested directly into the token
+	/// Get tokens nested directly into the token.
 	#[method(name = "unique_tokenChildren")]
 	fn token_children(
 		&self,
@@ -95,7 +95,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<TokenChild>>;
 
-	/// Get collection properties
+	/// Get collection properties, optionally limited to the provided keys.
 	#[method(name = "unique_collectionProperties")]
 	fn collection_properties(
 		&self,
@@ -104,7 +104,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<Property>>;
 
-	/// Get token properties
+	/// Get token properties, optionally limited to the provided keys.
 	#[method(name = "unique_tokenProperties")]
 	fn token_properties(
 		&self,
@@ -114,7 +114,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<Property>>;
 
-	/// Get property permissions
+	/// Get property permissions, optionally limited to the provided keys.
 	#[method(name = "unique_propertyPermissions")]
 	fn property_permissions(
 		&self,
@@ -123,7 +123,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<PropertyKeyPermission>>;
 
-	/// Get token data
+	/// Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT.
 	#[method(name = "unique_tokenData")]
 	fn token_data(
 		&self,
@@ -133,11 +133,11 @@
 		at: Option<BlockHash>,
 	) -> Result<TokenData<CrossAccountId>>;
 
-	/// Get amount of unique collection tokens
+	/// Get the amount of distinctive tokens present in a collection.
 	#[method(name = "unique_totalSupply")]
 	fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;
 
-	/// Get owned amount of any user tokens
+	/// Get the amount of any user tokens owned by an account.
 	#[method(name = "unique_accountBalance")]
 	fn account_balance(
 		&self,
@@ -146,7 +146,7 @@
 		at: Option<BlockHash>,
 	) -> Result<u32>;
 
-	/// Get owned amount of specific account token
+	/// Get the amount of a specific token owned by an account.
 	#[method(name = "unique_balance")]
 	fn balance(
 		&self,
@@ -156,7 +156,7 @@
 		at: Option<BlockHash>,
 	) -> Result<String>;
 
-	/// Get allowed amount
+	/// Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor.
 	#[method(name = "unique_allowance")]
 	fn allowance(
 		&self,
@@ -167,7 +167,7 @@
 		at: Option<BlockHash>,
 	) -> Result<String>;
 
-	/// Get admin list
+	/// Get the list of admin accounts of a collection.
 	#[method(name = "unique_adminlist")]
 	fn adminlist(
 		&self,
@@ -175,7 +175,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<CrossAccountId>>;
 
-	/// Get allowlist
+	/// Get the list of accounts allowed to operate within a collection.
 	#[method(name = "unique_allowlist")]
 	fn allowlist(
 		&self,
@@ -183,7 +183,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Vec<CrossAccountId>>;
 
-	/// Check if user is allowed to use collection
+	/// Check if a user is allowed to operate within a collection.
 	#[method(name = "unique_allowed")]
 	fn allowed(
 		&self,
@@ -192,11 +192,11 @@
 		at: Option<BlockHash>,
 	) -> Result<bool>;
 
-	/// Get last token ID created in a collection
+	/// Get the last token ID created in a collection.
 	#[method(name = "unique_lastTokenId")]
 	fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;
 
-	/// Get collection by specified ID
+	/// Get collection info by the specified ID.
 	#[method(name = "unique_collectionById")]
 	fn collection_by_id(
 		&self,
@@ -204,11 +204,11 @@
 		at: Option<BlockHash>,
 	) -> Result<Option<RpcCollection<AccountId>>>;
 
-	/// Get collection stats
+	/// Get chain stats about collections.
 	#[method(name = "unique_collectionStats")]
 	fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;
 
-	/// Get number of blocks when sponsored transaction is available
+	/// Get the number of blocks until sponsoring a transaction is available.
 	#[method(name = "unique_nextSponsored")]
 	fn next_sponsored(
 		&self,
@@ -218,7 +218,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Option<u64>>;
 
-	/// Get effective collection limits
+	/// Get effective collection limits. If not explicitly set, get the chain defaults.
 	#[method(name = "unique_effectiveCollectionLimits")]
 	fn effective_collection_limits(
 		&self,
@@ -226,7 +226,7 @@
 		at: Option<BlockHash>,
 	) -> Result<Option<CollectionLimits>>;
 
-	/// Get total pieces of token
+	/// Get the total amount of pieces of an RFT.
 	#[method(name = "unique_totalPieces")]
 	fn total_pieces(
 		&self,
@@ -253,20 +253,20 @@
 		Theme,
 	>
 	{
+		/// Get the latest created collection ID.
 		#[method(name = "rmrk_lastCollectionIdx")]
-		/// Get the latest created collection id
 		fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;
 
+		/// Get collection info by ID.
 		#[method(name = "rmrk_collectionById")]
-		/// Get collection by id
 		fn collection_by_id(
 			&self,
 			id: RmrkCollectionId,
 			at: Option<BlockHash>,
 		) -> Result<Option<CollectionInfo>>;
 
+		/// Get NFT info by collection and NFT IDs.
 		#[method(name = "rmrk_nftById")]
-		/// Get NFT by collection id and NFT id
 		fn nft_by_id(
 			&self,
 			collection_id: RmrkCollectionId,
@@ -274,8 +274,8 @@
 			at: Option<BlockHash>,
 		) -> Result<Option<NftInfo>>;
 
+		/// Get tokens owned by an account in a collection.
 		#[method(name = "rmrk_accountTokens")]
-		/// Get tokens owned by an account in a collection
 		fn account_tokens(
 			&self,
 			account_id: AccountId,
@@ -283,8 +283,8 @@
 			at: Option<BlockHash>,
 		) -> Result<Vec<RmrkNftId>>;
 
+		/// Get tokens nested in an NFT - its direct children (not the children's children).
 		#[method(name = "rmrk_nftChildren")]
-		/// Get NFT children
 		fn nft_children(
 			&self,
 			collection_id: RmrkCollectionId,
@@ -292,8 +292,8 @@
 			at: Option<BlockHash>,
 		) -> Result<Vec<RmrkNftChild>>;
 
+		/// Get collection properties, created by the user - not the proxy-specific properties.
 		#[method(name = "rmrk_collectionProperties")]
-		/// Get collection properties
 		fn collection_properties(
 			&self,
 			collection_id: RmrkCollectionId,
@@ -301,8 +301,8 @@
 			at: Option<BlockHash>,
 		) -> Result<Vec<PropertyInfo>>;
 
+		/// Get NFT properties, created by the user - not the proxy-specific properties.
 		#[method(name = "rmrk_nftProperties")]
-		/// Get NFT properties
 		fn nft_properties(
 			&self,
 			collection_id: RmrkCollectionId,
@@ -311,8 +311,8 @@
 			at: Option<BlockHash>,
 		) -> Result<Vec<PropertyInfo>>;
 
+		/// Get data of resources of an NFT.
 		#[method(name = "rmrk_nftResources")]
-		/// Get NFT resources
 		fn nft_resources(
 			&self,
 			collection_id: RmrkCollectionId,
@@ -320,8 +320,8 @@
 			at: Option<BlockHash>,
 		) -> Result<Vec<ResourceInfo>>;
 
+		/// Get the priority of a resource in an NFT.
 		#[method(name = "rmrk_nftResourcePriority")]
-		/// Get NFT resource priority
 		fn nft_resource_priority(
 			&self,
 			collection_id: RmrkCollectionId,
@@ -330,24 +330,24 @@
 			at: Option<BlockHash>,
 		) -> Result<Option<u32>>;
 
+		/// Get base info by its ID.
 		#[method(name = "rmrk_base")]
-		/// Get base info
 		fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;
 
+		/// Get all parts of a base.
 		#[method(name = "rmrk_baseParts")]
-		/// Get all Base's parts
 		fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;
 
+		/// Get the theme names belonging to a base.
 		#[method(name = "rmrk_themeNames")]
-		/// Get Base's theme names
 		fn theme_names(
 			&self,
 			base_id: RmrkBaseId,
 			at: Option<BlockHash>,
 		) -> Result<Vec<RmrkThemeName>>;
 
+		/// Get theme info, including properties, optionally limited to the provided keys.
 		#[method(name = "rmrk_themes")]
-		/// Get Theme info -- name, properties, and inherit flag
 		fn theme(
 			&self,
 			base_id: RmrkBaseId,
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
367367
368/// Limits and restrictions of a collection.368/// Limits and restrictions of a collection.
369/// All fields are wrapped in `Option`s, where None means chain default.369/// All fields are wrapped in `Option`s, where None means chain default.
370///
371/// todo:doc links to chain defaults
370// 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.
371#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]374#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
372#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]375#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
373pub struct CollectionLimits {376pub struct CollectionLimits {
374 /// Maximum number of owned tokens per account377 /// Maximum number of owned tokens per account. Chain default: [`ACCOUNT_TOKEN_OWNERSHIP_LIMIT`]
375 pub account_token_ownership_limit: Option<u32>,378 pub account_token_ownership_limit: Option<u32>,
376 /// Maximum size of data of a sponsored transaction379 /// Maximum size of data in bytes of a sponsored transaction. Chain default: [`CUSTOM_DATA_LIMIT`]
377 pub sponsored_data_size: Option<u32>,380 pub sponsored_data_size: Option<u32>,
378381
379 /// FIXME should we delete this or repurpose it?382 /// FIXME should we delete this or repurpose it?
380 /// None - setVariableMetadata is not sponsored383 /// None - setVariableMetadata is not sponsored
381 /// Some(v) - setVariableMetadata is sponsored384 /// Some(v) - setVariableMetadata is sponsored
382 /// if there is v block between txs385 /// if there is v block between txs
386 ///
387 /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
383 pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,388 pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,
384 /// Maximum amount of tokens inside the collection389 /// Maximum amount of tokens inside the collection. Chain default: [`COLLECTION_TOKEN_LIMIT`]
385 pub token_limit: Option<u32>,390 pub token_limit: Option<u32>,
386391
387 /// Timeout for sponsoring a token transfer in passed blocks392 /// Timeout for sponsoring a token transfer in passed blocks. Chain default: [`MAX_SPONSOR_TIMEOUT`]
388 pub sponsor_transfer_timeout: Option<u32>,393 pub sponsor_transfer_timeout: Option<u32>,
389 /// Timeout for sponsoring an approval in passed blocks394 /// Timeout for sponsoring an approval in passed blocks. Chain default: [`SPONSOR_APPROVE_TIMEOUT`]
390 pub sponsor_approve_timeout: Option<u32>,395 pub sponsor_approve_timeout: Option<u32>,
391 /// Can a token be transferred by the owner396 /// Can a token be transferred by the owner. Chain default: `false`
392 pub owner_can_transfer: Option<bool>,397 pub owner_can_transfer: Option<bool>,
393 /// Can a token be burned by the owner398 /// Can a token be burned by the owner. Chain default: `true`
394 pub owner_can_destroy: Option<bool>,399 pub owner_can_destroy: Option<bool>,
395 /// Can a token be transferred at all400 /// Can a token be transferred at all. Chain default: `true`
396 pub transfers_enabled: Option<bool>,401 pub transfers_enabled: Option<bool>,
397}402}
398403
445 }450 }
446}451}
447452
448// When adding/removing fields from this struct - don't forget to also update clamp_limits453/// Permissions on certain operations within a collection.
454/// All fields are wrapped in `Option`s, where None means chain default.
455// IMPORTANT: When adding/removing fields from this struct - don't forget to also
456// update clamp_limits() in pallet-common.
449#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]457#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
450#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]458#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
451pub struct CollectionPermissions {459pub struct CollectionPermissions {
500 }508 }
501}509}
502510
511/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens.
503#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]512#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]
504#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]513#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
505#[derivative(Debug)]514#[derivative(Debug)]
516 pub permissive: bool,525 pub permissive: bool,
517}526}
518527
528/// Enum denominating how often can sponsoring occur if it is enabled.
519#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]529#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]
520#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]530#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
521pub enum SponsoringRateLimit {531pub enum SponsoringRateLimit {
532 /// Sponsoring is disabled, and the collection sponsor will not pay for transactions
522 SponsoringDisabled,533 SponsoringDisabled,
523 /// Once per how many blocks can sponsorship of a transaction type occur534 /// Once per how many blocks can sponsorship of a transaction type occur
524 Blocks(u32),535 Blocks(u32),
525}536}
526537
538/// Data used to describe an NFT at creation.
527#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]539#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]
528#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]540#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
529#[derivative(Debug)]541#[derivative(Debug)]
534 pub properties: CollectionPropertiesVec,546 pub properties: CollectionPropertiesVec,
535}547}
536548
549/// Data used to describe a Fungible token at creation.
537#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]550#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]
538#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]551#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
539pub struct CreateFungibleData {552pub struct CreateFungibleData {
540 /// Number of fungible tokens minted553 /// Number of fungible coins minted
541 pub value: u128,554 pub value: u128,
542}555}
543556
557/// Data used to describe a Refungible token at creation.
544#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]558#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]
545#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]559#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
546#[derivative(Debug)]560#[derivative(Debug)]
547pub struct CreateReFungibleData {561pub struct CreateReFungibleData {
562 /// Immutable metadata of the token
548 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]563 #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]
549 #[derivative(Debug(format_with = "bounded::vec_debug"))]564 #[derivative(Debug(format_with = "bounded::vec_debug"))]
550 pub const_data: BoundedVec<u8, CustomDataLimit>,565 pub const_data: BoundedVec<u8, CustomDataLimit>,
560 None,575 None,
561}576}
562577
578/// Enum holding data used for creation of all three item types.
563#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]579#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
564#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]580#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
565pub enum CreateItemData {581pub enum CreateItemData {
modifiedtests/src/interfaces/unique/definitions.tsdiffbeforeafterboth
--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -37,48 +37,123 @@
 export default {
   types: {},
   rpc: {
-    adminlist: fun('Get admin list', [collectionParam], 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>'),
-    allowlist: fun('Get allowlist', [collectionParam], 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>'),
+    accountTokens: fun(
+      'Get tokens owned by an account in a collection', 
+      [collectionParam, crossAccountParam()], 
+      'Vec<u32>',
+    ),
+    collectionTokens: fun(
+      'Get tokens contained within a collection', 
+      [collectionParam], 
+      'Vec<u32>',
+    ),
+    tokenExists: fun(
+      'Check if the token exists', 
+      [collectionParam, tokenParam], 
+      'bool',
+    ),
 
-    accountTokens: fun('Get tokens owned by account', [collectionParam, crossAccountParam()], 'Vec<u32>'),
-    collectionTokens: fun('Get tokens contained in collection', [collectionParam], 'Vec<u32>'),
+    tokenOwner: fun(
+      'Get the token owner', 
+      [collectionParam, tokenParam], 
+      `Option<${CROSS_ACCOUNT_ID_TYPE}>`,
+    ),
+    topmostTokenOwner: fun(
+      'Get the topmost token owner in the hierarchy of a possibly nested token', 
+      [collectionParam, tokenParam], 
+      `Option<${CROSS_ACCOUNT_ID_TYPE}>`,
+    ),
+    tokenChildren: fun(
+      'Get tokens nested directly into the token', 
+      [collectionParam, tokenParam], 
+      'Vec<UpDataStructsTokenChild>',
+    ),
 
-    lastTokenId: fun('Get last token ID created in a collection', [collectionParam], 'u32'),
-    totalSupply: fun('Get amount of unique collection tokens', [collectionParam], 'u32'),
-    accountBalance: fun('Get owned amount of any user tokens', [collectionParam, crossAccountParam()], 'u32'),
-    balance: fun('Get owned amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),
-    allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),
-    tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),
-    topmostTokenOwner: fun('Get token owner, in case of nested token - find the parent recursively', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),
-    tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec<UpDataStructsTokenChild>'),
-    constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),
-    variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec<u8>'),
     collectionProperties: fun(
-      'Get collection properties',
+      'Get collection properties, optionally limited to the provided keys',
       [collectionParam, propertyKeysParam],
       'Vec<UpDataStructsProperty>',
     ),
     tokenProperties: fun(
-      'Get token properties',
+      'Get token properties, optionally limited to the provided keys',
       [collectionParam, tokenParam, propertyKeysParam],
       'Vec<UpDataStructsProperty>',
     ),
     propertyPermissions: fun(
-      'Get property permissions',
+      'Get property permissions, optionally limited to the provided keys',
       [collectionParam, propertyKeysParam],
       'Vec<UpDataStructsPropertyKeyPermission>',
     ),
+
     tokenData: fun(
-      'Get token data',
+      'Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT',
       [collectionParam, tokenParam, propertyKeysParam],
       'UpDataStructsTokenData',
     ),
-    tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'),
-    collectionById: fun('Get collection by specified ID', [collectionParam], 'Option<UpDataStructsRpcCollection>'),
-    collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'),
-    allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),
-    nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),
-    effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option<UpDataStructsCollectionLimits>'),
-    totalPieces: fun('Get total pieces of token', [collectionParam, tokenParam], 'Option<u128>'),
+    totalSupply: fun(
+      'Get the amount of distinctive tokens present in a collection', 
+      [collectionParam], 
+      'u32',
+    ),
+
+    accountBalance: fun(
+      'Get the amount of any user tokens owned by an account', 
+      [collectionParam, crossAccountParam()], 
+      'u32',
+    ),
+    balance: fun(
+      'Get the amount of a specific token owned by an account', 
+      [collectionParam, crossAccountParam(), tokenParam], 
+      'u128',
+    ),
+    allowance: fun(
+      'Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor', 
+      [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 
+      'u128',
+    ),
+
+    adminlist: fun(
+      'Get the list of admin accounts of a collection', 
+      [collectionParam], 
+      'Vec<PalletEvmAccountBasicCrossAccountIdRepr>',
+    ),
+    allowlist: fun(
+      'Get the list of accounts allowed to operate within a collection', 
+      [collectionParam], 
+      'Vec<PalletEvmAccountBasicCrossAccountIdRepr>',
+    ),
+    allowed: fun(
+      'Check if a user is allowed to operate within a collection', 
+      [collectionParam, crossAccountParam()], 
+      'bool',
+    ),
+
+    lastTokenId: fun('Get the last token ID created in a collection', [collectionParam], 'u32'),
+    collectionById: fun(
+      'Get a collection by the specified ID', 
+      [collectionParam], 
+      'Option<UpDataStructsRpcCollection>',
+    ),
+    collectionStats: fun(
+      'Get chain stats about collections', 
+      [], 
+      'UpDataStructsCollectionStats',
+    ),
+
+    nextSponsored: fun(
+      'Get the number of blocks until sponsoring a transaction is available', 
+      [collectionParam, crossAccountParam(), tokenParam], 
+      'Option<u64>',
+    ),
+    effectiveCollectionLimits: fun(
+      'Get effective collection limits', 
+      [collectionParam], 
+      'Option<UpDataStructsCollectionLimits>',
+    ),
+    totalPieces: fun(
+      'Get the total amount of pieces of an RFT', 
+      [collectionParam, tokenParam], 
+      'Option<u128>',
+    ),
   },
 };