diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index 0276f25e2c..7fb8dc2a7c 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -32,6 +32,6 @@ "@polkadot/types": "^1.0.0-beta.29" }, "devDependencies": { - "@polkadot/keyring": "^2.0.0-beta.6" + "@polkadot/keyring": "^2.0.0-beta.7" } } diff --git a/packages/api/package.json b/packages/api/package.json index fef70824b4..e0fcf7e6f5 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -28,14 +28,14 @@ "dependencies": { "@babel/runtime": "^7.8.3", "@polkadot/api-derive": "^1.0.0-beta.29", - "@polkadot/keyring": "^2.0.0-beta.6", + "@polkadot/keyring": "^2.0.0-beta.7", "@polkadot/metadata": "^1.0.0-beta.29", "@polkadot/rpc-core": "^1.0.0-beta.29", "@polkadot/rpc-provider": "^1.0.0-beta.29", "@polkadot/types": "^1.0.0-beta.29", - "@polkadot/util-crypto": "^2.0.0-beta.6" + "@polkadot/util-crypto": "^2.0.0-beta.7" }, "devDependencies": { - "@polkadot/keyring": "^2.0.0-beta.6" + "@polkadot/keyring": "^2.0.0-beta.7" } } diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 9537f42334..3cedb8e084 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -2,9 +2,17 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assertSingletonPackage } from '@polkadot/util'; +import { detectPackage } from '@polkadot/util'; -assertSingletonPackage('@polkadot/api'); +let pkgJson; + +try { + pkgJson = require('./package.json'); +} catch (error) { + pkgJson = require('../package.json'); +} + +detectPackage(pkgJson); export { Keyring } from '@polkadot/keyring'; export { WsProvider } from '@polkadot/rpc-provider'; diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 4d003c935d..079d075f55 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -28,10 +28,10 @@ "dependencies": { "@babel/runtime": "^7.8.3", "@polkadot/types": "^1.0.0-beta.29", - "@polkadot/util": "^2.0.0-beta.6", - "@polkadot/util-crypto": "^2.0.0-beta.6" + "@polkadot/util": "^2.0.0-beta.7", + "@polkadot/util-crypto": "^2.0.0-beta.7" }, "devDependencies": { - "@polkadot/keyring": "^2.0.0-beta.6" + "@polkadot/keyring": "^2.0.0-beta.7" } } diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index aa8677ded4..860422d33b 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -30,7 +30,7 @@ "@polkadot/jsonrpc": "^1.0.0-beta.29", "@polkadot/rpc-provider": "^1.0.0-beta.29", "@polkadot/types": "^1.0.0-beta.29", - "@polkadot/util": "^2.0.0-beta.6", + "@polkadot/util": "^2.0.0-beta.7", "rxjs": "^6.5.4" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 29ea91bf82..f67a038156 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -28,14 +28,14 @@ "dependencies": { "@babel/runtime": "^7.8.3", "@polkadot/metadata": "^1.0.0-beta.29", - "@polkadot/util": "^2.0.0-beta.6", - "@polkadot/util-crypto": "^2.0.0-beta.6", + "@polkadot/util": "^2.0.0-beta.7", + "@polkadot/util-crypto": "^2.0.0-beta.7", "eventemitter3": "^4.0.0", "isomorphic-fetch": "^2.2.1", "websocket": "^1.0.31" }, "devDependencies": { - "@polkadot/keyring": "^2.0.0-beta.6", + "@polkadot/keyring": "^2.0.0-beta.7", "mock-socket": "^9.0.3", "nock": "^11.7.2" } diff --git a/packages/types/package.json b/packages/types/package.json index 9424a5fcec..524b10ff0c 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -28,12 +28,12 @@ "dependencies": { "@babel/runtime": "^7.8.3", "@polkadot/metadata": "^1.0.0-beta.29", - "@polkadot/util": "^2.0.0-beta.6", - "@polkadot/util-crypto": "^2.0.0-beta.6", + "@polkadot/util": "^2.0.0-beta.7", + "@polkadot/util-crypto": "^2.0.0-beta.7", "@types/memoizee": "^0.4.3", "memoizee": "^0.4.14" }, "devDependencies": { - "@polkadot/keyring": "^2.0.0-beta.6" + "@polkadot/keyring": "^2.0.0-beta.7" } } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 4a684a50e0..c9f0a789da 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -5,9 +5,17 @@ // NOTE When adding any types here, we need to update the documentation links as // well - /docs/SUMMARY.md as well as ../README.md -import { assertSingletonPackage } from '@polkadot/util'; +import { detectPackage } from '@polkadot/util'; -assertSingletonPackage('@polkadot/types'); +let pkgJson; + +try { + pkgJson = require('./package.json'); +} catch (error) { + pkgJson = require('../package.json'); +} + +detectPackage(pkgJson); export * from './codec'; export * from './index.types'; diff --git a/yarn.lock b/yarn.lock index 760c59bad5..c87572ece0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2001,14 +2001,14 @@ typescript "^3.7.5" vuepress "^1.2.0" -"@polkadot/keyring@^2.0.0-beta.6": - version "2.0.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-2.0.0-beta.6.tgz#fdc7d45039a3e8c428ebcc38b620b7a42cdd6a42" - integrity sha512-pMV6gIk99lwQ7tHpiZPmcw3/LPqAF8a09jb5ddBu0a/RG3pnKy+0k23C2ckAqEtfHj6z2lCpXYOSBXwepMzDwQ== +"@polkadot/keyring@^2.0.0-beta.7": + version "2.0.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-2.0.0-beta.7.tgz#6c836ac14c9201df663709d4babeaf9b68279bf4" + integrity sha512-xOgXuRSg5+rYlcLe5HXellcQJ6SEFYVev7AKRjK0loMNAowX/KRt08eN6vzpVwLOnX9dt53b4mT0b1uQNxHsSA== dependencies: "@babel/runtime" "^7.8.3" - "@polkadot/util" "^2.0.0-beta.6" - "@polkadot/util-crypto" "^2.0.0-beta.6" + "@polkadot/util" "^2.0.0-beta.7" + "@polkadot/util-crypto" "^2.0.0-beta.7" "@polkadot/ts@^0.1.91": version "0.1.91" @@ -2017,13 +2017,13 @@ dependencies: "@types/chrome" "^0.0.92" -"@polkadot/util-crypto@^2.0.0-beta.6": - version "2.0.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-2.0.0-beta.6.tgz#948fd431e12f792d017bf8b550346cdd1b165b35" - integrity sha512-/0Ro95LxgasIM3b/Avg4ZcywjZJKL1jU1hJEtSgVQDZsaRTz7IGjR0gg5DJUiGvnIbGX0QbmX3yPuN/Kjwf4Bw== +"@polkadot/util-crypto@^2.0.0-beta.7": + version "2.0.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-2.0.0-beta.7.tgz#7eb00da7497b11147c8f240923bdb944135d697f" + integrity sha512-xC3sWMUskI+62VDTxmzMuv+I79tUc7YxTpSsyYDOenlLC5qeN4UeXO9PvfK/mXgg+/1JGX8QnskbgbHSPtsetQ== dependencies: "@babel/runtime" "^7.8.3" - "@polkadot/util" "^2.0.0-beta.6" + "@polkadot/util" "^2.0.0-beta.7" "@polkadot/wasm-crypto" "^0.20.0-beta.2" "@types/bip39" "^2.4.2" "@types/bs58" "^4.0.0" @@ -2039,10 +2039,10 @@ tweetnacl "^1.0.2" xxhashjs "^0.2.2" -"@polkadot/util@^2.0.0-beta.6": - version "2.0.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-2.0.0-beta.6.tgz#080daff44b19208bbc0593e0406c68ae6c451996" - integrity sha512-1ncVpdN8BogyN6GCIRRWv8OMV3WkaZSNF0AOYnwhbX8tRrNASRTLezv1Eii9I1Pn8flvqN/7ugOGKVt0cbsROg== +"@polkadot/util@^2.0.0-beta.7": + version "2.0.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-2.0.0-beta.7.tgz#7d3354f5876c9c940072c8c793333f96041818e6" + integrity sha512-mTQL5BCNYWSE6k0yw4Y54TRIQLfAH6SpGJH3nR9zGTK/isKQb+dHyCMnJAhrgDpZ8GuqY0Xgk5c9FjYe07OPFw== dependencies: "@babel/runtime" "^7.8.3" "@types/bn.js" "^4.11.6"