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

difftreelog

feat split tests into packages

Grigoriy Simonov2023-11-06parent: #2332519.patch.diff
in: master

179 files changed

modified.githooks/pre-commitdiffbeforeafterboth
28fi28fi
2929
30echo "Starting eslint.."30echo "Starting eslint.."
31./tests/node_modules/.bin/eslint --max-warnings 0 ${STAGED_TEST_FILES[@]}31./js-packages/node_modules/.bin/eslint --max-warnings 0 ${STAGED_TEST_FILES[@]}
32ESLINT_EXIT="$?"32ESLINT_EXIT="$?"
3333
34if [[ "${ESLINT_EXIT}" = 0 ]]; then34if [[ "${ESLINT_EXIT}" = 0 ]]; then
modified.github/workflows/polkadot-types.ymldiffbeforeafterboth
7575
76 - name: Run generate_types_package script76 - name: Run generate_types_package script
77 working-directory: tests77 working-directory: tests
78 run: |78 run: |
79 yarn install79 yarn install
80 /bin/bash ./scripts/wait_for_first_block.sh80 /bin/bash ./scripts/generate_types/wait_for_first_block.sh
81 git config --global user.name "Unique"81 git config --global user.name "Unique"
82 git config --global user.email github-actions@usetech.com 82 git config --global user.email github-actions@usetech.com
83 /bin/bash ./scripts/generate_types_package.sh --release ${{ matrix.usage }} --push83 /bin/bash ./scripts/generate_types/generate_types_package.sh --release ${{ matrix.usage }} --push
84 env:84 env:
85 RPC_URL: http://127.0.0.1:9944/85 RPC_URL: http://127.0.0.1:9944/
8686
modifiedMakefilediffbeforeafterboth
7 @echo " bench-unique"7 @echo " bench-unique"
88
9NATIVE_FUNGIBLE_EVM_STUBS=./pallets/balances-adapter/src/stubs9NATIVE_FUNGIBLE_EVM_STUBS=./pallets/balances-adapter/src/stubs
10NATIVE_FUNGIBLE_EVM_ABI=./tests/src/eth/abi/nativeFungible.json10NATIVE_FUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/nativeFungible.json
1111
12FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs12FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs
13FUNGIBLE_EVM_ABI=./tests/src/eth/abi/fungible.json13FUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/fungible.json
1414
15NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs15NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs
16NONFUNGIBLE_EVM_ABI=./tests/src/eth/abi/nonFungible.json16NONFUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/nonFungible.json
1717
18REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs18REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs
19REFUNGIBLE_EVM_ABI=./tests/src/eth/abi/reFungible.json19REFUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/reFungible.json
20REFUNGIBLE_TOKEN_EVM_ABI=./tests/src/eth/abi/reFungibleToken.json20REFUNGIBLE_TOKEN_EVM_ABI=./js-packages/tests/src/eth/abi/reFungibleToken.json
2121
22CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/22CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/
23CONTRACT_HELPERS_ABI=./tests/src/eth/abi/contractHelpers.json23CONTRACT_HELPERS_ABI=./js-packages/tests/src/eth/abi/contractHelpers.json
2424
25COLLECTION_HELPER_STUBS=./pallets/unique/src/eth/stubs/25COLLECTION_HELPER_STUBS=./pallets/unique/src/eth/stubs/
26COLLECTION_HELPER_ABI=./tests/src/eth/abi/collectionHelpers.json26COLLECTION_HELPER_ABI=./js-packages/tests/src/eth/abi/collectionHelpers.json
2727
28TESTS_API=./tests/src/eth/api/28TESTS_API=./js-packages/tests/src/eth/api/
2929
30.PHONY: regenerate_solidity30.PHONY: regenerate_solidity
31regenerate_solidity: UniqueFungible.sol UniqueNFT.sol UniqueRefungible.sol UniqueRefungibleToken.sol ContractHelpers.sol CollectionHelpers.sol31regenerate_solidity: UniqueFungible.sol UniqueNFT.sol UniqueRefungible.sol UniqueRefungibleToken.sol ContractHelpers.sol CollectionHelpers.sol
modifiedjs-packages/.gitignorediffbeforeafterboth
1/node_modules/1/node_modules/
2/*/dist/
3/*/tsconfig.tsbuildinfo
2properties.csv4properties.csv
3erc721.csv5erc721.csv
4erc20.csv6erc20.csv
5.yarn/cache7.yarn/cache
6.yarn/install-state.gz8.yarn/install-state.gz
7
modifiedjs-packages/package.jsondiffbeforeafterboth
3 "version": "1.0.0",3 "version": "1.0.0",
4 "description": "Unique Chain Tests",4 "description": "Unique Chain Tests",
5 "main": "",5 "main": "",
6 "private": true,
6 "devDependencies": {7 "dependencies": {
7 "@polkadot/typegen": "10.10.1",
8 "@types/chai": "^4.3.3",8 "@openzeppelin/contracts": "^4.9.2",
9 "@types/chai-as-promised": "^7.1.5",9 "chai-as-promised": "^7.1.1",
10 "@types/chai-like": "^1.1.1",10 "chai-like": "^1.1.1",
11 "@types/chai-subset": "^1.3.3",11 "csv-writer": "^1.6.0",
12 "@types/mocha": "^10.0.0",12 "lossless-json": "^3.0.1",
13 "@types/node": "^20.4.2",13 "solc": "^0.8.22",
14 "@typescript-eslint/eslint-plugin": "^6.0.0",14 "typechain": "^8.3.2",
15 "@typescript-eslint/parser": "^6.0.0",15 "web3": "1.10.0"
16 },
17 "devDependencies": {
16 "chai": "^4.3.6",18 "@types/chai": "^4.3.9",
17 "chai-subset": "^1.6.0",19 "@types/chai-as-promised": "^7.1.7",
18 "eslint": "^8.45.0",20 "@types/chai-like": "^1.1.2",
19 "eslint-plugin-mocha": "^10.1.0",21 "@types/chai-subset": "^1.3.4",
20 "mocha": "^10.1.0",22 "@types/mocha": "^10.0.3",
23 "@types/node": "^20.8.10",
24 "@unique/opal-types": "workspace:*",
25 "@unique/playgrounds": "workspace:*",
21 "mochawesome": "^7.1.3",26 "chai": "^4.3.10",
22 "ts-node": "^10.9.1",27 "chai-subset": "^1.6.0",
23 "typescript": "^5.1.6"28 "typescript": "^5.2.2"
24 },29 },
25 "mocha": {30 "mocha": {
26 "timeout": 9999999,31 "timeout": 9999999,
27 "require": [32 "require": [
31 "scripts": {36 "scripts": {
32 "lint": "eslint --ext .ts,.js src/",37 "lint": "eslint --ext .ts,.js src/",
33 "fix": "yarn lint --fix",38 "fix": "yarn lint --fix",
34 "setup": "ts-node --esm ./src/util/globalSetup.ts",
35 "setIdentities": "ts-node --esm ./src/util/identitySetter.ts",
36 "checkRelayIdentities": "ts-node --esm ./src/util/relayIdentitiesChecker.ts",
37 "frankenstein": "ts-node --esm ./src/util/frankenstein.ts",
38 "_test": "yarn setup && mocha --timeout 9999999 --loader=ts-node/esm.mjs",
39 "_testParallel": "yarn setup && mocha --timeout 9999999 --parallel --loader=ts-node/esm.mjs",
40 "test": "yarn _test './src/**/*.*test.ts'",
41 "testParallelFull": "yarn testParallel && yarn testSequential",
42 "testParallel": "yarn _testParallel './src/**/*.test.ts'",
43 "testSequential": "yarn _test './src/**/*.seqtest.ts'",
44 "testStructure": "yarn _test ./**/nesting/*.*test.ts",
45 "testGovernance": "RUN_GOV_TESTS=1 yarn _test ./**/governance/*.*test.ts",
46 "testEth": "yarn _test './**/eth/**/*.*test.ts'",
47 "testEthNesting": "yarn _test './**/eth/nesting/**/*.*test.ts'",
48 "testEthFractionalizer": "yarn _test './**/eth/fractionalizer/**/*.*test.ts'",
49 "testEthMarketplace": "yarn _test './**/eth/marketplace/**/*.*test.ts'",
50 "testEthMarket": "yarn _test './**/eth/marketplace-v2/**/*.*test.ts'",
51 "testPerformance": "yarn _test ./**/performance.*test.ts",
52 "testSub": "yarn _test './**/sub/**/*.*test.ts'",
53 "testSubNesting": "yarn _test './**/sub/nesting/**/*.*test.ts'",
54 "testEvent": "yarn _test ./src/check-event/*.*test.ts",
55 "testEthPayable": "yarn _test './**/eth/payable.test.ts'",
56 "testEvmCoder": "yarn _test './**/eth/evmCoder.test.ts'",
57 "testNesting": "yarn _test ./**/nest.test.ts",
58 "testUnnesting": "yarn _test ./**/unnest.test.ts",
59 "testProperties": "yarn _test ./**/collectionProperties.*test.ts ./**/tokenProperties.*test.ts ./**/getPropertiesRpc.test.ts",
60 "testCollectionProperties": "yarn _test ./**/collectionProperties.*test.ts",
61 "testTokenProperties": "yarn _test ./**/tokenProperties.*test.ts",
62 "testMigration": "yarn _test ./**/nesting/migration-check.test.ts",
63 "testAddCollectionAdmin": "yarn _test ./**/addCollectionAdmin.test.ts",
64 "testSetCollectionLimits": "yarn _test ./**/setCollectionLimits.test.ts",
65 "testChangeCollectionOwner": "yarn _test ./**/change-collection-owner.test.ts",
66 "testSetCollectionSponsor": "yarn _test ./**/setCollectionSponsor.test.ts",
67 "testConfirmSponsorship": "yarn _test ./**/confirmSponsorship.test.ts",
68 "testRemoveCollectionAdmin": "yarn _test ./**/removeCollectionAdmin.test.ts",
69 "testRemoveCollectionSponsor": "yarn _test ./**/removeCollectionSponsor.test.ts",
70 "testAllowLists": "yarn _test ./**/allowLists.test.ts",
71 "testConnection": "yarn _test ./**/connection.test.ts",
72 "testContracts": "yarn _test ./**/contracts.test.ts",
73 "testCreateItem": "yarn _test ./**/createItem.test.ts",
74 "testCreateMultipleItems": "yarn _test ./**/createMultipleItems.test.ts",
75 "testCreateMultipleItemsEx": "yarn _test ./**/createMultipleItemsEx.test.ts",
76 "testApprove": "yarn _test ./**/approve.test.ts",
77 "testTransferFrom": "yarn _test ./**/transferFrom.test.ts",
78 "testCreateCollection": "yarn _test ./**/createCollection.test.ts",
79 "testDestroyCollection": "yarn _test ./**/destroyCollection.test.ts",
80 "testToggleContractAllowList": "yarn _test ./**/toggleContractAllowList.test.ts",
81 "testAddToContractAllowList": "yarn _test ./**/addToContractAllowList.test.ts",
82 "testTransfer": "yarn _test ./**/transfer.test.ts",
83 "testBurnItem": "yarn _test ./**/burnItem.test.ts",
84 "testAdminTransferAndBurn": "yarn _test ./**/adminTransferAndBurn.test.ts",
85 "testSetPermissions": "yarn _test ./**/setPermissions.test.ts",
86 "testCreditFeesToTreasury": "yarn _test ./**/creditFeesToTreasury.seqtest.ts",
87 "testContractSponsoring": "yarn _test ./**/eth/contractSponsoring.test.ts",
88 "testEnableContractSponsoring": "yarn _test ./**/enableContractSponsoring.test.ts",
89 "testRemoveFromContractAllowList": "yarn _test ./**/removeFromContractAllowList.test.ts",
90 "testSetContractSponsoringRateLimit": "yarn _test ./**/setContractSponsoringRateLimit.test.ts",
91 "testSetOffchainSchema": "yarn _test ./**/setOffchainSchema.test.ts",
92 "testNextSponsoring": "yarn _test ./**/nextSponsoring.test.ts",
93 "testOverflow": "yarn _test ./**/overflow.test.ts",
94 "testMaintenance": "yarn _test ./**/maintenance.seqtest.ts",
95 "testInflation": "yarn _test ./**/inflation.seqtest.ts",
96 "testScheduler": "yarn _test ./**/scheduler.seqtest.ts",
97 "testSchedulingEVM": "yarn _test ./**/eth/scheduling.test.ts",
98 "testPalletPresence": "yarn _test ./**/pallet-presence.test.ts",
99 "testEnableDisableTransfers": "yarn _test ./**/enableDisableTransfer.test.ts",
100 "testLimits": "yarn _test ./**/limits.test.ts",
101 "testEthCreateNFTCollection": "yarn _test ./**/eth/createNFTCollection.test.ts",
102 "testEthCreateRFTCollection": "yarn _test ./**/eth/createRFTCollection.test.ts",
103 "testEthNFT": "yarn _test ./**/eth/nonFungible.test.ts",
104 "testRFT": "yarn _test ./**/refungible.test.ts",
105 "testEthRFT": "yarn _test ./**/eth/reFungible.test.ts ./**/eth/reFungibleToken.test.ts",
106 "testFT": "yarn _test ./**/fungible.test.ts",
107 "testEthFT": "yarn _test ./**/eth/fungible.test.ts",
108 "testRPC": "yarn _test ./**/rpc.test.ts",
109 "testPromotion": "yarn _test ./**/appPromotion/*test.ts",
110 "testApiConsts": "yarn _test ./**/apiConsts.test.ts",
111 "testCouncil": "yarn _test ./**/council.*test.ts",
112 "testDemocracy": "yarn _test ./**/democracy.*test.ts",
113 "testCollators": "RUN_COLLATOR_TESTS=1 yarn _test ./**/collator-selection/**.*test.ts --timeout 49999999",
114 "testCollatorSelection": "RUN_COLLATOR_TESTS=1 yarn _test ./**/collatorSelection.*test.ts --timeout 49999999",
115 "testIdentity": "RUN_COLLATOR_TESTS=1 yarn _test ./**/identity.*test.ts --timeout 49999999",
116 "testLowLevelXcmUnique": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/lowLevelXcmUnique.test.ts",
117 "testXcmUnique": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/xcmUnique.test.ts",
118 "testFullXcmUnique": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/*Unique.test.ts",
119 "testXcmQuartz": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/xcmQuartz.test.ts",
120 "testLowLevelXcmQuartz": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/lowLevelXcmQuartz.test.ts",
121 "testFullXcmQuartz": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/*Quartz.test.ts",
122 "testXcmOpal": "RUN_XCM_TESTS=1 yarn _test ./**/xcm/xcmOpal.test.ts",
123 "testXcmTransferAcala": "yarn _test ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000",
124 "testXcmTransferStatemine": "yarn _test ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000",
125 "testXcmTransferMoonbeam": "yarn _test ./**/xcm/xcmTransferMoonbeam.test.ts",
126 "benchMintingFee": "ts-node src/benchmarks/mintFee/benchmark.ts",
127 "load": "yarn _test './**/*.load.ts'",
128 "loadTransfer": "ts-node src/transfer.nload.ts",
129 "polkadot-types-fetch-metadata": "yarn ts-node --esm src/fetchMetadata.ts",39 "polkadot-types-fetch-metadata": "yarn ts-node --esm scripts/src/fetchMetadata.ts",
130 "polkadot-types-from-defs": "ts-node --esm ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .",40 "polkadot-types-from-defs": "ts-node --esm ./node_modules/.bin/polkadot-types-from-defs --endpoint types/src/metadata.json --input types/src/ --package .",
131 "polkadot-types-from-chain": "ts-node --esm ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .",41 "polkadot-types-from-chain": "ts-node --esm ./node_modules/.bin/polkadot-types-from-chain --endpoint types/src/metadata.json --output types/src/ --package .",
132 "polkadot-types": "echo \"export default {}\" > src/interfaces/lookup.ts && yarn polkadot-types-fetch-metadata && yarn polkadot-types-from-defs && yarn polkadot-types-from-defs && yarn polkadot-types-from-chain",42 "polkadot-types": "echo \"export default {}\" > types/src/lookup.ts && yarn polkadot-types-fetch-metadata && yarn polkadot-types-from-defs && yarn polkadot-types-from-defs && yarn polkadot-types-from-chain"
133 "generateEnv": "ts-node --esm ./src/generateEnv.ts",
134 "propose-upgrade": "ts-node --esm ./src/proposeupgrade.ts",
135 "propose-fast-track": "ts-node --esm ./src/proposefasttrack.ts"
136 },43 },
137 "author": "",44 "author": "",
138 "license": "SEE LICENSE IN ../LICENSE",45 "license": "SEE LICENSE IN ../LICENSE",
139 "homepage": "",46 "homepage": "",
140 "dependencies": {
141 "@openzeppelin/contracts": "^4.9.2",
142 "@polkadot/api": "10.10.1",
143 "@polkadot/rpc-core": "^10.10.1",
144 "@polkadot/util": "12.5.1",
145 "@polkadot/util-crypto": "12.5.1",
146 "@polkadot/wasm-crypto-asmjs": "^7.2.2",
147 "@polkadot/wasm-crypto-wasm": "^7.2.2",
148 "@rmrk-team/evm-contracts": "^1.2.1",
149 "@typechain/web3-v1": "^6.0.3",
150 "chai-as-promised": "^7.1.1",
151 "chai-like": "^1.1.1",
152 "csv-writer": "^1.6.0",
153 "find-process": "^1.4.7",
154 "lossless-json": "^2.0.9",
155 "solc": "0.8.20",
156 "typechain": "^8.2.0",
157 "web3": "1.10.0"
158 },
159 "resolutions": {47 "resolutions": {
160 "decode-uri-component": "^0.2.1"48 "decode-uri-component": "^0.2.1"
161 },49 },
162 "type": "module",50 "type": "module",
163 "packageManager": "yarn@3.6.1"51 "packageManager": "yarn@3.6.1",
52 "workspaces": [
53 "types",
54 "playgrounds",
55 "scripts",
56 "tests"
57 ]
164}58}
16559
addedjs-packages/playgrounds/package.jsondiffbeforeafterboth

no changes

addedjs-packages/playgrounds/src/index.tsdiffbeforeafterboth

no syntactic changes

modifiedjs-packages/playgrounds/src/types.tsdiffbeforeafterboth
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
2// SPDX-License-Identifier: Apache-2.02// SPDX-License-Identifier: Apache-2.0
33
4import {IKeyringPair} from '@polkadot/types/types';4import type {IKeyringPair} from '@polkadot/types/types';
55
6export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;6export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;
77
modifiedjs-packages/playgrounds/src/unique.dev.tsdiffbeforeafterboth
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
2// SPDX-License-Identifier: Apache-2.02// SPDX-License-Identifier: Apache-2.0
3
4import '@unique/opal-types/src/augment-api.js';
5import '@unique/opal-types/src/augment-types.js';
6import '@unique/opal-types/src/types-lookup.js';
37
4import {stringToU8a} from '@polkadot/util';8import {stringToU8a} from '@polkadot/util';
5import {blake2AsHex, encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto';9import {blake2AsHex, encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto';
10import type {ChainHelperBaseConstructor, UniqueHelperConstructor} from './unique.js';
6import {UniqueHelper, ChainHelperBase, ChainHelperBaseConstructor, HelperGroup, UniqueHelperConstructor} from './unique';11import {UniqueHelper, ChainHelperBase, HelperGroup} from './unique.js';
7import {ApiPromise, Keyring, WsProvider} from '@polkadot/api';12import {ApiPromise, Keyring, WsProvider} from '@polkadot/api';
8import * as defs from '../../interfaces/definitions';13import * as defs from '@unique/opal-types/src/definitions.js';
9import {IKeyringPair} from '@polkadot/types/types';14import type {IKeyringPair} from '@polkadot/types/types';
10import {EventRecord} from '@polkadot/types/interfaces';15import type {EventRecord} from '@polkadot/types/interfaces';
11import {ICrossAccountId, ILogger, IPovInfo, ISchedulerOptions, ITransactionResult, TSigner} from './types';16import type {ICrossAccountId, ILogger, IPovInfo, ISchedulerOptions, ITransactionResult, TSigner} from './types.js';
12import {FrameSystemEventRecord, StagingXcmV2TraitsError, StagingXcmV3TraitsOutcome} from '@polkadot/types/lookup';17import type {FrameSystemEventRecord, StagingXcmV2TraitsError, StagingXcmV3TraitsOutcome} from '@polkadot/types/lookup';
13import {SignerOptions, VoidFn} from '@polkadot/api/types';18import type {SignerOptions, VoidFn} from '@polkadot/api/types';
14import {Pallets} from '..';
15import {spawnSync} from 'child_process';19import {spawnSync} from 'child_process';
16import {AcalaHelper, AstarHelper, MoonbeamHelper, PolkadexHelper, RelayHelper, WestmintHelper, ForeignAssetsGroup, XcmGroup, XTokensGroup, TokensGroup} from './unique.xcm';20import {AcalaHelper, AstarHelper, MoonbeamHelper, PolkadexHelper, RelayHelper, WestmintHelper, ForeignAssetsGroup, XcmGroup, XTokensGroup, TokensGroup} from './unique.xcm.js';
17import {CollectiveGroup, CollectiveMembershipGroup, DemocracyGroup, ICollectiveGroup, IFellowshipGroup, RankedCollectiveGroup, ReferendaGroup} from './unique.governance';21import {CollectiveGroup, CollectiveMembershipGroup, DemocracyGroup, RankedCollectiveGroup, ReferendaGroup} from './unique.governance.js';
22import type {ICollectiveGroup, IFellowshipGroup} from './unique.governance.js';
1823
19export class SilentLogger {24export class SilentLogger {
20 log(_msg: any, _level: any): void { }25 log(_msg: any, _level: any): void { }
275 super(...args);280 super(...args);
276 }281 }
277282
278 async executeExtrinsic(283 override async executeExtrinsic(
279 sender: IKeyringPair,284 sender: IKeyringPair,
280 extrinsic: string,285 extrinsic: string,
281 params: any[],286 params: any[],
307 }312 }
308 return result;313 return result;
309 }314 }
310 async executeExtrinsicUncheckedWeight(315 override async executeExtrinsicUncheckedWeight(
311 sender: IKeyringPair,316 sender: IKeyringPair,
312 extrinsic: string,317 extrinsic: string,
313 params: any[],318 params: any[],
504 this.democracy = new DemocracyGroup(this);509 this.democracy = new DemocracyGroup(this);
505 }510 }
506511
507 async connect(wsEndpoint: string, _listeners?: any): Promise<void> {512 override async connect(wsEndpoint: string, _listeners?: any): Promise<void> {
508 if(!wsEndpoint) throw new Error('wsEndpoint was not set');513 if(!wsEndpoint) throw new Error('wsEndpoint was not set');
509 const wsProvider = new WsProvider(wsEndpoint);514 const wsProvider = new WsProvider(wsEndpoint);
510 this.api = new ApiPromise({515 this.api = new ApiPromise({
692 accounts.push(recipient);697 accounts.push(recipient);
693 if(balance !== 0n) {698 if(balance !== 0n) {
694 const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]);699 const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]);
695 transactions.push(this.helper.signTransaction(donor, tx, {nonce, era: 0}, 'account generation'));700 transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation'));
696 nonce++;701 nonce++;
697 }702 }
698 }703 }
806 const block1date = await findCreationDate(block1);811 const block1date = await findCreationDate(block1);
807 const block2date = await findCreationDate(block2);812 const block2date = await findCreationDate(block2);
808 if(block2date! - block1date! < 9000) return true;813 if(block2date! - block1date! < 9000) return true;
814 return false;
809 };815 };
810816
811 async calculcateFee(payer: ICrossAccountId, promise: () => Promise<any>): Promise<bigint> {817 async calculcateFee(payer: ICrossAccountId, promise: () => Promise<any>): Promise<bigint> {
1388 this.helper = helper;1394 this.helper = helper;
1389 }1395 }
13901396
1391 async enable() {1397 async enable(testUtilsPalletName: string) {
1392 if(this.helper.fetchMissingPalletNames([Pallets.TestUtils]).length != 0) {1398 if(this.helper.fetchMissingPalletNames([testUtilsPalletName]).length != 0) {
1393 return;1399 return;
1394 }1400 }
13951401
1502 this.options = options.options;1508 this.options = options.options;
1503 }1509 }
15041510
1505 executeExtrinsic(sender: IKeyringPair, scheduledExtrinsic: string, scheduledParams: any[], expectSuccess?: boolean): Promise<ITransactionResult> {1511 override executeExtrinsic(sender: IKeyringPair, scheduledExtrinsic: string, scheduledParams: any[], expectSuccess?: boolean): Promise<ITransactionResult> {
1506 const scheduledTx = this.constructApiCall(scheduledExtrinsic, scheduledParams);1512 const scheduledTx = this.constructApiCall(scheduledExtrinsic, scheduledParams);
15071513
1508 const mandatorySchedArgs = [1514 const mandatorySchedArgs = [
modifiedjs-packages/playgrounds/src/unique.governance.tsdiffbeforeafterboth
1import {blake2AsHex} from '@polkadot/util-crypto';1import {blake2AsHex} from '@polkadot/util-crypto';
2import {PalletDemocracyConviction} from '@polkadot/types/lookup';2import type {PalletDemocracyConviction} from '@polkadot/types/lookup';
3import {IPhasicEvent, TSigner} from './types';3import type {IPhasicEvent, TSigner} from './types.js';
4import {HelperGroup, UniqueHelper} from './unique';4import {HelperGroup, UniqueHelper} from './unique.js';
55
6export class CollectiveGroup extends HelperGroup<UniqueHelper> {6export class CollectiveGroup extends HelperGroup<UniqueHelper> {
7 /**7 /**
modifiedjs-packages/playgrounds/src/unique.tsdiffbeforeafterboth
6/* eslint-disable no-prototype-builtins */6/* eslint-disable no-prototype-builtins */
77
8import {ApiPromise, WsProvider, Keyring} from '@polkadot/api';8import {ApiPromise, WsProvider, Keyring} from '@polkadot/api';
9import {SignerOptions} from '@polkadot/api/types/submittable';9import type {SignerOptions} from '@polkadot/api/types';
10import '../../interfaces/augment-api';10import type {AugmentedSubmittables} from '@polkadot/api-base/types/submittable';
11import {AugmentedSubmittables} from '@polkadot/api-base/types/submittable';
12import {ApiInterfaceEvents} from '@polkadot/api/types';11import type {ApiInterfaceEvents} from '@polkadot/api/types';
13import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm, base58Encode, blake2AsU8a, blake2AsHex} from '@polkadot/util-crypto';12import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm, base58Encode, blake2AsU8a} from '@polkadot/util-crypto';
14import {IKeyringPair} from '@polkadot/types/types';13import type {IKeyringPair} from '@polkadot/types/types';
15import {hexToU8a} from '@polkadot/util/hex';14import {hexToU8a} from '@polkadot/util/hex';
16import {u8aConcat} from '@polkadot/util/u8a';15import {u8aConcat} from '@polkadot/util/u8a';
17import {16import type {
18 IApiListeners,17 IApiListeners,
19 IBlock,18 IBlock,
20 IEvent,19 IEvent,
28 INestingPermissions,27 INestingPermissions,
29 IProperty,28 IProperty,
30 IStakingInfo,29 IStakingInfo,
31 ISchedulerOptions,
32 ISubstrateBalance,30 ISubstrateBalance,
33 IToken,31 IToken,
34 ITokenPropertyPermission,32 ITokenPropertyPermission,
40 TSubstrateAccount,38 TSubstrateAccount,
41 TNetworks,39 TNetworks,
42 IEthCrossAccountId,40 IEthCrossAccountId,
43} from './types';41} from './types.js';
44import {RuntimeDispatchInfo} from '@polkadot/types/interfaces';42import type {RuntimeDispatchInfo} from '@polkadot/types/interfaces';
45import type {Vec} from '@polkadot/types-codec';
46import {FrameSystemEventRecord} from '@polkadot/types/lookup';
4743
48export class CrossAccountId {44export class CrossAccountId {
49 Substrate!: TSubstrateAccount;45 account: ICrossAccountId;
50 Ethereum!: TEthereumAccount;
5146
52 constructor(account: ICrossAccountId) {47 constructor(account: ICrossAccountId) {
53 if('Substrate' in account) this.Substrate = account.Substrate;48 this.account = account;
54 else this.Ethereum = account.Ethereum;
55 }49 }
5650
57 static fromKeyring(account: IKeyringPair, domain: 'Substrate' | 'Ethereum' = 'Substrate') {51 static fromKeyring(account: IKeyringPair, domain: 'Substrate' | 'Ethereum' = 'Substrate') {
66 else return new CrossAccountId({Ethereum: address.ethereum});60 else return new CrossAccountId({Ethereum: address.ethereum});
67 }61 }
6862
69 static normalizeSubstrateAddress(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount {63 static normalizeSubstrateAddress(address: {Substrate: TSubstrateAccount}, ss58Format = 42): TSubstrateAccount {
70 return encodeAddress(decodeAddress(address), ss58Format);64 return encodeAddress(decodeAddress(address.Substrate), ss58Format);
71 }65 }
7266
73 static withNormalizedSubstrate(address: TSubstrateAccount, ss58Format = 42): CrossAccountId {67 static withNormalizedSubstrate(address: ICrossAccountId, ss58Format = 42): ICrossAccountId {
74 return new CrossAccountId({Substrate: CrossAccountId.normalizeSubstrateAddress(address, ss58Format)});68 if('Substrate' in address) return {Substrate: CrossAccountId.normalizeSubstrateAddress(address, ss58Format)};
69 return address;
75 }70 }
7671
77 withNormalizedSubstrate(ss58Format = 42): CrossAccountId {72 withNormalizedSubstrate(ss58Format = 42): CrossAccountId {
78 if(this.Substrate) return CrossAccountId.withNormalizedSubstrate(this.Substrate, ss58Format);73 if('Substrate' in this.account) this.account = CrossAccountId.withNormalizedSubstrate(this.account, ss58Format);
79 return this;74 return this;
80 }75 }
8176
84 }79 }
8580
86 toEthereum(): CrossAccountId {81 toEthereum(): CrossAccountId {
87 if(this.Substrate) return new CrossAccountId({Ethereum: CrossAccountId.translateSubToEth(this.Substrate)});82 this.account = CrossAccountId.toEthereum(this.account);
88 return this;83 return this;
89 }84 }
9085
86 static toEthereum(account: ICrossAccountId): ICrossAccountId {
87 if('Substrate' in account) return {Ethereum: CrossAccountId.translateSubToEth(account.Substrate)};
88 return account;
89 }
90
91 static translateEthToSub(address: TEthereumAccount, ss58Format?: number): TSubstrateAccount {91 static translateEthToSub(address: TEthereumAccount, ss58Format?: number): TSubstrateAccount {
92 return evmToAddress(address, ss58Format);92 return evmToAddress(address, ss58Format);
93 }93 }
9494
95 toSubstrate(ss58Format?: number): CrossAccountId {95 toSubstrate(ss58Format?: number): CrossAccountId {
96 if(this.Ethereum) return new CrossAccountId({Substrate: CrossAccountId.translateEthToSub(this.Ethereum, ss58Format)});96 this.account = CrossAccountId.toSubstrate(this.account, ss58Format);
97 return this;97 return this;
98 }98 }
9999
100 static toSubstrate(account: ICrossAccountId, ss58Format?: number): ICrossAccountId {
101 if('Ethereum' in account) return {Substrate: CrossAccountId.translateEthToSub(account.Ethereum, ss58Format)};
102 return account;
103 }
104
100 toLowerCase(): CrossAccountId {105 toLowerCase(): CrossAccountId {
101 if(this.Substrate) this.Substrate = this.Substrate.toLowerCase();106 this.account = CrossAccountId.toLowerCase(this.account);
102 if(this.Ethereum) this.Ethereum = this.Ethereum.toLowerCase();
103 return this;107 return this;
104 }108 }
109
110 static toLowerCase(account: ICrossAccountId) {
111 if('Substrate' in account) return {Substrate: account.Substrate.toLowerCase()};
112 if('Ethereum' in account) return {Ethereum: account.Ethereum.toLowerCase()};
113 return account;
114 }
115
116 toICrossAccountId(): ICrossAccountId {
117 return this.account;
118 }
105}119}
106120
107const nesting = {121const nesting = {
141 RPC: 'rpc',155 RPC: 'rpc',
142 };156 };
143157
144 static getTokenAccount(token: IToken): CrossAccountId {158 static getTokenAccount(token: IToken): ICrossAccountId {
145 return new CrossAccountId({Ethereum: this.getTokenAddress(token)});159 return {Ethereum: this.getTokenAddress(token)};
146 }160 }
147161
148 static getTokenAddress(token: IToken): string {162 static getTokenAddress(token: IToken): string {
228 }242 }
229 let success = false;243 let success = false;
230 const tokens = [] as { collectionId: number, tokenId: number, owner: CrossAccountId, amount: bigint }[];244 const tokens = [] as { collectionId: number, tokenId: number, owner: CrossAccountId, amount: bigint }[];
231 burnResult.result.events.forEach(({event: {data, method, section}}) => {245 burnResult.result.events.forEach(({event: {data, method, section}}: any) => {
232 if(method === 'ExtrinsicSuccess') {246 if(method === 'ExtrinsicSuccess') {
233 success = true;247 success = true;
234 } else if((section === 'common') && (method === 'ItemDestroyed')) {248 } else if((section === 'common') && (method === 'ItemDestroyed')) {
260 static isTokenTransferSuccess(events: { event: IEvent }[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount = 1n) {274 static isTokenTransferSuccess(events: { event: IEvent }[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount = 1n) {
261 const normalizeAddress = (address: string | ICrossAccountId) => {275 const normalizeAddress = (address: string | ICrossAccountId) => {
262 if(typeof address === 'string') return address;276 if(typeof address === 'string') return address;
263 const obj = {} as any;277 if('Substrate' in address) return CrossAccountId.withNormalizedSubstrate(address);
264 Object.keys(address).forEach(k => {
265 obj[k.toLocaleLowerCase()] = (address as any)[k];
266 });
267 if(obj.substrate) return CrossAccountId.withNormalizedSubstrate(obj.substrate);
268 if(obj.ethereum) return CrossAccountId.fromLowerCaseKeys(obj).toLowerCase();278 if('Ethereum' in address) return CrossAccountId.toLowerCase(address);
269 return address;279 return address;
270 };280 };
271 let transfer = {collectionId: null, tokenId: null, from: null, to: null, amount: 1} as any;281 let transfer = {collectionId: null, tokenId: null, from: null, to: null, amount: 1} as any;
272 events.forEach(({event: {data, method, section}}) => {282 events.forEach(({event: {data, method, section}}) => {
273 if((section === 'common') && (method === 'Transfer')) {283 if((section === 'common') && (method === 'Transfer')) {
274 const hData = (data as any).toJSON();
275 transfer = {284 transfer = {
276 collectionId: hData[0],285 collectionId: data[0].toJSON(),
277 tokenId: hData[1],286 tokenId: data[1].toJSON(),
278 from: normalizeAddress(hData[2]),287 from: normalizeAddress(data[2].toHuman()),
279 to: normalizeAddress(hData[3]),288 to: normalizeAddress(data[3].toHuman()),
280 amount: BigInt(hData[4]),289 amount: BigInt(data[4].toJSON()),
281 };290 };
282 }291 }
283 });292 });
303}312}
304313
305class UniqueEventHelper {314class UniqueEventHelper {
306 private static extractIndex(index: any): [number, number] | string {315 static extractIndex(index: any): [number, number] | string {
307 if(index.toRawType() === '[u8;2]') return [index[0], index[1]];316 if(index.toRawType() === '[u8;2]') return [index[0], index[1]];
308 return index.toJSON();317 return index.toJSON();
309 }318 }
310319
311 private static extractSub(data: any, subTypes: any): { [key: string]: any } {320 static extractSub(data: any, subTypes: any): { [key: string]: any } {
312 let obj: any = {};321 let obj: any = {};
313 let index = 0;322 let index = 0;
314323
322 return obj;331 return obj;
323 }332 }
324333
325 private static toHuman(data: any) {334 static toHuman(data: any) {
326 return data && data.toHuman ? data.toHuman() : `${data}`;335 return data && data.toHuman ? data.toHuman() : `${data}`;
327 }336 }
328337
329 private static extractData(data: any, type: any): any {338 static extractData(data: any, type: any): any {
330 if(!type) return this.toHuman(data);339 if(!type) return this.toHuman(data);
331 if(['u16', 'u32'].indexOf(type.type) > -1) return data.toNumber();340 if(['u16', 'u32'].indexOf(type.type) > -1) return data.toNumber();
332 if(['u64', 'u128', 'u256'].indexOf(type.type) > -1) return data.toBigInt();341 if(['u64', 'u128', 'u256'].indexOf(type.type) > -1) return data.toBigInt();
361}370}
362const InvalidTypeSymbol = Symbol('Invalid type');371const InvalidTypeSymbol = Symbol('Invalid type');
363// eslint-disable-next-line @typescript-eslint/no-unused-vars372// eslint-disable-next-line @typescript-eslint/no-unused-vars
364export type Invalid<ErrorMessage> =373export type Invalid =
365 | ((374 | ((
366 invalidType: typeof InvalidTypeSymbol,375 invalidType: typeof InvalidTypeSymbol,
367 ..._: typeof InvalidTypeSymbol[]376 ..._: typeof InvalidTypeSymbol[]
371// Has slightly better error messages than Get380// Has slightly better error messages than Get
372type Get2<T, P extends string, E> =381type Get2<T, P extends string, E> =
373 P extends `${infer Key}.${infer Key2}` ? Key extends keyof T ? Key2 extends keyof T[Key] ? T[Key][Key2] : E : E : E;382 P extends `${infer Key}.${infer Key2}` ? Key extends keyof T ? Key2 extends keyof T[Key] ? T[Key][Key2] : E : E : E;
374type ForceFunction<T> = T extends (...args: any) => any ? T : (...args: any) => Invalid<'not a function'>;383type ForceFunction<T> = T extends (...args: any) => any ? T : (...args: any) => Invalid;
375384
376export class ChainHelperBase {385export class ChainHelperBase {
377 helperBase: any;386 helperBase: any;
432441
433 async subscribeEvents(expectedEvents: { section: string, names: string[] }[]) {442 async subscribeEvents(expectedEvents: { section: string, names: string[] }[]) {
434 const collectedEvents: IEvent[] = [];443 const collectedEvents: IEvent[] = [];
435 const unsubscribe = await this.getApi().query.system.events((events: Vec<FrameSystemEventRecord>) => {444 const unsubscribe = await this.getApi().query.system.events((events: any) => {
436 const ievents = this.eventHelper.extractEvents(events);445 const ievents = this.eventHelper.extractEvents(events);
437 ievents.forEach((event) => {446 ievents.forEach((event) => {
438 expectedEvents.forEach((e => {447 expectedEvents.forEach((e => {
523 westmint: {},532 westmint: {},
524 };533 };
525 if(!supportedRPC.hasOwnProperty(network)) network = await this.detectNetworkByWsEndpoint(wsEndpoint);534 if(!supportedRPC.hasOwnProperty(network)) network = await this.detectNetworkByWsEndpoint(wsEndpoint);
526 const rpc = supportedRPC[network];535 const rpc = supportedRPC[network] as any;
527536
528 // TODO: investigate how to replace rpc in runtime537 // TODO: investigate how to replace rpc in runtime
529 // api._rpcCore.addUserInterfaces(rpc);538 // api._rpcCore.addUserInterfaces(rpc);
669 ...args: any) => any = ForceFunction<678 ...args: any) => any = ForceFunction<
670 Get2<679 Get2<
671 AugmentedSubmittables<'promise'>,680 AugmentedSubmittables<'promise'>,
672 E, (...args: any) => Invalid<'not found'>681 E, (...args: any) => Invalid
673 >682 >
674 >683 >
675 >(684 >(
735 ...args: any) => any = ForceFunction<744 ...args: any) => any = ForceFunction<
736 Get2<745 Get2<
737 AugmentedSubmittables<'promise'>,746 AugmentedSubmittables<'promise'>,
738 E, (...args: any) => Invalid<'not found'>747 E, (...args: any) => Invalid
739 >748 >
740 >749 >
741 >(750 >(
742 sender: TSigner,751 _sender: TSigner,
743 extrinsic: `api.tx.${E}`,752 _extrinsic: `api.tx.${E}`,
744 params: Parameters<V>,753 _params: Parameters<V>,
745 expectSuccess = true,754 _expectSuccess = true,
746 options: Partial<SignerOptions> | null = null,/*, failureMessage='expected success'*/755 _options: Partial<SignerOptions> | null = null,/*, failureMessage='expected success'*/
747 ): Promise<ITransactionResult> {756 ): Promise<ITransactionResult> {
748 throw new Error('executeExtrinsicUncheckedWeight only supported in sudo');757 throw new Error('executeExtrinsicUncheckedWeight only supported in sudo');
749 }758 }
892 * @example await getAdmins(1)901 * @example await getAdmins(1)
893 * @returns array of administrators902 * @returns array of administrators
894 */903 */
895 async getAdmins(collectionId: number, normalize = false): Promise<CrossAccountId[]> {904 async getAdmins(collectionId: number, normalize = false): Promise<ICrossAccountId[]> {
896 const admins = (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman();905 const admins = (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman() as ICrossAccountId[];
897906
898 return normalize907 return normalize
899 ? admins.map((address: CrossAccountId) => address.withNormalizedSubstrate())908 ? admins.map(address => CrossAccountId.withNormalizedSubstrate(address))
900 : admins;909 : admins;
901 }910 }
902911
907 * @example await getAllowList(1)916 * @example await getAllowList(1)
908 * @returns array of allow-listed addresses917 * @returns array of allow-listed addresses
909 */918 */
910 async getAllowList(collectionId: number, normalize = false): Promise<CrossAccountId[]> {919 async getAllowList(collectionId: number, normalize = false): Promise<ICrossAccountId[]> {
911 const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman();920 const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman() as ICrossAccountId[];
912 return normalize921 return normalize
913 ? allowListed.map((address: CrossAccountId) => address.withNormalizedSubstrate())922 ? allowListed.map(address => CrossAccountId.withNormalizedSubstrate(address))
914 : allowListed;923 : allowListed;
915 }924 }
916925
1372 * @returns ```true``` if extrinsic success, otherwise ```false```1381 * @returns ```true``` if extrinsic success, otherwise ```false```
1373 */1382 */
1374 async approveTokenFromEth(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount = 1n) {1383 async approveTokenFromEth(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount = 1n) {
1375 const ethMirror = CrossAccountId.fromKeyring(signer).toEthereum();1384 const ethMirror = CrossAccountId.fromKeyring(signer).toEthereum().toICrossAccountId();
1376 return await this.approveTokenFrom(signer, collectionId, tokenId, ethMirror, toAddressObj, amount);1385 return await this.approveTokenFrom(signer, collectionId, tokenId, ethMirror, toAddressObj, amount);
1377 }1386 }
13781387
1439 */1448 */
1440 async getToken(collectionId: number, tokenId: number, propertyKeys: string[] = [], blockHashAt?: string): Promise<{1449 async getToken(collectionId: number, tokenId: number, propertyKeys: string[] = [], blockHashAt?: string): Promise<{
1441 properties: IProperty[];1450 properties: IProperty[];
1442 owner: CrossAccountId;1451 owner: ICrossAccountId;
1443 normalizedOwner: CrossAccountId;1452 normalizedOwner: ICrossAccountId;
1444 } | null> {1453 } | null> {
1445 let tokenData;1454 let args;
1446 if(typeof blockHashAt === 'undefined') {1455 if(typeof blockHashAt === 'undefined') {
1447 tokenData = await this.helper.callRpc('api.rpc.unique.tokenData', [collectionId, tokenId]);1456 args = [collectionId, tokenId];
1448 }1457 }
1449 else {1458 else {
1450 if(propertyKeys.length == 0) {1459 if(propertyKeys.length == 0) {
1451 const collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman();1460 const collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman();
1452 if(!collection) return null;1461 if(!collection) return null;
1453 propertyKeys = collection.tokenPropertyPermissions.map((x: ITokenPropertyPermission) => x.key);1462 propertyKeys = collection.tokenPropertyPermissions.map((x: ITokenPropertyPermission) => x.key);
1454 }1463 }
1455 tokenData = await this.helper.callRpc('api.rpc.unique.tokenData', [collectionId, tokenId, propertyKeys, blockHashAt]);1464 args = [collectionId, tokenId, propertyKeys, blockHashAt];
1456 }1465 }
1457 tokenData = tokenData.toHuman();1466 const tokenData = (await this.helper.callRpc('api.rpc.unique.tokenData', args)).toHuman();
1458 if(tokenData === null || tokenData.owner === null) return null;1467 if(tokenData === null || tokenData.owner === null) return null;
1459 const owner = {} as any;1468 tokenData.normalizedOwner = CrossAccountId.withNormalizedSubstrate(tokenData.owner);
1460 for(const key of Object.keys(tokenData.owner)) {
1461 owner[key.toLocaleLowerCase()] = key.toLocaleLowerCase() == 'substrate'
1462 ? CrossAccountId.normalizeSubstrateAddress(tokenData.owner[key])
1463 : tokenData.owner[key];
1464 }
1465 tokenData.normalizedOwner = CrossAccountId.fromLowerCaseKeys(owner);
1466 return tokenData;1469 return tokenData;
1467 }1470 }
14681471
1474 * @example getTokenOwner(10, 5);1477 * @example getTokenOwner(10, 5);
1475 * @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."}1478 * @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."}
1476 */1479 */
1477 async getTokenOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise<CrossAccountId> {1480 async getTokenOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise<ICrossAccountId> {
1478 let owner;1481 let owner;
1479 if(typeof blockHashAt === 'undefined') {1482 if(typeof blockHashAt === 'undefined') {
1480 owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId]);1483 owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId]);
1481 } else {1484 } else {
1482 owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId, blockHashAt]);1485 owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId, blockHashAt]);
1483 }1486 }
1484 return CrossAccountId.fromLowerCaseKeys(owner.toJSON());1487 return CrossAccountId.fromLowerCaseKeys(owner.toJSON()).toICrossAccountId();
1485 }1488 }
14861489
1487 /**1490 /**
1492 * @example getTokenTopmostOwner(10, 5);1495 * @example getTokenTopmostOwner(10, 5);
1493 * @returns address in CrossAccountId format, e.g. {Substrate: "5DyN4Y92vZCjv38fg..."}1496 * @returns address in CrossAccountId format, e.g. {Substrate: "5DyN4Y92vZCjv38fg..."}
1494 */1497 */
1495 async getTokenTopmostOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise<CrossAccountId | null> {1498 async getTokenTopmostOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise<ICrossAccountId | null> {
1496 let owner;1499 let owner;
1497 if(typeof blockHashAt === 'undefined') {1500 if(typeof blockHashAt === 'undefined') {
1498 owner = await this.helper.callRpc('api.rpc.unique.topmostTokenOwner', [collectionId, tokenId]);1501 owner = await this.helper.callRpc('api.rpc.unique.topmostTokenOwner', [collectionId, tokenId]);
1702 * @example getCollectionObject(2);1705 * @example getCollectionObject(2);
1703 * @returns instance of UniqueNFTCollection1706 * @returns instance of UniqueNFTCollection
1704 */1707 */
1705 getCollectionObject(collectionId: number): UniqueNFTCollection {1708 override getCollectionObject(collectionId: number): UniqueNFTCollection {
1706 return new UniqueNFTCollection(collectionId, this.helper);1709 return new UniqueNFTCollection(collectionId, this.helper);
1707 }1710 }
17081711
1713 * @example getTokenObject(10, 5);1716 * @example getTokenObject(10, 5);
1714 * @returns instance of UniqueNFTToken1717 * @returns instance of UniqueNFTToken
1715 */1718 */
1716 getTokenObject(collectionId: number, tokenId: number): UniqueNFToken {1719 override getTokenObject(collectionId: number, tokenId: number): UniqueNFToken {
1717 return new UniqueNFToken(tokenId, this.getCollectionObject(collectionId));1720 return new UniqueNFToken(tokenId, this.getCollectionObject(collectionId));
1718 }1721 }
17191722
1725 * @returns ```true``` if extrinsic success, otherwise ```false```1728 * @returns ```true``` if extrinsic success, otherwise ```false```
1726 */1729 */
1727 async isTokenApproved(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId): Promise<boolean> {1730 async isTokenApproved(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId): Promise<boolean> {
1728 return (await this.getTokenApprovedPieces(collectionId, tokenId, toAccountObj, await this.getTokenOwner(collectionId, tokenId))) === 1n;1731 return (await this.getTokenApprovedPieces(collectionId, tokenId, toAccountObj, (await this.getTokenOwner(collectionId, tokenId)))) === 1n;
1729 }1732 }
17301733
1731 /**1734 /**
1738 * @example transferToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."})1741 * @example transferToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."})
1739 * @returns ```true``` if extrinsic success, otherwise ```false```1742 * @returns ```true``` if extrinsic success, otherwise ```false```
1740 */1743 */
1741 async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise<boolean> {1744 override async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise<boolean> {
1742 return await super.transferToken(signer, collectionId, tokenId, addressObj, 1n);1745 return await super.transferToken(signer, collectionId, tokenId, addressObj, 1n);
1743 }1746 }
17441747
1754 * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Ethereum: "0x9F0583DbB85..."})1757 * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Ethereum: "0x9F0583DbB85..."})
1755 * @returns ```true``` if extrinsic success, otherwise ```false```1758 * @returns ```true``` if extrinsic success, otherwise ```false```
1756 */1759 */
1757 async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId): Promise<boolean> {1760 override async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId): Promise<boolean> {
1758 return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, 1n);1761 return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, 1n);
1759 }1762 }
17601763
1789 * })1792 * })
1790 * @returns object of the created collection1793 * @returns object of the created collection
1791 */1794 */
1792 async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}): Promise<UniqueNFTCollection> {1795 override async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}): Promise<UniqueNFTCollection> {
1793 return await super.mintCollection(signer, collectionOptions, 'NFT') as UniqueNFTCollection;1796 return await super.mintCollection(signer, collectionOptions, 'NFT') as UniqueNFTCollection;
1794 }1797 }
17951798
1883 * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."})1886 * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."})
1884 * @returns ```true``` if extrinsic success, otherwise ```false```1887 * @returns ```true``` if extrinsic success, otherwise ```false```
1885 */1888 */
1886 approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount = 1n) {1889 override approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount = 1n) {
1887 return super.approveToken(signer, collectionId, tokenId, toAddressObj, amount);1890 return super.approveToken(signer, collectionId, tokenId, toAddressObj, amount);
1888 }1891 }
1889}1892}
1896 * @example getCollectionObject(2);1899 * @example getCollectionObject(2);
1897 * @returns instance of UniqueRFTCollection1900 * @returns instance of UniqueRFTCollection
1898 */1901 */
1899 getCollectionObject(collectionId: number): UniqueRFTCollection {1902 override getCollectionObject(collectionId: number): UniqueRFTCollection {
1900 return new UniqueRFTCollection(collectionId, this.helper);1903 return new UniqueRFTCollection(collectionId, this.helper);
1901 }1904 }
19021905
1907 * @example getTokenObject(10, 5);1910 * @example getTokenObject(10, 5);
1908 * @returns instance of UniqueNFTToken1911 * @returns instance of UniqueNFTToken
1909 */1912 */
1910 getTokenObject(collectionId: number, tokenId: number): UniqueRFToken {1913 override getTokenObject(collectionId: number, tokenId: number): UniqueRFToken {
1911 return new UniqueRFToken(tokenId, this.getCollectionObject(collectionId));1914 return new UniqueRFToken(tokenId, this.getCollectionObject(collectionId));
1912 }1915 }
19131916
1918 * @example getTokenTop10Owners(10, 5);1921 * @example getTokenTop10Owners(10, 5);
1919 * @returns array of top 10 owners1922 * @returns array of top 10 owners
1920 */1923 */
1921 async getTokenTop10Owners(collectionId: number, tokenId: number): Promise<CrossAccountId[]> {1924 async getTokenTop10Owners(collectionId: number, tokenId: number): Promise<ICrossAccountId[]> {
1922 return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, tokenId])).toJSON().map(CrossAccountId.fromLowerCaseKeys);1925 return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, tokenId])).toJSON().map(CrossAccountId.fromLowerCaseKeys).map(a => a.toICrossAccountId());
1923 }1926 }
19241927
1925 /**1928 /**
1944 * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2000n)1947 * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2000n)
1945 * @returns ```true``` if extrinsic success, otherwise ```false```1948 * @returns ```true``` if extrinsic success, otherwise ```false```
1946 */1949 */
1947 async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount = 1n): Promise<boolean> {1950 override async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount = 1n): Promise<boolean> {
1948 return await super.transferToken(signer, collectionId, tokenId, addressObj, amount);1951 return await super.transferToken(signer, collectionId, tokenId, addressObj, amount);
1949 }1952 }
19501953
1959 * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5DfhbVfww7ThF8q6f3i..."}, 2000n)1962 * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5DfhbVfww7ThF8q6f3i..."}, 2000n)
1960 * @returns ```true``` if extrinsic success, otherwise ```false```1963 * @returns ```true``` if extrinsic success, otherwise ```false```
1961 */1964 */
1962 async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount = 1n): Promise<boolean> {1965 override async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount = 1n): Promise<boolean> {
1963 return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount);1966 return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount);
1964 }1967 }
19651968
1975 * })1978 * })
1976 * @returns object of the created collection1979 * @returns object of the created collection
1977 */1980 */
1978 async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}): Promise<UniqueRFTCollection> {1981 override async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}): Promise<UniqueRFTCollection> {
1979 return await super.mintCollection(signer, collectionOptions, 'RFT') as UniqueRFTCollection;1982 return await super.mintCollection(signer, collectionOptions, 'RFT') as UniqueRFTCollection;
1980 }1983 }
19811984
2003 return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId);2006 return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId);
2004 }2007 }
20052008
2006 async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: { owner: ICrossAccountId, pieces: bigint, properties?: IProperty[] }[]): Promise<UniqueRFToken[]> {2009 mintMultipleTokens(_signer: TSigner, _collectionId: number, _tokens: { owner: ICrossAccountId, pieces: bigint, properties?: IProperty[] }[]): Promise<UniqueRFToken[]> {
2007 throw Error('Not implemented');2010 throw Error('Not implemented');
2008 const creationResult = await this.helper.executeExtrinsic(2011 // const creationResult = await this.helper.executeExtrinsic(
2009 signer,2012 // signer,
2010 'api.tx.unique.createMultipleItemsEx', [collectionId, {RefungibleMultipleOwners: tokens}],2013 // 'api.tx.unique.createMultipleItemsEx', [collectionId, {RefungibleMultipleOwners: tokens}],
2011 true, // `Unable to mint RFT tokens for ${label}`,2014 // true, // `Unable to mint RFT tokens for ${label}`,
2012 );2015 // );
2013 const collection = this.getCollectionObject(collectionId);2016 // const collection = this.getCollectionObject(collectionId);
2014 return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));2017 // return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId));
2015 }2018 }
20162019
2017 /**2020 /**
2047 * @example burnToken(aliceKeyring, 10, 5);2050 * @example burnToken(aliceKeyring, 10, 5);
2048 * @returns ```true``` if the extrinsic is successful, otherwise ```false```2051 * @returns ```true``` if the extrinsic is successful, otherwise ```false```
2049 */2052 */
2050 async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount = 1n): Promise<boolean> {2053 override async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount = 1n): Promise<boolean> {
2051 return await super.burnToken(signer, collectionId, tokenId, amount);2054 return await super.burnToken(signer, collectionId, tokenId, amount);
2052 }2055 }
20532056
2061 * @example burnTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2n)2064 * @example burnTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2n)
2062 * @returns ```true``` if extrinsic success, otherwise ```false```2065 * @returns ```true``` if extrinsic success, otherwise ```false```
2063 */2066 */
2064 async burnTokenFrom(signer: IKeyringPair, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, amount = 1n): Promise<boolean> {2067 override async burnTokenFrom(signer: IKeyringPair, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, amount = 1n): Promise<boolean> {
2065 return await super.burnTokenFrom(signer, collectionId, tokenId, fromAddressObj, amount);2068 return await super.burnTokenFrom(signer, collectionId, tokenId, fromAddressObj, amount);
2066 }2069 }
20672070
2076 * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5GHoZe9c73RYbVzq..."}, "", 10000n);2079 * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5GHoZe9c73RYbVzq..."}, "", 10000n);
2077 * @returns true if the token success, otherwise false2080 * @returns true if the token success, otherwise false
2078 */2081 */
2079 approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount = 1n) {2082 override approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount = 1n) {
2080 return super.approveToken(signer, collectionId, tokenId, toAddressObj, amount);2083 return super.approveToken(signer, collectionId, tokenId, toAddressObj, amount);
2081 }2084 }
20822085
2202 * @example getTop10Owners(10);2205 * @example getTop10Owners(10);
2203 * @returns array of ```ICrossAccountId```2206 * @returns array of ```ICrossAccountId```
2204 */2207 */
2205 async getTop10Owners(collectionId: number): Promise<CrossAccountId[]> {2208 async getTop10Owners(collectionId: number): Promise<ICrossAccountId[]> {
2206 return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, 0])).toJSON().map(CrossAccountId.fromLowerCaseKeys);2209 return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, 0])).toJSON().map(CrossAccountId.fromLowerCaseKeys).map(a => a.toICrossAccountId());
2207 }2210 }
22082211
2209 /**2212 /**
2391 const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true/*, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`*/);2394 const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true/*, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`*/);
23922395
2393 let transfer = {from: null, to: null, amount: 0n} as any;2396 let transfer = {from: null, to: null, amount: 0n} as any;
2394 result.result.events.forEach(({event: {data, method, section}}) => {2397 result.result.events.forEach(({event: {data, method, section}}: any) => {
2395 if((section === 'balances') && (method === 'Transfer')) {2398 if((section === 'balances') && (method === 'Transfer')) {
2396 transfer = {2399 transfer = {
2397 from: this.helper.address.normalizeSubstrate(data[0]),2400 from: this.helper.address.normalizeSubstrate(data[0]),
2458 const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true);2461 const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true);
24592462
2460 let transfer = {from: null, to: null, amount: 0n} as any;2463 let transfer = {from: null, to: null, amount: 0n} as any;
2461 result.result.events.forEach(({event: {data, method, section}}) => {2464 result.result.events.forEach(({event: {data, method, section}}: any) => {
2462 if((section === 'balances') && (method === 'Transfer')) {2465 if((section === 'balances') && (method === 'Transfer')) {
2463 transfer = {2466 transfer = {
2464 from: data[0].toString(),2467 from: data[0].toString(),
2573 const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.forceTransfer', [from, to, amount], true);2576 const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.forceTransfer', [from, to, amount], true);
25742577
2575 let transfer = {from: null, to: null, amount: 0n} as any;2578 let transfer = {from: null, to: null, amount: 0n} as any;
2576 result.result.events.forEach(({event: {data, method, section}}) => {2579 result.result.events.forEach(({event: {data, method, section}}: any) => {
2577 if((section === 'balances') && (method === 'Transfer')) {2580 if((section === 'balances') && (method === 'Transfer')) {
2578 transfer = {2581 transfer = {
2579 from: this.helper.address.normalizeSubstrate(data[0]),2582 from: this.helper.address.normalizeSubstrate(data[0]),
2598 async vestedTransfer(signer: TSigner, address: TSubstrateAccount, schedule: { start: bigint, period: bigint, periodCount: bigint, perPeriod: bigint }): Promise<void> {2601 async vestedTransfer(signer: TSigner, address: TSubstrateAccount, schedule: { start: bigint, period: bigint, periodCount: bigint, perPeriod: bigint }): Promise<void> {
2599 const result = await this.helper.executeExtrinsic(signer, 'api.tx.vesting.vestedTransfer', [address, schedule]);2602 const result = await this.helper.executeExtrinsic(signer, 'api.tx.vesting.vestedTransfer', [address, schedule]);
2600 const event = result.result.events2603 const event = result.result.events
2601 .find(e => e.event.section === 'vesting' &&2604 .find((e: any) => e.event.section === 'vesting' &&
2602 e.event.method === 'VestingScheduleAdded' &&2605 e.event.method === 'VestingScheduleAdded' &&
2603 e.event.data[0].toHuman() === signer.address);2606 e.event.data[0].toHuman() === signer.address);
2604 if(!event) throw Error('Cannot find transfer in events');2607 if(!event) throw Error('Cannot find transfer in events');
2626 async claim(signer: TSigner) {2629 async claim(signer: TSigner) {
2627 const result = await this.helper.executeExtrinsic(signer, 'api.tx.vesting.claim', []);2630 const result = await this.helper.executeExtrinsic(signer, 'api.tx.vesting.claim', []);
2628 const event = result.result.events2631 const event = result.result.events
2629 .find(e => e.event.section === 'vesting' &&2632 .find((e: any) => e.event.section === 'vesting' &&
2630 e.event.method === 'Claimed' &&2633 e.event.method === 'Claimed' &&
2631 e.event.data[0].toHuman() === signer.address);2634 e.event.data[0].toHuman() === signer.address);
2632 if(!event) throw Error('Cannot find claim in events');2635 if(!event) throw Error('Cannot find claim in events');
2642 * @returns substrate address converted to normalized (i.e., starting with 5) or specified explicitly representation2645 * @returns substrate address converted to normalized (i.e., starting with 5) or specified explicitly representation
2643 */2646 */
2644 normalizeSubstrate(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount {2647 normalizeSubstrate(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount {
2645 return CrossAccountId.normalizeSubstrateAddress(address, ss58Format);2648 return CrossAccountId.normalizeSubstrateAddress({Substrate: address}, ss58Format);
2646 }2649 }
26472650
2648 /**2651 /**
2766 */2769 */
2767 async stake(signer: TSigner, amountToStake: bigint, label?: string): Promise<boolean> {2770 async stake(signer: TSigner, amountToStake: bigint, label?: string): Promise<boolean> {
2768 if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`;2771 if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`;
2769 const _stakeResult = await this.helper.executeExtrinsic(2772 await this.helper.executeExtrinsic(
2770 signer, 'api.tx.appPromotion.stake',2773 signer, 'api.tx.appPromotion.stake',
2771 [amountToStake], true,2774 [amountToStake], true,
2772 );2775 );
2895 const promise = this.helper.executeExtrinsic(signer, 'api.tx.preimage.notePreimage', [bytes]);2898 const promise = this.helper.executeExtrinsic(signer, 'api.tx.preimage.notePreimage', [bytes]);
2896 if(returnPreimageHash) {2899 if(returnPreimageHash) {
2897 const result = await promise;2900 const result = await promise;
2898 const events = result.result.events.filter(x => x.event.method === 'Noted' && x.event.section === 'preimage');2901 const events = result.result.events.filter((x: any) => x.event.method === 'Noted' && x.event.section === 'preimage');
2899 const preimageHash = events[0].event.data[0].toHuman();2902 const preimageHash = events[0].event.data[0].toHuman();
2900 return preimageHash;2903 return preimageHash;
2901 }2904 }
3363 return await this.collection.doesTokenExist(this.tokenId);3366 return await this.collection.doesTokenExist(this.tokenId);
3364 }3367 }
33653368
3366 nestingAccount() {3369 nestingAccount(): ICrossAccountId {
3367 return this.collection.helper.util.getTokenAccount(this);3370 return this.collection.helper.util.getTokenAccount(this);
3368 }3371 }
3369}3372}
33703373
3371export class UniqueNFToken extends UniqueBaseToken {3374export class UniqueNFToken extends UniqueBaseToken {
3372 collection: UniqueNFTCollection;3375 declare collection: UniqueNFTCollection;
33733376
3374 constructor(tokenId: number, collection: UniqueNFTCollection) {3377 constructor(tokenId: number, collection: UniqueNFTCollection) {
3375 super(tokenId, collection);3378 super(tokenId, collection);
3426}3429}
34273430
3428export class UniqueRFToken extends UniqueBaseToken {3431export class UniqueRFToken extends UniqueBaseToken {
3429 collection: UniqueRFTCollection;3432 declare collection: UniqueRFTCollection;
34303433
3431 constructor(tokenId: number, collection: UniqueRFTCollection) {3434 constructor(tokenId: number, collection: UniqueRFTCollection) {
3432 super(tokenId, collection);3435 super(tokenId, collection);
modifiedjs-packages/playgrounds/src/unique.xcm.tsdiffbeforeafterboth
1import {ApiPromise, WsProvider} from '@polkadot/api';1import {ApiPromise, WsProvider} from '@polkadot/api';
2import {IKeyringPair} from '@polkadot/types/types';2import type {IKeyringPair} from '@polkadot/types/types';
3import {ChainHelperBase, EthereumBalanceGroup, HelperGroup, SubstrateBalanceGroup, UniqueHelper} from './unique';3import {ChainHelperBase, EthereumBalanceGroup, HelperGroup, SubstrateBalanceGroup, UniqueHelper} from './unique.js';
4import {ILogger, TSigner, TSubstrateAccount} from './types';4import type {ILogger, TSigner, TSubstrateAccount} from './types.js';
5import {AcalaAssetMetadata, DemocracyStandardAccountVote, IForeignAssetMetadata, MoonbeamAssetInfo} from './types.xcm';5import type {AcalaAssetMetadata, DemocracyStandardAccountVote, IForeignAssetMetadata, MoonbeamAssetInfo} from './types.xcm.js';
66
77
8export class XcmChainHelper extends ChainHelperBase {8export class XcmChainHelper extends ChainHelperBase {
9 async connect(wsEndpoint: string, _listeners?: any): Promise<void> {9 override async connect(wsEndpoint: string, _listeners?: any): Promise<void> {
10 const wsProvider = new WsProvider(wsEndpoint);10 const wsProvider = new WsProvider(wsEndpoint);
11 this.api = new ApiPromise({11 this.api = new ApiPromise({
12 provider: wsProvider,12 provider: wsProvider,
addedjs-packages/playgrounds/tsconfig.jsondiffbeforeafterboth

no changes

addedjs-packages/scripts/package.jsondiffbeforeafterboth

no changes

modifiedjs-packages/scripts/src/benchmarks/mintFee/index.tsdiffbeforeafterboth
1import {EthUniqueHelper, usingEthPlaygrounds} from '../../eth/util';1import {usingEthPlaygrounds} from '@unique/tests/src/eth/util/index.js';
2import {EthUniqueHelper} from '@unique/tests/src/eth/util/playgrounds/unique.dev.js';
2import {readFile} from 'fs/promises';3import {readFile} from 'fs/promises';
3import {4import type {ICrossAccountId} from '@unique/playgrounds/src/types.js';
4 ICrossAccountId,
5} from '../../util/playgrounds/types';
6import {IKeyringPair} from '@polkadot/types/types';5import type {IKeyringPair} from '@polkadot/types/types';
7import {UniqueNFTCollection} from '../../util/playgrounds/unique';6import {UniqueNFTCollection} from '@unique/playgrounds/src/unique.js';
8import {Contract} from 'web3-eth-contract';7import {Contract} from 'web3-eth-contract';
9import {createObjectCsvWriter} from 'csv-writer';8import {createObjectCsvWriter} from 'csv-writer';
10import {convertToTokens, createCollectionForBenchmarks, PERMISSIONS, PROPERTIES} from '../utils/common';9import {convertToTokens, createCollectionForBenchmarks, PERMISSIONS, PROPERTIES} from '../utils/common.js';
11import {makeNames} from '../../util';10import {makeNames} from '@unique/tests/src/util/index.js';
12import {ContractImports} from '../../eth/util/playgrounds/types';11import type {ContractImports} from '@unique/tests/src/eth/util/playgrounds/types.js';
1312
14const {dirname} = makeNames(import.meta.url);13const {dirname} = makeNames(import.meta.url);
1514
modifiedjs-packages/scripts/src/benchmarks/nesting/ABIGEN/RMRKNestableMintable.tsdiffbeforeafterboth
8import type { EventEmitter } from "events";8import type { EventEmitter } from "events";
9import type {9import type {
10 Callback,10 Callback,
11 PayableTransactionObject,
12 NonPayableTransactionObject,11 NonPayableTransactionObject,
13 BlockType,12 BlockType,
14 ContractEventLog,13 ContractEventLog,
15 BaseContract,14 BaseContract,
16} from "./types";15} from "./types.js";
1716
18export interface EventOptions {17export interface EventOptions {
19 filter?: object;18 filter?: object;
modifiedjs-packages/scripts/src/benchmarks/nesting/ABIGEN/index.tsdiffbeforeafterboth
1/* Autogenerated file. Do not edit manually. */1/* Autogenerated file. Do not edit manually. */
2/* tslint:disable */2/* tslint:disable */
3/* eslint-disable */3/* eslint-disable */
4export type { RMRKNestableMintable } from "./RMRKNestableMintable";4export type { RMRKNestableMintable } from "./RMRKNestableMintable.js";
55
modifiedjs-packages/scripts/src/benchmarks/nesting/ABIGEN/types.tsdiffbeforeafterboth
3/* eslint-disable */3/* eslint-disable */
4import type BN from "bn.js";4import type BN from "bn.js";
5import type { EventEmitter } from "events";5import type { EventEmitter } from "events";
6import type { EventLog, PromiEvent, TransactionReceipt } from "web3-core/types";6import type { EventLog, PromiEvent, TransactionReceipt } from "web3-core";
7import type { Contract } from "web3-eth-contract";7import type { Contract } from "web3-eth-contract";
88
9export interface EstimateGasOptions {9export interface EstimateGasOptions {
modifiedjs-packages/scripts/src/benchmarks/nesting/index.tsdiffbeforeafterboth
1import {EthUniqueHelper, usingEthPlaygrounds} from '../../eth/util';1import {usingEthPlaygrounds} from '@unique/tests/src/eth/util/index.js';
2import {EthUniqueHelper} from '@unique/tests/src/eth/util/playgrounds/unique.dev.js';
2import {readFile} from 'fs/promises';3import {readFile} from 'fs/promises';
3import {IKeyringPair} from '@polkadot/types/types';4import type {IKeyringPair} from '@polkadot/types/types';
4import {Contract} from 'web3-eth-contract';5import {Contract} from 'web3-eth-contract';
5import {convertToTokens} from '../utils/common';6import {convertToTokens} from '../utils/common.js';
6import {makeNames} from '../../util';7import {makeNames} from '@unique/tests/src/util/index.js';
7import {ContractImports} from '../../eth/util/playgrounds/types';8import type {ContractImports} from '@unique/tests/src/eth/util/playgrounds/types.js';
8import {RMRKNestableMintable} from './ABIGEN';9import type {RMRKNestableMintable} from './ABIGEN/index.js';
910
10const {dirname} = makeNames(import.meta.url);11const {dirname} = makeNames(import.meta.url);
1112
12export const CONTRACT_IMPORT: ContractImports[] = [13export const CONTRACT_IMPORT: ContractImports[] = [
13 {14 {
14 fsPath: `${dirname}/../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/nestable/RMRKNestable.sol`,15 fsPath: `${dirname}/../../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/nestable/RMRKNestable.sol`,
15 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/nestable/RMRKNestable.sol',16 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/nestable/RMRKNestable.sol',
16 },17 },
17 {18 {
18 fsPath: `${dirname}/../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/nestable/IERC6059.sol`,19 fsPath: `${dirname}/../../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/nestable/IERC6059.sol`,
19 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/nestable/IERC6059.sol',20 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/nestable/IERC6059.sol',
20 },21 },
21 {22 {
22 fsPath: `${dirname}/../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/core/RMRKCore.sol`,23 fsPath: `${dirname}/../../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/core/RMRKCore.sol`,
23 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/core/RMRKCore.sol',24 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/core/RMRKCore.sol',
24 },25 },
25 {26 {
26 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol`,27 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol`,
27 solPath: '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol',28 solPath: '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol',
28 },29 },
29 {30 {
30 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol`,31 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol`,
31 solPath: '@openzeppelin/contracts/token/ERC721/IERC721.sol',32 solPath: '@openzeppelin/contracts/token/ERC721/IERC721.sol',
32 },33 },
33 {34 {
34 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol`,35 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol`,
35 solPath: '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol',36 solPath: '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol',
36 },37 },
37 {38 {
38 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/utils/Address.sol`,39 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/utils/Address.sol`,
39 solPath: '@openzeppelin/contracts/utils/Address.sol',40 solPath: '@openzeppelin/contracts/utils/Address.sol',
40 },41 },
41 {42 {
42 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/utils/Context.sol`,43 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/utils/Context.sol`,
43 solPath: '@openzeppelin/contracts/utils/Context.sol',44 solPath: '@openzeppelin/contracts/utils/Context.sol',
44 },45 },
45 {46 {
46 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol`,47 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol`,
47 solPath: '@openzeppelin/contracts/utils/introspection/IERC165.sol',48 solPath: '@openzeppelin/contracts/utils/introspection/IERC165.sol',
48 },49 },
49 {50 {
50 fsPath: `${dirname}/../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/library/RMRKErrors.sol`,51 fsPath: `${dirname}/../../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/library/RMRKErrors.sol`,
51 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/library/RMRKErrors.sol',52 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/library/RMRKErrors.sol',
52 },53 },
53 {54 {
54 fsPath: `${dirname}/../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/core/IRMRKCore.sol`,55 fsPath: `${dirname}/../../../../node_modules/@rmrk-team/evm-contracts/contracts/RMRK/core/IRMRKCore.sol`,
55 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/core/IRMRKCore.sol',56 solPath: '@rmrk-team/evm-contracts/contracts/RMRK/core/IRMRKCore.sol',
56 },57 },
57 {58 {
modifiedjs-packages/scripts/src/benchmarks/opsFee/index.tsdiffbeforeafterboth
1import {EthUniqueHelper, usingEthPlaygrounds} from '../../eth/util';1import {usingEthPlaygrounds} from '@unique/tests/src/eth/util/index.js';
2import {EthUniqueHelper} from '@unique/tests/src/eth/util/playgrounds/unique.dev.js';
2import {readFile} from 'fs/promises';3import {readFile} from 'fs/promises';
3import {CollectionLimitField, CreateCollectionData, TokenPermissionField} from '../../eth/util/playgrounds/types';4import {CollectionLimitField, CreateCollectionData, TokenPermissionField} from '@unique/tests/src/eth/util/playgrounds/types.js';
4import {IKeyringPair} from '@polkadot/types/types';5import type {IKeyringPair} from '@polkadot/types/types';
5import {UniqueFTCollection, UniqueNFTCollection} from '../../util/playgrounds/unique';6import {UniqueFTCollection, UniqueNFTCollection} from '@unique/playgrounds/src/unique.js';
6import {Contract} from 'web3-eth-contract';7import {Contract} from 'web3-eth-contract';
7import {createObjectCsvWriter} from 'csv-writer';8import {createObjectCsvWriter} from 'csv-writer';
8import {FunctionFeeVM, IFunctionFee} from '../utils/types';9import {FunctionFeeVM} from '../utils/types.js';
10import type {IFunctionFee} from '../utils/types.js';
9import {convertToTokens, createCollectionForBenchmarks, PERMISSIONS, PROPERTIES, SUBS_PROPERTIES} from '../utils/common';11import {convertToTokens, createCollectionForBenchmarks, PERMISSIONS, PROPERTIES, SUBS_PROPERTIES} from '../utils/common.js';
10import {makeNames} from '../../util';12import {makeNames} from '@unique/tests/src/util/index.js';
1113
1214
13const {dirname} = makeNames(import.meta.url);15const {dirname} = makeNames(import.meta.url);
modifiedjs-packages/scripts/src/benchmarks/utils/common.tsdiffbeforeafterboth
1import {EthUniqueHelper} from '../../eth/util';1import {EthUniqueHelper} from '@unique/tests/src/eth/util/playgrounds/unique.dev.js';
2import {ITokenPropertyPermission, TCollectionMode} from '../../util/playgrounds/types';2import {UniqueNFTCollection, UniqueRFTCollection} from '@unique/playgrounds/src/unique.js';
3import {UniqueNFTCollection, UniqueRFTCollection} from '../../util/playgrounds/unique';3import type {ITokenPropertyPermission, TCollectionMode} from '@unique/playgrounds/src/types.js';
4import {IKeyringPair} from '@polkadot/types/types';4import type {IKeyringPair} from '@polkadot/types/types';
55
6export const PROPERTIES = Array(40)6export const PROPERTIES = Array(40)
7 .fill(0)7 .fill(0)
modifiedjs-packages/scripts/src/calibrate.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {usingEthPlaygrounds, EthUniqueHelper} from './eth/util';2import {usingEthPlaygrounds} from '@unique/tests/src/eth/util/index.js';
3import {EthUniqueHelper} from '@unique/tests/src//eth/util/playgrounds/unique.dev.js';
34
4class Fract {5class Fract {
5 static ZERO = new Fract(0n);6 static ZERO = new Fract(0n);
174175
175const hypothesisLinear = (a: Fract, b: Fract) => (x: Fract) => rpn(x, a, '*', b, '+');176const hypothesisLinear = (a: Fract, b: Fract) => (x: Fract) => rpn(x, a, '*', b, '+');
176177
177function _error(points: { x: Fract, y: Fract }[], hypothesis: (a: Fract) => Fract) {178// function error(points: { x: Fract, y: Fract }[], hypothesis: (a: Fract) => Fract) {
178 return points.map(p => {179// return points.map(p => {
179 const v = hypothesis(p.x);180// const v = hypothesis(p.x);
180 const vv = p.y;181// const vv = p.y;
181182
182 return rpn(v, vv, '-', 'dup', '*');183// return rpn(v, vv, '-', 'dup', '*');
183 }).reduce((a, b) => a.plus(b), Fract.ZERO).sqrt().div(new Fract(BigInt(points.length)));184// }).reduce((a, b) => a.plus(b), Fract.ZERO).sqrt().div(new Fract(BigInt(points.length)));
184}185// }
185186
186async function calibrateWeightToFee(helper: EthUniqueHelper, privateKey: (account: string) => Promise<IKeyringPair>) {187async function calibrateWeightToFee(helper: EthUniqueHelper, privateKey: (account: string) => Promise<IKeyringPair>) {
187 const alice = await privateKey('//Alice');188 const alice = await privateKey('//Alice');
modifiedjs-packages/scripts/src/calibrateApply.tsdiffbeforeafterboth
1import {readFile, writeFile} from 'fs/promises';1import {readFile, writeFile} from 'fs/promises';
2import path from 'path';2import path from 'path';
3import usingApi from './.outdated/substrate/substrate-api';
4import {makeNames} from './util';3import {makeNames, usingPlaygrounds} from '@unique/tests/src/util/index.js';
54
6const {dirname} = makeNames(import.meta.url);5const {dirname} = makeNames(import.meta.url);
76
10(async () => {9(async () => {
11 let weightToFeeCoefficientOverride: string;10 let weightToFeeCoefficientOverride: string;
12 let minGasPriceOverride: string;11 let minGasPriceOverride: string;
13 await usingApi(async (api, _privateKey) => {12 await usingPlaygrounds(async (helpers, _privateKey) => {
14 weightToFeeCoefficientOverride = (await api.query.configuration.weightToFeeCoefficientOverride() as any).toBigInt().toString();13 weightToFeeCoefficientOverride = (await helpers.getApi().query.configuration.weightToFeeCoefficientOverride() as any).toBigInt().toString();
15 minGasPriceOverride = (await api.query.configuration.minGasPriceOverride() as any).toBigInt().toString();14 minGasPriceOverride = (await helpers.getApi().query.configuration.minGasPriceOverride() as any).toBigInt().toString();
16 });15 });
17 const constantsFile = path.resolve(dirname, '../../primitives/common/src/constants.rs');16 const constantsFile = path.resolve(dirname, '../../primitives/common/src/constants.rs');
18 let constants = (await readFile(constantsFile)).toString();17 let constants = (await readFile(constantsFile)).toString();
modifiedjs-packages/scripts/src/fetchMetadata.tsdiffbeforeafterboth
25 }),25 }),
26 });26 });
27 const json = await response.json();27 const json = await response.json();
28 const output = join(srcDir, 'interfaces/metadata.json');28 const output = join(srcDir, 'metadata.json');
29 console.log(`Received response, saving to ${output}`);29 console.log(`Received response, saving to ${output}`);
30 await writeFile(output, JSON.stringify(json));30 await writeFile(output, JSON.stringify(json));
31 exit(0);31 exit(0);
modifiedjs-packages/scripts/src/generateEnv.tsdiffbeforeafterboth
1import {ApiPromise, WsProvider} from '@polkadot/api';1import {ApiPromise, WsProvider} from '@polkadot/api';
2import {readFile} from 'fs/promises';2import {readFile} from 'fs/promises';
3import {join} from 'path';3import {join} from 'path';
4import {makeNames} from './util';4import {makeNames} from '@unique/tests/src/util/index.js';
55
6const {dirname} = makeNames(import.meta.url);6const {dirname} = makeNames(import.meta.url);
77
modifiedjs-packages/scripts/src/generate_types/readyness.jsdiffbeforeafterboth
9 await api.disconnect();9 await api.disconnect();
10 if(head < 1) throw Error('No block #1');10 if(head < 1) throw Error('No block #1');
1111
12}12};
1313
14const sleep = time => {14const sleep = time => new Promise(resolve => {
15 return new Promise(resolve => {
16 setTimeout(() => resolve(), time);15 setTimeout(() => resolve(), time);
17 });16});
18};
1917
20const main = async () => {18const main = async () => {
19 // eslint-disable-next-line no-constant-condition
21 while(true) {20 while(true) {
22 try {21 try {
23 await connect();22 await connect();
28 console.log(e);27 console.log(e);
29 }28 }
30 }29 }
31}30};
3231
33main().then(() => process.exit(0)).catch(e => {32main().then(() => process.exit(0)).catch(e => {
34 console.error(e);33 console.error(e);
addedjs-packages/scripts/src/metadata.jsondiffbeforeafterboth

no changes

modifiedjs-packages/scripts/src/transfer.nload.tsdiffbeforeafterboth
1616
17/* eslint-disable @typescript-eslint/no-floating-promises */17/* eslint-disable @typescript-eslint/no-floating-promises */
18import os from 'os';18import os from 'os';
19import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
20import {usingPlaygrounds} from './util';20import {usingPlaygrounds} from '@unique/tests/src/util/index.js';
21import {UniqueHelper} from './util/playgrounds/unique';21import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
22import * as notReallyCluster from 'cluster'; // https://github.com/nodejs/node/issues/42271#issuecomment-106341534622import * as notReallyCluster from 'cluster'; // https://github.com/nodejs/node/issues/42271#issuecomment-1063415346
23const cluster = notReallyCluster as unknown as notReallyCluster.Cluster;23const cluster = notReallyCluster as unknown as notReallyCluster.Cluster;
2424
addedjs-packages/scripts/tsconfig.jsondiffbeforeafterboth

no changes

addedjs-packages/tests/package.jsondiffbeforeafterboth

no changes

modifiedjs-packages/tests/src/addCollectionAdmin.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {21describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
modifiedjs-packages/tests/src/adminTransferAndBurn.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub} from './util';18import {usingPlaygrounds, expect, itSub} from './util/index.js';
1919
20describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => {20describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
4040
41 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address});41 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address});
42 const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId);42 const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId);
43 expect(newTokenOwner.Substrate).to.be.equal(charlie.address);43 expect(newTokenOwner).to.be.deep.equal({Substrate: charlie.address});
44 });44 });
4545
46 itSub('admin burns other user\'s token', async ({helper}) => {46 itSub('admin burns other user\'s token', async ({helper}) => {
modifiedjs-packages/tests/src/allowLists.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub} from './util';18import {usingPlaygrounds, expect, itSub} from './util/index.js';
19import {ICollectionPermissions, NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import type {ICollectionPermissions} from '@unique/playgrounds/src/types.js';
20import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2021
21describe('Integration Test ext. Allow list tests', () => {22describe('Integration Test ext. Allow list tests', () => {
22 let alice: IKeyringPair;23 let alice: IKeyringPair;
177 await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});178 await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
178 await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});179 await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
179 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);180 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
180 expect(owner.Substrate).to.be.equal(charlie.address);181 expect(owner).to.be.deep.equal({Substrate: charlie.address});
181 });182 });
182183
183 itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => {184 itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => {
190191
191 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});192 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
192 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);193 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
193 expect(owner.Substrate).to.be.equal(charlie.address);194 expect(owner).to.be.deep.equal({Substrate: charlie.address});
194 });195 });
195196
196 itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => {197 itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => {
202203
203 await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});204 await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
204 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);205 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
205 expect(owner.Substrate).to.be.equal(charlie.address);206 expect(owner).to.be.deep.equal({Substrate: charlie.address});
206 });207 });
207208
208 itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => {209 itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => {
215216
216 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});217 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
217 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);218 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
218 expect(owner.Substrate).to.be.equal(charlie.address);219 expect(owner).to.be.deep.equal({Substrate: charlie.address});
219 });220 });
220 });221 });
221222
modifiedjs-packages/tests/src/apiConsts.test.tsdiffbeforeafterboth
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/>.
1616
17import {ApiPromise} from '@polkadot/api';17import {ApiPromise} from '@polkadot/api';
18import {usingPlaygrounds, itSub, expect, COLLECTION_HELPER, CONTRACT_HELPER} from './util';18import {usingPlaygrounds, itSub, expect, COLLECTION_HELPER, CONTRACT_HELPER} from './util/index.js';
1919
2020
21const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;21const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;
modifiedjs-packages/tests/src/approve.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, usingPlaygrounds} from './util';18import {expect, itSub, Pallets, usingPlaygrounds} from './util/index.js';
19import {CrossAccountId} from './util/playgrounds/unique';19import {CrossAccountId} from '@unique/playgrounds/src/unique.js';
2020
2121
2222
23[23[
24 {method: 'approveToken', account: (account: IKeyringPair) => CrossAccountId.fromKeyring(account)},24 {method: 'approveToken', account: (account: IKeyringPair) => CrossAccountId.fromKeyring(account).toICrossAccountId()},
25 {method: 'approveTokenFromEth', account: (account: IKeyringPair) => CrossAccountId.fromKeyring(account).toEthereum()},25 {method: 'approveTokenFromEth', account: (account: IKeyringPair) => CrossAccountId.fromKeyring(account).toEthereum().toICrossAccountId()},
26].map(testCase => {26].map(testCase => {
27 describe(`Integration Test ${testCase.method}(spender, collection_id, item_id, amount):`, () => {27 describe(`Integration Test ${testCase.method}(spender, collection_id, item_id, amount):`, () => {
28 let alice: IKeyringPair;28 let alice: IKeyringPair;
158 await (helper.nft as any)[testCase.method](bob, collectionId, tokenId, {Substrate: charlie.address});158 await (helper.nft as any)[testCase.method](bob, collectionId, tokenId, {Substrate: charlie.address});
159 await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, testCase.account(bob), {Substrate: alice.address});159 await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, testCase.account(bob), {Substrate: alice.address});
160 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);160 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
161 expect(owner.Substrate).to.be.equal(alice.address);161 expect(owner).to.be.deep.equal({Substrate: alice.address});
162 });162 });
163163
164 itSub('Fungible up to an approved amount', async ({helper}) => {164 itSub('Fungible up to an approved amount', async ({helper}) => {
201 await (helper.nft as any)[testCase.method](bob, collectionId, tokenId, {Substrate: charlie.address});201 await (helper.nft as any)[testCase.method](bob, collectionId, tokenId, {Substrate: charlie.address});
202 await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, testCase.account(bob), {Substrate: alice.address});202 await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, testCase.account(bob), {Substrate: alice.address});
203 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);203 const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
204 expect(owner.Substrate).to.be.equal(alice.address);204 expect(owner).to.be.deep.equal({Substrate: alice.address});
205 const transferTokenFromTx = () => helper.nft.transferTokenFrom(charlie, collectionId, tokenId, testCase.account(bob), {Substrate: alice.address});205 const transferTokenFromTx = () => helper.nft.transferTokenFrom(charlie, collectionId, tokenId, testCase.account(bob), {Substrate: alice.address});
206 await expect(transferTokenFromTx()).to.be.rejectedWith('common.ApprovedValueTooLow');206 await expect(transferTokenFromTx()).to.be.rejectedWith('common.ApprovedValueTooLow');
207 });207 });
559559
560 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address});560 await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address});
561 const owner1 = await helper.nft.getTokenOwner(collectionId, tokenId);561 const owner1 = await helper.nft.getTokenOwner(collectionId, tokenId);
562 expect(owner1.Substrate).to.be.equal(dave.address);562 expect(owner1).to.be.deep.equal({Substrate: dave.address});
563563
564 await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address});564 await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address});
565 await helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address});565 await helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address});
566 const owner2 = await helper.nft.getTokenOwner(collectionId, tokenId);566 const owner2 = await helper.nft.getTokenOwner(collectionId, tokenId);
567 expect(owner2.Substrate).to.be.equal(alice.address);567 expect(owner2).to.be.deep.equal({Substrate: alice.address});
568 });568 });
569569
570 itSub('Fungible up to an approved amount', async ({helper}) => {570 itSub('Fungible up to an approved amount', async ({helper}) => {
modifiedjs-packages/tests/src/burnItem.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from './util';18import {expect, itSub, usingPlaygrounds} from './util/index.js';
1919
2020
21describe('integration test: ext. burnItem():', () => {21describe('integration test: ext. burnItem():', () => {
modifiedjs-packages/tests/src/change-collection-owner.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub} from './util';18import {usingPlaygrounds, expect, itSub} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {21describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/check-event/burnItemEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {usingPlaygrounds, expect, itSub} from '../util';19import {usingPlaygrounds, expect, itSub} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
2222
23describe('Burn Item event ', () => {23describe('Burn Item event ', () => {
modifiedjs-packages/tests/src/check-event/createCollectionEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {usingPlaygrounds, itSub, expect} from '../util';19import {usingPlaygrounds, itSub, expect} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
22describe('Create collection event ', () => {22describe('Create collection event ', () => {
23 let alice: IKeyringPair;23 let alice: IKeyringPair;
modifiedjs-packages/tests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {itSub, usingPlaygrounds, expect} from '../util';19import {itSub, usingPlaygrounds, expect} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
22describe('Create Item event ', () => {22describe('Create Item event ', () => {
23 let alice: IKeyringPair;23 let alice: IKeyringPair;
modifiedjs-packages/tests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {usingPlaygrounds, itSub, expect} from '../util';19import {usingPlaygrounds, itSub, expect} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
22describe('Create Multiple Items Event event ', () => {22describe('Create Multiple Items Event event ', () => {
23 let alice: IKeyringPair;23 let alice: IKeyringPair;
modifiedjs-packages/tests/src/check-event/destroyCollectionEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {itSub, usingPlaygrounds, expect} from '../util';19import {itSub, usingPlaygrounds, expect} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
22describe('Destroy collection event ', () => {22describe('Destroy collection event ', () => {
23 let alice: IKeyringPair;23 let alice: IKeyringPair;
modifiedjs-packages/tests/src/check-event/transferEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {usingPlaygrounds, expect, itSub} from '../util';19import {usingPlaygrounds, expect, itSub} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
22describe('Transfer event ', () => {22describe('Transfer event ', () => {
23 let alice: IKeyringPair;23 let alice: IKeyringPair;
modifiedjs-packages/tests/src/check-event/transferFromEvent.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {usingPlaygrounds, expect, itSub} from '../util';19import {usingPlaygrounds, expect, itSub} from '../util/index.js';
20import {IEvent} from '../util/playgrounds/types';20import type {IEvent} from '@unique/playgrounds/src/types.js';
2121
22describe('Transfer event ', () => {22describe('Transfer event ', () => {
23 let alice: IKeyringPair;23 let alice: IKeyringPair;
modifiedjs-packages/tests/src/collator-selection/collatorSelection.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../util';18import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../util/index.js';
1919
20async function nodeAddress(name: string) {20async function nodeAddress(name: string) {
21 // eslint-disable-next-line require-await21 // eslint-disable-next-line require-await
22 return await usingPlaygrounds(async (helper, _) => {22 return await usingPlaygrounds(async (helper) => {
23 const envNodeStash = `RELAY_UNIQUE_NODE_${name.toUpperCase()}_STASH`;23 const envNodeStash = `RELAY_UNIQUE_NODE_${name.toUpperCase()}_STASH`;
2424
25 const nodeStash = process.env[envNodeStash];25 const nodeStash = process.env[envNodeStash];
91 let deltaNode: string;91 let deltaNode: string;
9292
93 before(async function() {93 before(async function() {
94 await usingPlaygrounds(async (helper, privateKey) => {94 await usingPlaygrounds(async (helper) => {
95 // todo:collator see again if blocks start to be finalized in dev mode95 // todo:collator see again if blocks start to be finalized in dev mode
96 // Skip the collator block production in dev mode, since the blocks are sealed automatically.96 // Skip the collator block production in dev mode, since the blocks are sealed automatically.
97 if(await helper.arrange.isDevNode()) this.skip();97 if(await helper.arrange.isDevNode()) this.skip();
137 let crowd: IKeyringPair[];137 let crowd: IKeyringPair[];
138138
139 before(async function() {139 before(async function() {
140 await usingPlaygrounds(async (helper, privateKey) => {140 await usingPlaygrounds(async (helper) => {
141 crowd = await helper.arrange.createCrowd(20, 100n, superuser);141 crowd = await helper.arrange.createCrowd(20, 100n, superuser);
142142
143 // set session keys for everyone143 // set session keys for everyone
219 let crowd: IKeyringPair[];219 let crowd: IKeyringPair[];
220220
221 before(async function() {221 before(async function() {
222 await usingPlaygrounds(async (helper, privateKey) => {222 await usingPlaygrounds(async (helper) => {
223 crowd = await helper.arrange.createCrowd(20, 100n, superuser);223 crowd = await helper.arrange.createCrowd(20, 100n, superuser);
224224
225 // set session keys for everyone225 // set session keys for everyone
modifiedjs-packages/tests/src/collator-selection/identity.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../util';18import {usingPlaygrounds, expect, itSub, Pallets, requirePalletsOrSkip} from '../util/index.js';
19import {UniqueHelper} from '../util/playgrounds/unique';19import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
2020
21async function getIdentities(helper: UniqueHelper) {21async function getIdentities(helper: UniqueHelper) {
22 const identities: [string, any][] = [];22 const identities: [string, any][] = [];
modifiedjs-packages/tests/src/confirmSponsorship.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub, Pallets} from './util';18import {usingPlaygrounds, expect, itSub, Pallets} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21async function setSponsorHelper(collection: any, signer: IKeyringPair, sponsorAddress: string) {21async function setSponsorHelper(collection: any, signer: IKeyringPair, sponsorAddress: string) {
22 await collection.setSponsor(signer, sponsorAddress);22 await collection.setSponsor(signer, sponsorAddress);
modifiedjs-packages/tests/src/connection.test.tsdiffbeforeafterboth
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/>.
1616
17import {itSub, expect, usingPlaygrounds} from './util';17import {itSub, expect, usingPlaygrounds} from './util/index.js';
1818
19describe('Connection smoke test', () => {19describe('Connection smoke test', () => {
20 itSub('Connection can be established', async ({helper}) => {20 itSub('Connection can be established', async ({helper}) => {
modifiedjs-packages/tests/src/createCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub, Pallets} from './util';18import {usingPlaygrounds, expect, itSub, Pallets} from './util/index.js';
19import {CollectionFlag} from '@unique/playgrounds/src/types.js';
19import {CollectionFlag, ICollectionCreationOptions, IProperty} from './util/playgrounds/types';20import type {ICollectionCreationOptions, IProperty} from '@unique/playgrounds/src/types.js';
20import {UniqueHelper} from './util/playgrounds/unique';21import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
2122
22async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') {23async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') {
23 let collection;24 let collection;
modifiedjs-packages/tests/src/createItem.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub, Pallets} from './util';18import {usingPlaygrounds, expect, itSub, Pallets} from './util/index.js';
19import {IProperty, ICrossAccountId} from './util/playgrounds/types';19import type {IProperty, ICrossAccountId} from '@unique/playgrounds/src/types.js';
20import {UniqueHelper} from './util/playgrounds/unique';20import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
2121
22async function mintTokenHelper(helper: UniqueHelper, collection: any, signer: IKeyringPair, owner: ICrossAccountId, type: 'nft' | 'fungible' | 'refungible'='nft', properties?: IProperty[]) {22async function mintTokenHelper(helper: UniqueHelper, collection: any, signer: IKeyringPair, owner: ICrossAccountId, type: 'nft' | 'fungible' | 'refungible'='nft', properties?: IProperty[]) {
23 let token;23 let token;
modifiedjs-packages/tests/src/createMultipleItems.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, Pallets, itSub} from './util';18import {usingPlaygrounds, expect, Pallets, itSub} from './util/index.js';
1919
20describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => {20describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
44 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);44 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);
45 for(const [i, token] of tokens.entries()) {45 for(const [i, token] of tokens.entries()) {
46 const tokenData = await token.getData();46 const tokenData = await token.getData();
47 expect(tokenData?.normalizedOwner.Substrate).to.be.deep.equal(helper.address.normalizeSubstrate(alice.address));47 expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.address.normalizeSubstrate(alice.address)});
48 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);48 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);
49 }49 }
50 });50 });
112 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);112 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);
113 for(const [i, token] of tokens.entries()) {113 for(const [i, token] of tokens.entries()) {
114 const tokenData = await token.getData();114 const tokenData = await token.getData();
115 expect(tokenData?.normalizedOwner.Substrate).to.be.deep.equal(helper.address.normalizeSubstrate(alice.address));115 expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.address.normalizeSubstrate(alice.address)});
116 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);116 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);
117 }117 }
118 });118 });
134 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);134 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);
135 for(const [i, token] of tokens.entries()) {135 for(const [i, token] of tokens.entries()) {
136 const tokenData = await token.getData();136 const tokenData = await token.getData();
137 expect(tokenData?.normalizedOwner.Substrate).to.be.deep.equal(helper.address.normalizeSubstrate(alice.address));137 expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.address.normalizeSubstrate(alice.address)});
138 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);138 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);
139 }139 }
140 });140 });
156 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);156 const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args);
157 for(const [i, token] of tokens.entries()) {157 for(const [i, token] of tokens.entries()) {
158 const tokenData = await token.getData();158 const tokenData = await token.getData();
159 expect(tokenData?.normalizedOwner.Substrate).to.be.equal(helper.address.normalizeSubstrate(alice.address));159 expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.address.normalizeSubstrate(alice.address)});
160 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);160 expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value);
161 }161 }
162 });162 });
modifiedjs-packages/tests/src/createMultipleItemsEx.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, Pallets, itSub} from './util';18import {usingPlaygrounds, expect, Pallets, itSub} from './util/index.js';
19import {IProperty} from './util/playgrounds/types';19import type {IProperty} from '@unique/playgrounds/src/types.js';
2020
21describe('Integration Test: createMultipleItemsEx', () => {21describe('Integration Test: createMultipleItemsEx', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/creditFeesToTreasury.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import './interfaces/augment-api-consts';
18import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
19import {ApiPromise} from '@polkadot/api';18import {ApiPromise} from '@polkadot/api';
20import {usingPlaygrounds, expect, itSub} from './util';19import {usingPlaygrounds, expect, itSub} from './util/index.js';
20import type {u32} from '@polkadot/types-codec';
2121
22const TREASURY = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z';22const TREASURY = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z';
23const saneMinimumFee = 0.05;23const saneMinimumFee = 0.05;
29/*eslint no-async-promise-executor: "off"*/29/*eslint no-async-promise-executor: "off"*/
30function skipInflationBlock(api: ApiPromise): Promise<void> {30function skipInflationBlock(api: ApiPromise): Promise<void> {
31 const promise = new Promise<void>(async (resolve) => {31 const promise = new Promise<void>(async (resolve) => {
32 const blockInterval = api.consts.inflation.inflationBlockInterval.toNumber();32 const inflationBlockInterval = api.consts.inflation.inflationBlockInterval as u32;
33 const blockInterval = inflationBlockInterval.toNumber();
33 const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {34 const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
34 const currentBlock = head.number.toNumber();35 const currentBlock = head.number.toNumber();
35 if(currentBlock % blockInterval < blockInterval - 10) {36 if(currentBlock % blockInterval < blockInterval - 10) {
modifiedjs-packages/tests/src/destroyCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, expect, usingPlaygrounds, Pallets} from './util';18import {itSub, expect, usingPlaygrounds, Pallets} from './util/index.js';
1919
20describe('integration test: ext. destroyCollection():', () => {20describe('integration test: ext. destroyCollection():', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedjs-packages/tests/src/enableDisableTransfer.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
1919
20describe('Enable/Disable Transfers', () => {20describe('Enable/Disable Transfers', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedjs-packages/tests/src/eth/allowlist.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {Pallets} from '../util';18import {Pallets} from '../util/index.js';
19import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from './util';19import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from './util/index.js';
20import {CreateCollectionData} from './util/playgrounds/types';20import {CreateCollectionData} from './util/playgrounds/types.js';
2121
22describe('EVM contract allowlist', () => {22describe('EVM contract allowlist', () => {
23 let donor: IKeyringPair;23 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/base.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util';18import {itEth, usingEthPlaygrounds, expect} from './util/index.js';
19import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
1920
2021
21describe('Contract calls', () => {22describe('Contract calls', () => {
modifiedjs-packages/tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth
13// You should have received a copy of the GNU General Public License13// You should have received a copy of the GNU General Public License
14// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.14// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1515
16import {IKeyringPair} from '@polkadot/types/types';16import type {IKeyringPair} from '@polkadot/types/types';
17import {expect} from 'chai';17import {expect} from 'chai';
18import {Pallets} from '../util';18import {Pallets} from '../util/index.js';
19import {IEthCrossAccountId} from '../util/playgrounds/types';19import type {IEthCrossAccountId} from '@unique/playgrounds/src/types.js';
20import {usingEthPlaygrounds, itEth} from './util';20import {usingEthPlaygrounds, itEth} from './util/index.js';
21import {EthUniqueHelper} from './util/playgrounds/unique.dev';21import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
22import {CreateCollectionData} from './util/playgrounds/types';22import {CreateCollectionData} from './util/playgrounds/types.js';
2323
24async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise<any>) {24async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise<any>) {
25 const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress));25 const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress));
modifiedjs-packages/tests/src/eth/collectionHelperAddress.test.tsdiffbeforeafterboth
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/>.
1616
17import {itEth, usingEthPlaygrounds, expect} from './util';17import {itEth, usingEthPlaygrounds, expect} from './util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {COLLECTION_HELPER, Pallets} from '../util';19import {COLLECTION_HELPER, Pallets} from '../util/index.js';
2020
21describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {21describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
2323
24 before(async function() {24 before(async function() {
25 await usingEthPlaygrounds(async (helper, privateKey) => {25 await usingEthPlaygrounds(async (_, privateKey) => {
26 donor = await privateKey({url: import.meta.url});26 donor = await privateKey({url: import.meta.url});
27 });27 });
28 });28 });
modifiedjs-packages/tests/src/eth/collectionLimits.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {Pallets} from '../util';2import {Pallets} from '../util/index.js';
3import {expect, itEth, usingEthPlaygrounds} from './util';3import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
4import {CollectionLimitField, CreateCollectionData} from './util/playgrounds/types';4import {CollectionLimitField, CreateCollectionData} from './util/playgrounds/types.js';
55
66
7describe('Can set collection limits', () => {7describe('Can set collection limits', () => {
modifiedjs-packages/tests/src/eth/collectionProperties.test.tsdiffbeforeafterboth
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/>.
1616
17import {itEth, usingEthPlaygrounds, expect} from './util';17import {itEth, usingEthPlaygrounds, expect} from './util/index.js';
18import {Pallets} from '../util';18import {Pallets} from '../util/index.js';
19import {IProperty, ITokenPropertyPermission} from '../util/playgrounds/types';19import type {IProperty, ITokenPropertyPermission} from '@unique/playgrounds/src/types.js';
20import {IKeyringPair} from '@polkadot/types/types';20import type {IKeyringPair} from '@polkadot/types/types';
2121
22describe('EVM collection properties', () => {22describe('EVM collection properties', () => {
23 let donor: IKeyringPair;23 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../util/index';18import {Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../util/index.js';
19import {itEth, expect} from './util';19import {itEth, expect} from './util/index.js';
20import {CollectionLimitField, TokenPermissionField} from './util/playgrounds/types';20import {CollectionLimitField, TokenPermissionField} from './util/playgrounds/types.js';
2121
22describe('evm nft collection sponsoring', () => {22describe('evm nft collection sponsoring', () => {
23 let donor: IKeyringPair;23 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {EthUniqueHelper} from './util/playgrounds/unique.dev';18import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
19import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from './util';19import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from './util/index.js';
20import {usingPlaygrounds} from '../util';20import {usingPlaygrounds} from '../util/index.js';
21import {CompiledContract} from './util/playgrounds/types';21import type {CompiledContract} from './util/playgrounds/types.js';
2222
23describe('Sponsoring EVM contracts', () => {23describe('Sponsoring EVM contracts', () => {
24 let donor: IKeyringPair;24 let donor: IKeyringPair;
433 callerBalanceBefore = callerBalanceAfter;433 callerBalanceBefore = callerBalanceAfter;
434 };434 };
435435
436 const gasPrice = BigInt(await helper.eth.getGasPrice());436 const gasPrice = BigInt((await helper.eth.getGasPrice())!);
437 await flip(gasPrice);437 await flip(gasPrice);
438 await flip(gasPrice * 2n);438 await flip(gasPrice * 2n);
439 await flip(gasPrice * 21n / 10n);439 await flip(gasPrice * 21n / 10n);
modifiedjs-packages/tests/src/eth/createCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {evmToAddress} from '@polkadot/util-crypto';18import {evmToAddress} from '@polkadot/util-crypto';
19import {Pallets, requirePalletsOrSkip} from '../util';19import {Pallets, requirePalletsOrSkip} from '../util/index.js';
20import {expect, itEth, usingEthPlaygrounds} from './util';20import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
21import {CREATE_COLLECTION_DATA_DEFAULTS, CollectionLimitField, CollectionMode, CreateCollectionData, TokenPermissionField, emptyAddress} from './util/playgrounds/types';21import {CREATE_COLLECTION_DATA_DEFAULTS, CollectionLimitField, CollectionMode, CreateCollectionData, TokenPermissionField, emptyAddress} from './util/playgrounds/types.js';
22import {CollectionFlag} from '@unique/playgrounds/src/types.js';
22import {CollectionFlag, IEthCrossAccountId, TCollectionMode} from '../util/playgrounds/types';23import type {IEthCrossAccountId, TCollectionMode} from '@unique/playgrounds/src/types.js';
2324
24const DECIMALS = 18;25const DECIMALS = 18;
25const CREATE_COLLECTION_DATA_DEFAULTS_ARRAY = [26const CREATE_COLLECTION_DATA_DEFAULTS_ARRAY = [
modifiedjs-packages/tests/src/eth/createFTCollection.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {Pallets, requirePalletsOrSkip} from '../util';18import {Pallets, requirePalletsOrSkip} from '../util/index.js';
19import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
2020
21const DECIMALS = 18;21const DECIMALS = 18;
2222
modifiedjs-packages/tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {evmToAddress} from '@polkadot/util-crypto';18import {evmToAddress} from '@polkadot/util-crypto';
19import {Pallets, requirePalletsOrSkip} from '../util';19import {Pallets, requirePalletsOrSkip} from '../util/index.js';
20import {expect, itEth, usingEthPlaygrounds} from './util';20import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
21import {CollectionLimitField} from './util/playgrounds/types';21import {CollectionLimitField} from './util/playgrounds/types.js';
2222
23const DECIMALS = 18;23const DECIMALS = 18;
2424
modifiedjs-packages/tests/src/eth/createNFTCollection.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itEth, usingEthPlaygrounds} from './util';18import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
1919
2020
21describe('Create NFT collection from EVM', () => {21describe('Create NFT collection from EVM', () => {
modifiedjs-packages/tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {evmToAddress} from '@polkadot/util-crypto';17import {evmToAddress} from '@polkadot/util-crypto';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
20import {CollectionLimitField} from './util/playgrounds/types';20import {CollectionLimitField} from './util/playgrounds/types.js';
21import {COLLECTION_HELPER} from '../util';
2221
2322
24describe('Create NFT collection from EVM', () => {23describe('Create NFT collection from EVM', () => {
modifiedjs-packages/tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {evmToAddress} from '@polkadot/util-crypto';17import {evmToAddress} from '@polkadot/util-crypto';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {Pallets, requirePalletsOrSkip} from '../util';19import {Pallets, requirePalletsOrSkip} from '../util/index.js';
20import {expect, itEth, usingEthPlaygrounds} from './util';20import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
21import {CollectionLimitField} from './util/playgrounds/types';21import {CollectionLimitField} from './util/playgrounds/types.js';
2222
2323
24describe('Create RFT collection from EVM', () => {24describe('Create RFT collection from EVM', () => {
modifiedjs-packages/tests/src/eth/crossTransfer.test.tsdiffbeforeafterboth
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/>.
1616
17import {itEth, usingEthPlaygrounds} from './util';17import {itEth, usingEthPlaygrounds} from './util/index.js';
18import {CrossAccountId} from '../util/playgrounds/unique';18import {CrossAccountId} from '@unique/playgrounds/src/unique.js';
19import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
2020
21describe('Token transfer between substrate address and EVM address. Fungible', () => {21describe('Token transfer between substrate address and EVM address. Fungible', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
32 });32 });
3333
34 itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {34 itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {
35 const bobCA = CrossAccountId.fromKeyring(bob);35 const bobCA = CrossAccountId.fromKeyring(bob).toICrossAccountId();
36 const charlieCA = CrossAccountId.fromKeyring(charlie);36 const charlieCA = CrossAccountId.fromKeyring(charlie).toICrossAccountId();
37 const charlieCAEth = CrossAccountId.fromKeyring(charlie).toEthereum().toICrossAccountId();
3738
38 const collection = await helper.ft.mintCollection(alice);39 const collection = await helper.ft.mintCollection(alice);
39 await collection.setLimits(alice, {ownerCanTransfer: true});40 await collection.setLimits(alice, {ownerCanTransfer: true});
4041
41 await collection.mint(alice, 200n);42 await collection.mint(alice, 200n);
42 await collection.transfer(alice, charlieCA.toEthereum(), 200n);43 await collection.transfer(alice, charlieCAEth, 200n);
43 await collection.transferFrom(alice, charlieCA.toEthereum(), charlieCA, 50n);44 await collection.transferFrom(alice, charlieCAEth, charlieCA, 50n);
44 await collection.transfer(charlie, bobCA, 50n);45 await collection.transfer(charlie, bobCA, 50n);
45 });46 });
4647
5657
57 await collection.mint(alice, 200n, {Ethereum: aliceProxy});58 await collection.mint(alice, 200n, {Ethereum: aliceProxy});
58 await contract.methods.transfer(bobProxy, 50).send({from: aliceProxy});59 await contract.methods.transfer(bobProxy, 50).send({from: aliceProxy});
59 await collection.transferFrom(alice, {Ethereum: bobProxy}, CrossAccountId.fromKeyring(bob), 50n);60 await collection.transferFrom(alice, {Ethereum: bobProxy}, CrossAccountId.fromKeyring(bob).toICrossAccountId(), 50n);
60 await collection.transfer(bob, CrossAccountId.fromKeyring(alice), 50n);61 await collection.transfer(bob, CrossAccountId.fromKeyring(alice).toICrossAccountId(), 50n);
61 });62 });
62});63});
6364
75 });76 });
7677
77 itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {78 itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => {
78 const charlieEth = CrossAccountId.fromKeyring(charlie, 'Ethereum');79 const charlieEth = CrossAccountId.fromKeyring(charlie, 'Ethereum').toICrossAccountId();
7980
80 const collection = await helper.nft.mintCollection(alice);81 const collection = await helper.nft.mintCollection(alice);
81 await collection.setLimits(alice, {ownerCanTransfer: true});82 await collection.setLimits(alice, {ownerCanTransfer: true});
82 const token = await collection.mintToken(alice);83 const token = await collection.mintToken(alice);
83 await token.transfer(alice, charlieEth);84 await token.transfer(alice, charlieEth);
84 await token.transferFrom(alice, charlieEth, CrossAccountId.fromKeyring(charlie));85 await token.transferFrom(alice, charlieEth, CrossAccountId.fromKeyring(charlie).toICrossAccountId());
85 await token.transfer(charlie, CrossAccountId.fromKeyring(bob));86 await token.transfer(charlie, CrossAccountId.fromKeyring(bob).toICrossAccountId());
86 });87 });
8788
88 itEth('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({helper}) => {89 itEth('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({helper}) => {
modifiedjs-packages/tests/src/eth/destroyCollection.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {Pallets} from '../util';18import {Pallets} from '../util/index.js';
19import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
20import {TCollectionMode} from '../util/playgrounds/types';20import type {TCollectionMode} from '@unique/playgrounds/src/types.js';
21import {CreateCollectionData} from './util/playgrounds/types';21import {CreateCollectionData} from './util/playgrounds/types.js';
2222
23describe('Destroy Collection from EVM', function() {23describe('Destroy Collection from EVM', function() {
24 let donor: IKeyringPair;24 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/ethFeesAreCorrect.test.tsdiffbeforeafterboth
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://witww.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://witww.gnu.org/licenses/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itEth, usingEthPlaygrounds, expect} from './util';18import {itEth, usingEthPlaygrounds, expect} from './util/index.js';
1919
20describe('Eth fees are correct', () => {20describe('Eth fees are correct', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
44 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);44 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
4545
46 const balanceBeforeWeb3Transfer = await helper.balance.getEthereum(owner);46 const balanceBeforeWeb3Transfer = await helper.balance.getEthereum(owner);
47 await contract.methods.transfer(receiver, tokenA).send({from: owner, maxFeePerGas: (await helper.eth.getGasPrice()).toString()});47 await contract.methods.transfer(receiver, tokenA).send({from: owner, maxFeePerGas: ((await helper.eth.getGasPrice())!).toString()});
48 const balanceAfterWeb3Transfer = await helper.balance.getEthereum(owner);48 const balanceAfterWeb3Transfer = await helper.balance.getEthereum(owner);
49 const web3Diff = balanceBeforeWeb3Transfer - balanceAfterWeb3Transfer;49 const web3Diff = balanceBeforeWeb3Transfer - balanceAfterWeb3Transfer;
5050
modifiedjs-packages/tests/src/eth/events.test.tsdiffbeforeafterboth
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/>.
1616
17import {expect} from 'chai';17import {expect} from 'chai';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {EthUniqueHelper, itEth, usingEthPlaygrounds} from './util';19import {itEth, usingEthPlaygrounds} from './util/index.js';
20import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
20import {IEvent, TCollectionMode} from '../util/playgrounds/types';21import type {IEvent, TCollectionMode} from '@unique/playgrounds/src/types.js';
21import {Pallets, requirePalletsOrSkip} from '../util';22import {Pallets, requirePalletsOrSkip} from '../util/index.js';
22import {CollectionLimitField, TokenPermissionField, NormalizedEvent, CreateCollectionData} from './util/playgrounds/types';23import {CollectionLimitField, TokenPermissionField, CreateCollectionData} from './util/playgrounds/types.js';
24import type {NormalizedEvent} from './util/playgrounds/types.js';
2325
24let donor: IKeyringPair;26let donor: IKeyringPair;
2527
498 const mode: TCollectionMode = 'rft';500 const mode: TCollectionMode = 'rft';
499501
500 before(async function() {502 before(async function() {
501 await usingEthPlaygrounds(async (helper, privateKey) => {503 await usingEthPlaygrounds((helper) => {
502 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);504 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
503 const _donor = await privateKey({url: import.meta.url});505 return Promise.resolve();
504 });506 });
505 });507 });
506508
modifiedjs-packages/tests/src/eth/evmCoder.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itEth, expect, usingEthPlaygrounds} from './util';18import {itEth, expect, usingEthPlaygrounds} from './util/index.js';
1919
20const getContractSource = (collectionAddress: string, contractAddress: string): string => `20const getContractSource = (collectionAddress: string, contractAddress: string): string => `
21 // SPDX-License-Identifier: MIT21 // SPDX-License-Identifier: MIT
modifiedjs-packages/tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth
1717
18import {readFile} from 'fs/promises';18import {readFile} from 'fs/promises';
1919
20import {IKeyringPair} from '@polkadot/types/types';20import type {IKeyringPair} from '@polkadot/types/types';
21import {evmToAddress} from '@polkadot/util-crypto';21import {evmToAddress} from '@polkadot/util-crypto';
2222
23import {Contract} from 'web3-eth-contract';23import {Contract} from 'web3-eth-contract';
2424
25import {usingEthPlaygrounds, expect, itEth, EthUniqueHelper} from '../util';25import {usingEthPlaygrounds, expect, itEth} from '../util/index.js';
26import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js';
26import {CompiledContract} from '../util/playgrounds/types';27import type {CompiledContract} from '../util/playgrounds/types.js';
27import {requirePalletsOrSkip, Pallets, makeNames} from '../../util';28import {requirePalletsOrSkip, Pallets, makeNames} from '../../util/index.js';
2829
29const {dirname} = makeNames(import.meta.url);30const {dirname} = makeNames(import.meta.url);
3031
modifiedjs-packages/tests/src/eth/fungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {expect, itEth, usingEthPlaygrounds} from './util';17import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
1919
20describe('Fungible: Plain calls', () => {20describe('Fungible: Plain calls', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/getCode.test.tsdiffbeforeafterboth
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/>.
1616
17import {expect, itEth, usingEthPlaygrounds} from './util';17import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {COLLECTION_HELPER, CONTRACT_HELPER} from '../util';19import {COLLECTION_HELPER, CONTRACT_HELPER} from '../util/index.js';
2020
21describe('RPC eth_getCode', () => {21describe('RPC eth_getCode', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
2323
24 before(async function() {24 before(async function() {
25 await usingEthPlaygrounds(async (helper, privateKey) => {25 await usingEthPlaygrounds(async (_, privateKey) => {
26 donor = await privateKey({url: import.meta.url});26 donor = await privateKey({url: import.meta.url});
27 });27 });
28 });28 });
modifiedjs-packages/tests/src/eth/helpersSmoke.test.tsdiffbeforeafterboth
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/>.
1616
17import {expect, itEth, usingEthPlaygrounds} from './util';17import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
1919
20describe('Helpers sanity check', () => {20describe('Helpers sanity check', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/marketplace-v2/marketplace.test.tsdiffbeforeafterboth
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/>.
1616
17import Web3 from 'web3';
17import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
18import {readFile} from 'fs/promises';19import {readFile} from 'fs/promises';
19import {EthUniqueHelper, SponsoringMode, itEth, usingEthPlaygrounds} from '../util';20import {SponsoringMode, itEth, usingEthPlaygrounds} from '../util/index.js';
21import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js';
20import {makeNames} from '../../util';22import {makeNames} from '../../util/index.js';
21import {expect} from 'chai';23import {expect} from 'chai';
22import Web3 from 'web3';
2324
24const {dirname} = makeNames(import.meta.url);25const {dirname} = makeNames(import.meta.url);
2526
54 },55 },
55 {56 {
56 solPath: '@openzeppelin/contracts/utils/introspection/IERC165.sol',57 solPath: '@openzeppelin/contracts/utils/introspection/IERC165.sol',
57 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol`,58 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol`,
58 },59 },
59 {60 {
60 solPath: '@openzeppelin/contracts/access/Ownable.sol',61 solPath: '@openzeppelin/contracts/access/Ownable.sol',
61 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/access/Ownable.sol`,62 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/access/Ownable.sol`,
62 },63 },
63 {64 {
64 solPath: '@openzeppelin/contracts/utils/Context.sol',65 solPath: '@openzeppelin/contracts/utils/Context.sol',
65 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/utils/Context.sol`,66 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/utils/Context.sol`,
66 },67 },
67 {68 {
68 solPath: '@openzeppelin/contracts/security/ReentrancyGuard.sol',69 solPath: '@openzeppelin/contracts/security/ReentrancyGuard.sol',
69 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol`,70 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol`,
70 },71 },
71 {72 {
72 solPath: '@openzeppelin/contracts/utils/introspection/ERC165Checker.sol',73 solPath: '@openzeppelin/contracts/utils/introspection/ERC165Checker.sol',
73 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/utils/introspection/ERC165Checker.sol`,74 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/utils/introspection/ERC165Checker.sol`,
74 },75 },
75 {76 {
76 solPath: '@openzeppelin/contracts/token/ERC721/IERC721.sol',77 solPath: '@openzeppelin/contracts/token/ERC721/IERC721.sol',
77 fsPath: `${dirname}/../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol`,78 fsPath: `${dirname}/../../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol`,
78 },79 },
79 {80 {
80 solPath: '@unique-nft/solidity-interfaces/contracts/CollectionHelpers.sol',81 solPath: '@unique-nft/solidity-interfaces/contracts/CollectionHelpers.sol',
98 );99 );
99 }100 }
100101
101 function substrateAddressToHex(sub: Uint8Array| string, web3: Web3) {102 function substrateAddressToHex(sub: Uint8Array| string, web3: Web3.default) {
102 if(typeof sub === 'string')103 if(typeof sub === 'string')
103 return web3.utils.padLeft(web3.utils.toHex(web3.utils.toBN(sub)), 64);104 return web3.utils.padLeft(web3.utils.toHex(web3.utils.toBN(sub)), 64);
104 else if(sub instanceof Uint8Array)105 else if(sub instanceof Uint8Array)
105 return web3.utils.padLeft(web3.utils.bytesToHex(Array.from(sub)), 64);106 return web3.utils.padLeft(web3.utils.bytesToHex(Array.from(sub)), 64);
107 throw Error('Infallible');
106 }108 }
107109
108 itEth('Put + Buy [eth]', async ({helper}) => {110 itEth('Put + Buy [eth]', async ({helper}) => {
modifiedjs-packages/tests/src/eth/marketplace/marketplace.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {readFile} from 'fs/promises';18import {readFile} from 'fs/promises';
19import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from '../util';19import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from '../util/index.js';
20import {makeNames} from '../../util';20import {makeNames} from '../../util/index.js';
2121
22const {dirname} = makeNames(import.meta.url);22const {dirname} = makeNames(import.meta.url);
2323
modifiedjs-packages/tests/src/eth/migration.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {expect, itEth, usingEthPlaygrounds} from './util';17import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {Struct} from '@polkadot/types';19import {Struct} from '@polkadot/types';
2020
21import {IEvent} from '../util/playgrounds/types';21import type {IEvent} from '@unique/playgrounds/src/types.js';
22import type {InterfaceTypes} from '@polkadot/types/types/registry';
22import {ApiPromise} from '@polkadot/api';23import {ApiPromise} from '@polkadot/api';
2324
24const encodeEvent = (api: ApiPromise, pallet: string, palletEvents: string, event: string, fields: any) => {25const encodeEvent = (api: ApiPromise, pallet: string, palletEvents: string, event: string, fields: any) => {
32 data.push(...new Struct(api.registry, {data: metaEvent}, {data: fields}).toU8a());33 data.push(...new Struct(api.registry, {data: metaEvent}, {data: fields}).toU8a());
3334
34 const typeName = api.registry.lookup.names.find(n => n.endsWith('RuntimeEvent'))!;35 const typeName = api.registry.lookup.names.find(n => n.endsWith('RuntimeEvent'))!;
35 return api.registry.createType(typeName, new Uint8Array(data)).toHex();36 const obj = api.registry.createType(typeName, new Uint8Array(data)) as InterfaceTypes['RuntimeEvent'];
37 return obj.toHex();
36};38};
3739
38describe('EVM Migrations', () => {40describe('EVM Migrations', () => {
modifiedjs-packages/tests/src/eth/nativeFungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itEth, usingEthPlaygrounds} from './util';18import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
19import {UniqueHelper} from '../util/playgrounds/unique';19import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
2020
21describe('NativeFungible: ERC20 calls', () => {21describe('NativeFungible: ERC20 calls', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
2323
24 before(async function() {24 before(async function() {
25 await usingEthPlaygrounds(async (helper, privateKey) => {25 await usingEthPlaygrounds(async (_, privateKey) => {
26 donor = await privateKey({url: import.meta.url});26 donor = await privateKey({url: import.meta.url});
27 });27 });
28 });28 });
128 let donor: IKeyringPair;128 let donor: IKeyringPair;
129129
130 before(async function() {130 before(async function() {
131 await usingEthPlaygrounds(async (helper, privateKey) => {131 await usingEthPlaygrounds(async (_, privateKey) => {
132 donor = await privateKey({url: import.meta.url});132 donor = await privateKey({url: import.meta.url});
133 });133 });
134 });134 });
modifiedjs-packages/tests/src/eth/nativeRpc/estimateGas.test.tsdiffbeforeafterboth
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/>.
1616
17import {expect, itEth, usingEthPlaygrounds} from '../util';17import {expect, itEth, usingEthPlaygrounds} from '../util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
1919
2020
21describe('Ethereum native RPC calls', () => {21describe('Ethereum native RPC calls', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
23 const NATIVE_TOKEN_ADDRESS = '0x17c4e6453cc49aaaaeaca894e6d9683e00000000';23 const NATIVE_TOKEN_ADDRESS = '0x17c4e6453cc49aaaaeaca894e6d9683e00000000';
2424
25 before(async function() {25 before(async function() {
26 await usingEthPlaygrounds(async (helper, privateKey) => {26 await usingEthPlaygrounds(async (_, privateKey) => {
27 donor = await privateKey({url: import.meta.url});27 donor = await privateKey({url: import.meta.url});
28 });28 });
29 });29 });
modifiedjs-packages/tests/src/eth/nesting/nest.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {Contract} from 'web3-eth-contract';2import {Contract} from 'web3-eth-contract';
33
4import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util';4import {itEth, usingEthPlaygrounds, expect} from '../util/index.js';
5import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js';
56
6const createNestingCollection = async (7const createNestingCollection = async (
7 helper: EthUniqueHelper,8 helper: EthUniqueHelper,
modifiedjs-packages/tests/src/eth/nonFungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util';17import {itEth, usingEthPlaygrounds, expect} from './util/index.js';
18import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
18import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
19import {Contract} from 'web3-eth-contract';20import {Contract} from 'web3-eth-contract';
20import {ITokenPropertyPermission} from '../util/playgrounds/types';21import type {ITokenPropertyPermission} from '@unique/playgrounds/src/types.js';
21import {CREATE_COLLECTION_DATA_DEFAULTS, CollectionMode, CreateCollectionData, TokenPermissionField} from './util/playgrounds/types';22import {CREATE_COLLECTION_DATA_DEFAULTS, TokenPermissionField} from './util/playgrounds/types.js';
2223
23describe('Check ERC721 token URI for NFT', () => {24describe('Check ERC721 token URI for NFT', () => {
24 let donor: IKeyringPair;25 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/payable.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
1818
19import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util';19import {itEth, expect, usingEthPlaygrounds} from './util/index.js';
20import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
20import {makeNames} from '../util';21import {makeNames} from '../util/index.js';
2122
22const {dirname} = makeNames(import.meta.url);23const {dirname} = makeNames(import.meta.url);
2324
modifiedjs-packages/tests/src/eth/precompile.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
1818
19import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
2020
21describe('Precompiles', () => {21describe('Precompiles', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/proxy/fungibleProxy.test.tsdiffbeforeafterboth
1616
17import {expect} from 'chai';17import {expect} from 'chai';
18import {readFile} from 'fs/promises';18import {readFile} from 'fs/promises';
19import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
20import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util';20import {itEth, usingEthPlaygrounds} from '../util/index.js';
21import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js';
21import {makeNames} from '../../util';22import {makeNames} from '../../util/index.js';
2223
23const {dirname} = makeNames(import.meta.url);24const {dirname} = makeNames(import.meta.url);
2425
modifiedjs-packages/tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth
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/>.
1616
17import {readFile} from 'fs/promises';17import {readFile} from 'fs/promises';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from '../util';19import {itEth, usingEthPlaygrounds, expect} from '../util/index.js';
20import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js';
20import {makeNames} from '../../util';21import {makeNames} from '../../util/index.js';
2122
22const {dirname} = makeNames(import.meta.url);23const {dirname} = makeNames(import.meta.url);
2324
modifiedjs-packages/tests/src/eth/proxyContract.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
1818
19import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util';19import {itEth, expect, usingEthPlaygrounds} from './util/index.js';
20import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
2021
21describe('EVM payable contracts', () => {22describe('EVM payable contracts', () => {
22 let donor: IKeyringPair;23 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/reFungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {Pallets, requirePalletsOrSkip} from '../util';17import {Pallets, requirePalletsOrSkip} from '../util/index.js';
18import {expect, itEth, usingEthPlaygrounds} from './util';18import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
19import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
20import {ITokenPropertyPermission} from '../util/playgrounds/types';20import type {ITokenPropertyPermission} from '@unique/playgrounds/src/types.js';
21import {CREATE_COLLECTION_DATA_DEFAULTS, TokenPermissionField} from './util/playgrounds/types';21import {CREATE_COLLECTION_DATA_DEFAULTS, TokenPermissionField} from './util/playgrounds/types.js';
2222
23describe('Refungible: Plain calls', () => {23describe('Refungible: Plain calls', () => {
24 let donor: IKeyringPair;24 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
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/>.
1616
17import {Pallets, requirePalletsOrSkip} from '../util';17import {Pallets, requirePalletsOrSkip} from '../util/index.js';
18import {EthUniqueHelper, expect, itEth, usingEthPlaygrounds} from './util';18import {expect, itEth, usingEthPlaygrounds} from './util/index.js';
19import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
19import {IKeyringPair} from '@polkadot/types/types';20import type {IKeyringPair} from '@polkadot/types/types';
20import {Contract} from 'web3-eth-contract';21import {Contract} from 'web3-eth-contract';
2122
22// FIXME: Need erc721 for ReFubgible.23// FIXME: Need erc721 for ReFubgible.
modifiedjs-packages/tests/src/eth/scheduling.test.tsdiffbeforeafterboth
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/>.
1616
17import {expect} from 'chai';17import {expect} from 'chai';
18import {EthUniqueHelper, itSchedEth} from './util';18import {itSchedEth} from './util/index.js';
19import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';
19import {Pallets, usingPlaygrounds} from '../util';20import {Pallets, usingPlaygrounds} from '../util/index.js';
2021
21describe('Scheduing EVM smart contracts', () => {22describe('Scheduing EVM smart contracts', () => {
2223
23 before(async () => {24 before(async () => {
24 await usingPlaygrounds(async (helper) => {25 await usingPlaygrounds(async (helper) => {
25 await helper.testUtils.enable();26 await helper.testUtils.enable(Pallets.TestUtils);
26 });27 });
27 });28 });
2829
modifiedjs-packages/tests/src/eth/sponsoring.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itEth, expect, SponsoringMode} from './util';18import {itEth, expect, SponsoringMode} from './util/index.js';
19import {usingPlaygrounds} from '../util/index';19import {usingPlaygrounds} from '../util/index.js';
2020
21describe('EVM sponsoring', () => {21describe('EVM sponsoring', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {Contract} from 'web3-eth-contract';18import {Contract} from 'web3-eth-contract';
19import {itEth, usingEthPlaygrounds, expect} from './util';19import {itEth, usingEthPlaygrounds, expect} from './util/index.js';
20import {ITokenPropertyPermission} from '../util/playgrounds/types';20import type {ITokenPropertyPermission} from '@unique/playgrounds/src/types.js';
21import {Pallets} from '../util';21import {Pallets} from '../util/index.js';
22import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '../util/playgrounds/unique';22import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '@unique/playgrounds/src/unique.js';
23import {CreateCollectionData, TokenPermissionField} from './util/playgrounds/types';23import {CreateCollectionData, TokenPermissionField} from './util/playgrounds/types.js';
2424
25describe('EVM token properties', () => {25describe('EVM token properties', () => {
26 let donor: IKeyringPair;26 let donor: IKeyringPair;
modifiedjs-packages/tests/src/eth/tokens/callMethodsERC20.test.tsdiffbeforeafterboth
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/>.
1616
17import {Pallets, requirePalletsOrSkip} from '../../util';17import {Pallets, requirePalletsOrSkip} from '../../util/index.js';
18import {expect, itEth, usingEthPlaygrounds} from '../util';18import {expect, itEth, usingEthPlaygrounds} from '../util/index.js';
19import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
20import {CreateCollectionData} from '../util/playgrounds/types';20import {CreateCollectionData} from '../util/playgrounds/types.js';
2121
22[22[
23 {mode: 'ft' as const, requiredPallets: []},23 {mode: 'ft' as const, requiredPallets: []},
modifiedjs-packages/tests/src/eth/tokens/callMethodsERC721.test.tsdiffbeforeafterboth
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/>.
1616
17import {Pallets} from '../../util';17import {Pallets} from '../../util/index.js';
18import {expect, itEth, usingEthPlaygrounds} from '../util';18import {expect, itEth, usingEthPlaygrounds} from '../util/index.js';
19import {IKeyringPair} from '@polkadot/types/types';19import type {IKeyringPair} from '@polkadot/types/types';
20import {CreateCollectionData} from '../util/playgrounds/types';20import {CreateCollectionData} from '../util/playgrounds/types.js';
2121
2222
23describe('ERC-721 call methods', () => {23describe('ERC-721 call methods', () => {
24 let donor: IKeyringPair;24 let donor: IKeyringPair;
2525
26 before(async function() {26 before(async function() {
27 await usingEthPlaygrounds(async (helper, privateKey) => {27 await usingEthPlaygrounds(async (_, privateKey) => {
28 donor = await privateKey({url: import.meta.url});28 donor = await privateKey({url: import.meta.url});
29 });29 });
30 });30 });
modifiedjs-packages/tests/src/eth/tokens/minting.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {Pallets} from '../../util';18import {Pallets} from '../../util/index.js';
19import {expect, itEth, usingEthPlaygrounds} from '../util';19import {expect, itEth, usingEthPlaygrounds} from '../util/index.js';
20import {CreateCollectionData} from '../util/playgrounds/types';20import {CreateCollectionData} from '../util/playgrounds/types.js';
2121
2222
23describe('Minting tokens', () => {23describe('Minting tokens', () => {
modifiedjs-packages/tests/src/eth/transferValue.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itEth, usingEthPlaygrounds} from './util';18import {itEth, usingEthPlaygrounds} from './util/index.js';
19import {expect} from 'chai';19import {expect} from 'chai';
2020
21describe('Send value to contract', () => {21describe('Send value to contract', () => {
modifiedjs-packages/tests/src/eth/util/index.tsdiffbeforeafterboth
2// SPDX-License-Identifier: Apache-2.02// SPDX-License-Identifier: Apache-2.0
33
4import * as path from 'path';4import * as path from 'path';
5import {IKeyringPair} from '@polkadot/types/types';5import type {IKeyringPair} from '@polkadot/types/types';
66
7import config from '../../config';7import config from '../../config.js';
88
9import {EthUniqueHelper} from './playgrounds/unique.dev';9import {EthUniqueHelper} from './playgrounds/unique.dev.js';
10import {SilentLogger, SilentConsole} from '../../util/playgrounds/unique.dev';10import {SilentLogger, SilentConsole} from '@unique/playgrounds/src/unique.dev.js';
11import {SchedKind, makeNames} from '../../util';11import {makeNames} from '../../util/index.js';
12
13export {EthUniqueHelper} from './playgrounds/unique.dev';12import type {SchedKind} from '../../util/index.js';
1413
15import chai from 'chai';14import chai from 'chai';
16import chaiAsPromised from 'chai-as-promised';15import chaiAsPromised from 'chai-as-promised';
17import chaiLike from 'chai-like';16import chaiLike from 'chai-like';
18import {getTestSeed, MINIMUM_DONOR_FUND, requirePalletsOrSkip} from '../../util';17import {getTestSeed, MINIMUM_DONOR_FUND, requirePalletsOrSkip} from '../../util/index.js';
1918
20chai.use(chaiAsPromised);19chai.use(chaiAsPromised);
21chai.use(chaiLike);20chai.use(chaiLike);
modifiedjs-packages/tests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth
1import {CollectionFlag, TCollectionMode} from '../../../util/playgrounds/types';1import {CollectionFlag} from '@unique/playgrounds/src/types.js';
2import type {TCollectionMode} from '@unique/playgrounds/src/types.js';
23
3export interface ContractImports {4export interface ContractImports {
4 solPath: string;5 solPath: string;
modifiedjs-packages/tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
14import solc from 'solc';14import solc from 'solc';
1515
16import {evmToAddress} from '@polkadot/util-crypto';16import {evmToAddress} from '@polkadot/util-crypto';
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
1818
19import {ArrangeGroup, DevUniqueHelper} from '../../../util/playgrounds/unique.dev';19import {ArrangeGroup, DevUniqueHelper} from '@unique/playgrounds/src/unique.dev.js';
2020
21import {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty, CollectionMode, CreateCollectionData} from './types';21import type {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty} from './types.js';
22import {CollectionMode, CreateCollectionData} from './types.js';
2223
23// Native contracts ABI24// Native contracts ABI
24import collectionHelpersAbi from '../../abi/collectionHelpers.json' assert {type: 'json'};25import collectionHelpersAbi from '../../abi/collectionHelpers.json' assert {type: 'json'};
32import refungibleTokenAbi from '../../abi/reFungibleToken.json' assert {type: 'json'};33import refungibleTokenAbi from '../../abi/reFungibleToken.json' assert {type: 'json'};
33import refungibleTokenDeprecatedAbi from '../../abi/reFungibleTokenDeprecated.json' assert {type: 'json'};34import refungibleTokenDeprecatedAbi from '../../abi/reFungibleTokenDeprecated.json' assert {type: 'json'};
34import contractHelpersAbi from '../../abi/contractHelpers.json' assert {type: 'json'};35import contractHelpersAbi from '../../abi/contractHelpers.json' assert {type: 'json'};
35import {ICrossAccountId, TEthereumAccount} from '../../../util/playgrounds/types';36import type {ICrossAccountId, TEthereumAccount, TCollectionMode} from '@unique/playgrounds/src/types.js';
36import {TCollectionMode} from '../../../util/playgrounds/types';
3737
38class EthGroupBase {38class EthGroupBase {
39 helper: EthUniqueHelper;39 helper: EthUniqueHelper;
192192
193 let flags = 0;193 let flags = 0;
194 // convert CollectionFlags to number and join them in one number194 // convert CollectionFlags to number and join them in one number
195 if(!data.flags || typeof data.flags == 'number') {195 if(!data.flags) {
196 flags = 0;
197 } else if(typeof data.flags == 'number') {
196 flags = data.flags ?? 0;198 flags = data.flags;
197 } else {199 } else {
198 for(let i = 0; i < data.flags.length; i++){200 for(let i = 0; i < data.flags.length; i++){
199 const flag = data.flags[i];201 const flag = data.flags[i];
345 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'rft')).send();347 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'rft')).send();
346 }348 }
347349
348 createFungibleCollection(signer: string, name: string, decimals: number, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {350 createFungibleCollection(signer: string, name: string, _decimals: number, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
349 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'ft')).send();351 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'ft')).send();
350 }352 }
351353
459461
460 fromCollectionId(collectionId: number): string {462 fromCollectionId(collectionId: number): string {
461 if(collectionId >= 0xffffffff || collectionId < 0) throw new Error('collectionId overflow');463 if(collectionId >= 0xffffffff || collectionId < 0) throw new Error('collectionId overflow');
462 return Web3.utils.toChecksumAddress(`0x17c4e6453cc49aaaaeaca894e6d9683e${collectionId.toString(16).padStart(8, '0')}`);464 return (Web3 as any).utils.toChecksumAddress(`0x17c4e6453cc49aaaaeaca894e6d9683e${collectionId.toString(16).padStart(8, '0')}`);
463 }465 }
464466
465 extractTokenId(address: string): { collectionId: number, tokenId: number } {467 extractTokenId(address: string): { collectionId: number, tokenId: number } {
545}547}
546548
547class EthArrangeGroup extends ArrangeGroup {549class EthArrangeGroup extends ArrangeGroup {
548 helper: EthUniqueHelper;550 declare helper: EthUniqueHelper;
549551
550 constructor(helper: EthUniqueHelper) {552 constructor(helper: EthUniqueHelper) {
551 super(helper);553 super(helper);
558 }560 }
559}561}
560export class EthUniqueHelper extends DevUniqueHelper {562export class EthUniqueHelper extends DevUniqueHelper {
561 web3: Web3 | null = null;563 web3: Web3.default | null = null;
562 web3Provider: WebsocketProvider | null = null;564 web3Provider: WebsocketProvider | null = null;
563565
564 eth: EthGroup;566 eth: EthGroup;
567 ethNativeContract: NativeContractGroup;569 ethNativeContract: NativeContractGroup;
568 ethContract: ContractGroup;570 ethContract: ContractGroup;
569 ethProperty: EthPropertyGroup;571 ethProperty: EthPropertyGroup;
570 arrange: EthArrangeGroup;572 declare arrange: EthArrangeGroup;
571 constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: { [key: string]: any } = {}) {573 constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: { [key: string]: any } = {}) {
572 options.helperBase = options.helperBase ?? EthUniqueHelper;574 options.helperBase = options.helperBase ?? EthUniqueHelper;
573575
582 super.arrange = this.arrange;584 super.arrange = this.arrange;
583 }585 }
584586
585 getWeb3(): Web3 {587 getWeb3(): Web3.default {
586 if(this.web3 === null) throw Error('Web3 not connected');588 if(this.web3 === null) throw Error('Web3 not connected');
587 return this.web3;589 return this.web3;
588 }590 }
589591
590 connectWeb3(wsEndpoint: string) {592 connectWeb3(wsEndpoint: string) {
591 if(this.web3 !== null) return;593 if(this.web3 !== null) return;
592 this.web3Provider = new Web3.providers.WebsocketProvider(wsEndpoint);594 this.web3Provider = new (Web3 as any).providers.WebsocketProvider(wsEndpoint);
593 this.web3 = new Web3(this.web3Provider);595 this.web3 = new (Web3 as any)(this.web3Provider);
594 }596 }
595597
596 async disconnect() {598 override async disconnect() {
597 if(this.web3 === null) return;599 if(this.web3 === null) return;
598 this.web3Provider?.connection.close();600 this.web3Provider?.connection.close();
599601
600 await super.disconnect();602 await super.disconnect();
601 }603 }
602604
603 clearApi() {605 override clearApi() {
604 super.clearApi();606 super.clearApi();
605 this.web3 = null;607 this.web3 = null;
606 }608 }
607609
608 clone(helperCls: EthUniqueHelperConstructor, options?: { [key: string]: any; }): EthUniqueHelper {610 override clone(helperCls: EthUniqueHelperConstructor, options?: { [key: string]: any; }): EthUniqueHelper {
609 const newHelper = super.clone(helperCls, options) as EthUniqueHelper;611 const newHelper = super.clone(helperCls, options) as EthUniqueHelper;
610 newHelper.web3 = this.web3;612 newHelper.web3 = this.web3;
611 newHelper.web3Provider = this.web3Provider;613 newHelper.web3Provider = this.web3Provider;
modifiedjs-packages/tests/src/fungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect, requirePalletsOrSkip, Pallets} from './util';18import {itSub, usingPlaygrounds, expect, requirePalletsOrSkip, Pallets} from './util/index.js';
1919
20const U128_MAX = (1n << 128n) - 1n;20const U128_MAX = (1n << 128n) - 1n;
2121
modifiedjs-packages/tests/src/getPropertiesRpc.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
19import {UniqueHelper, UniqueNFTCollection} from './util/playgrounds/unique';19import {UniqueHelper, UniqueNFTCollection} from '@unique/playgrounds/src/unique.js';
2020
21const collectionProps = [21const collectionProps = [
22 {key: 'col-0', value: 'col-0-value'},22 {key: 'col-0', value: 'col-0-value'},
modifiedjs-packages/tests/src/governance/council.test.tsdiffbeforeafterboth
11
2import {IKeyringPair} from '@polkadot/types/types';2import type {IKeyringPair} from '@polkadot/types/types';
3import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util';3import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util/index.js';
4import {Event} from '../util/playgrounds/unique.dev';4import {Event} from '@unique/playgrounds/src/unique.dev.js';
5import {ICounselors, initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyEnactmentPeriod, councilMotionDuration, democracyFastTrackVotingPeriod, fellowshipRankLimit, clearCouncil, clearTechComm, initTechComm, clearFellowship, dummyProposal, dummyProposalCall, initFellowship, defaultEnactmentMoment, fellowshipPropositionOrigin} from './util';5import {initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyEnactmentPeriod, councilMotionDuration, democracyFastTrackVotingPeriod, fellowshipRankLimit, clearCouncil, clearTechComm, initTechComm, clearFellowship, dummyProposal, dummyProposalCall, initFellowship, defaultEnactmentMoment, fellowshipPropositionOrigin} from './util.js';
6import type {ICounselors} from './util.js';
67
7describeGov('Governance: Council tests', () => {8describeGov('Governance: Council tests', () => {
8 let donor: IKeyringPair;9 let donor: IKeyringPair;
modifiedjs-packages/tests/src/governance/democracy.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util';2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util/index.js';
3import {clearFellowship, democracyLaunchPeriod, democracyTrackMinRank, dummyProposalCall, fellowshipConfirmPeriod, fellowshipMinEnactPeriod, fellowshipPreparePeriod, fellowshipPropositionOrigin, initFellowship, voteUnanimouslyInFellowship} from './util';3import {clearFellowship, democracyLaunchPeriod, democracyTrackMinRank, dummyProposalCall, fellowshipConfirmPeriod, fellowshipMinEnactPeriod, fellowshipPreparePeriod, fellowshipPropositionOrigin, initFellowship, voteUnanimouslyInFellowship} from './util.js';
4import {Event} from '../util/playgrounds/unique.dev';4import {Event} from '@unique/playgrounds/src/unique.dev.js';
55
6describeGov('Governance: Democracy tests', () => {6describeGov('Governance: Democracy tests', () => {
7 let regularUser: IKeyringPair;7 let regularUser: IKeyringPair;
modifiedjs-packages/tests/src/governance/fellowship.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util';2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util/index.js';
3import {DevUniqueHelper, Event} from '../util/playgrounds/unique.dev';3import {DevUniqueHelper, Event} from '@unique/playgrounds/src/unique.dev.js';
4import {ICounselors, initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyFastTrackVotingPeriod, fellowshipRankLimit, clearCouncil, clearTechComm, ITechComms, clearFellowship, defaultEnactmentMoment, dummyProposal, dummyProposalCall, fellowshipPropositionOrigin, initFellowship, initTechComm, voteUnanimouslyInFellowship, democracyTrackMinRank, fellowshipPreparePeriod, fellowshipConfirmPeriod, fellowshipMinEnactPeriod, democracyTrackId, hardResetFellowshipReferenda, hardResetDemocracy, hardResetGovScheduler} from './util';4import {initCouncil, democracyLaunchPeriod, democracyVotingPeriod, democracyFastTrackVotingPeriod, fellowshipRankLimit, clearCouncil, clearTechComm, clearFellowship, defaultEnactmentMoment, dummyProposal, dummyProposalCall, fellowshipPropositionOrigin, initFellowship, initTechComm, voteUnanimouslyInFellowship, democracyTrackMinRank, fellowshipPreparePeriod, fellowshipConfirmPeriod, fellowshipMinEnactPeriod, democracyTrackId, hardResetFellowshipReferenda, hardResetDemocracy, hardResetGovScheduler} from './util.js';
5import type {ICounselors, ITechComms} from './util.js';
56
6describeGov('Governance: Fellowship tests', () => {7describeGov('Governance: Fellowship tests', () => {
7 let members: IKeyringPair[][];8 let members: IKeyringPair[][];
modifiedjs-packages/tests/src/governance/init.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util';2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util/index.js';
3import {Event} from '../util/playgrounds/unique.dev';3import {Event} from '@unique/playgrounds/src/unique.dev.js';
4import {ICounselors, democracyLaunchPeriod, democracyVotingPeriod, ITechComms, democracyEnactmentPeriod, clearCouncil, clearTechComm, clearFellowship} from './util';4import {democracyLaunchPeriod, democracyVotingPeriod, democracyEnactmentPeriod, clearCouncil, clearTechComm, clearFellowship} from './util.js';
5import type {ICounselors, ITechComms} from './util.js';
56
6describeGov('Governance: Initialization', () => {7describeGov('Governance: Initialization', () => {
7 let donor: IKeyringPair;8 let donor: IKeyringPair;
modifiedjs-packages/tests/src/governance/technicalCommittee.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util';2import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '../util/index.js';
3import {Event} from '../util/playgrounds/unique.dev';3import {Event} from '@unique/playgrounds/src/unique.dev.js';
4import {initCouncil, democracyLaunchPeriod, democracyFastTrackVotingPeriod, clearCouncil, clearTechComm, ITechComms, clearFellowship, defaultEnactmentMoment, dummyProposal, dummyProposalCall, fellowshipPropositionOrigin, initFellowship, initTechComm, hardResetFellowshipReferenda, hardResetDemocracy, hardResetGovScheduler} from './util';4import {initCouncil, democracyLaunchPeriod, democracyFastTrackVotingPeriod, clearCouncil, clearTechComm, clearFellowship, defaultEnactmentMoment, dummyProposal, dummyProposalCall, fellowshipPropositionOrigin, initFellowship, initTechComm, hardResetFellowshipReferenda, hardResetDemocracy, hardResetGovScheduler} from './util.js';
5import type {ITechComms} from './util.js';
56
6describeGov('Governance: Technical Committee tests', () => {7describeGov('Governance: Technical Committee tests', () => {
7 let sudoer: IKeyringPair;8 let sudoer: IKeyringPair;
190 });191 });
191192
192193
193 itSub.skip('[Negative] TechComm cannot promote/demote Fellowship member', async ({helper}) => {194 itSub.skip('[Negative] TechComm cannot promote/demote Fellowship member', async () => {
194195
195 });196 });
196197
197 itSub.skip('[Negative] TechComm member cannot promote/demote Fellowship member', async ({helper}) => {198 itSub.skip('[Negative] TechComm member cannot promote/demote Fellowship member', async () => {
198199
199 });200 });
200201
338 )).to.be.rejectedWith('BadOrigin');339 )).to.be.rejectedWith('BadOrigin');
339 });340 });
340341
341 itSub.skip('[Negative] TechComm member cannot veto external Democracy proposals until the cool-off period pass', async ({helper}) => {342 itSub.skip('[Negative] TechComm member cannot veto external Democracy proposals until the cool-off period pass', async () => {
342343
343 });344 });
344345
modifiedjs-packages/tests/src/governance/util.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {xxhashAsHex} from '@polkadot/util-crypto';2import {xxhashAsHex} from '@polkadot/util-crypto';
3import type {u32} from '@polkadot/types-codec';
3import {usingPlaygrounds, expect} from '../util';4import {usingPlaygrounds, expect} from '../util/index.js';
4import {UniqueHelper} from '../util/playgrounds/unique';5import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
5import {DevUniqueHelper} from '../util/playgrounds/unique.dev';6import {DevUniqueHelper} from '@unique/playgrounds/src/unique.dev.js';
67
7export const democracyLaunchPeriod = 35;8export const democracyLaunchPeriod = 35;
8export const democracyVotingPeriod = 35;9export const democracyVotingPeriod = 35;
173174
174export async function clearFellowshipReferenda(sudoer: IKeyringPair) {175export async function clearFellowshipReferenda(sudoer: IKeyringPair) {
175 await usingPlaygrounds(async (helper) => {176 await usingPlaygrounds(async (helper) => {
176 const proposalsCount = (await helper.getApi().query.fellowshipReferenda.referendumCount());177 const proposalsCount = (await helper.getApi().query.fellowshipReferenda.referendumCount()) as u32;
177 for(let i = 0; i < proposalsCount.toNumber(); i++) {178 for(let i = 0; i < proposalsCount.toNumber(); i++) {
178 await helper.getSudo().fellowship.referenda.cancel(sudoer, i);179 await helper.getSudo().fellowship.referenda.cancel(sudoer, i);
179 }180 }
modifiedjs-packages/tests/src/inflation.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from './util';18import {expect, itSub, usingPlaygrounds} from './util/index.js';
1919
20// todo:playgrounds requires sudo, look into on the later stage20// todo:playgrounds requires sudo, look into on the later stage
21describe('integration test: Inflation', () => {21describe('integration test: Inflation', () => {
modifiedjs-packages/tests/src/limits.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util';18import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/index.js';
1919
20describe('Number of tokens per address (NFT)', () => {20describe('Number of tokens per address (NFT)', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedjs-packages/tests/src/maintenance.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {ApiPromise} from '@polkadot/api';18import {ApiPromise} from '@polkadot/api';
19import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util';19import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/index.js';
20import {itEth} from './eth/util';20import {itEth} from './eth/util/index.js';
21import {main as correctState} from './migrations/correctStateAfterMaintenance';21import {main as correctState} from './migrations/correctStateAfterMaintenance.js';
22import type {PalletBalancesIdAmount} from '@polkadot/types/lookup';
23import type {Vec} from '@polkadot/types-codec';
2224
23async function maintenanceEnabled(api: ApiPromise): Promise<boolean> {25async function maintenanceEnabled(api: ApiPromise): Promise<boolean> {
24 return (await api.query.maintenance.enabled()).toJSON() as boolean;26 return (await api.query.maintenance.enabled()).toJSON() as boolean;
319321
320 expect((await api.query.appPromotion.pendingUnstake(1)).toJSON()).to.be.deep.equal([[superuser.address, '0x00000000000000056bc75e2d63100000']]);322 expect((await api.query.appPromotion.pendingUnstake(1)).toJSON()).to.be.deep.equal([[superuser.address, '0x00000000000000056bc75e2d63100000']]);
321 expect((await api.query.appPromotion.pendingUnstake(2)).toJSON()).to.be.deep.equal([[superuser.address, '0x00000000000000056bc75e2d63100000']]);323 expect((await api.query.appPromotion.pendingUnstake(2)).toJSON()).to.be.deep.equal([[superuser.address, '0x00000000000000056bc75e2d63100000']]);
322 expect((await api.query.balances.freezes(superuser.address))324 expect((await api.query.balances.freezes(superuser.address) as Vec<PalletBalancesIdAmount>)
323 .map(lock => ({id: lock.id.toUtf8(), amount: lock.amount.toBigInt()})))325 .map(lock => ({id: lock.id.toUtf8(), amount: lock.amount.toBigInt()})))
324 .to.be.deep.equal([{id: 'appstakeappstake', amount: 200000000000000000000n}]);326 .to.be.deep.equal([{id: 'appstakeappstake', amount: 200000000000000000000n}]);
325 await correctState();327 await correctState();
modifiedjs-packages/tests/src/migrations/942057-appPromotion/executeMigration.tsdiffbeforeafterboth
1import {migrateLockedToFreeze} from './lockedToFreeze';1import {migrateLockedToFreeze} from './lockedToFreeze.js';
22
33
4const WS_RPC = process.env.WS_RPC || 'wss://ws-opal.unique.network:443';4const WS_RPC = process.env.WS_RPC || 'wss://ws-opal.unique.network:443';
modifiedjs-packages/tests/src/migrations/942057-appPromotion/index.tsdiffbeforeafterboth
1import {Migration} from '../../util/frankensteinMigrate';1import type {Migration} from '../../util/frankensteinMigrate.js';
2import {collectData} from './collectData';2import {collectData} from './collectData.js';
3import {migrateLockedToFreeze} from './lockedToFreeze';3import {migrateLockedToFreeze} from './lockedToFreeze.js';
44
5export const migration: Migration = {5export const migration: Migration = {
6 async before() {6 async before() {
modifiedjs-packages/tests/src/migrations/942057-appPromotion/lockedToFreeze.tsdiffbeforeafterboth
1// import { usingApi, privateKey, onlySign } from "./../../load/lib";1// import { usingApi, privateKey, onlySign } from "./../../load/lib";
2import * as fs from 'fs';2import * as fs from 'fs';
3import {usingPlaygrounds} from '../../util';3import {usingPlaygrounds} from '../../util/index.js';
4import path, {dirname} from 'path';4import path, {dirname} from 'path';
5import {isInteger, parse} from 'lossless-json';5import {isInteger, parse} from 'lossless-json';
6import {fileURLToPath} from 'url';6import {fileURLToPath} from 'url';
7import config from '../../config';7import config from '../../config.js';
88
99
10const WS_ENDPOINT = config.substrateUrl;10const WS_ENDPOINT = config.substrateUrl;
modifiedjs-packages/tests/src/migrations/correctStateAfterMaintenance.tsdiffbeforeafterboth
1import config from '../config';1import config from '../config.js';
2import {usingPlaygrounds} from '../util';2import {usingPlaygrounds} from '../util/index.js';
33import type {u32} from '@polkadot/types-codec';
4
54
6const WS_ENDPOINT = config.substrateUrl;5const WS_ENDPOINT = config.substrateUrl;
20 const pendingBlocks = (19 const pendingBlocks = (
21 await api.query.appPromotion.pendingUnstake.entries()20 await api.query.appPromotion.pendingUnstake.entries()
22 ).map(([k, _v]) =>21 ).map(([k, _v]) =>
23 k.args[0]);22 (k.args[0] as u32).toNumber());
2423
25 const currentBlock = await api.query.system.number();24 const currentBlock = (await api.query.system.number() as u32).toNumber();
2625
27 const filteredBlocks = pendingBlocks.filter((b) => currentBlock.gt(b));26 const filteredBlocks = pendingBlocks.filter(b => currentBlock > b);
2827
29 if(filteredBlocks.length != 0) {28 if(filteredBlocks.length != 0) {
30 console.log(`During maintenance mode, ${filteredBlocks.length} block(s) were not processed. Number(s): ${filteredBlocks}`);29 console.log(`During maintenance mode, ${filteredBlocks.length} block(s) were not processed. Number(s): ${filteredBlocks}`);
4544
46 await Promise.allSettled(promises.map((p) => p()));45 await Promise.allSettled(promises.map((p) => p()));
4746
48 const failedBlocks: bigint[] = [];47 const failedBlocks: number[] = [];
49 let isSuccess = true;48 let isSuccess = true;
5049
51 for(const b of filteredBlocks) {50 for(const b of filteredBlocks) {
52 if(((await api.query.appPromotion.pendingUnstake(b)).toJSON() as any[]).length != 0) {51 if(((await api.query.appPromotion.pendingUnstake(b)).toJSON() as any[]).length != 0) {
53 failedBlocks.push(b.toBigInt());52 failedBlocks.push(b);
54 isSuccess = false;53 isSuccess = false;
55 }54 }
56 }55 }
modifiedjs-packages/tests/src/migrations/runCheckState.tsdiffbeforeafterboth
1import {main} from './correctStateAfterMaintenance';1import {main} from './correctStateAfterMaintenance.js';
22
3main({3main({
4 wsEndpoint: process.env.WS_RPC!,4 wsEndpoint: process.env.WS_RPC!,
modifiedjs-packages/tests/src/nativeFungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from './util';18import {expect, itSub, usingPlaygrounds} from './util/index.js';
1919
20describe('Native fungible', () => {20describe('Native fungible', () => {
21 let root: IKeyringPair;21 let root: IKeyringPair;
modifiedjs-packages/tests/src/nesting/collectionProperties.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../util';18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../util/index.js';
1919
20describe('Integration Test: Collection Properties with sudo', () => {20describe('Integration Test: Collection Properties with sudo', () => {
21 let superuser: IKeyringPair;21 let superuser: IKeyringPair;
modifiedjs-packages/tests/src/nesting/collectionProperties.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../util';18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../util/index.js';
1919
20describe('Integration Test: Collection Properties', () => {20describe('Integration Test: Collection Properties', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedjs-packages/tests/src/nesting/graphs.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from '../util';18import {expect, itSub, usingPlaygrounds} from '../util/index.js';
19import {UniqueHelper, UniqueNFTCollection, UniqueNFToken} from '../util/playgrounds/unique';19import {UniqueHelper, UniqueNFTCollection, UniqueNFToken} from '@unique/playgrounds/src/unique.js';
2020
21/**21/**
22 * ```dot22 * ```dot
modifiedjs-packages/tests/src/nesting/propertyPermissions.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, usingPlaygrounds, expect} from '../util';18import {itSub, Pallets, usingPlaygrounds, expect} from '../util/index.js';
19import {UniqueNFTCollection, UniqueRFTCollection} from '../util/playgrounds/unique';19import {UniqueNFTCollection, UniqueRFTCollection} from '@unique/playgrounds/src/unique.js';
2020
21describe('Integration Test: Access Rights to Token Properties', () => {21describe('Integration Test: Access Rights to Token Properties', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/nesting/tokenProperties.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../util';18import {itSub, Pallets, usingPlaygrounds, expect, requirePalletsOrSkip, sizeOfProperty} from '../util/index.js';
1919
20describe('Integration Test: Token Properties with sudo', () => {20describe('Integration Test: Token Properties with sudo', () => {
21 let superuser: IKeyringPair;21 let superuser: IKeyringPair;
modifiedjs-packages/tests/src/nesting/tokenProperties.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect, sizeOfProperty} from '../util';18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect, sizeOfProperty} from '../util/index.js';
19import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique';19import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '@unique/playgrounds/src/unique.js';
2020
21describe('Integration Test: Token Properties', () => {21describe('Integration Test: Token Properties', () => {
22 let alice: IKeyringPair; // collection owner22 let alice: IKeyringPair; // collection owner
modifiedjs-packages/tests/src/nesting/unnest.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, usingPlaygrounds} from '../util';18import {expect, itSub, Pallets, usingPlaygrounds} from '../util/index.js';
19import {UniqueFTCollection, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique';19import {CrossAccountId, UniqueFTCollection, UniqueNFToken, UniqueRFToken} from '@unique/playgrounds/src/unique.js';
2020
21describe('Integration Test: Unnesting', () => {21describe('Integration Test: Unnesting', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
304304
305 // Try to unnest305 // Try to unnest
306 await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/);306 await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/);
307 expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());307 expect(await nestedToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
308308
309 // Try to burn309 // Try to burn
310 await expect(nestedToken.burnFrom(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.ApprovedValueTooLow/);310 await expect(nestedToken.burnFrom(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.ApprovedValueTooLow/);
311 expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());311 expect(await nestedToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
312 });312 });
313313
314 // todo another test for creating excessive depth matryoshka with Ethereum?314 // todo another test for creating excessive depth matryoshka with Ethereum?
modifiedjs-packages/tests/src/nextSponsoring.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, usingPlaygrounds} from './util';18import {expect, itSub, Pallets, usingPlaygrounds} from './util/index.js';
1919
20const SPONSORING_TIMEOUT = 5;20const SPONSORING_TIMEOUT = 5;
2121
modifiedjs-packages/tests/src/pallet-presence.test.tsdiffbeforeafterboth
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/>.
1616
17import {itSub, usingPlaygrounds, expect} from './util';17import {itSub, usingPlaygrounds, expect} from './util/index.js';
1818
19// Pallets that must always be present19// Pallets that must always be present
20const requiredPallets = [20const requiredPallets = [
modifiedjs-packages/tests/src/performance.seq.test.tsdiffbeforeafterboth
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/>.
1616
17import {ApiPromise} from '@polkadot/api';17import {ApiPromise} from '@polkadot/api';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {expect, itSub, usingPlaygrounds} from './util';19import {expect, itSub, usingPlaygrounds} from './util/index.js';
20import {ICrossAccountId, IProperty} from './util/playgrounds/types';20import type {ICrossAccountId, IProperty} from '@unique/playgrounds/src/types.js';
21import {UniqueHelper} from './util/playgrounds/unique';21import {UniqueHelper} from '@unique/playgrounds/src/unique.js';
2222
23describe('Performace tests', () => {23describe('Performace tests', () => {
24 let alice: IKeyringPair;24 let alice: IKeyringPair;
modifiedjs-packages/tests/src/refungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util';18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/index.js';
1919
20const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n;20const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n;
2121
modifiedjs-packages/tests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {21describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/removeCollectionSponsor.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('integration test: ext. removeCollectionSponsor():', () => {21describe('integration test: ext. removeCollectionSponsor():', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
modifiedjs-packages/tests/src/rpc.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, itSub, expect} from './util';18import {usingPlaygrounds, itSub, expect} from './util/index.js';
19import {CrossAccountId} from './util/playgrounds/unique';19import {ICrossAccountId} from '@unique/playgrounds/src/types.js';
2020
21describe('integration test: RPC methods', () => {21describe('integration test: RPC methods', () => {
22 let donor: IKeyringPair;22 let donor: IKeyringPair;
55 // Set-up over55 // Set-up over
5656
57 const owners = await helper.callRpc('api.rpc.unique.tokenOwners', [collection.collectionId, 0]);57 const owners = await helper.callRpc('api.rpc.unique.tokenOwners', [collection.collectionId, 0]);
58 const ids = (owners.toJSON() as any[]).map(CrossAccountId.fromLowerCaseKeys);58 const ids = owners.toHuman() as ICrossAccountId[];
5959
60 expect(ids).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]);60 expect(ids).to.have.deep.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]);
61 expect(owners.length == 10).to.be.true;61 expect(owners.length == 10).to.be.true;
6262
63 // Make sure only 10 results are returned with this RPC63 // Make sure only 10 results are returned with this RPC
modifiedjs-packages/tests/src/scheduler.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util';17import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/index.js';
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {DevUniqueHelper, Event} from './util/playgrounds/unique.dev';19import {DevUniqueHelper, Event} from '@unique/playgrounds/src/unique.dev.js';
2020
21describe('Scheduling token and balance transfers', () => {21describe('Scheduling token and balance transfers', () => {
22 let superuser: IKeyringPair;22 let superuser: IKeyringPair;
32 const donor = await privateKey({url: import.meta.url});32 const donor = await privateKey({url: import.meta.url});
33 [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);33 [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
3434
35 await helper.testUtils.enable();35 await helper.testUtils.enable(Pallets.TestUtils);
36 });36 });
37 });37 });
3838
571 const donor = await privateKey({url: import.meta.url});571 const donor = await privateKey({url: import.meta.url});
572 [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor);572 [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor);
573573
574 await helper.testUtils.enable();574 await helper.testUtils.enable(Pallets.TestUtils);
575 });575 });
576 });576 });
577577
modifiedjs-packages/tests/src/setCollectionLimits.test.tsdiffbeforeafterboth
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/>.
1616
17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
18import {IKeyringPair} from '@polkadot/types/types';18import type {IKeyringPair} from '@polkadot/types/types';
19import {itSub, usingPlaygrounds, expect} from './util';19import {itSub, usingPlaygrounds, expect} from './util/index.js';
20import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';20import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2121
22const accountTokenOwnershipLimit = 0;22const accountTokenOwnershipLimit = 0;
23const sponsoredDataSize = 0;23const sponsoredDataSize = 0;
modifiedjs-packages/tests/src/setCollectionSponsor.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect, Pallets} from './util';18import {itSub, usingPlaygrounds, expect, Pallets} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('integration test: ext. setCollectionSponsor():', () => {21describe('integration test: ext. setCollectionSponsor():', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/setPermissions.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('Integration Test: Set Permissions', () => {21describe('Integration Test: Set Permissions', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/sub/appPromotion/appPromotion.seqtest.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from '../../util';18import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from '../../util/index.js';
19import {expect} from '../../eth/util';19import {expect} from '../../eth/util/index.js';
2020
21let superuser: IKeyringPair;21let superuser: IKeyringPair;
22let donor: IKeyringPair;22let donor: IKeyringPair;
modifiedjs-packages/tests/src/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {18import {
19 itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip, LOCKING_PERIOD, UNLOCKING_PERIOD,19 itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip, LOCKING_PERIOD, UNLOCKING_PERIOD,
20} from '../../util';20} from '../../util/index.js';
21import {DevUniqueHelper} from '../../util/playgrounds/unique.dev';21import {DevUniqueHelper} from '@unique/playgrounds/src/unique.dev.js';
22import {itEth, expect, SponsoringMode} from '../../eth/util';22import {itEth, expect, SponsoringMode} from '../../eth/util/index.js';
2323
24let donor: IKeyringPair;24let donor: IKeyringPair;
25let palletAdmin: IKeyringPair;25let palletAdmin: IKeyringPair;
modifiedjs-packages/tests/src/sub/nesting/admin.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from '../../util';18import {expect, itSub, usingPlaygrounds} from '../../util/index.js';
19import {CrossAccountId} from '@unique/playgrounds/src/unique.js';
1920
20describe('Nesting by collection admin', () => {21describe('Nesting by collection admin', () => {
21 let alice: IKeyringPair;22 let alice: IKeyringPair;
51 // 1.2 From different collection:52 // 1.2 From different collection:
52 const nestedTokenB = await collectionB.mintToken(bob, targetTokenA.nestingAccount());53 const nestedTokenB = await collectionB.mintToken(bob, targetTokenA.nestingAccount());
53 expect(await nestedTokenA.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});54 expect(await nestedTokenA.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});
54 expect(await nestedTokenA.getOwner()).to.be.deep.equal(targetTokenA.nestingAccount().toLowerCase());55 expect(await nestedTokenA.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetTokenA.nestingAccount()));
55 expect(await nestedTokenB.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});56 expect(await nestedTokenB.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});
56 expect(await nestedTokenB.getOwner()).to.be.deep.equal(targetTokenA.nestingAccount().toLowerCase());57 expect(await nestedTokenB.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetTokenA.nestingAccount()));
5758
58 // 2. Create a token to be nested and nest:59 // 2. Create a token to be nested and nest:
59 const newNestedTokenA = await collectionA.mintToken(bob);60 const newNestedTokenA = await collectionA.mintToken(bob);
63 // 2.2 From different collection:64 // 2.2 From different collection:
64 await newNestedTokenB.nest(bob, targetTokenA);65 await newNestedTokenB.nest(bob, targetTokenA);
65 expect(await newNestedTokenB.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});66 expect(await newNestedTokenB.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});
66 expect(await newNestedTokenB.getOwner()).to.be.deep.equal(targetTokenA.nestingAccount().toLowerCase());67 expect(await newNestedTokenB.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetTokenA.nestingAccount()));
67 });68 });
68 });69 });
6970
75 // Admin can create an immediately nested token:76 // Admin can create an immediately nested token:
76 const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount());77 const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount());
77 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});78 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});
78 expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());79 expect(await nestedToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
7980
80 // Owner can create and and nest:81 // Owner can create and and nest:
81 const newToken = await collection.mintToken(alice, {Substrate: charlie.address});82 const newToken = await collection.mintToken(alice, {Substrate: charlie.address});
82 await newToken.nest(charlie, targetToken);83 await newToken.nest(charlie, targetToken);
83 expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});84 expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address});
84 expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());85 expect(await newToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
85 });86 });
86});87});
8788
modifiedjs-packages/tests/src/sub/nesting/common.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, usingPlaygrounds} from '../../util';18import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js';
19import {UniqueNFTCollection, UniqueRFTCollection} from '../../util/playgrounds/unique';19import {CrossAccountId, UniqueNFTCollection, UniqueRFTCollection} from '@unique/playgrounds/src/unique.js';
2020
21let alice: IKeyringPair;21let alice: IKeyringPair;
22let bob: IKeyringPair;22let bob: IKeyringPair;
51 ? await (collectionForNesting as UniqueNFTCollection).mintToken(bob, targetTokenBob.nestingAccount())51 ? await (collectionForNesting as UniqueNFTCollection).mintToken(bob, targetTokenBob.nestingAccount())
52 : await (collectionForNesting as UniqueRFTCollection).mintToken(bob, 10n, targetTokenBob.nestingAccount());52 : await (collectionForNesting as UniqueRFTCollection).mintToken(bob, 10n, targetTokenBob.nestingAccount());
53 expect(await nestedToken1.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});53 expect(await nestedToken1.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});
54 expect(await nestedToken1.getOwner()).to.be.deep.equal(targetTokenBob.nestingAccount().toLowerCase());54 expect(await nestedToken1.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetTokenBob.nestingAccount()));
5555
56 // 2. Bob can mint and nest token:56 // 2. Bob can mint and nest token:
57 const nestedToken2 = await collectionForNesting.mintToken(bob);57 const nestedToken2 = await collectionForNesting.mintToken(bob);
58 await nestedToken2.nest(bob, targetTokenBob);58 await nestedToken2.nest(bob, targetTokenBob);
59 expect(await nestedToken2.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});59 expect(await nestedToken2.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});
60 expect(await nestedToken2.getOwner()).to.be.deep.equal(targetTokenBob.nestingAccount().toLowerCase());60 expect(await nestedToken2.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetTokenBob.nestingAccount()));
61 });61 });
62 });62 });
6363
7979
80 // 1. Alice can immediately create nested tokens:80 // 1. Alice can immediately create nested tokens:
81 await collectionForNesting.mint(bob, 100n, targetTokenBob.nestingAccount());81 await collectionForNesting.mint(bob, 100n, targetTokenBob.nestingAccount());
82 expect(await collectionForNesting.getTop10Owners()).deep.eq([targetTokenBob.nestingAccount().toLowerCase()]);82 expect(await collectionForNesting.getTop10Owners()).deep.eq([CrossAccountId.toLowerCase(targetTokenBob.nestingAccount())]);
83 expect(await collectionForNesting.getBalance(targetTokenBob.nestingAccount())).eq(100n);83 expect(await collectionForNesting.getBalance(targetTokenBob.nestingAccount())).eq(100n);
8484
85 // 2. Alice can mint and nest token:85 // 2. Alice can mint and nest token:
128128
129 const nestedNFT = await nftCollectionToBeNested.mintToken(alice, tokenA.nestingAccount());129 const nestedNFT = await nftCollectionToBeNested.mintToken(alice, tokenA.nestingAccount());
130 const nestedRFT = await rftCollectionToBeNested.mintToken(alice, 100n, tokenA.nestingAccount());130 const nestedRFT = await rftCollectionToBeNested.mintToken(alice, 100n, tokenA.nestingAccount());
131 const _nestedFT = await ftCollectionToBeNested.mint(alice, 100n, tokenA.nestingAccount());131 await ftCollectionToBeNested.mint(alice, 100n, tokenA.nestingAccount());
132 await nativeFtCollectionToBeNested.transfer(alice, tokenA.nestingAccount(), 100n);132 await nativeFtCollectionToBeNested.transfer(alice, tokenA.nestingAccount(), 100n);
133 expect(await nestedNFT.getOwner()).to.be.deep.equal(tokenA.nestingAccount().toLowerCase());133 expect(await nestedNFT.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(tokenA.nestingAccount()));
134 expect(await nestedRFT.getOwner()).to.be.deep.equal(tokenA.nestingAccount().toLowerCase());134 expect(await nestedRFT.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(tokenA.nestingAccount()));
135 expect(await ftCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(100n);135 expect(await ftCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(100n);
136 expect(await nativeFtCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(100n);136 expect(await nativeFtCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(100n);
137137
145 await nativeFtCollectionToBeNested.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);145 await nativeFtCollectionToBeNested.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);
146146
147 expect(await nestedNFT.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});147 expect(await nestedNFT.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});
148 expect(await nestedNFT.getOwner()).to.be.deep.equal(tokenB.nestingAccount().toLowerCase());148 expect(await nestedNFT.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(tokenB.nestingAccount()));
149149
150 expect(await nestedRFT.getBalance(tokenB.nestingAccount())).to.equal(25n);150 expect(await nestedRFT.getBalance(tokenB.nestingAccount())).to.equal(25n);
151 expect(await nestedRFT.getBalance(tokenA.nestingAccount())).to.equal(75n);151 expect(await nestedRFT.getBalance(tokenA.nestingAccount())).to.equal(75n);
modifiedjs-packages/tests/src/sub/nesting/e2e.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from '../../util';18import {expect, itSub, usingPlaygrounds} from '../../util/index.js';
19import {CrossAccountId} from '@unique/playgrounds/src/unique.js';
1920
20describe('Composite nesting tests', () => {21describe('Composite nesting tests', () => {
21 let alice: IKeyringPair;22 let alice: IKeyringPair;
119 // Create an immediately nested token120 // Create an immediately nested token
120 const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount());121 const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount());
121 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});122 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});
122 expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());123 expect(await nestedToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
123124
124 // Create a token to be nested125 // Create a token to be nested
125 const newToken = await collection.mintToken(alice);126 const newToken = await collection.mintToken(alice);
126127
127 // Nest128 // Nest
128 await newToken.nest(alice, targetToken);129 await newToken.nest(alice, targetToken);
129 expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});130 expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});
130 expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());131 expect(await newToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
131132
132 // Move bundle to different user133 // Move bundle to different user
133 await targetToken.transfer(alice, {Substrate: bob.address});134 await targetToken.transfer(alice, {Substrate: bob.address});
134 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});135 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});
135 expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());136 expect(await nestedToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
136 expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});137 expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});
137 expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());138 expect(await newToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
138139
139 // Unnest140 // Unnest
140 await newToken.unnest(bob, targetToken, {Substrate: bob.address});141 await newToken.unnest(bob, targetToken, {Substrate: bob.address});
modifiedjs-packages/tests/src/sub/nesting/nesting.negative.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, usingPlaygrounds} from '../../util';18import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js';
19import {UniqueFTCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '../../util/playgrounds/unique';19import {UniqueFTCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '@unique/playgrounds/src/unique.js';
20import {itEth} from '../../eth/util';20import {itEth} from '../../eth/util/index.js';
2121
22let alice: IKeyringPair;22let alice: IKeyringPair;
23let bob: IKeyringPair;23let bob: IKeyringPair;
182 // 2. Alice cannot mint and nest token:182 // 2. Alice cannot mint and nest token:
183 const nft = await nftCollectionForNesting.mintToken(alice);183 const nft = await nftCollectionForNesting.mintToken(alice);
184 const rft = await rftCollectionForNesting.mintToken(alice, 100n);184 const rft = await rftCollectionForNesting.mintToken(alice, 100n);
185 const _ft = await ftCollectionForNesting.mint(alice, 100n);185 await ftCollectionForNesting.mint(alice, 100n);
186 await expect(nft.transfer(alice, testCase.token.nestingAccount())).to.be.rejectedWith(testCase.error);186 await expect(nft.transfer(alice, testCase.token.nestingAccount())).to.be.rejectedWith(testCase.error);
187 await expect(rft.transfer(alice, testCase.token.nestingAccount())).to.be.rejectedWith(testCase.error);187 await expect(rft.transfer(alice, testCase.token.nestingAccount())).to.be.rejectedWith(testCase.error);
188 await expect(ftCollectionForNesting.transfer(alice, testCase.token.nestingAccount(), 50n)).to.be.rejectedWith(testCase.error);188 await expect(ftCollectionForNesting.transfer(alice, testCase.token.nestingAccount(), 50n)).to.be.rejectedWith(testCase.error);
214 const nativeFtCollection = helper.ft.getCollectionObject(0);214 const nativeFtCollection = helper.ft.getCollectionObject(0);
215215
216 const rftToken = await rftCollection.mintToken(alice);216 const rftToken = await rftCollection.mintToken(alice);
217 const _ftToken = await ftCollection.mint(alice, 100n);217 await ftCollection.mint(alice, 100n);
218218
219 const collectionForNesting = await helper.nft.mintCollection(alice);219 const collectionForNesting = await helper.nft.mintCollection(alice);
220220
modifiedjs-packages/tests/src/sub/nesting/refungible.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, usingPlaygrounds} from '../../util';18import {expect, itSub, Pallets, usingPlaygrounds} from '../../util/index.js';
1919
20describe('ReFungible-specific nesting tests', () => {20describe('ReFungible-specific nesting tests', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedjs-packages/tests/src/sub/nesting/unnesting.negative.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, usingPlaygrounds} from '../../util';18import {expect, itSub, usingPlaygrounds} from '../../util/index.js';
19import {CrossAccountId} from '@unique/playgrounds/src/unique.js';
1920
20describe('Negative Test: Unnesting', () => {21describe('Negative Test: Unnesting', () => {
21 let alice: IKeyringPair;22 let alice: IKeyringPair;
4849
49 expect(await targetToken.getChildren()).to.be.length(1);50 expect(await targetToken.getChildren()).to.be.length(1);
50 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});51 expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address});
51 expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());52 expect(await nestedToken.getOwner()).to.be.deep.equal(CrossAccountId.toLowerCase(targetToken.nestingAccount()));
52 });53 });
5354
54 [55 [
modifiedjs-packages/tests/src/sub/refungible/burn.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util';18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util/index.js';
1919
20describe('Refungible: burn', () => {20describe('Refungible: burn', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedjs-packages/tests/src/sub/refungible/nesting.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../../util';18import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from '../../util/index.js';
1919
20describe('Refungible nesting', () => {20describe('Refungible nesting', () => {
21 let alice: IKeyringPair;21 let alice: IKeyringPair;
modifiedjs-packages/tests/src/sub/refungible/repartition.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util';18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util/index.js';
1919
20describe('integration test: Refungible functionality:', () => {20describe('integration test: Refungible functionality:', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedjs-packages/tests/src/sub/refungible/transfer.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util';18import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../../util/index.js';
1919
20describe('Refungible transfer tests', () => {20describe('Refungible transfer tests', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedjs-packages/tests/src/transfer.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itEth, usingEthPlaygrounds} from './eth/util';18import {itEth, usingEthPlaygrounds} from './eth/util/index.js';
19import {itSub, Pallets, usingPlaygrounds, expect} from './util';19import {itSub, Pallets, usingPlaygrounds, expect} from './util/index.js';
20import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';20import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2121
22describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {22describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
23 let donor: IKeyringPair;23 let donor: IKeyringPair;
modifiedjs-packages/tests/src/transferFrom.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, Pallets, usingPlaygrounds, expect} from './util';18import {itSub, Pallets, usingPlaygrounds, expect} from './util/index.js';
19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';19import {NON_EXISTENT_COLLECTION_ID} from '@unique/playgrounds/src/types.js';
2020
21describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {21describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {
22 let alice: IKeyringPair;22 let alice: IKeyringPair;
modifiedjs-packages/tests/src/tx-version-presence.test.tsdiffbeforeafterboth
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/>.
1616
17import {Metadata} from '@polkadot/types';17import {Metadata} from '@polkadot/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
1919
20let metadata: Metadata;20let metadata: Metadata;
2121
modifiedjs-packages/tests/src/util/authorizeEnactUpgrade.tsdiffbeforeafterboth
1import {readFile} from 'fs/promises';1import {readFile} from 'fs/promises';
2import {u8aToHex} from '@polkadot/util';2import {u8aToHex} from '@polkadot/util';
3import {usingPlaygrounds} from '.';3import {usingPlaygrounds} from './index.js';
4import {blake2AsHex} from '@polkadot/util-crypto';4import {blake2AsHex} from '@polkadot/util-crypto';
55
66
modifiedjs-packages/tests/src/util/createHrmp.tsdiffbeforeafterboth
1import {usingPlaygrounds} from '.';1import {usingPlaygrounds} from './index.js';
2import config from '../config';2import config from '../config.js';
33
4const profile = process.argv[2];4const profile = process.argv[2];
5if(!profile) throw new Error('missing profile/relay argument');5if(!profile) throw new Error('missing profile/relay argument');
modifiedjs-packages/tests/src/util/frankensteinMigrate.tsdiffbeforeafterboth
1import {migration as locksToFreezesMigration} from '../migrations/942057-appPromotion';1import {migration as locksToFreezesMigration} from '../migrations/942057-appPromotion/index.js';
2export interface Migration {2export interface Migration {
3 before: () => Promise<void>,3 before: () => Promise<void>,
4 after: () => Promise<void>,4 after: () => Promise<void>,
modifiedjs-packages/tests/src/util/globalSetup.tsdiffbeforeafterboth
33
4import {4import {
5 usingPlaygrounds, Pallets, DONOR_FUNDING, MINIMUM_DONOR_FUND, LOCKING_PERIOD, UNLOCKING_PERIOD, makeNames,5 usingPlaygrounds, Pallets, DONOR_FUNDING, MINIMUM_DONOR_FUND, LOCKING_PERIOD, UNLOCKING_PERIOD, makeNames,
6} from './index';6} from './index.js';
7import * as path from 'path';7import * as path from 'path';
8import {promises as fs} from 'fs';8import {promises as fs} from 'fs';
99
70 const batchSize = 300;70 const batchSize = 300;
71 let balanceGrantedCounter = 0;71 let balanceGrantedCounter = 0;
72 for(let b = 0; b < filenames.length; b += batchSize) {72 for(let b = 0; b < filenames.length; b += batchSize) {
73 const tx = [];73 const tx: Promise<boolean>[] = [];
74 let batchBalanceGrantedCounter = 0;74 let batchBalanceGrantedCounter = 0;
75 for(let i = 0; batchBalanceGrantedCounter < batchSize && b + i < filenames.length; i++) {75 for(let i = 0; batchBalanceGrantedCounter < batchSize && b + i < filenames.length; i++) {
76 const f = filenames[b + i];76 const f = filenames[b + i];
modifiedjs-packages/tests/src/util/identitySetter.tsdiffbeforeafterboth
8// Example: `yarn setIdentities wss://polkadot-rpc.dwellir.com ws://localhost:9944 escape pattern miracle train sudden cart adapt embark wedding alien lamp mesh`8// Example: `yarn setIdentities wss://polkadot-rpc.dwellir.com ws://localhost:9944 escape pattern miracle train sudden cart adapt embark wedding alien lamp mesh`
99
10import {encodeAddress} from '@polkadot/keyring';10import {encodeAddress} from '@polkadot/keyring';
11import {IKeyringPair} from '@polkadot/types/types';11import type {IKeyringPair} from '@polkadot/types/types';
12import {usingPlaygrounds, Pallets} from './index';12import {usingPlaygrounds, Pallets} from './index.js';
13import {ChainHelperBase} from './playgrounds/unique';13import {ChainHelperBase} from '@unique/playgrounds/src/unique.js';
1414
15const relayUrl = process.argv[2] ?? 'ws://localhost:9844';15const relayUrl = process.argv[2] ?? 'ws://localhost:9844';
16const paraUrl = process.argv[3] ?? 'ws://localhost:9944';16const paraUrl = process.argv[3] ?? 'ws://localhost:9944';
modifiedjs-packages/tests/src/util/index.tsdiffbeforeafterboth
33
4import * as path from 'path';4import * as path from 'path';
5import * as crypto from 'crypto';5import * as crypto from 'crypto';
6import {IKeyringPair} from '@polkadot/types/types/interfaces';6import type {IKeyringPair} from '@polkadot/types/types/interfaces';
7import chai from 'chai';7import chai from 'chai';
8import chaiAsPromised from 'chai-as-promised';8import chaiAsPromised from 'chai-as-promised';
9import chaiSubset from 'chai-subset';9import chaiSubset from 'chai-subset';
10import {Context} from 'mocha';10import {Context} from 'mocha';
11import config from '../config';11import config from '../config.js';
12import {ChainHelperBase} from './playgrounds/unique';12import {ChainHelperBase} from '@unique/playgrounds/src/unique.js';
13import {ILogger} from './playgrounds/types';13import type {ILogger} from '@unique/playgrounds/src/types.js';
14import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper, DevWestmintHelper, DevStatemineHelper, DevStatemintHelper, DevAstarHelper, DevShidenHelper, DevPolkadexHelper} from './playgrounds/unique.dev';14import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper, DevWestmintHelper, DevStatemineHelper, DevStatemintHelper, DevAstarHelper, DevShidenHelper, DevPolkadexHelper} from '@unique/playgrounds/src/unique.dev.js';
15import {dirname} from 'path';15import {dirname} from 'path';
16import {fileURLToPath} from 'url';16import {fileURLToPath} from 'url';
1717
modifiedjs-packages/tests/src/util/relayIdentitiesChecker.tsdiffbeforeafterboth
7// Example: `yarn checkRelayIdentities wss://polkadot-rpc.dwellir.com wss://kusama-rpc.dwellir.com`7// Example: `yarn checkRelayIdentities wss://polkadot-rpc.dwellir.com wss://kusama-rpc.dwellir.com`
88
9import {encodeAddress} from '@polkadot/keyring';9import {encodeAddress} from '@polkadot/keyring';
10import {usingPlaygrounds} from './index';10import {usingPlaygrounds} from './index.js';
11import {getIdentities, getSubs, getSupers, constructSubInfo} from './identitySetter';11import {getIdentities, getSubs, getSupers, constructSubInfo} from './identitySetter.js';
1212
13const relay1Url = process.argv[2] ?? 'ws://localhost:9844';13const relay1Url = process.argv[2] ?? 'ws://localhost:9844';
14const relay2Url = process.argv[3] ?? 'ws://localhost:9844';14const relay2Url = process.argv[3] ?? 'ws://localhost:9844';
modifiedjs-packages/tests/src/util/setCode.tsdiffbeforeafterboth
1import {readFile} from 'fs/promises';1import {readFile} from 'fs/promises';
2import {u8aToHex} from '@polkadot/util';2import {u8aToHex} from '@polkadot/util';
3import {usingPlaygrounds} from '.';3import {usingPlaygrounds} from './index.js';
44
5const codePath = process.argv[2];5const codePath = process.argv[2];
6if(!codePath) throw new Error('missing code path argument');6if(!codePath) throw new Error('missing code path argument');
modifiedjs-packages/tests/src/vesting.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';
1919
20describe('Vesting', () => {20describe('Vesting', () => {
21 let donor: IKeyringPair;21 let donor: IKeyringPair;
modifiedjs-packages/tests/src/xcm/lowLevelXcmQuartz.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingMoonriverPlaygrounds, usingShidenPlaygrounds, usingRelayPlaygrounds} from '../util';18import {itSub, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingMoonriverPlaygrounds, usingShidenPlaygrounds, usingRelayPlaygrounds} from '../util/index.js';
19import {QUARTZ_CHAIN, QTZ_DECIMALS, SHIDEN_DECIMALS, karuraUrl, moonriverUrl, shidenUrl, SAFE_XCM_VERSION, XcmTestHelper, TRANSFER_AMOUNT, SENDER_BUDGET, relayUrl} from './xcm.types';19import {QUARTZ_CHAIN, QTZ_DECIMALS, SHIDEN_DECIMALS, karuraUrl, moonriverUrl, shidenUrl, SAFE_XCM_VERSION, XcmTestHelper, TRANSFER_AMOUNT, SENDER_BUDGET, relayUrl} from './xcm.types.js';
20import {hexToString} from '@polkadot/util';20import {hexToString} from '@polkadot/util';
2121
22const testHelper = new XcmTestHelper('quartz');22const testHelper = new XcmTestHelper('quartz');
modifiedjs-packages/tests/src/xcm/lowLevelXcmUnique.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import config from '../config';18import config from '../config.js';
19import {itSub, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingMoonbeamPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds, usingRelayPlaygrounds} from '../util';19import {itSub, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingMoonbeamPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds, usingRelayPlaygrounds} from '../util/index.js';
20import {nToBigInt} from '@polkadot/util';20import {nToBigInt} from '@polkadot/util';
21import {hexToString} from '@polkadot/util';21import {hexToString} from '@polkadot/util';
22import {ASTAR_DECIMALS, SAFE_XCM_VERSION, SENDER_BUDGET, UNIQUE_CHAIN, UNQ_DECIMALS, XcmTestHelper, acalaUrl, astarUrl, moonbeamUrl, polkadexUrl, relayUrl, uniqueAssetId} from './xcm.types';22import {ASTAR_DECIMALS, SAFE_XCM_VERSION, SENDER_BUDGET, UNIQUE_CHAIN, UNQ_DECIMALS, XcmTestHelper, acalaUrl, astarUrl, moonbeamUrl, polkadexUrl, relayUrl, uniqueAssetId} from './xcm.types.js';
2323
24const testHelper = new XcmTestHelper('unique');24const testHelper = new XcmTestHelper('unique');
2525
modifiedjs-packages/tests/src/xcm/xcm.types.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';
2import {hexToString} from '@polkadot/util';2import {hexToString} from '@polkadot/util';
3import {expect, usingAcalaPlaygrounds, usingAstarPlaygrounds, usingKaruraPlaygrounds, usingMoonbeamPlaygrounds, usingMoonriverPlaygrounds, usingPlaygrounds, usingPolkadexPlaygrounds, usingRelayPlaygrounds, usingShidenPlaygrounds} from '../util';3import {expect, usingAcalaPlaygrounds, usingAstarPlaygrounds, usingKaruraPlaygrounds, usingMoonbeamPlaygrounds, usingMoonriverPlaygrounds, usingPlaygrounds, usingPolkadexPlaygrounds, usingRelayPlaygrounds, usingShidenPlaygrounds} from '../util/index.js';
4import {DevUniqueHelper, Event} from '../util/playgrounds/unique.dev';4import {DevUniqueHelper, Event} from '@unique/playgrounds/src/unique.dev.js';
5import config from '../config';5import config from '../config.js';
66
7export const UNIQUE_CHAIN = +(process.env.RELAY_UNIQUE_ID || 2037);7export const UNIQUE_CHAIN = +(process.env.RELAY_UNIQUE_ID || 2037);
8export const STATEMINT_CHAIN = +(process.env.RELAY_STATEMINT_ID || 1000);8export const STATEMINT_CHAIN = +(process.env.RELAY_STATEMINT_ID || 1000);
modifiedjs-packages/tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import config from '../config';18import config from '../config.js';
19import {itSub, expect, describeXCM, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util';19import {itSub, expect, describeXCM, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/index.js';
2020
21const STATEMINE_CHAIN = +(process.env.RELAY_WESTMINT_ID || 1000);21const STATEMINE_CHAIN = +(process.env.RELAY_WESTMINT_ID || 1000);
22const UNIQUE_CHAIN = +(process.env.RELAY_OPAL_ID || 2095);22const UNIQUE_CHAIN = +(process.env.RELAY_OPAL_ID || 2095);
modifiedjs-packages/tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '../util';18import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '../util/index.js';
19import {DevUniqueHelper, Event} from '../util/playgrounds/unique.dev';19import {DevUniqueHelper, Event} from '@unique/playgrounds/src/unique.dev.js';
20import {STATEMINE_CHAIN, QUARTZ_CHAIN, KARURA_CHAIN, MOONRIVER_CHAIN, SHIDEN_CHAIN, STATEMINE_DECIMALS, KARURA_DECIMALS, QTZ_DECIMALS, RELAY_DECIMALS, SHIDEN_DECIMALS, karuraUrl, moonriverUrl, relayUrl, shidenUrl, statemineUrl} from './xcm.types';20import {STATEMINE_CHAIN, QUARTZ_CHAIN, KARURA_CHAIN, MOONRIVER_CHAIN, SHIDEN_CHAIN, STATEMINE_DECIMALS, KARURA_DECIMALS, QTZ_DECIMALS, RELAY_DECIMALS, SHIDEN_DECIMALS, karuraUrl, moonriverUrl, relayUrl, shidenUrl, statemineUrl} from './xcm.types.js';
21import {hexToString} from '@polkadot/util';21import {hexToString} from '@polkadot/util';
2222
2323
modifiedjs-packages/tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth
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/>.
1616
17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';
18import config from '../config';18import config from '../config.js';
19import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds} from '../util';19import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds, usingPolkadexPlaygrounds} from '../util/index.js';
20import {Event} from '../util/playgrounds/unique.dev';20import {Event} from '@unique/playgrounds/src/unique.dev.js';
21import {hexToString, nToBigInt} from '@polkadot/util';21import {hexToString, nToBigInt} from '@polkadot/util';
22import {ACALA_CHAIN, ASTAR_CHAIN, MOONBEAM_CHAIN, POLKADEX_CHAIN, SAFE_XCM_VERSION, STATEMINT_CHAIN, UNIQUE_CHAIN, expectFailedToTransact, expectUntrustedReserveLocationFail, uniqueAssetId, uniqueVersionedMultilocation} from './xcm.types';22import {ACALA_CHAIN, ASTAR_CHAIN, MOONBEAM_CHAIN, POLKADEX_CHAIN, SAFE_XCM_VERSION, STATEMINT_CHAIN, UNIQUE_CHAIN, expectFailedToTransact, expectUntrustedReserveLocationFail, uniqueAssetId, uniqueVersionedMultilocation} from './xcm.types.js';
2323
2424
25const STATEMINT_PALLET_INSTANCE = 50;25const STATEMINT_PALLET_INSTANCE = 50;
addedjs-packages/tests/tsconfig.jsondiffbeforeafterboth

no changes

addedjs-packages/tsconfig.base.jsondiffbeforeafterboth

no changes

modifiedjs-packages/tsconfig.jsondiffbeforeafterboth
1{1{
2 "compilerOptions": {2 "references": [
3 "target": "ES2020",3 { "path": "./types/tsconfig.json" },
4 "moduleResolution": "node",
5 "esModuleInterop": true,
6 "resolveJsonModule": true,
7 "module": "ESNext",4 { "path": "./playgrounds/tsconfig.json" },
8 "sourceMap": true,
9 "outDir": "dist",5 { "path": "./scripts/tsconfig.json" },
10 "strict": true,
11 "paths": {6 { "path": "./tests/tsconfig.json" }
12 "@polkadot/types/lookup": ["./src/interfaces/types-lookup.ts"],
13 "@unique-nft/types/*": ["./src/interfaces/*"]
14 }
15 },7 ],
16 "include": ["./src/**/*", "./src/interfaces/*.ts"],8 "files": [],
17 "exclude": ["./src/.outdated"],9 "exclude": ["**/node_modules"]
18 "lib": ["es2017"],
19 "ts-node": {
20 "experimentalSpecifierResolution": "node"
21 }
22}10 }
2311
addedjs-packages/tsconfig.packages.jsondiffbeforeafterboth

no changes

addedjs-packages/types/package.jsondiffbeforeafterboth

no changes

modifiedjs-packages/types/src/augment-api-rpc.tsdiffbeforeafterboth
5// this is required to allow for ambient/previous definitions5// this is required to allow for ambient/previous definitions
6import '@polkadot/rpc-core/types/jsonrpc';6import '@polkadot/rpc-core/types/jsonrpc';
77
8import type { PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData, UpPovEstimateRpcPovInfo } from './default';8import type { PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData, UpPovEstimateRpcPovInfo } from './default/index.js';
9import type { AugmentedRpc } from '@polkadot/rpc-core/types';9import type { AugmentedRpc } from '@polkadot/rpc-core/types';
10import type { Metadata, StorageKey } from '@polkadot/types';10import type { Metadata, StorageKey } from '@polkadot/types';
11import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec';11import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u32, u64 } from '@polkadot/types-codec';
12import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types';12import type { AnyNumber, Codec } from '@polkadot/types-codec/types';
13import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';13import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
14import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';14import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
15import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';15import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
3535
36declare module '@polkadot/rpc-core/types/jsonrpc' {36declare module '@polkadot/rpc-core/types/jsonrpc' {
37 interface RpcInterface {37 interface RpcInterface {
38 appPromotion: {
39 /**
40 * Returns the total amount of unstaked tokens
41 **/
42 pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
43 /**
44 * Returns the total amount of unstaked tokens per block
45 **/
46 pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
47 /**
48 * Returns the total amount of staked tokens
49 **/
50 totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
51 /**
52 * Returns the total amount of staked tokens per block when staked
53 **/
54 totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;
55 };
56 author: {38 author: {
57 /**39 /**
58 * Returns true if the keystore has private keys for the given public key and key type.40 * Returns true if the keystore has private keys for the given public key and key type.
444 **/426 **/
445 queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfoV1>>;427 queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfoV1>>;
446 };428 };
447 povinfo: {
448 /**
449 * Estimate PoV size of encoded signed extrinsics
450 **/
451 estimateExtrinsicPoV: AugmentedRpc<(encodedXt: Vec<Bytes> | (Bytes | string | Uint8Array)[], at?: Hash | string | Uint8Array) => Observable<UpPovEstimateRpcPovInfo>>;
452 };
453 rpc: {429 rpc: {
454 /**430 /**
455 * Retrieves the list of RPC methods that are exposed by the node431 * Retrieves the list of RPC methods that are exposed by the node
628 **/604 **/
629 version: AugmentedRpc<() => Observable<Text>>;605 version: AugmentedRpc<() => Observable<Text>>;
630 };606 };
631 unique: {
632 /**
633 * Get the amount of any user tokens owned by an account
634 **/
635 accountBalance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
636 /**
637 * Get tokens owned by an account in a collection
638 **/
639 accountTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;
640 /**
641 * Get the list of admin accounts of a collection
642 **/
643 adminlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;
644 /**
645 * Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor
646 **/
647 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>>;
648 /**
649 * Tells whether the given `owner` approves the `operator`.
650 **/
651 allowanceForAll: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, operator: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<bool>>>;
652 /**
653 * Check if a user is allowed to operate within a collection
654 **/
655 allowed: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
656 /**
657 * Get the list of accounts allowed to operate within a collection
658 **/
659 allowlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;
660 /**
661 * Get the amount of a specific token owned by an account
662 **/
663 balance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;
664 /**
665 * Get a collection by the specified ID
666 **/
667 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;
668 /**
669 * Get collection properties, optionally limited to the provided keys
670 **/
671 collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;
672 /**
673 * Get chain stats about collections
674 **/
675 collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;
676 /**
677 * Get tokens contained within a collection
678 **/
679 collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;
680 /**
681 * Get token constant metadata
682 **/
683 constMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
684 /**
685 * Get effective collection limits
686 **/
687 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;
688 /**
689 * Get the last token ID created in a collection
690 **/
691 lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
692 /**
693 * Get the number of blocks until sponsoring a transaction is available
694 **/
695 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>>>;
696 /**
697 * Get property permissions, optionally limited to the provided keys
698 **/
699 propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;
700 /**
701 * Get tokens nested directly into the token
702 **/
703 tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenChild>>>;
704 /**
705 * Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT
706 **/
707 tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenData>>;
708 /**
709 * Check if the token exists
710 **/
711 tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;
712 /**
713 * Get the token owner
714 **/
715 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;
716 /**
717 * Returns 10 tokens owners in no particular order
718 **/
719 tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;
720 /**
721 * Get token properties, optionally limited to the provided keys
722 **/
723 tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;
724 /**
725 * Get the topmost token owner in the hierarchy of a possibly nested token
726 **/
727 topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;
728 /**
729 * Get the total amount of pieces of an RFT
730 **/
731 totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u128>>>;
732 /**
733 * Get the amount of distinctive tokens present in a collection
734 **/
735 totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;
736 /**
737 * Get token variable metadata
738 **/
739 variableMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;
740 };
741 web3: {607 web3: {
742 /**608 /**
743 * Returns current client version.609 * Returns current client version.
modifiedjs-packages/types/src/augment-types.tsdiffbeforeafterboth
5// this is required to allow for ambient/previous definitions5// this is required to allow for ambient/previous definitions
6import '@polkadot/types/types/registry';6import '@polkadot/types/types/registry';
77
8import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemCodeUpgradeAuthorization, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletParachainSystemRelayStateSnapshotRelayDispatchQueueRemainingCapacity, CumulusPalletParachainSystemUnincludedSegmentAncestor, CumulusPalletParachainSystemUnincludedSegmentHrmpChannelUpdate, CumulusPalletParachainSystemUnincludedSegmentSegmentTracker, CumulusPalletParachainSystemUnincludedSegmentUsedBandwidth, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportPreimagesBounded, FrameSupportScheduleDispatchTime, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls, OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance, OpalRuntimeRuntimeCommonSessionKeys, OpalRuntimeRuntimeHoldReason, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesIdAmount, PalletBalancesReasons, PalletBalancesReserveData, PalletCollatorSelectionCall, PalletCollatorSelectionError, PalletCollatorSelectionEvent, PalletCollatorSelectionHoldReason, PalletCollectiveCall, PalletCollectiveError, PalletCollectiveEvent, PalletCollectiveRawOrigin, PalletCollectiveVotes, PalletCommonError, PalletCommonEvent, PalletConfigurationAppPromotionConfiguration, PalletConfigurationCall, PalletConfigurationError, PalletConfigurationEvent, PalletDemocracyCall, PalletDemocracyConviction, PalletDemocracyDelegations, PalletDemocracyError, PalletDemocracyEvent, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyTally, PalletDemocracyVoteAccountVote, PalletDemocracyVotePriorLock, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCodeMetadata, PalletEvmCoderSubstrateError, PalletEvmContractHelpersCall, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletEvmMigrationEvent, PalletForeignAssetsAssetId, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletGovOriginsOrigin, PalletIdentityBitFlags, PalletIdentityCall, PalletIdentityError, PalletIdentityEvent, PalletIdentityIdentityField, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletInflationCall, PalletMaintenanceCall, PalletMaintenanceError, PalletMaintenanceEvent, PalletMembershipCall, PalletMembershipError, PalletMembershipEvent, PalletNonfungibleError, PalletNonfungibleItemData, PalletPreimageCall, PalletPreimageError, PalletPreimageEvent, PalletPreimageRequestStatus, PalletRankedCollectiveCall, PalletRankedCollectiveError, PalletRankedCollectiveEvent, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletReferendaCall, PalletReferendaCurve, PalletReferendaDecidingStatus, PalletReferendaDeposit, PalletReferendaError, PalletReferendaEvent, PalletReferendaReferendumInfo, PalletReferendaReferendumStatus, PalletReferendaTrackInfo, PalletRefungibleError, PalletSchedulerCall, PalletSchedulerError, PalletSchedulerEvent, PalletSchedulerScheduled, PalletSessionCall, PalletSessionError, PalletSessionEvent, PalletStateTrieMigrationCall, PalletStateTrieMigrationError, PalletStateTrieMigrationEvent, PalletStateTrieMigrationMigrationCompute, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletStateTrieMigrationProgress, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTestUtilsCall, PalletTestUtilsError, PalletTestUtilsEvent, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUtilityCall, PalletUtilityError, PalletUtilityEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, ParachainInfoCall, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesPrimitivesXcmpMessageFormat, PolkadotPrimitivesV5AbridgedHostConfiguration, PolkadotPrimitivesV5AbridgedHrmpChannel, PolkadotPrimitivesV5PersistedValidationData, PolkadotPrimitivesV5UpgradeGoAhead, PolkadotPrimitivesV5UpgradeRestriction, PolkadotPrimitivesVstagingAsyncBackingParams, SpArithmeticArithmeticError, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Public, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionValidityInvalidTransaction, SpRuntimeTransactionValidityTransactionValidityError, SpRuntimeTransactionValidityUnknownTransaction, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight, StagingXcmDoubleEncoded, StagingXcmV2BodyId, StagingXcmV2BodyPart, StagingXcmV2Instruction, StagingXcmV2Junction, StagingXcmV2MultiAsset, StagingXcmV2MultiLocation, StagingXcmV2MultiassetAssetId, StagingXcmV2MultiassetAssetInstance, StagingXcmV2MultiassetFungibility, StagingXcmV2MultiassetMultiAssetFilter, StagingXcmV2MultiassetMultiAssets, StagingXcmV2MultiassetWildFungibility, StagingXcmV2MultiassetWildMultiAsset, StagingXcmV2MultilocationJunctions, StagingXcmV2NetworkId, StagingXcmV2OriginKind, StagingXcmV2Response, StagingXcmV2TraitsError, StagingXcmV2WeightLimit, StagingXcmV2Xcm, StagingXcmV3Instruction, StagingXcmV3Junction, StagingXcmV3JunctionBodyId, StagingXcmV3JunctionBodyPart, StagingXcmV3JunctionNetworkId, StagingXcmV3Junctions, StagingXcmV3MaybeErrorCode, StagingXcmV3MultiAsset, StagingXcmV3MultiLocation, StagingXcmV3MultiassetAssetId, StagingXcmV3MultiassetAssetInstance, StagingXcmV3MultiassetFungibility, StagingXcmV3MultiassetMultiAssetFilter, StagingXcmV3MultiassetMultiAssets, StagingXcmV3MultiassetWildFungibility, StagingXcmV3MultiassetWildMultiAsset, StagingXcmV3PalletInfo, StagingXcmV3QueryResponseInfo, StagingXcmV3Response, StagingXcmV3TraitsError, StagingXcmV3TraitsOutcome, StagingXcmV3WeightLimit, StagingXcmV3Xcm, StagingXcmVersionedAssetId, StagingXcmVersionedMultiAsset, StagingXcmVersionedMultiAssets, StagingXcmVersionedMultiLocation, StagingXcmVersionedResponse, StagingXcmVersionedXcm, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, UpPovEstimateRpcPovInfo, UpPovEstimateRpcTrieKeyValue } from './default';8import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemCodeUpgradeAuthorization, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletParachainSystemRelayStateSnapshotRelayDispatchQueueRemainingCapacity, CumulusPalletParachainSystemUnincludedSegmentAncestor, CumulusPalletParachainSystemUnincludedSegmentHrmpChannelUpdate, CumulusPalletParachainSystemUnincludedSegmentSegmentTracker, CumulusPalletParachainSystemUnincludedSegmentUsedBandwidth, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportPreimagesBounded, FrameSupportScheduleDispatchTime, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls, OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance, OpalRuntimeRuntimeCommonSessionKeys, OpalRuntimeRuntimeHoldReason, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesIdAmount, PalletBalancesReasons, PalletBalancesReserveData, PalletCollatorSelectionCall, PalletCollatorSelectionError, PalletCollatorSelectionEvent, PalletCollatorSelectionHoldReason, PalletCollectiveCall, PalletCollectiveError, PalletCollectiveEvent, PalletCollectiveRawOrigin, PalletCollectiveVotes, PalletCommonError, PalletCommonEvent, PalletConfigurationAppPromotionConfiguration, PalletConfigurationCall, PalletConfigurationError, PalletConfigurationEvent, PalletDemocracyCall, PalletDemocracyConviction, PalletDemocracyDelegations, PalletDemocracyError, PalletDemocracyEvent, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyReferendumStatus, PalletDemocracyTally, PalletDemocracyVoteAccountVote, PalletDemocracyVotePriorLock, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCodeMetadata, PalletEvmCoderSubstrateError, PalletEvmContractHelpersCall, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletEvmMigrationEvent, PalletForeignAssetsAssetId, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletGovOriginsOrigin, PalletIdentityBitFlags, PalletIdentityCall, PalletIdentityError, PalletIdentityEvent, PalletIdentityIdentityField, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletInflationCall, PalletMaintenanceCall, PalletMaintenanceError, PalletMaintenanceEvent, PalletMembershipCall, PalletMembershipError, PalletMembershipEvent, PalletNonfungibleError, PalletNonfungibleItemData, PalletPreimageCall, PalletPreimageError, PalletPreimageEvent, PalletPreimageRequestStatus, PalletRankedCollectiveCall, PalletRankedCollectiveError, PalletRankedCollectiveEvent, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletReferendaCall, PalletReferendaCurve, PalletReferendaDecidingStatus, PalletReferendaDeposit, PalletReferendaError, PalletReferendaEvent, PalletReferendaReferendumInfo, PalletReferendaReferendumStatus, PalletReferendaTrackInfo, PalletRefungibleError, PalletSchedulerCall, PalletSchedulerError, PalletSchedulerEvent, PalletSchedulerScheduled, PalletSessionCall, PalletSessionError, PalletSessionEvent, PalletStateTrieMigrationCall, PalletStateTrieMigrationError, PalletStateTrieMigrationEvent, PalletStateTrieMigrationMigrationCompute, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletStateTrieMigrationProgress, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTestUtilsCall, PalletTestUtilsError, PalletTestUtilsEvent, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUtilityCall, PalletUtilityError, PalletUtilityEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, ParachainInfoCall, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesPrimitivesXcmpMessageFormat, PolkadotPrimitivesV5AbridgedHostConfiguration, PolkadotPrimitivesV5AbridgedHrmpChannel, PolkadotPrimitivesV5PersistedValidationData, PolkadotPrimitivesV5UpgradeGoAhead, PolkadotPrimitivesV5UpgradeRestriction, PolkadotPrimitivesVstagingAsyncBackingParams, SpArithmeticArithmeticError, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Public, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionValidityInvalidTransaction, SpRuntimeTransactionValidityTransactionValidityError, SpRuntimeTransactionValidityUnknownTransaction, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight, StagingXcmDoubleEncoded, StagingXcmV2BodyId, StagingXcmV2BodyPart, StagingXcmV2Instruction, StagingXcmV2Junction, StagingXcmV2MultiAsset, StagingXcmV2MultiLocation, StagingXcmV2MultiassetAssetId, StagingXcmV2MultiassetAssetInstance, StagingXcmV2MultiassetFungibility, StagingXcmV2MultiassetMultiAssetFilter, StagingXcmV2MultiassetMultiAssets, StagingXcmV2MultiassetWildFungibility, StagingXcmV2MultiassetWildMultiAsset, StagingXcmV2MultilocationJunctions, StagingXcmV2NetworkId, StagingXcmV2OriginKind, StagingXcmV2Response, StagingXcmV2TraitsError, StagingXcmV2WeightLimit, StagingXcmV2Xcm, StagingXcmV3Instruction, StagingXcmV3Junction, StagingXcmV3JunctionBodyId, StagingXcmV3JunctionBodyPart, StagingXcmV3JunctionNetworkId, StagingXcmV3Junctions, StagingXcmV3MaybeErrorCode, StagingXcmV3MultiAsset, StagingXcmV3MultiLocation, StagingXcmV3MultiassetAssetId, StagingXcmV3MultiassetAssetInstance, StagingXcmV3MultiassetFungibility, StagingXcmV3MultiassetMultiAssetFilter, StagingXcmV3MultiassetMultiAssets, StagingXcmV3MultiassetWildFungibility, StagingXcmV3MultiassetWildMultiAsset, StagingXcmV3PalletInfo, StagingXcmV3QueryResponseInfo, StagingXcmV3Response, StagingXcmV3TraitsError, StagingXcmV3TraitsOutcome, StagingXcmV3WeightLimit, StagingXcmV3Xcm, StagingXcmVersionedAssetId, StagingXcmVersionedMultiAsset, StagingXcmVersionedMultiAssets, StagingXcmVersionedMultiLocation, StagingXcmVersionedResponse, StagingXcmVersionedXcm, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission,
9 UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, UpPovEstimateRpcPovInfo, UpPovEstimateRpcTrieKeyValue } from '@polkadot/types/lookup';
9import type { Data, StorageKey } from '@polkadot/types';10import type { Data, StorageKey } from '@polkadot/types';
10import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, ISize, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, isize, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';11import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, ISize, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, isize, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
11import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';12import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
325 CoreState: CoreState;326 CoreState: CoreState;
326 CrateVersion: CrateVersion;327 CrateVersion: CrateVersion;
327 CreatedBlock: CreatedBlock;328 CreatedBlock: CreatedBlock;
328 CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall;
329 CumulusPalletDmpQueueConfigData: CumulusPalletDmpQueueConfigData;
330 CumulusPalletDmpQueueError: CumulusPalletDmpQueueError;
331 CumulusPalletDmpQueueEvent: CumulusPalletDmpQueueEvent;
332 CumulusPalletDmpQueuePageIndexData: CumulusPalletDmpQueuePageIndexData;
333 CumulusPalletParachainSystemCall: CumulusPalletParachainSystemCall;
334 CumulusPalletParachainSystemCodeUpgradeAuthorization: CumulusPalletParachainSystemCodeUpgradeAuthorization;
335 CumulusPalletParachainSystemError: CumulusPalletParachainSystemError;
336 CumulusPalletParachainSystemEvent: CumulusPalletParachainSystemEvent;
337 CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot;
338 CumulusPalletParachainSystemRelayStateSnapshotRelayDispatchQueueRemainingCapacity: CumulusPalletParachainSystemRelayStateSnapshotRelayDispatchQueueRemainingCapacity;
339 CumulusPalletParachainSystemUnincludedSegmentAncestor: CumulusPalletParachainSystemUnincludedSegmentAncestor;
340 CumulusPalletParachainSystemUnincludedSegmentHrmpChannelUpdate: CumulusPalletParachainSystemUnincludedSegmentHrmpChannelUpdate;
341 CumulusPalletParachainSystemUnincludedSegmentSegmentTracker: CumulusPalletParachainSystemUnincludedSegmentSegmentTracker;
342 CumulusPalletParachainSystemUnincludedSegmentUsedBandwidth: CumulusPalletParachainSystemUnincludedSegmentUsedBandwidth;
343 CumulusPalletXcmCall: CumulusPalletXcmCall;
344 CumulusPalletXcmError: CumulusPalletXcmError;
345 CumulusPalletXcmEvent: CumulusPalletXcmEvent;
346 CumulusPalletXcmOrigin: CumulusPalletXcmOrigin;
347 CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall;
348 CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError;
349 CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent;
350 CumulusPalletXcmpQueueInboundChannelDetails: CumulusPalletXcmpQueueInboundChannelDetails;
351 CumulusPalletXcmpQueueInboundState: CumulusPalletXcmpQueueInboundState;
352 CumulusPalletXcmpQueueOutboundChannelDetails: CumulusPalletXcmpQueueOutboundChannelDetails;
353 CumulusPalletXcmpQueueOutboundState: CumulusPalletXcmpQueueOutboundState;
354 CumulusPalletXcmpQueueQueueConfigData: CumulusPalletXcmpQueueQueueConfigData;
355 CumulusPrimitivesParachainInherentParachainInherentData: CumulusPrimitivesParachainInherentParachainInherentData;
356 CustomMetadata15: CustomMetadata15;329 CustomMetadata15: CustomMetadata15;
357 CustomValueMetadata15: CustomValueMetadata15;330 CustomValueMetadata15: CustomValueMetadata15;
358 Data: Data;331 Data: Data;
429 EthAddress: EthAddress;402 EthAddress: EthAddress;
430 EthBlock: EthBlock;403 EthBlock: EthBlock;
431 EthBloom: EthBloom;404 EthBloom: EthBloom;
432 EthbloomBloom: EthbloomBloom;
433 EthCallRequest: EthCallRequest;405 EthCallRequest: EthCallRequest;
434 EthereumAccountId: EthereumAccountId;406 EthereumAccountId: EthereumAccountId;
435 EthereumAddress: EthereumAddress;407 EthereumAddress: EthereumAddress;
436 EthereumBlock: EthereumBlock;
437 EthereumHeader: EthereumHeader;
438 EthereumLog: EthereumLog;
439 EthereumLookupSource: EthereumLookupSource;408 EthereumLookupSource: EthereumLookupSource;
440 EthereumReceiptEip658ReceiptData: EthereumReceiptEip658ReceiptData;
441 EthereumReceiptReceiptV3: EthereumReceiptReceiptV3;
442 EthereumSignature: EthereumSignature;409 EthereumSignature: EthereumSignature;
443 EthereumTransactionAccessListItem: EthereumTransactionAccessListItem;
444 EthereumTransactionEip1559Transaction: EthereumTransactionEip1559Transaction;
445 EthereumTransactionEip2930Transaction: EthereumTransactionEip2930Transaction;
446 EthereumTransactionLegacyTransaction: EthereumTransactionLegacyTransaction;
447 EthereumTransactionTransactionAction: EthereumTransactionTransactionAction;
448 EthereumTransactionTransactionSignature: EthereumTransactionTransactionSignature;
449 EthereumTransactionTransactionV2: EthereumTransactionTransactionV2;
450 EthereumTypesHashH64: EthereumTypesHashH64;
451 EthFeeHistory: EthFeeHistory;410 EthFeeHistory: EthFeeHistory;
452 EthFilter: EthFilter;411 EthFilter: EthFilter;
453 EthFilterAddress: EthFilterAddress;412 EthFilterAddress: EthFilterAddress;
489 EvmAccount: EvmAccount;448 EvmAccount: EvmAccount;
490 EvmCallInfo: EvmCallInfo;449 EvmCallInfo: EvmCallInfo;
491 EvmCallInfoV2: EvmCallInfoV2;450 EvmCallInfoV2: EvmCallInfoV2;
492 EvmCoreErrorExitError: EvmCoreErrorExitError;
493 EvmCoreErrorExitFatal: EvmCoreErrorExitFatal;
494 EvmCoreErrorExitReason: EvmCoreErrorExitReason;
495 EvmCoreErrorExitRevert: EvmCoreErrorExitRevert;
496 EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed;
497 EvmCreateInfo: EvmCreateInfo;451 EvmCreateInfo: EvmCreateInfo;
498 EvmCreateInfoV2: EvmCreateInfoV2;452 EvmCreateInfoV2: EvmCreateInfoV2;
499 EvmLog: EvmLog;453 EvmLog: EvmLog;
543 Forcing: Forcing;497 Forcing: Forcing;
544 ForkTreePendingChange: ForkTreePendingChange;498 ForkTreePendingChange: ForkTreePendingChange;
545 ForkTreePendingChangeNode: ForkTreePendingChangeNode;499 ForkTreePendingChangeNode: ForkTreePendingChangeNode;
546 FpRpcTransactionStatus: FpRpcTransactionStatus;
547 FrameSupportDispatchDispatchClass: FrameSupportDispatchDispatchClass;
548 FrameSupportDispatchDispatchInfo: FrameSupportDispatchDispatchInfo;
549 FrameSupportDispatchPays: FrameSupportDispatchPays;
550 FrameSupportDispatchPerDispatchClassU32: FrameSupportDispatchPerDispatchClassU32;
551 FrameSupportDispatchPerDispatchClassWeight: FrameSupportDispatchPerDispatchClassWeight;
552 FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass;
553 FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin;
554 FrameSupportPalletId: FrameSupportPalletId;
555 FrameSupportPreimagesBounded: FrameSupportPreimagesBounded;
556 FrameSupportScheduleDispatchTime: FrameSupportScheduleDispatchTime;
557 FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus;
558 FrameSystemAccountInfo: FrameSystemAccountInfo;
559 FrameSystemCall: FrameSystemCall;
560 FrameSystemError: FrameSystemError;
561 FrameSystemEvent: FrameSystemEvent;
562 FrameSystemEventRecord: FrameSystemEventRecord;
563 FrameSystemExtensionsCheckGenesis: FrameSystemExtensionsCheckGenesis;
564 FrameSystemExtensionsCheckNonce: FrameSystemExtensionsCheckNonce;
565 FrameSystemExtensionsCheckSpecVersion: FrameSystemExtensionsCheckSpecVersion;
566 FrameSystemExtensionsCheckTxVersion: FrameSystemExtensionsCheckTxVersion;
567 FrameSystemExtensionsCheckWeight: FrameSystemExtensionsCheckWeight;
568 FrameSystemLastRuntimeUpgradeInfo: FrameSystemLastRuntimeUpgradeInfo;
569 FrameSystemLimitsBlockLength: FrameSystemLimitsBlockLength;
570 FrameSystemLimitsBlockWeights: FrameSystemLimitsBlockWeights;
571 FrameSystemLimitsWeightsPerClass: FrameSystemLimitsWeightsPerClass;
572 FrameSystemPhase: FrameSystemPhase;
573 FullIdentification: FullIdentification;500 FullIdentification: FullIdentification;
574 FunctionArgumentMetadataLatest: FunctionArgumentMetadataLatest;501 FunctionArgumentMetadataLatest: FunctionArgumentMetadataLatest;
575 FunctionArgumentMetadataV10: FunctionArgumentMetadataV10;502 FunctionArgumentMetadataV10: FunctionArgumentMetadataV10;
807 OffenceDetails: OffenceDetails;734 OffenceDetails: OffenceDetails;
808 Offender: Offender;735 Offender: Offender;
809 OldV1SessionInfo: OldV1SessionInfo;736 OldV1SessionInfo: OldV1SessionInfo;
810 OpalRuntimeOriginCaller: OpalRuntimeOriginCaller;
811 OpalRuntimeRuntime: OpalRuntimeRuntime;
812 OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls: OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls;
813 OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance;
814 OpalRuntimeRuntimeCommonSessionKeys: OpalRuntimeRuntimeCommonSessionKeys;
815 OpalRuntimeRuntimeHoldReason: OpalRuntimeRuntimeHoldReason;
816 OpaqueCall: OpaqueCall;737 OpaqueCall: OpaqueCall;
817 OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof;738 OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof;
818 OpaqueMetadata: OpaqueMetadata;739 OpaqueMetadata: OpaqueMetadata;
831 OriginKindV0: OriginKindV0;752 OriginKindV0: OriginKindV0;
832 OriginKindV1: OriginKindV1;753 OriginKindV1: OriginKindV1;
833 OriginKindV2: OriginKindV2;754 OriginKindV2: OriginKindV2;
834 OrmlTokensAccountData: OrmlTokensAccountData;
835 OrmlTokensBalanceLock: OrmlTokensBalanceLock;
836 OrmlTokensModuleCall: OrmlTokensModuleCall;
837 OrmlTokensModuleError: OrmlTokensModuleError;
838 OrmlTokensModuleEvent: OrmlTokensModuleEvent;
839 OrmlTokensReserveData: OrmlTokensReserveData;
840 OrmlVestingModuleCall: OrmlVestingModuleCall;
841 OrmlVestingModuleError: OrmlVestingModuleError;
842 OrmlVestingModuleEvent: OrmlVestingModuleEvent;
843 OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
844 OrmlXtokensModuleCall: OrmlXtokensModuleCall;
845 OrmlXtokensModuleError: OrmlXtokensModuleError;
846 OrmlXtokensModuleEvent: OrmlXtokensModuleEvent;
847 OutboundHrmpMessage: OutboundHrmpMessage;755 OutboundHrmpMessage: OutboundHrmpMessage;
848 OutboundLaneData: OutboundLaneData;756 OutboundLaneData: OutboundLaneData;
849 OutboundMessageFee: OutboundMessageFee;757 OutboundMessageFee: OutboundMessageFee;
855 Owner: Owner;763 Owner: Owner;
856 PageCounter: PageCounter;764 PageCounter: PageCounter;
857 PageIndexData: PageIndexData;765 PageIndexData: PageIndexData;
858 PalletAppPromotionCall: PalletAppPromotionCall;
859 PalletAppPromotionError: PalletAppPromotionError;
860 PalletAppPromotionEvent: PalletAppPromotionEvent;
861 PalletBalancesAccountData: PalletBalancesAccountData;
862 PalletBalancesBalanceLock: PalletBalancesBalanceLock;
863 PalletBalancesCall: PalletBalancesCall;
864 PalletBalancesError: PalletBalancesError;
865 PalletBalancesEvent: PalletBalancesEvent;
866 PalletBalancesIdAmount: PalletBalancesIdAmount;
867 PalletBalancesReasons: PalletBalancesReasons;
868 PalletBalancesReserveData: PalletBalancesReserveData;
869 PalletCallMetadataLatest: PalletCallMetadataLatest;766 PalletCallMetadataLatest: PalletCallMetadataLatest;
870 PalletCallMetadataV14: PalletCallMetadataV14;767 PalletCallMetadataV14: PalletCallMetadataV14;
871 PalletCollatorSelectionCall: PalletCollatorSelectionCall;
872 PalletCollatorSelectionError: PalletCollatorSelectionError;
873 PalletCollatorSelectionEvent: PalletCollatorSelectionEvent;
874 PalletCollatorSelectionHoldReason: PalletCollatorSelectionHoldReason;
875 PalletCollectiveCall: PalletCollectiveCall;
876 PalletCollectiveError: PalletCollectiveError;
877 PalletCollectiveEvent: PalletCollectiveEvent;
878 PalletCollectiveRawOrigin: PalletCollectiveRawOrigin;
879 PalletCollectiveVotes: PalletCollectiveVotes;
880 PalletCommonError: PalletCommonError;
881 PalletCommonEvent: PalletCommonEvent;
882 PalletConfigurationAppPromotionConfiguration: PalletConfigurationAppPromotionConfiguration;
883 PalletConfigurationCall: PalletConfigurationCall;
884 PalletConfigurationError: PalletConfigurationError;
885 PalletConfigurationEvent: PalletConfigurationEvent;
886 PalletConstantMetadataLatest: PalletConstantMetadataLatest;768 PalletConstantMetadataLatest: PalletConstantMetadataLatest;
887 PalletConstantMetadataV14: PalletConstantMetadataV14;769 PalletConstantMetadataV14: PalletConstantMetadataV14;
888 PalletDemocracyCall: PalletDemocracyCall;
889 PalletDemocracyConviction: PalletDemocracyConviction;
890 PalletDemocracyDelegations: PalletDemocracyDelegations;
891 PalletDemocracyError: PalletDemocracyError;
892 PalletDemocracyEvent: PalletDemocracyEvent;
893 PalletDemocracyMetadataOwner: PalletDemocracyMetadataOwner;
894 PalletDemocracyReferendumInfo: PalletDemocracyReferendumInfo;
895 PalletDemocracyReferendumStatus: PalletDemocracyReferendumStatus;
896 PalletDemocracyTally: PalletDemocracyTally;
897 PalletDemocracyVoteAccountVote: PalletDemocracyVoteAccountVote;
898 PalletDemocracyVotePriorLock: PalletDemocracyVotePriorLock;
899 PalletDemocracyVoteThreshold: PalletDemocracyVoteThreshold;
900 PalletDemocracyVoteVoting: PalletDemocracyVoteVoting;
901 PalletErrorMetadataLatest: PalletErrorMetadataLatest;770 PalletErrorMetadataLatest: PalletErrorMetadataLatest;
902 PalletErrorMetadataV14: PalletErrorMetadataV14;771 PalletErrorMetadataV14: PalletErrorMetadataV14;
903 PalletEthereumCall: PalletEthereumCall;
904 PalletEthereumError: PalletEthereumError;
905 PalletEthereumEvent: PalletEthereumEvent;
906 PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer;
907 PalletEthereumRawOrigin: PalletEthereumRawOrigin;
908 PalletEventMetadataLatest: PalletEventMetadataLatest;772 PalletEventMetadataLatest: PalletEventMetadataLatest;
909 PalletEventMetadataV14: PalletEventMetadataV14;773 PalletEventMetadataV14: PalletEventMetadataV14;
910 PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr;
911 PalletEvmCall: PalletEvmCall;
912 PalletEvmCodeMetadata: PalletEvmCodeMetadata;
913 PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError;
914 PalletEvmContractHelpersCall: PalletEvmContractHelpersCall;
915 PalletEvmContractHelpersError: PalletEvmContractHelpersError;
916 PalletEvmContractHelpersEvent: PalletEvmContractHelpersEvent;
917 PalletEvmContractHelpersSponsoringModeT: PalletEvmContractHelpersSponsoringModeT;
918 PalletEvmError: PalletEvmError;
919 PalletEvmEvent: PalletEvmEvent;
920 PalletEvmMigrationCall: PalletEvmMigrationCall;
921 PalletEvmMigrationError: PalletEvmMigrationError;
922 PalletEvmMigrationEvent: PalletEvmMigrationEvent;
923 PalletForeignAssetsAssetId: PalletForeignAssetsAssetId;
924 PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata;
925 PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall;
926 PalletForeignAssetsModuleError: PalletForeignAssetsModuleError;
927 PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent;
928 PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency;
929 PalletFungibleError: PalletFungibleError;
930 PalletGovOriginsOrigin: PalletGovOriginsOrigin;
931 PalletId: PalletId;774 PalletId: PalletId;
932 PalletIdentityBitFlags: PalletIdentityBitFlags;
933 PalletIdentityCall: PalletIdentityCall;
934 PalletIdentityError: PalletIdentityError;
935 PalletIdentityEvent: PalletIdentityEvent;
936 PalletIdentityIdentityField: PalletIdentityIdentityField;
937 PalletIdentityIdentityInfo: PalletIdentityIdentityInfo;
938 PalletIdentityJudgement: PalletIdentityJudgement;
939 PalletIdentityRegistrarInfo: PalletIdentityRegistrarInfo;
940 PalletIdentityRegistration: PalletIdentityRegistration;
941 PalletInflationCall: PalletInflationCall;
942 PalletMaintenanceCall: PalletMaintenanceCall;
943 PalletMaintenanceError: PalletMaintenanceError;
944 PalletMaintenanceEvent: PalletMaintenanceEvent;
945 PalletMembershipCall: PalletMembershipCall;
946 PalletMembershipError: PalletMembershipError;
947 PalletMembershipEvent: PalletMembershipEvent;
948 PalletMetadataLatest: PalletMetadataLatest;775 PalletMetadataLatest: PalletMetadataLatest;
949 PalletMetadataV14: PalletMetadataV14;776 PalletMetadataV14: PalletMetadataV14;
950 PalletMetadataV15: PalletMetadataV15;777 PalletMetadataV15: PalletMetadataV15;
951 PalletNonfungibleError: PalletNonfungibleError;
952 PalletNonfungibleItemData: PalletNonfungibleItemData;
953 PalletPreimageCall: PalletPreimageCall;
954 PalletPreimageError: PalletPreimageError;
955 PalletPreimageEvent: PalletPreimageEvent;
956 PalletPreimageRequestStatus: PalletPreimageRequestStatus;
957 PalletRankedCollectiveCall: PalletRankedCollectiveCall;
958 PalletRankedCollectiveError: PalletRankedCollectiveError;
959 PalletRankedCollectiveEvent: PalletRankedCollectiveEvent;
960 PalletRankedCollectiveMemberRecord: PalletRankedCollectiveMemberRecord;
961 PalletRankedCollectiveTally: PalletRankedCollectiveTally;
962 PalletRankedCollectiveVoteRecord: PalletRankedCollectiveVoteRecord;
963 PalletReferendaCall: PalletReferendaCall;
964 PalletReferendaCurve: PalletReferendaCurve;
965 PalletReferendaDecidingStatus: PalletReferendaDecidingStatus;
966 PalletReferendaDeposit: PalletReferendaDeposit;
967 PalletReferendaError: PalletReferendaError;
968 PalletReferendaEvent: PalletReferendaEvent;
969 PalletReferendaReferendumInfo: PalletReferendaReferendumInfo;
970 PalletReferendaReferendumStatus: PalletReferendaReferendumStatus;
971 PalletReferendaTrackInfo: PalletReferendaTrackInfo;
972 PalletRefungibleError: PalletRefungibleError;
973 PalletSchedulerCall: PalletSchedulerCall;
974 PalletSchedulerError: PalletSchedulerError;
975 PalletSchedulerEvent: PalletSchedulerEvent;
976 PalletSchedulerScheduled: PalletSchedulerScheduled;
977 PalletSessionCall: PalletSessionCall;
978 PalletSessionError: PalletSessionError;
979 PalletSessionEvent: PalletSessionEvent;
980 PalletsOrigin: PalletsOrigin;778 PalletsOrigin: PalletsOrigin;
981 PalletStateTrieMigrationCall: PalletStateTrieMigrationCall;
982 PalletStateTrieMigrationError: PalletStateTrieMigrationError;
983 PalletStateTrieMigrationEvent: PalletStateTrieMigrationEvent;
984 PalletStateTrieMigrationMigrationCompute: PalletStateTrieMigrationMigrationCompute;
985 PalletStateTrieMigrationMigrationLimits: PalletStateTrieMigrationMigrationLimits;
986 PalletStateTrieMigrationMigrationTask: PalletStateTrieMigrationMigrationTask;
987 PalletStateTrieMigrationProgress: PalletStateTrieMigrationProgress;
988 PalletStorageMetadataLatest: PalletStorageMetadataLatest;779 PalletStorageMetadataLatest: PalletStorageMetadataLatest;
989 PalletStorageMetadataV14: PalletStorageMetadataV14;780 PalletStorageMetadataV14: PalletStorageMetadataV14;
990 PalletStructureCall: PalletStructureCall;
991 PalletStructureError: PalletStructureError;
992 PalletStructureEvent: PalletStructureEvent;
993 PalletSudoCall: PalletSudoCall;
994 PalletSudoError: PalletSudoError;
995 PalletSudoEvent: PalletSudoEvent;
996 PalletTemplateTransactionPaymentChargeTransactionPayment: PalletTemplateTransactionPaymentChargeTransactionPayment;
997 PalletTestUtilsCall: PalletTestUtilsCall;
998 PalletTestUtilsError: PalletTestUtilsError;
999 PalletTestUtilsEvent: PalletTestUtilsEvent;
1000 PalletTimestampCall: PalletTimestampCall;
1001 PalletTransactionPaymentEvent: PalletTransactionPaymentEvent;
1002 PalletTransactionPaymentReleases: PalletTransactionPaymentReleases;
1003 PalletTreasuryCall: PalletTreasuryCall;
1004 PalletTreasuryError: PalletTreasuryError;
1005 PalletTreasuryEvent: PalletTreasuryEvent;
1006 PalletTreasuryProposal: PalletTreasuryProposal;
1007 PalletUniqueCall: PalletUniqueCall;
1008 PalletUniqueError: PalletUniqueError;
1009 PalletUtilityCall: PalletUtilityCall;
1010 PalletUtilityError: PalletUtilityError;
1011 PalletUtilityEvent: PalletUtilityEvent;
1012 PalletVersion: PalletVersion;781 PalletVersion: PalletVersion;
1013 PalletXcmCall: PalletXcmCall;
1014 PalletXcmError: PalletXcmError;
1015 PalletXcmEvent: PalletXcmEvent;
1016 PalletXcmOrigin: PalletXcmOrigin;
1017 PalletXcmQueryStatus: PalletXcmQueryStatus;
1018 PalletXcmRemoteLockedFungibleRecord: PalletXcmRemoteLockedFungibleRecord;
1019 PalletXcmVersionMigrationStage: PalletXcmVersionMigrationStage;
1020 ParachainDispatchOrigin: ParachainDispatchOrigin;782 ParachainDispatchOrigin: ParachainDispatchOrigin;
1021 ParachainInfoCall: ParachainInfoCall;
1022 ParachainInherentData: ParachainInherentData;783 ParachainInherentData: ParachainInherentData;
1023 ParachainProposal: ParachainProposal;784 ParachainProposal: ParachainProposal;
1024 ParachainsInherentData: ParachainsInherentData;785 ParachainsInherentData: ParachainsInherentData;
1058 PerU16: PerU16;819 PerU16: PerU16;
1059 Phantom: Phantom;820 Phantom: Phantom;
1060 PhantomData: PhantomData;821 PhantomData: PhantomData;
1061 PhantomTypeUpDataStructs: PhantomTypeUpDataStructs;
1062 Phase: Phase;822 Phase: Phase;
1063 PhragmenScore: PhragmenScore;823 PhragmenScore: PhragmenScore;
1064 Points: Points;824 Points: Points;
1065 PolkadotCorePrimitivesInboundDownwardMessage: PolkadotCorePrimitivesInboundDownwardMessage;
1066 PolkadotCorePrimitivesInboundHrmpMessage: PolkadotCorePrimitivesInboundHrmpMessage;
1067 PolkadotCorePrimitivesOutboundHrmpMessage: PolkadotCorePrimitivesOutboundHrmpMessage;
1068 PolkadotParachainPrimitivesPrimitivesXcmpMessageFormat: PolkadotParachainPrimitivesPrimitivesXcmpMessageFormat;
1069 PolkadotPrimitivesV5AbridgedHostConfiguration: PolkadotPrimitivesV5AbridgedHostConfiguration;
1070 PolkadotPrimitivesV5AbridgedHrmpChannel: PolkadotPrimitivesV5AbridgedHrmpChannel;
1071 PolkadotPrimitivesV5PersistedValidationData: PolkadotPrimitivesV5PersistedValidationData;
1072 PolkadotPrimitivesV5UpgradeGoAhead: PolkadotPrimitivesV5UpgradeGoAhead;
1073 PolkadotPrimitivesV5UpgradeRestriction: PolkadotPrimitivesV5UpgradeRestriction;
1074 PolkadotPrimitivesVstagingAsyncBackingParams: PolkadotPrimitivesVstagingAsyncBackingParams;
1075 PortableType: PortableType;825 PortableType: PortableType;
1076 PortableTypeV14: PortableTypeV14;826 PortableTypeV14: PortableTypeV14;
1077 Precommits: Precommits;827 Precommits: Precommits;
1284 SolutionSupports: SolutionSupports;1034 SolutionSupports: SolutionSupports;
1285 SpanIndex: SpanIndex;1035 SpanIndex: SpanIndex;
1286 SpanRecord: SpanRecord;1036 SpanRecord: SpanRecord;
1287 SpArithmeticArithmeticError: SpArithmeticArithmeticError;
1288 SpConsensusAuraSr25519AppSr25519Public: SpConsensusAuraSr25519AppSr25519Public;
1289 SpCoreCryptoKeyTypeId: SpCoreCryptoKeyTypeId;
1290 SpCoreEcdsaSignature: SpCoreEcdsaSignature;
1291 SpCoreEd25519Signature: SpCoreEd25519Signature;
1292 SpCoreSr25519Public: SpCoreSr25519Public;
1293 SpCoreSr25519Signature: SpCoreSr25519Signature;
1294 SpCoreVoid: SpCoreVoid;
1295 SpecVersion: SpecVersion;1037 SpecVersion: SpecVersion;
1296 SpRuntimeDigest: SpRuntimeDigest;
1297 SpRuntimeDigestDigestItem: SpRuntimeDigestDigestItem;
1298 SpRuntimeDispatchError: SpRuntimeDispatchError;
1299 SpRuntimeModuleError: SpRuntimeModuleError;
1300 SpRuntimeMultiSignature: SpRuntimeMultiSignature;
1301 SpRuntimeTokenError: SpRuntimeTokenError;
1302 SpRuntimeTransactionalError: SpRuntimeTransactionalError;
1303 SpRuntimeTransactionValidityInvalidTransaction: SpRuntimeTransactionValidityInvalidTransaction;
1304 SpRuntimeTransactionValidityTransactionValidityError: SpRuntimeTransactionValidityTransactionValidityError;
1305 SpRuntimeTransactionValidityUnknownTransaction: SpRuntimeTransactionValidityUnknownTransaction;
1306 SpTrieStorageProof: SpTrieStorageProof;
1307 SpVersionRuntimeVersion: SpVersionRuntimeVersion;
1308 SpWeightsRuntimeDbWeight: SpWeightsRuntimeDbWeight;
1309 SpWeightsWeightV2Weight: SpWeightsWeightV2Weight;
1310 Sr25519Signature: Sr25519Signature;1038 Sr25519Signature: Sr25519Signature;
1311 StagingXcmDoubleEncoded: StagingXcmDoubleEncoded;
1312 StagingXcmV2BodyId: StagingXcmV2BodyId;
1313 StagingXcmV2BodyPart: StagingXcmV2BodyPart;
1314 StagingXcmV2Instruction: StagingXcmV2Instruction;
1315 StagingXcmV2Junction: StagingXcmV2Junction;
1316 StagingXcmV2MultiAsset: StagingXcmV2MultiAsset;
1317 StagingXcmV2MultiassetAssetId: StagingXcmV2MultiassetAssetId;
1318 StagingXcmV2MultiassetAssetInstance: StagingXcmV2MultiassetAssetInstance;
1319 StagingXcmV2MultiassetFungibility: StagingXcmV2MultiassetFungibility;
1320 StagingXcmV2MultiassetMultiAssetFilter: StagingXcmV2MultiassetMultiAssetFilter;
1321 StagingXcmV2MultiassetMultiAssets: StagingXcmV2MultiassetMultiAssets;
1322 StagingXcmV2MultiassetWildFungibility: StagingXcmV2MultiassetWildFungibility;
1323 StagingXcmV2MultiassetWildMultiAsset: StagingXcmV2MultiassetWildMultiAsset;
1324 StagingXcmV2MultiLocation: StagingXcmV2MultiLocation;
1325 StagingXcmV2MultilocationJunctions: StagingXcmV2MultilocationJunctions;
1326 StagingXcmV2NetworkId: StagingXcmV2NetworkId;
1327 StagingXcmV2OriginKind: StagingXcmV2OriginKind;
1328 StagingXcmV2Response: StagingXcmV2Response;
1329 StagingXcmV2TraitsError: StagingXcmV2TraitsError;
1330 StagingXcmV2WeightLimit: StagingXcmV2WeightLimit;
1331 StagingXcmV2Xcm: StagingXcmV2Xcm;
1332 StagingXcmV3Instruction: StagingXcmV3Instruction;
1333 StagingXcmV3Junction: StagingXcmV3Junction;
1334 StagingXcmV3JunctionBodyId: StagingXcmV3JunctionBodyId;
1335 StagingXcmV3JunctionBodyPart: StagingXcmV3JunctionBodyPart;
1336 StagingXcmV3JunctionNetworkId: StagingXcmV3JunctionNetworkId;
1337 StagingXcmV3Junctions: StagingXcmV3Junctions;
1338 StagingXcmV3MaybeErrorCode: StagingXcmV3MaybeErrorCode;
1339 StagingXcmV3MultiAsset: StagingXcmV3MultiAsset;
1340 StagingXcmV3MultiassetAssetId: StagingXcmV3MultiassetAssetId;
1341 StagingXcmV3MultiassetAssetInstance: StagingXcmV3MultiassetAssetInstance;
1342 StagingXcmV3MultiassetFungibility: StagingXcmV3MultiassetFungibility;
1343 StagingXcmV3MultiassetMultiAssetFilter: StagingXcmV3MultiassetMultiAssetFilter;
1344 StagingXcmV3MultiassetMultiAssets: StagingXcmV3MultiassetMultiAssets;
1345 StagingXcmV3MultiassetWildFungibility: StagingXcmV3MultiassetWildFungibility;
1346 StagingXcmV3MultiassetWildMultiAsset: StagingXcmV3MultiassetWildMultiAsset;
1347 StagingXcmV3MultiLocation: StagingXcmV3MultiLocation;
1348 StagingXcmV3PalletInfo: StagingXcmV3PalletInfo;
1349 StagingXcmV3QueryResponseInfo: StagingXcmV3QueryResponseInfo;
1350 StagingXcmV3Response: StagingXcmV3Response;
1351 StagingXcmV3TraitsError: StagingXcmV3TraitsError;
1352 StagingXcmV3TraitsOutcome: StagingXcmV3TraitsOutcome;
1353 StagingXcmV3WeightLimit: StagingXcmV3WeightLimit;
1354 StagingXcmV3Xcm: StagingXcmV3Xcm;
1355 StagingXcmVersionedAssetId: StagingXcmVersionedAssetId;
1356 StagingXcmVersionedMultiAsset: StagingXcmVersionedMultiAsset;
1357 StagingXcmVersionedMultiAssets: StagingXcmVersionedMultiAssets;
1358 StagingXcmVersionedMultiLocation: StagingXcmVersionedMultiLocation;
1359 StagingXcmVersionedResponse: StagingXcmVersionedResponse;
1360 StagingXcmVersionedXcm: StagingXcmVersionedXcm;
1361 StakingLedger: StakingLedger;1039 StakingLedger: StakingLedger;
1362 StakingLedgerTo223: StakingLedgerTo223;1040 StakingLedgerTo223: StakingLedgerTo223;
1363 StakingLedgerTo240: StakingLedgerTo240;1041 StakingLedgerTo240: StakingLedgerTo240;
1459 UnlockChunk: UnlockChunk;1137 UnlockChunk: UnlockChunk;
1460 UnrewardedRelayer: UnrewardedRelayer;1138 UnrewardedRelayer: UnrewardedRelayer;
1461 UnrewardedRelayersState: UnrewardedRelayersState;1139 UnrewardedRelayersState: UnrewardedRelayersState;
1462 UpDataStructsAccessMode: UpDataStructsAccessMode;
1463 UpDataStructsCollection: UpDataStructsCollection;
1464 UpDataStructsCollectionLimits: UpDataStructsCollectionLimits;
1465 UpDataStructsCollectionMode: UpDataStructsCollectionMode;
1466 UpDataStructsCollectionPermissions: UpDataStructsCollectionPermissions;
1467 UpDataStructsCollectionStats: UpDataStructsCollectionStats;
1468 UpDataStructsCreateCollectionData: UpDataStructsCreateCollectionData;
1469 UpDataStructsCreateFungibleData: UpDataStructsCreateFungibleData;
1470 UpDataStructsCreateItemData: UpDataStructsCreateItemData;
1471 UpDataStructsCreateItemExData: UpDataStructsCreateItemExData;
1472 UpDataStructsCreateNftData: UpDataStructsCreateNftData;
1473 UpDataStructsCreateNftExData: UpDataStructsCreateNftExData;
1474 UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData;
1475 UpDataStructsCreateRefungibleExMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;
1476 UpDataStructsCreateRefungibleExSingleOwner: UpDataStructsCreateRefungibleExSingleOwner;
1477 UpDataStructsNestingPermissions: UpDataStructsNestingPermissions;
1478 UpDataStructsOwnerRestrictedSet: UpDataStructsOwnerRestrictedSet;
1479 UpDataStructsProperties: UpDataStructsProperties;
1480 UpDataStructsPropertiesMapBoundedVec: UpDataStructsPropertiesMapBoundedVec;
1481 UpDataStructsPropertiesMapPropertyPermission: UpDataStructsPropertiesMapPropertyPermission;
1482 UpDataStructsProperty: UpDataStructsProperty;
1483 UpDataStructsPropertyKeyPermission: UpDataStructsPropertyKeyPermission;
1484 UpDataStructsPropertyPermission: UpDataStructsPropertyPermission;
1485 UpDataStructsPropertyScope: UpDataStructsPropertyScope;
1486 UpDataStructsRpcCollection: UpDataStructsRpcCollection;
1487 UpDataStructsRpcCollectionFlags: UpDataStructsRpcCollectionFlags;
1488 UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit;
1489 UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32;
1490 UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr;
1491 UpDataStructsTokenChild: UpDataStructsTokenChild;
1492 UpDataStructsTokenData: UpDataStructsTokenData;
1493 UpgradeGoAhead: UpgradeGoAhead;1140 UpgradeGoAhead: UpgradeGoAhead;
1494 UpgradeRestriction: UpgradeRestriction;1141 UpgradeRestriction: UpgradeRestriction;
1495 UpPovEstimateRpcPovInfo: UpPovEstimateRpcPovInfo;
1496 UpPovEstimateRpcTrieKeyValue: UpPovEstimateRpcTrieKeyValue;
1497 UpwardMessage: UpwardMessage;1142 UpwardMessage: UpwardMessage;
1498 usize: usize;1143 usize: usize;
1499 USize: USize;1144 USize: USize;
modifiedjs-packages/types/src/default/definitions.tsdiffbeforeafterboth
1import types from '../lookup';1import types from '../lookup.js';
22
3export default {3export default {
4 types,4 types,
modifiedjs-packages/types/src/definitions.tsdiffbeforeafterboth
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/>.
1616
17export {default as unique} from './unique/definitions';17export {default as unique} from './unique/definitions.js';
18export {default as appPromotion} from './appPromotion/definitions';18export {default as appPromotion} from './appPromotion/definitions.js';
19export {default as povinfo} from './povinfo/definitions';19export {default as povinfo} from './povinfo/definitions.js';
20export {default as default} from './default/definitions';20export {default as default} from './default/definitions.js';
2121
modifiedjs-packages/types/src/registry.tsdiffbeforeafterboth

no syntactic changes

addedjs-packages/types/tsconfig.jsondiffbeforeafterboth

no changes

deletedtests/.dockerignorediffbeforeafterboth

no changes