difftreelog
doc: clarifications to primitives and rpcs
in: master
3 files changed
client/rpc/src/lib.rsdiffbeforeafterboth42#[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 account45 /// Get tokens owned by account.46 #[method(name = "unique_accountTokens")]46 #[method(name = "unique_accountTokens")]47 fn account_tokens(47 fn account_tokens(48 &self,48 &self,51 at: Option<BlockHash>,51 at: Option<BlockHash>,52 ) -> Result<Vec<TokenId>>;52 ) -> Result<Vec<TokenId>>;535354 /// Get tokens contained in collection54 /// Get tokens contained within a collection.55 #[method(name = "unique_collectionTokens")]55 #[method(name = "unique_collectionTokens")]56 fn collection_tokens(56 fn collection_tokens(57 &self,57 &self,58 collection: CollectionId,58 collection: CollectionId,59 at: Option<BlockHash>,59 at: Option<BlockHash>,60 ) -> Result<Vec<TokenId>>;60 ) -> Result<Vec<TokenId>>;616162 /// Check if token exists62 /// Check if the token exists.63 #[method(name = "unique_tokenExists")]63 #[method(name = "unique_tokenExists")]64 fn token_exists(64 fn token_exists(65 &self,65 &self,68 at: Option<BlockHash>,68 at: Option<BlockHash>,69 ) -> Result<bool>;69 ) -> Result<bool>;707071 /// Get token owner71 /// Get the token owner.72 #[method(name = "unique_tokenOwner")]72 #[method(name = "unique_tokenOwner")]73 fn token_owner(73 fn token_owner(74 &self,74 &self,77 at: Option<BlockHash>,77 at: Option<BlockHash>,78 ) -> Result<Option<CrossAccountId>>;78 ) -> Result<Option<CrossAccountId>>;797980 /// Get token owner, in case of nested token - find the parent recursively80 /// Get the topmost token owner in the hierarchy of a possibly nested token.81 #[method(name = "unique_topmostTokenOwner")]81 #[method(name = "unique_topmostTokenOwner")]82 fn topmost_token_owner(82 fn topmost_token_owner(83 &self,83 &self,86 at: Option<BlockHash>,86 at: Option<BlockHash>,87 ) -> Result<Option<CrossAccountId>>;87 ) -> Result<Option<CrossAccountId>>;888889 /// Get tokens nested directly into the token89 /// Get tokens nested directly into the token.90 #[method(name = "unique_tokenChildren")]90 #[method(name = "unique_tokenChildren")]91 fn token_children(91 fn token_children(92 &self,92 &self,95 at: Option<BlockHash>,95 at: Option<BlockHash>,96 ) -> Result<Vec<TokenChild>>;96 ) -> Result<Vec<TokenChild>>;979798 /// Get collection properties98 /// Get collection properties, optionally limited to the provided keys.99 #[method(name = "unique_collectionProperties")]99 #[method(name = "unique_collectionProperties")]100 fn collection_properties(100 fn collection_properties(101 &self,101 &self,104 at: Option<BlockHash>,104 at: Option<BlockHash>,105 ) -> Result<Vec<Property>>;105 ) -> Result<Vec<Property>>;106106107 /// Get token properties107 /// Get token properties, optionally limited to the provided keys.108 #[method(name = "unique_tokenProperties")]108 #[method(name = "unique_tokenProperties")]109 fn token_properties(109 fn token_properties(110 &self,110 &self,114 at: Option<BlockHash>,114 at: Option<BlockHash>,115 ) -> Result<Vec<Property>>;115 ) -> Result<Vec<Property>>;116116117 /// Get property permissions117 /// Get property permissions, optionally limited to the provided keys.118 #[method(name = "unique_propertyPermissions")]118 #[method(name = "unique_propertyPermissions")]119 fn property_permissions(119 fn property_permissions(120 &self,120 &self,123 at: Option<BlockHash>,123 at: Option<BlockHash>,124 ) -> Result<Vec<PropertyKeyPermission>>;124 ) -> Result<Vec<PropertyKeyPermission>>;125125126 /// Get token data126 /// Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT.127 #[method(name = "unique_tokenData")]127 #[method(name = "unique_tokenData")]128 fn token_data(128 fn token_data(129 &self,129 &self,133 at: Option<BlockHash>,133 at: Option<BlockHash>,134 ) -> Result<TokenData<CrossAccountId>>;134 ) -> Result<TokenData<CrossAccountId>>;135135136 /// Get amount of unique collection tokens136 /// Get the amount of distinctive tokens present in a collection.137 #[method(name = "unique_totalSupply")]137 #[method(name = "unique_totalSupply")]138 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;138 fn total_supply(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<u32>;139139140 /// Get owned amount of any user tokens140 /// Get the amount of any user tokens owned by an account.141 #[method(name = "unique_accountBalance")]141 #[method(name = "unique_accountBalance")]142 fn account_balance(142 fn account_balance(143 &self,143 &self,146 at: Option<BlockHash>,146 at: Option<BlockHash>,147 ) -> Result<u32>;147 ) -> Result<u32>;148148149 /// Get owned amount of specific account token149 /// Get the amount of a specific token owned by an account.150 #[method(name = "unique_balance")]150 #[method(name = "unique_balance")]151 fn balance(151 fn balance(152 &self,152 &self,156 at: Option<BlockHash>,156 at: Option<BlockHash>,157 ) -> Result<String>;157 ) -> Result<String>;158158159 /// Get allowed amount159 /// Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor.160 #[method(name = "unique_allowance")]160 #[method(name = "unique_allowance")]161 fn allowance(161 fn allowance(162 &self,162 &self,167 at: Option<BlockHash>,167 at: Option<BlockHash>,168 ) -> Result<String>;168 ) -> Result<String>;169169170 /// Get admin list170 /// Get the list of admin accounts of a collection.171 #[method(name = "unique_adminlist")]171 #[method(name = "unique_adminlist")]172 fn adminlist(172 fn adminlist(173 &self,173 &self,174 collection: CollectionId,174 collection: CollectionId,175 at: Option<BlockHash>,175 at: Option<BlockHash>,176 ) -> Result<Vec<CrossAccountId>>;176 ) -> Result<Vec<CrossAccountId>>;177177178 /// Get allowlist178 /// Get the list of accounts allowed to operate within a collection.179 #[method(name = "unique_allowlist")]179 #[method(name = "unique_allowlist")]180 fn allowlist(180 fn allowlist(181 &self,181 &self,182 collection: CollectionId,182 collection: CollectionId,183 at: Option<BlockHash>,183 at: Option<BlockHash>,184 ) -> Result<Vec<CrossAccountId>>;184 ) -> Result<Vec<CrossAccountId>>;185185186 /// Check if user is allowed to use collection186 /// Check if a user is allowed to operate within a collection.187 #[method(name = "unique_allowed")]187 #[method(name = "unique_allowed")]188 fn allowed(188 fn allowed(189 &self,189 &self,192 at: Option<BlockHash>,192 at: Option<BlockHash>,193 ) -> Result<bool>;193 ) -> Result<bool>;194194195 /// Get last token ID created in a collection195 /// Get the last token ID created in a collection.196 #[method(name = "unique_lastTokenId")]196 #[method(name = "unique_lastTokenId")]197 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;197 fn last_token_id(&self, collection: CollectionId, at: Option<BlockHash>) -> Result<TokenId>;198198199 /// Get collection by specified ID199 /// Get collection info by the specified ID.200 #[method(name = "unique_collectionById")]200 #[method(name = "unique_collectionById")]201 fn collection_by_id(201 fn collection_by_id(202 &self,202 &self,203 collection: CollectionId,203 collection: CollectionId,204 at: Option<BlockHash>,204 at: Option<BlockHash>,205 ) -> Result<Option<RpcCollection<AccountId>>>;205 ) -> Result<Option<RpcCollection<AccountId>>>;206206207 /// Get collection stats207 /// Get chain stats about collections.208 #[method(name = "unique_collectionStats")]208 #[method(name = "unique_collectionStats")]209 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;209 fn collection_stats(&self, at: Option<BlockHash>) -> Result<CollectionStats>;210210211 /// Get number of blocks when sponsored transaction is available211 /// Get the number of blocks until sponsoring a transaction is available.212 #[method(name = "unique_nextSponsored")]212 #[method(name = "unique_nextSponsored")]213 fn next_sponsored(213 fn next_sponsored(214 &self,214 &self,218 at: Option<BlockHash>,218 at: Option<BlockHash>,219 ) -> Result<Option<u64>>;219 ) -> Result<Option<u64>>;220220221 /// Get effective collection limits221 /// Get effective collection limits. If not explicitly set, get the chain defaults.222 #[method(name = "unique_effectiveCollectionLimits")]222 #[method(name = "unique_effectiveCollectionLimits")]223 fn effective_collection_limits(223 fn effective_collection_limits(224 &self,224 &self,225 collection_id: CollectionId,225 collection_id: CollectionId,226 at: Option<BlockHash>,226 at: Option<BlockHash>,227 ) -> Result<Option<CollectionLimits>>;227 ) -> Result<Option<CollectionLimits>>;228228229 /// Get total pieces of token229 /// Get the total amount of pieces of an RFT.230 #[method(name = "unique_totalPieces")]230 #[method(name = "unique_totalPieces")]231 fn total_pieces(231 fn total_pieces(232 &self,232 &self,253 Theme,253 Theme,254 >254 >255 {255 {256 /// Get the latest created collection ID.256 #[method(name = "rmrk_lastCollectionIdx")]257 #[method(name = "rmrk_lastCollectionIdx")]257 /// Get the latest created collection id258 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;258 fn last_collection_idx(&self, at: Option<BlockHash>) -> Result<RmrkCollectionId>;259259260 /// Get collection info by ID.260 #[method(name = "rmrk_collectionById")]261 #[method(name = "rmrk_collectionById")]261 /// Get collection by id262 fn collection_by_id(262 fn collection_by_id(263 &self,263 &self,264 id: RmrkCollectionId,264 id: RmrkCollectionId,265 at: Option<BlockHash>,265 at: Option<BlockHash>,266 ) -> Result<Option<CollectionInfo>>;266 ) -> Result<Option<CollectionInfo>>;267267268 /// Get NFT info by collection and NFT IDs.268 #[method(name = "rmrk_nftById")]269 #[method(name = "rmrk_nftById")]269 /// Get NFT by collection id and NFT id270 fn nft_by_id(270 fn nft_by_id(271 &self,271 &self,272 collection_id: RmrkCollectionId,272 collection_id: RmrkCollectionId,273 nft_id: RmrkNftId,273 nft_id: RmrkNftId,274 at: Option<BlockHash>,274 at: Option<BlockHash>,275 ) -> Result<Option<NftInfo>>;275 ) -> Result<Option<NftInfo>>;276276277 /// Get tokens owned by an account in a collection.277 #[method(name = "rmrk_accountTokens")]278 #[method(name = "rmrk_accountTokens")]278 /// Get tokens owned by an account in a collection279 fn account_tokens(279 fn account_tokens(280 &self,280 &self,281 account_id: AccountId,281 account_id: AccountId,282 collection_id: RmrkCollectionId,282 collection_id: RmrkCollectionId,283 at: Option<BlockHash>,283 at: Option<BlockHash>,284 ) -> Result<Vec<RmrkNftId>>;284 ) -> Result<Vec<RmrkNftId>>;285285286 /// Get tokens nested in an NFT - its direct children (not the children's children).286 #[method(name = "rmrk_nftChildren")]287 #[method(name = "rmrk_nftChildren")]287 /// Get NFT children288 fn nft_children(288 fn nft_children(289 &self,289 &self,290 collection_id: RmrkCollectionId,290 collection_id: RmrkCollectionId,291 nft_id: RmrkNftId,291 nft_id: RmrkNftId,292 at: Option<BlockHash>,292 at: Option<BlockHash>,293 ) -> Result<Vec<RmrkNftChild>>;293 ) -> Result<Vec<RmrkNftChild>>;294294295 /// Get collection properties, created by the user - not the proxy-specific properties.295 #[method(name = "rmrk_collectionProperties")]296 #[method(name = "rmrk_collectionProperties")]296 /// Get collection properties297 fn collection_properties(297 fn collection_properties(298 &self,298 &self,299 collection_id: RmrkCollectionId,299 collection_id: RmrkCollectionId,300 filter_keys: Option<Vec<String>>,300 filter_keys: Option<Vec<String>>,301 at: Option<BlockHash>,301 at: Option<BlockHash>,302 ) -> Result<Vec<PropertyInfo>>;302 ) -> Result<Vec<PropertyInfo>>;303303304 /// Get NFT properties, created by the user - not the proxy-specific properties.304 #[method(name = "rmrk_nftProperties")]305 #[method(name = "rmrk_nftProperties")]305 /// Get NFT properties306 fn nft_properties(306 fn nft_properties(307 &self,307 &self,308 collection_id: RmrkCollectionId,308 collection_id: RmrkCollectionId,311 at: Option<BlockHash>,311 at: Option<BlockHash>,312 ) -> Result<Vec<PropertyInfo>>;312 ) -> Result<Vec<PropertyInfo>>;313313314 /// Get data of resources of an NFT.314 #[method(name = "rmrk_nftResources")]315 #[method(name = "rmrk_nftResources")]315 /// Get NFT resources316 fn nft_resources(316 fn nft_resources(317 &self,317 &self,318 collection_id: RmrkCollectionId,318 collection_id: RmrkCollectionId,319 nft_id: RmrkNftId,319 nft_id: RmrkNftId,320 at: Option<BlockHash>,320 at: Option<BlockHash>,321 ) -> Result<Vec<ResourceInfo>>;321 ) -> Result<Vec<ResourceInfo>>;322322323 /// Get the priority of a resource in an NFT.323 #[method(name = "rmrk_nftResourcePriority")]324 #[method(name = "rmrk_nftResourcePriority")]324 /// Get NFT resource priority325 fn nft_resource_priority(325 fn nft_resource_priority(326 &self,326 &self,327 collection_id: RmrkCollectionId,327 collection_id: RmrkCollectionId,330 at: Option<BlockHash>,330 at: Option<BlockHash>,331 ) -> Result<Option<u32>>;331 ) -> Result<Option<u32>>;332332333 /// Get base info by its ID.333 #[method(name = "rmrk_base")]334 #[method(name = "rmrk_base")]334 /// Get base info335 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;335 fn base(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Option<BaseInfo>>;336336337 /// Get all parts of a base.337 #[method(name = "rmrk_baseParts")]338 #[method(name = "rmrk_baseParts")]338 /// Get all Base's parts339 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;339 fn base_parts(&self, base_id: RmrkBaseId, at: Option<BlockHash>) -> Result<Vec<PartType>>;340340341 /// Get the theme names belonging to a base.341 #[method(name = "rmrk_themeNames")]342 #[method(name = "rmrk_themeNames")]342 /// Get Base's theme names343 fn theme_names(343 fn theme_names(344 &self,344 &self,345 base_id: RmrkBaseId,345 base_id: RmrkBaseId,346 at: Option<BlockHash>,346 at: Option<BlockHash>,347 ) -> Result<Vec<RmrkThemeName>>;347 ) -> Result<Vec<RmrkThemeName>>;348348349 /// Get theme info, including properties, optionally limited to the provided keys.349 #[method(name = "rmrk_themes")]350 #[method(name = "rmrk_themes")]350 /// Get Theme info -- name, properties, and inherit flag351 fn theme(351 fn theme(352 &self,352 &self,353 base_id: RmrkBaseId,353 base_id: RmrkBaseId,primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -367,32 +367,37 @@
/// Limits and restrictions of a collection.
/// All fields are wrapped in `Option`s, where None means chain default.
-// When adding/removing fields from this struct - don't forget to also update clamp_limits
+///
+/// todo:doc links to chain defaults
+// IMPORTANT: When adding/removing fields from this struct - don't forget to also
+// update clamp_limits() in pallet-common.
#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct CollectionLimits {
- /// Maximum number of owned tokens per account
+ /// Maximum number of owned tokens per account. Chain default: [`ACCOUNT_TOKEN_OWNERSHIP_LIMIT`]
pub account_token_ownership_limit: Option<u32>,
- /// Maximum size of data of a sponsored transaction
+ /// Maximum size of data in bytes of a sponsored transaction. Chain default: [`CUSTOM_DATA_LIMIT`]
pub sponsored_data_size: Option<u32>,
/// FIXME should we delete this or repurpose it?
/// None - setVariableMetadata is not sponsored
/// Some(v) - setVariableMetadata is sponsored
/// if there is v block between txs
+ ///
+ /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
pub sponsored_data_rate_limit: Option<SponsoringRateLimit>,
- /// Maximum amount of tokens inside the collection
+ /// Maximum amount of tokens inside the collection. Chain default: [`COLLECTION_TOKEN_LIMIT`]
pub token_limit: Option<u32>,
- /// Timeout for sponsoring a token transfer in passed blocks
+ /// Timeout for sponsoring a token transfer in passed blocks. Chain default: [`MAX_SPONSOR_TIMEOUT`]
pub sponsor_transfer_timeout: Option<u32>,
- /// Timeout for sponsoring an approval in passed blocks
+ /// Timeout for sponsoring an approval in passed blocks. Chain default: [`SPONSOR_APPROVE_TIMEOUT`]
pub sponsor_approve_timeout: Option<u32>,
- /// Can a token be transferred by the owner
+ /// Can a token be transferred by the owner. Chain default: `false`
pub owner_can_transfer: Option<bool>,
- /// Can a token be burned by the owner
+ /// Can a token be burned by the owner. Chain default: `true`
pub owner_can_destroy: Option<bool>,
- /// Can a token be transferred at all
+ /// Can a token be transferred at all. Chain default: `true`
pub transfers_enabled: Option<bool>,
}
@@ -445,7 +450,10 @@
}
}
-// When adding/removing fields from this struct - don't forget to also update clamp_limits
+/// Permissions on certain operations within a collection.
+/// All fields are wrapped in `Option`s, where None means chain default.
+// IMPORTANT: When adding/removing fields from this struct - don't forget to also
+// update clamp_limits() in pallet-common.
#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct CollectionPermissions {
@@ -500,6 +508,7 @@
}
}
+/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens.
#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
#[derivative(Debug)]
@@ -516,14 +525,17 @@
pub permissive: bool,
}
+/// Enum denominating how often can sponsoring occur if it is enabled.
#[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub enum SponsoringRateLimit {
+ /// Sponsoring is disabled, and the collection sponsor will not pay for transactions
SponsoringDisabled,
/// Once per how many blocks can sponsorship of a transaction type occur
Blocks(u32),
}
+/// Data used to describe an NFT at creation.
#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
#[derivative(Debug)]
@@ -534,17 +546,20 @@
pub properties: CollectionPropertiesVec,
}
+/// Data used to describe a Fungible token at creation.
#[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct CreateFungibleData {
- /// Number of fungible tokens minted
+ /// Number of fungible coins minted
pub value: u128,
}
+/// Data used to describe a Refungible token at creation.
#[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
#[derivative(Debug)]
pub struct CreateReFungibleData {
+ /// Immutable metadata of the token
#[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))]
#[derivative(Debug(format_with = "bounded::vec_debug"))]
pub const_data: BoundedVec<u8, CustomDataLimit>,
@@ -560,6 +575,7 @@
None,
}
+/// Enum holding data used for creation of all three item types.
#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub enum CreateItemData {
tests/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>',
+ ),
},
};