difftreelog
feat split tests into packages
in: master
179 files changed
.githooks/pre-commitdiffbeforeafterboth28fi28fi292930echo "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="$?"333334if [[ "${ESLINT_EXIT}" = 0 ]]; then34if [[ "${ESLINT_EXIT}" = 0 ]]; then.github/workflows/polkadot-types.ymldiffbeforeafterboth757576 - name: Run generate_types_package script76 - name: Run generate_types_package script77 working-directory: tests77 working-directory: tests78 run: |78 run: |79 yarn install79 yarn install80 /bin/bash ./scripts/wait_for_first_block.sh80 /bin/bash ./scripts/generate_types/wait_for_first_block.sh81 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 }} --push84 env:84 env:85 RPC_URL: http://127.0.0.1:9944/85 RPC_URL: http://127.0.0.1:9944/8686Makefilediffbeforeafterboth7 @echo " bench-unique"7 @echo " bench-unique"889NATIVE_FUNGIBLE_EVM_STUBS=./pallets/balances-adapter/src/stubs9NATIVE_FUNGIBLE_EVM_STUBS=./pallets/balances-adapter/src/stubs10NATIVE_FUNGIBLE_EVM_ABI=./tests/src/eth/abi/nativeFungible.json10NATIVE_FUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/nativeFungible.json111112FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs12FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs13FUNGIBLE_EVM_ABI=./tests/src/eth/abi/fungible.json13FUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/fungible.json141415NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs15NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs16NONFUNGIBLE_EVM_ABI=./tests/src/eth/abi/nonFungible.json16NONFUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/nonFungible.json171718REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs18REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs19REFUNGIBLE_EVM_ABI=./tests/src/eth/abi/reFungible.json19REFUNGIBLE_EVM_ABI=./js-packages/tests/src/eth/abi/reFungible.json20REFUNGIBLE_TOKEN_EVM_ABI=./tests/src/eth/abi/reFungibleToken.json20REFUNGIBLE_TOKEN_EVM_ABI=./js-packages/tests/src/eth/abi/reFungibleToken.json212122CONTRACT_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.json242425COLLECTION_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.json272728TESTS_API=./tests/src/eth/api/28TESTS_API=./js-packages/tests/src/eth/api/292930.PHONY: regenerate_solidity30.PHONY: regenerate_solidity31regenerate_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.soljs-packages/.gitignorediffbeforeafterboth1/node_modules/1/node_modules/2/*/dist/3/*/tsconfig.tsbuildinfo2properties.csv4properties.csv3erc721.csv5erc721.csv4erc20.csv6erc20.csv5.yarn/cache7.yarn/cache6.yarn/install-state.gz8.yarn/install-state.gz7js-packages/package.jsondiffbeforeafterboth3 "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}16559js-packages/playgrounds/package.jsondiffbeforeafterbothno changes
js-packages/playgrounds/src/index.tsdiffbeforeafterbothno syntactic changes
js-packages/playgrounds/src/types.tsdiffbeforeafterboth1// 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.0334import {IKeyringPair} from '@polkadot/types/types';4import type {IKeyringPair} from '@polkadot/types/types';556export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;6export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;77js-packages/playgrounds/src/unique.dev.tsdiffbeforeafterboth1// 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.034import '@unique/opal-types/src/augment-api.js';5import '@unique/opal-types/src/augment-types.js';6import '@unique/opal-types/src/types-lookup.js';374import {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';182319export 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 }277282278 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 }506511507 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 };810816811 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 }139013961391 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 }139514011502 this.options = options.options;1508 this.options = options.options;1503 }1509 }150415101505 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);150715131508 const mandatorySchedArgs = [1514 const mandatorySchedArgs = [js-packages/playgrounds/src/unique.governance.tsdiffbeforeafterboth1import {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';556export class CollectiveGroup extends HelperGroup<UniqueHelper> {6export class CollectiveGroup extends HelperGroup<UniqueHelper> {7 /**7 /**js-packages/playgrounds/src/unique.tsdiffbeforeafterboth6/* eslint-disable no-prototype-builtins */6/* eslint-disable no-prototype-builtins */778import {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';474348export class CrossAccountId {44export class CrossAccountId {49 Substrate!: TSubstrateAccount;45 account: ICrossAccountId;50 Ethereum!: TEthereumAccount;514652 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 }565057 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 }686269 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 }726673 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 }767177 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 }817684 }79 }858086 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 }908586 static toEthereum(account: ICrossAccountId): ICrossAccountId {87 if('Substrate' in account) return {Ethereum: CrossAccountId.translateSubToEth(account.Substrate)};88 return account;89 }9091 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 }949495 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 }9999100 static toSubstrate(account: ICrossAccountId, ss58Format?: number): ICrossAccountId {101 if('Ethereum' in account) return {Substrate: CrossAccountId.translateEthToSub(account.Ethereum, ss58Format)};102 return account;103 }104100 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 }109110 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 }115116 toICrossAccountId(): ICrossAccountId {117 return this.account;118 }105}119}106120107const nesting = {121const nesting = {141 RPC: 'rpc',155 RPC: 'rpc',142 };156 };143157144 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 }147161148 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}304313305class 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 }310319311 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;314323322 return obj;331 return obj;323 }332 }324333325 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 }328337329 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-vars364export 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 Get372type 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;375384376export class ChainHelperBase {385export class ChainHelperBase {377 helperBase: any;386 helperBase: any;432441433 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;527536528 // TODO: investigate how to replace rpc in runtime537 // TODO: investigate how to replace rpc in runtime529 // 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) => Invalid673 >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) => Invalid739 >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 administrators894 */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[];897906898 return normalize907 return normalize899 ? admins.map((address: CrossAccountId) => address.withNormalizedSubstrate())908 ? admins.map(address => CrossAccountId.withNormalizedSubstrate(address))900 : admins;909 : admins;901 }910 }902911907 * @example await getAllowList(1)916 * @example await getAllowList(1)908 * @returns array of allow-listed addresses917 * @returns array of allow-listed addresses909 */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 normalize913 ? allowListed.map((address: CrossAccountId) => address.withNormalizedSubstrate())922 ? allowListed.map(address => CrossAccountId.withNormalizedSubstrate(address))914 : allowListed;923 : allowListed;915 }924 }9169251372 * @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 }137813871439 */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 }146814711474 * @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 }148614891487 /**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 UniqueNFTCollection1704 */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 }170817111713 * @example getTokenObject(10, 5);1716 * @example getTokenObject(10, 5);1714 * @returns instance of UniqueNFTToken1717 * @returns instance of UniqueNFTToken1715 */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 }171917221725 * @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 }173017331731 /**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 }174417471754 * @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 }176017631789 * })1792 * })1790 * @returns object of the created collection1793 * @returns object of the created collection1791 */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 }179517981883 * @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 UniqueRFTCollection1898 */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 }190219051907 * @example getTokenObject(10, 5);1910 * @example getTokenObject(10, 5);1908 * @returns instance of UniqueNFTToken1911 * @returns instance of UniqueNFTToken1909 */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 }191319161918 * @example getTokenTop10Owners(10, 5);1921 * @example getTokenTop10Owners(10, 5);1919 * @returns array of top 10 owners1922 * @returns array of top 10 owners1920 */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 }192419271925 /**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 }195019531959 * @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 }196519681975 * })1978 * })1976 * @returns object of the created collection1979 * @returns object of the created collection1977 */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 }198119842003 return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId);2006 return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId);2004 }2007 }200520082006 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 }201620192017 /**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 }205320562061 * @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 }206720702076 * @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 false2078 */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 }208220852202 * @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 }220822112209 /**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}`*/);239223952393 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);245924622460 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);257425772575 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.events2601 .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.events2629 .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 representation2643 */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 }264726502648 /**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 }336533683366 nestingAccount() {3369 nestingAccount(): ICrossAccountId {3367 return this.collection.helper.util.getTokenAccount(this);3370 return this.collection.helper.util.getTokenAccount(this);3368 }3371 }3369}3372}337033733371export class UniqueNFToken extends UniqueBaseToken {3374export class UniqueNFToken extends UniqueBaseToken {3372 collection: UniqueNFTCollection;3375 declare collection: UniqueNFTCollection;337333763374 constructor(tokenId: number, collection: UniqueNFTCollection) {3377 constructor(tokenId: number, collection: UniqueNFTCollection) {3375 super(tokenId, collection);3378 super(tokenId, collection);3426}3429}342734303428export class UniqueRFToken extends UniqueBaseToken {3431export class UniqueRFToken extends UniqueBaseToken {3429 collection: UniqueRFTCollection;3432 declare collection: UniqueRFTCollection;343034333431 constructor(tokenId: number, collection: UniqueRFTCollection) {3434 constructor(tokenId: number, collection: UniqueRFTCollection) {3432 super(tokenId, collection);3435 super(tokenId, collection);js-packages/playgrounds/src/unique.xcm.tsdiffbeforeafterboth1import {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';66778export 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,js-packages/playgrounds/tsconfig.jsondiffbeforeafterbothno changes
js-packages/scripts/package.jsondiffbeforeafterbothno changes
js-packages/scripts/src/benchmarks/mintFee/index.tsdiffbeforeafterboth1import {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';131214const {dirname} = makeNames(import.meta.url);13const {dirname} = makeNames(import.meta.url);1514js-packages/scripts/src/benchmarks/nesting/ABIGEN/RMRKNestableMintable.tsdiffbeforeafterboth8import 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";171618export interface EventOptions {17export interface EventOptions {19 filter?: object;18 filter?: object;js-packages/scripts/src/benchmarks/nesting/ABIGEN/index.tsdiffbeforeafterboth1/* 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";55js-packages/scripts/src/benchmarks/nesting/ABIGEN/types.tsdiffbeforeafterboth3/* 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";889export interface EstimateGasOptions {9export interface EstimateGasOptions {js-packages/scripts/src/benchmarks/nesting/index.tsdiffbeforeafterboth1import {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';91010const {dirname} = makeNames(import.meta.url);11const {dirname} = makeNames(import.meta.url);111212export 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 {js-packages/scripts/src/benchmarks/opsFee/index.tsdiffbeforeafterboth1import {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';1113121413const {dirname} = makeNames(import.meta.url);15const {dirname} = makeNames(import.meta.url);js-packages/scripts/src/benchmarks/utils/common.tsdiffbeforeafterboth1import {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';556export const PROPERTIES = Array(40)6export const PROPERTIES = Array(40)7 .fill(0)7 .fill(0)js-packages/scripts/src/calibrate.tsdiffbeforeafterboth1import {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';344class Fract {5class Fract {5 static ZERO = new Fract(0n);6 static ZERO = new Fract(0n);174175175const hypothesisLinear = (a: Fract, b: Fract) => (x: Fract) => rpn(x, a, '*', b, '+');176const hypothesisLinear = (a: Fract, b: Fract) => (x: Fract) => rpn(x, a, '*', b, '+');176177177function _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;181182182 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// }185186186async 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');js-packages/scripts/src/calibrateApply.tsdiffbeforeafterboth1import {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';546const {dirname} = makeNames(import.meta.url);5const {dirname} = makeNames(import.meta.url);7610(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();js-packages/scripts/src/fetchMetadata.tsdiffbeforeafterboth25 }),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);js-packages/scripts/src/generateEnv.tsdiffbeforeafterboth1import {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';556const {dirname} = makeNames(import.meta.url);6const {dirname} = makeNames(import.meta.url);77js-packages/scripts/src/generate_types/readyness.jsdiffbeforeafterboth9 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');111112}12};131314const sleep = time => {14const sleep = time => new Promise(resolve => {15 return new Promise(resolve => {16 setTimeout(() => resolve(), time);15 setTimeout(() => resolve(), time);17 });16});18};191720const main = async () => {18const main = async () => {19 // eslint-disable-next-line no-constant-condition21 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};323133main().then(() => process.exit(0)).catch(e => {32main().then(() => process.exit(0)).catch(e => {34 console.error(e);33 console.error(e);js-packages/scripts/src/metadata.jsondiffbeforeafterbothno changes
js-packages/scripts/src/transfer.nload.tsdiffbeforeafterboth161617/* 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-106341534623const cluster = notReallyCluster as unknown as notReallyCluster.Cluster;23const cluster = notReallyCluster as unknown as notReallyCluster.Cluster;2424js-packages/scripts/tsconfig.jsondiffbeforeafterbothno changes
js-packages/tests/package.jsondiffbeforeafterbothno changes
js-packages/tests/src/addCollectionAdmin.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('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;js-packages/tests/src/adminTransferAndBurn.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('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;404041 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 });454546 itSub('admin burns other user\'s token', async ({helper}) => {46 itSub('admin burns other user\'s token', async ({helper}) => {js-packages/tests/src/allowLists.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202121describe('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 });182183183 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}) => {190191191 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 });195196196 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}) => {202203203 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 });207208208 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}) => {215216216 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 });221222js-packages/tests/src/apiConsts.test.tsdiffbeforeafterboth15// 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/>.161617import {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';1919202021const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;21const MAX_COLLECTION_DESCRIPTION_LENGTH = 256n;js-packages/tests/src/approve.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';20202121222223[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 });163163164 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 });559559560 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});563563564 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 });569569570 itSub('Fungible up to an approved amount', async ({helper}) => {570 itSub('Fungible up to an approved amount', async ({helper}) => {js-packages/tests/src/burnItem.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';1919202021describe('integration test: ext. burnItem():', () => {21describe('integration test: ext. burnItem():', () => {js-packages/tests/src/change-collection-owner.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {21describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;js-packages/tests/src/check-event/burnItemEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';2121222223describe('Burn Item event ', () => {23describe('Burn Item event ', () => {js-packages/tests/src/check-event/createCollectionEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122describe('Create collection event ', () => {22describe('Create collection event ', () => {23 let alice: IKeyringPair;23 let alice: IKeyringPair;js-packages/tests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122describe('Create Item event ', () => {22describe('Create Item event ', () => {23 let alice: IKeyringPair;23 let alice: IKeyringPair;js-packages/tests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122describe('Create Multiple Items Event event ', () => {22describe('Create Multiple Items Event event ', () => {23 let alice: IKeyringPair;23 let alice: IKeyringPair;js-packages/tests/src/check-event/destroyCollectionEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122describe('Destroy collection event ', () => {22describe('Destroy collection event ', () => {23 let alice: IKeyringPair;23 let alice: IKeyringPair;js-packages/tests/src/check-event/transferEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122describe('Transfer event ', () => {22describe('Transfer event ', () => {23 let alice: IKeyringPair;23 let alice: IKeyringPair;js-packages/tests/src/check-event/transferFromEvent.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122describe('Transfer event ', () => {22describe('Transfer event ', () => {23 let alice: IKeyringPair;23 let alice: IKeyringPair;js-packages/tests/src/collator-selection/collatorSelection.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920async function nodeAddress(name: string) {20async function nodeAddress(name: string) {21 // eslint-disable-next-line require-await21 // eslint-disable-next-line require-await22 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`;242425 const nodeStash = process.env[envNodeStash];25 const nodeStash = process.env[envNodeStash];91 let deltaNode: string;91 let deltaNode: string;929293 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 mode96 // 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[];138138139 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);142142143 // set session keys for everyone143 // set session keys for everyone219 let crowd: IKeyringPair[];219 let crowd: IKeyringPair[];220220221 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);224224225 // set session keys for everyone225 // set session keys for everyonejs-packages/tests/src/collator-selection/identity.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021async function getIdentities(helper: UniqueHelper) {21async function getIdentities(helper: UniqueHelper) {22 const identities: [string, any][] = [];22 const identities: [string, any][] = [];js-packages/tests/src/confirmSponsorship.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021async 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);js-packages/tests/src/connection.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {itSub, expect, usingPlaygrounds} from './util';17import {itSub, expect, usingPlaygrounds} from './util/index.js';181819describe('Connection smoke test', () => {19describe('Connection smoke test', () => {20 itSub('Connection can be established', async ({helper}) => {20 itSub('Connection can be established', async ({helper}) => {js-packages/tests/src/createCollection.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212222async 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;js-packages/tests/src/createItem.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122async 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;js-packages/tests/src/createMultipleItems.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('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 });js-packages/tests/src/createMultipleItemsEx.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test: createMultipleItemsEx', () => {21describe('Integration Test: createMultipleItemsEx', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;js-packages/tests/src/creditFeesToTreasury.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import './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';212122const 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) {js-packages/tests/src/destroyCollection.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('integration test: ext. destroyCollection():', () => {20describe('integration test: ext. destroyCollection():', () => {21 let alice: IKeyringPair;21 let alice: IKeyringPair;js-packages/tests/src/enableDisableTransfer.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Enable/Disable Transfers', () => {20describe('Enable/Disable Transfers', () => {21 let alice: IKeyringPair;21 let alice: IKeyringPair;js-packages/tests/src/eth/allowlist.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122describe('EVM contract allowlist', () => {22describe('EVM contract allowlist', () => {23 let donor: IKeyringPair;23 let donor: IKeyringPair;js-packages/tests/src/eth/base.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';1920202121describe('Contract calls', () => {22describe('Contract calls', () => {js-packages/tests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth13// You should have received a copy of the GNU General Public License13// You should have received a copy of the GNU General Public License14// 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/>.151516import {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';232324async 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));js-packages/tests/src/eth/collectionHelperAddress.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {21describe('[eth]CollectionHelperAddress test: ERC20/ERC721 ', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;232324 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 });js-packages/tests/src/eth/collectionLimits.test.tsdiffbeforeafterboth1import {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';55667describe('Can set collection limits', () => {7describe('Can set collection limits', () => {js-packages/tests/src/eth/collectionProperties.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122describe('EVM collection properties', () => {22describe('EVM collection properties', () => {23 let donor: IKeyringPair;23 let donor: IKeyringPair;js-packages/tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122describe('evm nft collection sponsoring', () => {22describe('evm nft collection sponsoring', () => {23 let donor: IKeyringPair;23 let donor: IKeyringPair;js-packages/tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';222223describe('Sponsoring EVM contracts', () => {23describe('Sponsoring EVM contracts', () => {24 let donor: IKeyringPair;24 let donor: IKeyringPair;433 callerBalanceBefore = callerBalanceAfter;433 callerBalanceBefore = callerBalanceAfter;434 };434 };435435436 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);js-packages/tests/src/eth/createCollection.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';232424const DECIMALS = 18;25const DECIMALS = 18;25const CREATE_COLLECTION_DATA_DEFAULTS_ARRAY = [26const CREATE_COLLECTION_DATA_DEFAULTS_ARRAY = [js-packages/tests/src/eth/createFTCollection.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021const DECIMALS = 18;21const DECIMALS = 18;2222js-packages/tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';222223const DECIMALS = 18;23const DECIMALS = 18;2424js-packages/tests/src/eth/createNFTCollection.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';1919202021describe('Create NFT collection from EVM', () => {21describe('Create NFT collection from EVM', () => {js-packages/tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth15// 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/>.161617import {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';2221232224describe('Create NFT collection from EVM', () => {23describe('Create NFT collection from EVM', () => {js-packages/tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth15// 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/>.161617import {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';2222232324describe('Create RFT collection from EVM', () => {24describe('Create RFT collection from EVM', () => {js-packages/tests/src/eth/crossTransfer.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('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 });333334 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();373838 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});404141 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 });4647565757 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});636475 });76 });767777 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();798080 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 });878888 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}) => {js-packages/tests/src/eth/destroyCollection.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';222223describe('Destroy Collection from EVM', function() {23describe('Destroy Collection from EVM', function() {24 let donor: IKeyringPair;24 let donor: IKeyringPair;js-packages/tests/src/eth/ethFeesAreCorrect.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('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);454546 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;5050js-packages/tests/src/eth/events.test.tsdiffbeforeafterboth15// 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/>.161617import {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';232524let donor: IKeyringPair;26let donor: IKeyringPair;2527498 const mode: TCollectionMode = 'rft';500 const mode: TCollectionMode = 'rft';499501500 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 });506508js-packages/tests/src/eth/evmCoder.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920const getContractSource = (collectionAddress: string, contractAddress: string): string => `20const getContractSource = (collectionAddress: string, contractAddress: string): string => `21 // SPDX-License-Identifier: MIT21 // SPDX-License-Identifier: MITjs-packages/tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth171718import {readFile} from 'fs/promises';18import {readFile} from 'fs/promises';191920import {IKeyringPair} from '@polkadot/types/types';20import type {IKeyringPair} from '@polkadot/types/types';21import {evmToAddress} from '@polkadot/util-crypto';21import {evmToAddress} from '@polkadot/util-crypto';222223import {Contract} from 'web3-eth-contract';23import {Contract} from 'web3-eth-contract';242425import {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';282929const {dirname} = makeNames(import.meta.url);30const {dirname} = makeNames(import.meta.url);3031js-packages/tests/src/eth/fungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Fungible: Plain calls', () => {20describe('Fungible: Plain calls', () => {21 let donor: IKeyringPair;21 let donor: IKeyringPair;js-packages/tests/src/eth/getCode.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('RPC eth_getCode', () => {21describe('RPC eth_getCode', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;232324 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 });js-packages/tests/src/eth/helpersSmoke.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Helpers sanity check', () => {20describe('Helpers sanity check', () => {21 let donor: IKeyringPair;21 let donor: IKeyringPair;js-packages/tests/src/eth/marketplace-v2/marketplace.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import 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';232424const {dirname} = makeNames(import.meta.url);25const {dirname} = makeNames(import.meta.url);252654 },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 }100101101 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 }107109108 itEth('Put + Buy [eth]', async ({helper}) => {110 itEth('Put + Buy [eth]', async ({helper}) => {js-packages/tests/src/eth/marketplace/marketplace.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122const {dirname} = makeNames(import.meta.url);22const {dirname} = makeNames(import.meta.url);2323js-packages/tests/src/eth/migration.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021import {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';232424const 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());333434 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};373938describe('EVM Migrations', () => {40describe('EVM Migrations', () => {js-packages/tests/src/eth/nativeFungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('NativeFungible: ERC20 calls', () => {21describe('NativeFungible: ERC20 calls', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;232324 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;129129130 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 });js-packages/tests/src/eth/nativeRpc/estimateGas.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';1919202021describe('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';242425 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 });js-packages/tests/src/eth/nesting/nest.test.tsdiffbeforeafterboth1import {IKeyringPair} from '@polkadot/types/types';1import type {IKeyringPair} from '@polkadot/types/types';2import {Contract} from 'web3-eth-contract';2import {Contract} from 'web3-eth-contract';334import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util';4import {itEth, usingEthPlaygrounds, expect} from '../util/index.js';5import {EthUniqueHelper} from '../util/playgrounds/unique.dev.js';566const createNestingCollection = async (7const createNestingCollection = async (7 helper: EthUniqueHelper,8 helper: EthUniqueHelper,js-packages/tests/src/eth/nonFungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';222323describe('Check ERC721 token URI for NFT', () => {24describe('Check ERC721 token URI for NFT', () => {24 let donor: IKeyringPair;25 let donor: IKeyringPair;js-packages/tests/src/eth/payable.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';181819import {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';212222const {dirname} = makeNames(import.meta.url);23const {dirname} = makeNames(import.meta.url);2324js-packages/tests/src/eth/precompile.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';181819import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util/index.js';202021describe('Precompiles', () => {21describe('Precompiles', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;js-packages/tests/src/eth/proxy/fungibleProxy.test.tsdiffbeforeafterboth161617import {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';222323const {dirname} = makeNames(import.meta.url);24const {dirname} = makeNames(import.meta.url);2425js-packages/tests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth15// 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/>.161617import {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';212222const {dirname} = makeNames(import.meta.url);23const {dirname} = makeNames(import.meta.url);2324js-packages/tests/src/eth/proxyContract.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';181819import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util';19import {itEth, expect, usingEthPlaygrounds} from './util/index.js';20import {EthUniqueHelper} from './util/playgrounds/unique.dev.js';202121describe('EVM payable contracts', () => {22describe('EVM payable contracts', () => {22 let donor: IKeyringPair;23 let donor: IKeyringPair;js-packages/tests/src/eth/reFungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';222223describe('Refungible: Plain calls', () => {23describe('Refungible: Plain calls', () => {24 let donor: IKeyringPair;24 let donor: IKeyringPair;js-packages/tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212222// FIXME: Need erc721 for ReFubgible.23// FIXME: Need erc721 for ReFubgible.js-packages/tests/src/eth/scheduling.test.tsdiffbeforeafterboth15// 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/>.161617import {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';202121describe('Scheduing EVM smart contracts', () => {22describe('Scheduing EVM smart contracts', () => {222323 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 });2829js-packages/tests/src/eth/sponsoring.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('EVM sponsoring', () => {21describe('EVM sponsoring', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;js-packages/tests/src/eth/tokenProperties.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';242425describe('EVM token properties', () => {25describe('EVM token properties', () => {26 let donor: IKeyringPair;26 let donor: IKeyringPair;js-packages/tests/src/eth/tokens/callMethodsERC20.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122[22[23 {mode: 'ft' as const, requiredPallets: []},23 {mode: 'ft' as const, requiredPallets: []},js-packages/tests/src/eth/tokens/callMethodsERC721.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';2121222223describe('ERC-721 call methods', () => {23describe('ERC-721 call methods', () => {24 let donor: IKeyringPair;24 let donor: IKeyringPair;252526 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 });js-packages/tests/src/eth/tokens/minting.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';2121222223describe('Minting tokens', () => {23describe('Minting tokens', () => {js-packages/tests/src/eth/transferValue.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Send value to contract', () => {21describe('Send value to contract', () => {js-packages/tests/src/eth/util/index.tsdiffbeforeafterboth2// SPDX-License-Identifier: Apache-2.02// SPDX-License-Identifier: Apache-2.0334import * as path from 'path';4import * as path from 'path';5import {IKeyringPair} from '@polkadot/types/types';5import type {IKeyringPair} from '@polkadot/types/types';667import config from '../../config';7import config from '../../config.js';889import {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';1213export {EthUniqueHelper} from './playgrounds/unique.dev';12import type {SchedKind} from '../../util/index.js';141315import 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';191820chai.use(chaiAsPromised);19chai.use(chaiAsPromised);21chai.use(chaiLike);20chai.use(chaiLike);js-packages/tests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth1import {CollectionFlag, TCollectionMode} from '../../../util/playgrounds/types';1import {CollectionFlag} from '@unique/playgrounds/src/types.js';2import type {TCollectionMode} from '@unique/playgrounds/src/types.js';233export interface ContractImports {4export interface ContractImports {4 solPath: string;5 solPath: string;js-packages/tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth14import solc from 'solc';14import solc from 'solc';151516import {evmToAddress} from '@polkadot/util-crypto';16import {evmToAddress} from '@polkadot/util-crypto';17import {IKeyringPair} from '@polkadot/types/types';17import type {IKeyringPair} from '@polkadot/types/types';181819import {ArrangeGroup, DevUniqueHelper} from '../../../util/playgrounds/unique.dev';19import {ArrangeGroup, DevUniqueHelper} from '@unique/playgrounds/src/unique.dev.js';202021import {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';222323// Native contracts ABI24// Native contracts ABI24import 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';373738class EthGroupBase {38class EthGroupBase {39 helper: EthUniqueHelper;39 helper: EthUniqueHelper;192192193 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 number195 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 }347349348 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 }351353459461460 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 }464466465 extractTokenId(address: string): { collectionId: number, tokenId: number } {467 extractTokenId(address: string): { collectionId: number, tokenId: number } {545}547}546548547class EthArrangeGroup extends ArrangeGroup {549class EthArrangeGroup extends ArrangeGroup {548 helper: EthUniqueHelper;550 declare helper: EthUniqueHelper;549551550 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;563565564 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;573575582 super.arrange = this.arrange;584 super.arrange = this.arrange;583 }585 }584586585 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 }589591590 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 }595597596 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();599601600 await super.disconnect();602 await super.disconnect();601 }603 }602604603 clearApi() {605 override clearApi() {604 super.clearApi();606 super.clearApi();605 this.web3 = null;607 this.web3 = null;606 }608 }607609608 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;js-packages/tests/src/fungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920const U128_MAX = (1n << 128n) - 1n;20const U128_MAX = (1n << 128n) - 1n;2121js-packages/tests/src/getPropertiesRpc.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021const collectionProps = [21const collectionProps = [22 {key: 'col-0', value: 'col-0-value'},22 {key: 'col-0', value: 'col-0-value'},js-packages/tests/src/governance/council.test.tsdiffbeforeafterboth112import {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';677describeGov('Governance: Council tests', () => {8describeGov('Governance: Council tests', () => {8 let donor: IKeyringPair;9 let donor: IKeyringPair;js-packages/tests/src/governance/democracy.test.tsdiffbeforeafterboth1import {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';556describeGov('Governance: Democracy tests', () => {6describeGov('Governance: Democracy tests', () => {7 let regularUser: IKeyringPair;7 let regularUser: IKeyringPair;js-packages/tests/src/governance/fellowship.test.tsdiffbeforeafterboth1import {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';566describeGov('Governance: Fellowship tests', () => {7describeGov('Governance: Fellowship tests', () => {7 let members: IKeyringPair[][];8 let members: IKeyringPair[][];js-packages/tests/src/governance/init.test.tsdiffbeforeafterboth1import {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';566describeGov('Governance: Initialization', () => {7describeGov('Governance: Initialization', () => {7 let donor: IKeyringPair;8 let donor: IKeyringPair;js-packages/tests/src/governance/technicalCommittee.test.tsdiffbeforeafterboth1import {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';566describeGov('Governance: Technical Committee tests', () => {7describeGov('Governance: Technical Committee tests', () => {7 let sudoer: IKeyringPair;8 let sudoer: IKeyringPair;190 });191 });191192192193193 itSub.skip('[Negative] TechComm cannot promote/demote Fellowship member', async ({helper}) => {194 itSub.skip('[Negative] TechComm cannot promote/demote Fellowship member', async () => {194195195 });196 });196197197 itSub.skip('[Negative] TechComm member cannot promote/demote Fellowship member', async ({helper}) => {198 itSub.skip('[Negative] TechComm member cannot promote/demote Fellowship member', async () => {198199199 });200 });200201338 )).to.be.rejectedWith('BadOrigin');339 )).to.be.rejectedWith('BadOrigin');339 });340 });340341341 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 () => {342343343 });344 });344345js-packages/tests/src/governance/util.tsdiffbeforeafterboth1import {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';677export const democracyLaunchPeriod = 35;8export const democracyLaunchPeriod = 35;8export const democracyVotingPeriod = 35;9export const democracyVotingPeriod = 35;173174174export 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 }js-packages/tests/src/inflation.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920// todo:playgrounds requires sudo, look into on the later stage20// todo:playgrounds requires sudo, look into on the later stage21describe('integration test: Inflation', () => {21describe('integration test: Inflation', () => {js-packages/tests/src/limits.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Number of tokens per address (NFT)', () => {20describe('Number of tokens per address (NFT)', () => {21 let alice: IKeyringPair;21 let alice: IKeyringPair;js-packages/tests/src/maintenance.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';222423async 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;319321320 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();js-packages/tests/src/migrations/942057-appPromotion/executeMigration.tsdiffbeforeafterboth1import {migrateLockedToFreeze} from './lockedToFreeze';1import {migrateLockedToFreeze} from './lockedToFreeze.js';22334const 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';js-packages/tests/src/migrations/942057-appPromotion/index.tsdiffbeforeafterboth1import {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';445export const migration: Migration = {5export const migration: Migration = {6 async before() {6 async before() {js-packages/tests/src/migrations/942057-appPromotion/lockedToFreeze.tsdiffbeforeafterboth1// 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';889910const WS_ENDPOINT = config.substrateUrl;10const WS_ENDPOINT = config.substrateUrl;js-packages/tests/src/migrations/correctStateAfterMaintenance.tsdiffbeforeafterboth1import 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';4546const 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());242325 const currentBlock = await api.query.system.number();24 const currentBlock = (await api.query.system.number() as u32).toNumber();262527 const filteredBlocks = pendingBlocks.filter((b) => currentBlock.gt(b));26 const filteredBlocks = pendingBlocks.filter(b => currentBlock > b);282729 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}`);454446 await Promise.allSettled(promises.map((p) => p()));45 await Promise.allSettled(promises.map((p) => p()));474648 const failedBlocks: bigint[] = [];47 const failedBlocks: number[] = [];49 let isSuccess = true;48 let isSuccess = true;504951 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 }js-packages/tests/src/migrations/runCheckState.tsdiffbeforeafterboth1import {main} from './correctStateAfterMaintenance';1import {main} from './correctStateAfterMaintenance.js';223main({3main({4 wsEndpoint: process.env.WS_RPC!,4 wsEndpoint: process.env.WS_RPC!,js-packages/tests/src/nativeFungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Native fungible', () => {20describe('Native fungible', () => {21 let root: IKeyringPair;21 let root: IKeyringPair;js-packages/tests/src/nesting/collectionProperties.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Integration Test: Collection Properties with sudo', () => {20describe('Integration Test: Collection Properties with sudo', () => {21 let superuser: IKeyringPair;21 let superuser: IKeyringPair;js-packages/tests/src/nesting/collectionProperties.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Integration Test: Collection Properties', () => {20describe('Integration Test: Collection Properties', () => {21 let alice: IKeyringPair;21 let alice: IKeyringPair;js-packages/tests/src/nesting/graphs.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021/**21/**22 * ```dot22 * ```dotjs-packages/tests/src/nesting/propertyPermissions.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test: Access Rights to Token Properties', () => {21describe('Integration Test: Access Rights to Token Properties', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;js-packages/tests/src/nesting/tokenProperties.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Integration Test: Token Properties with sudo', () => {20describe('Integration Test: Token Properties with sudo', () => {21 let superuser: IKeyringPair;21 let superuser: IKeyringPair;js-packages/tests/src/nesting/tokenProperties.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test: Token Properties', () => {21describe('Integration Test: Token Properties', () => {22 let alice: IKeyringPair; // collection owner22 let alice: IKeyringPair; // collection ownerjs-packages/tests/src/nesting/unnest.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test: Unnesting', () => {21describe('Integration Test: Unnesting', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;304304305 // Try to unnest305 // Try to unnest306 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()));308308309 // Try to burn309 // Try to burn310 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 });313313314 // todo another test for creating excessive depth matryoshka with Ethereum?314 // todo another test for creating excessive depth matryoshka with Ethereum?js-packages/tests/src/nextSponsoring.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920const SPONSORING_TIMEOUT = 5;20const SPONSORING_TIMEOUT = 5;2121js-packages/tests/src/pallet-presence.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {itSub, usingPlaygrounds, expect} from './util';17import {itSub, usingPlaygrounds, expect} from './util/index.js';181819// Pallets that must always be present19// Pallets that must always be present20const requiredPallets = [20const requiredPallets = [js-packages/tests/src/performance.seq.test.tsdiffbeforeafterboth15// 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/>.161617import {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';222223describe('Performace tests', () => {23describe('Performace tests', () => {24 let alice: IKeyringPair;24 let alice: IKeyringPair;js-packages/tests/src/refungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n;20const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n;2121js-packages/tests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {21describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;js-packages/tests/src/removeCollectionSponsor.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('integration test: ext. removeCollectionSponsor():', () => {21describe('integration test: ext. removeCollectionSponsor():', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;js-packages/tests/src/rpc.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('integration test: RPC methods', () => {21describe('integration test: RPC methods', () => {22 let donor: IKeyringPair;22 let donor: IKeyringPair;55 // Set-up over55 // Set-up over565657 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[];595960 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;626263 // Make sure only 10 results are returned with this RPC63 // Make sure only 10 results are returned with this RPCjs-packages/tests/src/scheduler.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('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);343435 await helper.testUtils.enable();35 await helper.testUtils.enable(Pallets.TestUtils);36 });36 });37 });37 });3838571 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);573573574 await helper.testUtils.enable();574 await helper.testUtils.enable(Pallets.TestUtils);575 });575 });576 });576 });577577js-packages/tests/src/setCollectionLimits.test.tsdiffbeforeafterboth15// 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/>.161617// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits17// https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits18import {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';212122const accountTokenOwnershipLimit = 0;22const accountTokenOwnershipLimit = 0;23const sponsoredDataSize = 0;23const sponsoredDataSize = 0;js-packages/tests/src/setCollectionSponsor.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('integration test: ext. setCollectionSponsor():', () => {21describe('integration test: ext. setCollectionSponsor():', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;js-packages/tests/src/setPermissions.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('Integration Test: Set Permissions', () => {21describe('Integration Test: Set Permissions', () => {22 let alice: IKeyringPair;22 let alice: IKeyringPair;js-packages/tests/src/sub/appPromotion/appPromotion.seqtest.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021let superuser: IKeyringPair;21let superuser: IKeyringPair;22let donor: IKeyringPair;22let donor: IKeyringPair;js-packages/tests/src/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';232324let donor: IKeyringPair;24let donor: IKeyringPair;25let palletAdmin: IKeyringPair;25let palletAdmin: IKeyringPair;js-packages/tests/src/sub/nesting/admin.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';192020describe('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()));575858 // 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 });697075 // 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()));798080 // 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});8788js-packages/tests/src/sub/nesting/common.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021let 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()));555556 // 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 });6363797980 // 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);848485 // 2. Alice can mint and nest token:85 // 2. Alice can mint and nest token:128128129 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);137137145 await nativeFtCollectionToBeNested.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);145 await nativeFtCollectionToBeNested.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);146146147 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()));149149150 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);js-packages/tests/src/sub/nesting/e2e.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';192020describe('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 token120 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()));123124124 // Create a token to be nested125 // Create a token to be nested125 const newToken = await collection.mintToken(alice);126 const newToken = await collection.mintToken(alice);126127127 // Nest128 // Nest128 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()));131132132 // Move bundle to different user133 // Move bundle to different user133 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()));138139139 // Unnest140 // Unnest140 await newToken.unnest(bob, targetToken, {Substrate: bob.address});141 await newToken.unnest(bob, targetToken, {Substrate: bob.address});js-packages/tests/src/sub/nesting/nesting.negative.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122let 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);215215216 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);218218219 const collectionForNesting = await helper.nft.mintCollection(alice);219 const collectionForNesting = await helper.nft.mintCollection(alice);220220js-packages/tests/src/sub/nesting/refungible.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('ReFungible-specific nesting tests', () => {20describe('ReFungible-specific nesting tests', () => {21 let alice: IKeyringPair;21 let alice: IKeyringPair;js-packages/tests/src/sub/nesting/unnesting.negative.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';192020describe('Negative Test: Unnesting', () => {21describe('Negative Test: Unnesting', () => {21 let alice: IKeyringPair;22 let alice: IKeyringPair;484949 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 });535454 [55 [js-packages/tests/src/sub/refungible/burn.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Refungible: burn', () => {20describe('Refungible: burn', () => {21 let donor: IKeyringPair;21 let donor: IKeyringPair;js-packages/tests/src/sub/refungible/nesting.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Refungible nesting', () => {20describe('Refungible nesting', () => {21 let alice: IKeyringPair;21 let alice: IKeyringPair;js-packages/tests/src/sub/refungible/repartition.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('integration test: Refungible functionality:', () => {20describe('integration test: Refungible functionality:', () => {21 let donor: IKeyringPair;21 let donor: IKeyringPair;js-packages/tests/src/sub/refungible/transfer.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Refungible transfer tests', () => {20describe('Refungible transfer tests', () => {21 let donor: IKeyringPair;21 let donor: IKeyringPair;js-packages/tests/src/transfer.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122describe('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;js-packages/tests/src/transferFrom.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021describe('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;js-packages/tests/src/tx-version-presence.test.tsdiffbeforeafterboth15// 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/>.161617import {Metadata} from '@polkadot/types';17import {Metadata} from '@polkadot/types';18import {itSub, usingPlaygrounds, expect} from './util';18import {itSub, usingPlaygrounds, expect} from './util/index.js';191920let metadata: Metadata;20let metadata: Metadata;2121js-packages/tests/src/util/authorizeEnactUpgrade.tsdiffbeforeafterboth1import {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';5566js-packages/tests/src/util/createHrmp.tsdiffbeforeafterboth1import {usingPlaygrounds} from '.';1import {usingPlaygrounds} from './index.js';2import config from '../config';2import config from '../config.js';334const 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');js-packages/tests/src/util/frankensteinMigrate.tsdiffbeforeafterboth1import {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>,js-packages/tests/src/util/globalSetup.tsdiffbeforeafterboth334import {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';9970 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];js-packages/tests/src/util/identitySetter.tsdiffbeforeafterboth8// 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`9910import {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';141415const 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';js-packages/tests/src/util/index.tsdiffbeforeafterboth334import * 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';1717js-packages/tests/src/util/relayIdentitiesChecker.tsdiffbeforeafterboth7// 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`889import {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';121213const 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';js-packages/tests/src/util/setCode.tsdiffbeforeafterboth1import {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';445const 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');js-packages/tests/src/vesting.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';191920describe('Vesting', () => {20describe('Vesting', () => {21 let donor: IKeyringPair;21 let donor: IKeyringPair;js-packages/tests/src/xcm/lowLevelXcmQuartz.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';212122const testHelper = new XcmTestHelper('quartz');22const testHelper = new XcmTestHelper('quartz');js-packages/tests/src/xcm/lowLevelXcmUnique.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';232324const testHelper = new XcmTestHelper('unique');24const testHelper = new XcmTestHelper('unique');2525js-packages/tests/src/xcm/xcm.types.tsdiffbeforeafterboth1import {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';667export 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);js-packages/tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';202021const 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);js-packages/tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';22222323js-packages/tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617import {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';2323242425const STATEMINT_PALLET_INSTANCE = 50;25const STATEMINT_PALLET_INSTANCE = 50;js-packages/tests/tsconfig.jsondiffbeforeafterbothno changes
js-packages/tsconfig.base.jsondiffbeforeafterbothno changes
js-packages/tsconfig.jsondiffbeforeafterboth1{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 js-packages/tsconfig.packages.jsondiffbeforeafterbothno changes
js-packages/types/package.jsondiffbeforeafterbothno changes
js-packages/types/src/augment-api-rpc.tsdiffbeforeafterboth5// this is required to allow for ambient/previous definitions5// this is required to allow for ambient/previous definitions6import '@polkadot/rpc-core/types/jsonrpc';6import '@polkadot/rpc-core/types/jsonrpc';778import 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';353536declare 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 tokens41 **/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 block45 **/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 tokens49 **/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 staked53 **/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 extrinsics450 **/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 node628 **/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 account634 **/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 collection638 **/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 collection642 **/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 sponsor646 **/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 collection654 **/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 collection658 **/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 account662 **/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 ID666 **/667 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;668 /**669 * Get collection properties, optionally limited to the provided keys670 **/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 collections674 **/675 collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;676 /**677 * Get tokens contained within a collection678 **/679 collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;680 /**681 * Get token constant metadata682 **/683 constMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;684 /**685 * Get effective collection limits686 **/687 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;688 /**689 * Get the last token ID created in a collection690 **/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 available694 **/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 keys698 **/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 token702 **/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 RFT706 **/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 exists710 **/711 tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;712 /**713 * Get the token owner714 **/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 order718 **/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 keys722 **/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 token726 **/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 RFT730 **/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 collection734 **/735 totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;736 /**737 * Get token variable metadata738 **/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.js-packages/types/src/augment-types.tsdiffbeforeafterboth5// this is required to allow for ambient/previous definitions5// this is required to allow for ambient/previous definitions6import '@polkadot/types/types/registry';6import '@polkadot/types/types/registry';778import 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;js-packages/types/src/default/definitions.tsdiffbeforeafterboth1import types from '../lookup';1import types from '../lookup.js';223export default {3export default {4 types,4 types,js-packages/types/src/definitions.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// 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/>.161617export {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';2121js-packages/types/src/registry.tsdiffbeforeafterbothno syntactic changes
js-packages/types/tsconfig.jsondiffbeforeafterbothno changes
tests/.dockerignorediffbeforeafterbothno changes