difftreelog
feat(api) added RPC method, integrations tests for fungibble pallet
in: master
Added method that returns 10 tokens owners in no particular order.
30 files changed
Cargo.lockdiffbeforeafterboth595359535954[[package]]5954[[package]]5955name = "pallet-fungible"5955name = "pallet-fungible"5956version = "0.1.0"5956version = "0.1.1"5957dependencies = [5957dependencies = [5958 "ethereum",5958 "ethereum",5959 "evm-coder",5959 "evm-coder",619861986199[[package]]6199[[package]]6200name = "pallet-nonfungible"6200name = "pallet-nonfungible"6201version = "0.1.0"6201version = "0.1.1"6202dependencies = [6202dependencies = [6203 "ethereum",6203 "ethereum",6204 "evm-coder",6204 "evm-coder",123741237412375[[package]]12375[[package]]12376name = "uc-rpc"12376name = "uc-rpc"12377version = "0.1.0"12377version = "0.1.1"12378dependencies = [12378dependencies = [12379 "anyhow",12379 "anyhow",12380 "jsonrpsee",12380 "jsonrpsee",126791267912680[[package]]12680[[package]]12681name = "unique-runtime-common"12681name = "unique-runtime-common"12682version = "0.9.24"12682version = "0.9.25"12683dependencies = [12683dependencies = [12684 "evm-coder",12684 "evm-coder",12685 "fp-rpc",12685 "fp-rpc",127511275112752[[package]]12752[[package]]12753name = "up-rpc"12753name = "up-rpc"12754version = "0.1.0"12754version = "0.1.1"12755dependencies = [12755dependencies = [12756 "pallet-common",12756 "pallet-common",12757 "pallet-evm",12757 "pallet-evm",client/rpc/CHANGELOG.mddiffbeforeafterbothno changes
client/rpc/Cargo.tomldiffbeforeafterboth1[package]1[package]2name = "uc-rpc"2name = "uc-rpc"3version = "0.1.0"3version = "0.1.1"4license = "GPLv3"4license = "GPLv3"5edition = "2021"5edition = "2021"66client/rpc/src/lib.rsdiffbeforeafterboth71 at: Option<BlockHash>,71 at: Option<BlockHash>,72 ) -> Result<Option<CrossAccountId>>;72 ) -> Result<Option<CrossAccountId>>;737374 /// Returns 10 tokens owners in no particular order.74 #[method(name = "unique_tokenOwners")]75 #[method(name = "unique_tokenOwners")]75 fn token_owners(76 fn token_owners(76 &self,77 &self,pallets/common/CHANGELOG.mddiffbeforeafterbothno changes
pallets/common/src/lib.rsdiffbeforeafterboth1748 /// * `token` - The token for which you need to find out the owner.1748 /// * `token` - The token for which you need to find out the owner.1749 fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId>;1749 fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId>;175017501751 /// Token owners1751 /// Returns 10 tokens owners in no particular order.1752 ///1753 /// * `token` - The token for which you need to find out the owners.1752 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId>;1754 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId>;175317551754 /// Get the value of the token property by key.1756 /// Get the value of the token property by key.pallets/fungible/CHANGELOG.mddiffbeforeafterbothno changes
pallets/fungible/Cargo.tomldiffbeforeafterboth1[package]1[package]2name = "pallet-fungible"2name = "pallet-fungible"3version = "0.1.0"3version = "0.1.1"4license = "GPLv3"4license = "GPLv3"5edition = "2021"5edition = "2021"66pallets/fungible/src/common.rsdiffbeforeafterboth362 None362 None363 }363 }364364365 /// Returns 10 tokens owners in no particular order.365 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {366 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {366 <Pallet<T>>::token_owners(self.id, token).unwrap_or_else(|| vec![])367 <Pallet<T>>::token_owners(self.id, token).unwrap_or_else(|| vec![])367 }368 }pallets/fungible/src/lib.rsdiffbeforeafterboth614 )614 )615 }615 }616616617 /// Returns 10 tokens owners in no particular order618 ///619 /// There is no direct way to get token holders in ascending order,620 /// since `iter_prefix` returns values in no particular order.621 /// Therefore, getting the 10 largest holders with a large value of holders622 /// can lead to impact memory allocation + sorting with `n * log (n)`.617 pub fn token_owners(623 pub fn token_owners(618 collection: CollectionId,624 collection: CollectionId,619 _token: TokenId,625 _token: TokenId,620 ) -> Option<Vec<T::CrossAccountId>> {626 ) -> Option<Vec<T::CrossAccountId>> {621 let res: Vec<T::CrossAccountId> = <Balance<T>>::iter_prefix((collection,))627 let res: Vec<T::CrossAccountId> = <Balance<T>>::iter_prefix((collection,))622 .map(|r| r.0)628 .map(|(owner, _amount)| owner)623 .take(10)629 .take(10)624 .collect();630 .collect();625631pallets/nonfungible/CHANGELOG.mddiffbeforeafterbothno changes
pallets/nonfungible/Cargo.tomldiffbeforeafterboth1[package]1[package]2name = "pallet-nonfungible"2name = "pallet-nonfungible"3version = "0.1.0"3version = "0.1.1"4license = "GPLv3"4license = "GPLv3"5edition = "2021"5edition = "2021"66pallets/nonfungible/src/common.rsdiffbeforeafterboth422 <TokenData<T>>::get((self.id, token)).map(|t| t.owner)422 <TokenData<T>>::get((self.id, token)).map(|t| t.owner)423 }423 }424424425 /// Returns token owners.425 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {426 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {426 self.token_owner(token).map_or_else(|| vec![], |t| vec![t])427 self.token_owner(token).map_or_else(|| vec![], |t| vec![t])427 }428 }pallets/refungible/CHANGELOG.mddiffbeforeafterbothno changes
pallets/refungible/src/common.rsdiffbeforeafterboth438 <Pallet<T>>::token_owner(self.id, token)438 <Pallet<T>>::token_owner(self.id, token)439 }439 }440440441 /// Returns 10 token in no particular order.441 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {442 fn token_owners(&self, token: TokenId) -> Vec<T::CrossAccountId> {442 <Pallet<T>>::token_owners(self.id, token).unwrap_or_else(|| vec![])443 <Pallet<T>>::token_owners(self.id, token).unwrap_or_else(|| vec![])443 }444 }pallets/refungible/src/lib.rsdiffbeforeafterboth1135 <PalletCommon<T>>::set_token_property_permissions(collection, sender, property_permissions)1135 <PalletCommon<T>>::set_token_property_permissions(collection, sender, property_permissions)1136 }1136 }1137 11371138 /// Returns 10 token in no particular order.1139 ///1140 /// There is no direct way to get token holders in ascending order,1141 /// since `iter_prefix` returns values in no particular order.1142 /// Therefore, getting the 10 largest holders with a large value of holders1143 /// can lead to impact memory allocation + sorting with `n * log (n)`.1138 pub fn token_owners(1144 pub fn token_owners(1139 collection_id: CollectionId,1145 collection_id: CollectionId,1140 token: TokenId,1146 token: TokenId,1141 ) -> Option<Vec<T::CrossAccountId>> {1147 ) -> Option<Vec<T::CrossAccountId>> {1142 let res: Vec<T::CrossAccountId> = <Balance<T>>::iter_prefix((collection_id, token))1148 let res: Vec<T::CrossAccountId> = <Balance<T>>::iter_prefix((collection_id, token))1143 .map(|r| r.0)1149 .map(|(owner, _amount)| owner)1144 .take(10)1150 .take(10)1145 .collect();1151 .collect();11461152primitives/rpc/CHANGELOG.mddiffbeforeafterbothno changes
primitives/rpc/Cargo.tomldiffbeforeafterboth1[package]1[package]2name = "up-rpc"2name = "up-rpc"3version = "0.1.0"3version = "0.1.1"4license = "GPLv3"4license = "GPLv3"5edition = "2021"5edition = "2021"66runtime/common/CHANGELOG.mddiffbeforeafterbothno changes
runtime/common/Cargo.tomldiffbeforeafterboth6license = 'All Rights Reserved'6license = 'All Rights Reserved'7name = 'unique-runtime-common'7name = 'unique-runtime-common'8repository = 'https://github.com/UniqueNetwork/unique-chain'8repository = 'https://github.com/UniqueNetwork/unique-chain'9version = '0.9.24'9version = '0.9.25'101011[features]11[features]12default = ['std']12default = ['std']tests/CHANGELOG.mddiffbeforeafterbothno changes
tests/package.jsondiffbeforeafterboth80 "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",80 "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts",81 "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts",81 "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts",82 "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts",82 "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts",83 "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts",83 "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts",84 "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts",84 "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json",85 "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json",85 "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",86 "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",tests/src/fungible.test.tsdiffbeforeafterbothno changes
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth29 [key: string]: Codec;29 [key: string]: Codec;30 };30 };31 common: {31 common: {32 /**33 * Maximum admins per collection.34 **/32 collectionAdminsLimit: u32 & AugmentedConst<ApiType>;35 collectionAdminsLimit: u32 & AugmentedConst<ApiType>;36 /**37 * Set price to create a collection.38 **/33 collectionCreationPrice: u128 & AugmentedConst<ApiType>;39 collectionCreationPrice: u128 & AugmentedConst<ApiType>;34 /**40 /**35 * Generic const41 * Generic consttests/src/interfaces/augment-api-events.tsdiffbeforeafterboth58 [key: string]: AugmentedEvent<ApiType>;58 [key: string]: AugmentedEvent<ApiType>;59 };59 };60 common: {60 common: {61 /**61 /**62 * * collection_id62 * Amount pieces of token owned by `sender` was approved for `spender`.63 * 63 **/64 * * item_id65 * 66 * * sender67 * 68 * * spender69 * 70 * * amount71 **/72 Approved: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;64 Approved: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;73 /**65 /**74 * New collection was created66 * New collection was created75 * 67 **/76 * # Arguments77 * 78 * * collection_id: Globally unique identifier of newly created collection.79 * 80 * * mode: [CollectionMode] converted into u8.81 * 82 * * account_id: Collection owner.83 **/84 CollectionCreated: AugmentedEvent<ApiType, [u32, u8, AccountId32]>;68 CollectionCreated: AugmentedEvent<ApiType, [u32, u8, AccountId32]>;85 /**69 /**86 * New collection was destroyed70 * New collection was destroyed87 * 71 **/88 * # Arguments89 * 90 * * collection_id: Globally unique identifier of collection.91 **/92 CollectionDestroyed: AugmentedEvent<ApiType, [u32]>;72 CollectionDestroyed: AugmentedEvent<ApiType, [u32]>;73 /**74 * The property has been deleted.75 **/93 CollectionPropertyDeleted: AugmentedEvent<ApiType, [u32, Bytes]>;76 CollectionPropertyDeleted: AugmentedEvent<ApiType, [u32, Bytes]>;77 /**78 * The colletion property has been set.79 **/94 CollectionPropertySet: AugmentedEvent<ApiType, [u32, Bytes]>;80 CollectionPropertySet: AugmentedEvent<ApiType, [u32, Bytes]>;95 /**81 /**96 * New item was created.82 * New item was created.97 * 83 **/98 * # Arguments99 * 100 * * collection_id: Id of the collection where item was created.101 * 102 * * item_id: Id of an item. Unique within the collection.103 * 104 * * recipient: Owner of newly created item105 * 106 * * amount: Always 1 for NFT107 **/108 ItemCreated: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;84 ItemCreated: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;109 /**85 /**110 * Collection item was burned.86 * Collection item was burned.111 * 87 **/112 * # Arguments113 * 114 * * collection_id.115 * 116 * * item_id: Identifier of burned NFT.117 * 118 * * owner: which user has destroyed its tokens119 * 120 * * amount: Always 1 for NFT121 **/122 ItemDestroyed: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;88 ItemDestroyed: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;89 /**90 * The colletion property permission has been set.91 **/123 PropertyPermissionSet: AugmentedEvent<ApiType, [u32, Bytes]>;92 PropertyPermissionSet: AugmentedEvent<ApiType, [u32, Bytes]>;93 /**94 * The token property has been deleted.95 **/124 TokenPropertyDeleted: AugmentedEvent<ApiType, [u32, u32, Bytes]>;96 TokenPropertyDeleted: AugmentedEvent<ApiType, [u32, u32, Bytes]>;97 /**98 * The token property has been set.99 **/125 TokenPropertySet: AugmentedEvent<ApiType, [u32, u32, Bytes]>;100 TokenPropertySet: AugmentedEvent<ApiType, [u32, u32, Bytes]>;126 /**101 /**127 * Item was transferred102 * Item was transferred128 * 103 **/129 * * collection_id: Id of collection to which item is belong130 * 131 * * item_id: Id of an item132 * 133 * * sender: Original owner of item134 * 135 * * recipient: New owner of item136 * 137 * * amount: Always 1 for NFT138 **/139 Transfer: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;104 Transfer: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;140 /**105 /**141 * Generic event106 * Generic eventtests/src/interfaces/augment-api-query.tsdiffbeforeafterboth69 [key: string]: QueryableStorageEntry<ApiType>;69 [key: string]: QueryableStorageEntry<ApiType>;70 };70 };71 common: {71 common: {72 /**73 * Storage of collection admins count.74 **/72 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]>;73 /**76 /**74 * Allowlisted collection users77 * Allowlisted collection users75 **/78 **/76 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]>;77 /**80 /**78 * Collection info81 * Storage of collection info.79 **/82 **/80 collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<UpDataStructsCollection>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;83 collectionById: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<UpDataStructsCollection>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;81 /**84 /**82 * Collection properties85 * Storage of collection properties.83 **/86 **/84 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 /**89 * Storage of collection properties permissions.90 **/85 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 /**93 * Storage of the count of created collections.94 **/86 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;95 createdCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;96 /**97 * Storage of the count of deleted collections.98 **/87 destroyedCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;99 destroyedCollectionCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;88 /**100 /**89 * Not used by code, exists only to provide some types to metadata101 * Not used by code, exists only to provide some types to metadata.90 **/102 **/91 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, []>;92 /**104 /**93 * List of collection admins105 * List of collection admins231 [key: string]: QueryableStorageEntry<ApiType>;243 [key: string]: QueryableStorageEntry<ApiType>;232 };244 };233 nonfungible: {245 nonfungible: {246 /**247 * Amount of tokens owned by account.248 **/234 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 /**251 * Allowance set by an owner for a spender for a token.252 **/235 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]>;236 /**254 /**237 * Used to enumerate tokens owned by account255 * Used to enumerate tokens owned by account.238 **/256 **/239 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 /**259 * Custom data that is serialized to bytes and attached to a token property.260 * Currently used to store RMRK data.261 **/240 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]>;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]>;241 /**263 /**242 * Used to enumerate token's children264 * Used to enumerate token's children.243 **/265 **/244 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]>]>;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]>]>;267 /**268 * Custom data serialized to bytes for token.269 **/245 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNonfungibleItemData>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;270 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNonfungibleItemData>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;271 /**272 * Key-Value map stored for token.273 **/246 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;274 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;275 /**276 * Amount of burnt tokens for collection.277 **/247 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;278 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;279 /**280 * Amount of tokens minted for collection.281 **/248 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;282 tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;249 /**283 /**250 * Generic query284 * Generic query430 **/464 **/431 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<PalletRefungibleItemData>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;465 tokenData: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<PalletRefungibleItemData>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;432 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;466 tokenProperties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<UpDataStructsProperties>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;467 /**468 * Amount of burnt tokens for collection469 **/433 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;470 tokensBurnt: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;434 /**471 /**435 * Amount of tokens minted for collection472 * Amount of tokens minted for collectiontests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth708 * Get token owner708 * Get token owner709 **/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 * Get token owners712 * Returns 10 tokens owners in no particular order713 **/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 propertiestests/src/interfaces/unique/definitions.tsdiffbeforeafterboth49 balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),49 balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'),50 allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),50 allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'),51 tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),51 tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),52 tokenOwners: fun('Get token owners', [collectionParam, tokenParam], `Vec<${CROSS_ACCOUNT_ID_TYPE}>`),52 tokenOwners: fun('Returns 10 tokens owners in no particular order', [collectionParam, tokenParam], `Vec<${CROSS_ACCOUNT_ID_TYPE}>`),53 topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),53 topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`),54 tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec<UpDataStructsTokenChild>'),54 tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec<UpDataStructsTokenChild>'),55 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),55 constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec<u8>'),tests/src/refungible.test.tsdiffbeforeafterboth32 repartitionRFT,32 repartitionRFT,33 createCollectionWithPropsExpectSuccess,33 createCollectionWithPropsExpectSuccess,34 getDetailedCollectionInfo,34 getDetailedCollectionInfo,35 normalizeAccountId,36 CrossAccountId,35} from './util/helpers';37} from './util/helpers';363837import chai from 'chai';39import chai from 'chai';100 expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]);102 expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]);101 expect(owners.length == 10).to.be.true;103 expect(owners.length == 10).to.be.true;104 105 const eleven = privateKeyWrapper('11');106 expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true;107 expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10);102 });108 });103 });109 });104 110 tests/src/rpc.test.tsdiffbeforeafterboth49 expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]);49 expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]);50 expect(owners.length == 10).to.be.true;50 expect(owners.length == 10).to.be.true;51 52 const eleven = privateKeyWrapper('11');53 expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true;54 expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10);51 });55 });52 });56 });53});57});