--- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -50,6 +50,7 @@ account: CrossAccountId, at: Option, ) -> Result>; + /// Get tokens contained in collection #[method(name = "unique_collectionTokens")] fn collection_tokens( @@ -57,6 +58,7 @@ collection: CollectionId, at: Option, ) -> Result>; + /// Check if token exists #[method(name = "unique_tokenExists")] fn token_exists( @@ -65,6 +67,7 @@ token: TokenId, at: Option, ) -> Result; + /// Get token owner #[method(name = "unique_tokenOwner")] fn token_owner( @@ -73,6 +76,7 @@ token: TokenId, at: Option, ) -> Result>; + /// Get token owner, in case of nested token - find the parent recursively #[method(name = "unique_topmostTokenOwner")] fn topmost_token_owner( @@ -81,6 +85,7 @@ token: TokenId, at: Option, ) -> Result>; + /// Get tokens nested directly into the token #[method(name = "unique_tokenChildren")] fn token_children( @@ -89,6 +94,7 @@ token: TokenId, at: Option, ) -> Result>; + /// Get collection properties #[method(name = "unique_collectionProperties")] fn collection_properties( @@ -97,6 +103,7 @@ keys: Option>, at: Option, ) -> Result>; + /// Get token properties #[method(name = "unique_tokenProperties")] fn token_properties( @@ -106,6 +113,7 @@ keys: Option>, at: Option, ) -> Result>; + /// Get property permissions #[method(name = "unique_propertyPermissions")] fn property_permissions( @@ -114,6 +122,7 @@ keys: Option>, at: Option, ) -> Result>; + /// Get token data #[method(name = "unique_tokenData")] fn token_data( @@ -123,9 +132,11 @@ keys: Option>, at: Option, ) -> Result>; + /// Get amount of unique collection tokens #[method(name = "unique_totalSupply")] fn total_supply(&self, collection: CollectionId, at: Option) -> Result; + /// Get owned amount of any user tokens #[method(name = "unique_accountBalance")] fn account_balance( @@ -134,6 +145,7 @@ account: CrossAccountId, at: Option, ) -> Result; + /// Get owned amount of specific account token #[method(name = "unique_balance")] fn balance( @@ -143,6 +155,7 @@ token: TokenId, at: Option, ) -> Result; + /// Get allowed amount #[method(name = "unique_allowance")] fn allowance( @@ -153,6 +166,7 @@ token: TokenId, at: Option, ) -> Result; + /// Get admin list #[method(name = "unique_adminlist")] fn adminlist( @@ -160,6 +174,7 @@ collection: CollectionId, at: Option, ) -> Result>; + /// Get allowlist #[method(name = "unique_allowlist")] fn allowlist( @@ -167,6 +182,7 @@ collection: CollectionId, at: Option, ) -> Result>; + /// Check if user is allowed to use collection #[method(name = "unique_allowed")] fn allowed( @@ -175,9 +191,11 @@ user: CrossAccountId, at: Option, ) -> Result; + /// Get last token ID created in a collection #[method(name = "unique_lastTokenId")] fn last_token_id(&self, collection: CollectionId, at: Option) -> Result; + /// Get collection by specified ID #[method(name = "unique_collectionById")] fn collection_by_id( @@ -185,9 +203,11 @@ collection: CollectionId, at: Option, ) -> Result>>; + /// Get collection stats #[method(name = "unique_collectionStats")] fn collection_stats(&self, at: Option) -> Result; + /// Get number of blocks when sponsored transaction is available #[method(name = "unique_nextSponsored")] fn next_sponsored( @@ -197,6 +217,7 @@ token: TokenId, at: Option, ) -> Result>; + /// Get effective collection limits #[method(name = "unique_effectiveCollectionLimits")] fn effective_collection_limits( @@ -204,6 +225,7 @@ collection_id: CollectionId, at: Option, ) -> Result>; + /// Get total pieces of token #[method(name = "unique_totalPieces")] fn total_pieces( --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -334,7 +334,7 @@ /// /// * collection_id: ID of the collection to which the item belongs. /// - /// * item_id: ID of the item trasnferred. + /// * item_id: ID of the item transferred. /// /// * sender: Original owner of the item. /// --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -58,13 +58,13 @@ pub enum Error { /// Not Fungible item data used to mint in Fungible collection. NotFungibleDataUsedToMintFungibleCollectionToken, - /// Not default id passed as TokenId argument + /// Not default id passed as TokenId argument. FungibleItemsHaveNoId, - /// Tried to set data for fungible item + /// Tried to set data for fungible item. FungibleItemsDontHaveData, - /// Fungible token does not support nested + /// Fungible token does not support nesting. FungibleDisallowsNesting, - /// Setting item properties is not allowed + /// Setting item properties is not allowed. SettingPropertiesNotAllowed, } --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -171,7 +171,7 @@ QueryKind = ValueQuery, >; - /// Amount of tokens owned in a collection.s + /// Amount of tokens owned in a collection. #[pallet::storage] pub type AccountBalance = StorageNMap< Key = ( @@ -182,7 +182,7 @@ QueryKind = ValueQuery, >; - /// todo doc + /// todo:doc #[pallet::storage] pub type Allowance = StorageNMap< Key = (Key, Key), --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -64,13 +64,13 @@ pub enum Error { /// Not Refungible item data used to mint in Refungible collection. NotRefungibleDataUsedToMintFungibleCollectionToken, - /// Maximum refungibility exceeded + /// Maximum refungibility exceeded. WrongRefungiblePieces, - /// Refungible token can't be repartitioned by user who isn't owns all pieces + /// Refungible token can't be repartitioned by user who isn't owns all pieces. RepartitionWhileNotOwningAllPieces, - /// Refungible token can't nest other tokens + /// Refungible token can't nest other tokens. RefungibleDisallowsNesting, - /// Setting item properties is not allowed + /// Setting item properties is not allowed. SettingPropertiesNotAllowed, } @@ -605,7 +605,6 @@ Ok(()) } - /// todo:doc oh look, a precedent. not pub, too. but it has an unclear use-case. /// Returns allowance, which should be set after transaction fn check_allowed( collection: &RefungibleHandle, --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -31,7 +31,7 @@ DepthLimit, /// While iterating over children, reached the breadth limit. BreadthLimit, - /// Couldn't find the token owner that is a token. Perhaps, it does not yet exist. todo:doc? rephrase? + /// Couldn't find the token owner that is itself a token. TokenNotFound, } --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -286,7 +286,7 @@ } } -/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version) +/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version). #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] pub struct Collection { @@ -327,7 +327,7 @@ pub meta_update_permission: MetaUpdatePermission, } -/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version) +/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version). #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct RpcCollection { @@ -568,7 +568,7 @@ ReFungible(CreateReFungibleData), } -/// Explicit NFT creation data with meta parameters +/// Explicit NFT creation data with meta parameters. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug)] pub struct CreateNftExData { @@ -577,7 +577,7 @@ pub owner: CrossAccountId, } -/// Explicit RFT creation data with meta parameters +/// Explicit RFT creation data with meta parameters. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub struct CreateRefungibleExData { @@ -587,7 +587,7 @@ pub users: BoundedBTreeMap>, } -/// Explicit item creation data with meta parameters, namely the owner +/// Explicit item creation data with meta parameters, namely the owner. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub enum CreateItemExData { @@ -635,7 +635,7 @@ } } -/// Token's address, dictated by its collection and token IDs +/// Token's address, dictated by its collection and token IDs. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] // todo possibly rename to be used generally as an address pair