diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf4f8efea..80951fbd9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ -# 1.3.0-beta.x +# 1.3.1 Feb 18, 2020 +- Add `@types/bn.js` as a normal dependency, exposed in `*.d.ts` ((Thanks to https://github.com/monitz87) +- Type generation scripts (including `polkadot-types-from-{chain,defs}`) has been moved to the `@polkadot/typegen` package - The `@polkadot/types/codec/create` has been moved to `@polkadot/types/create`, imports from `@polkadot/types` are unaffected - Expose chain properies on registry (and use for API type formatting) - Add `toHuman(isExtended?: boolean)` to all codec types, formatting into a human-readable structure diff --git a/lerna.json b/lerna.json index 27d8c0bad7..ba8f2e6c2f 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ "packages": [ "packages/*" ], - "version": "1.3.0-beta.11" + "version": "1.3.0" } diff --git a/package.json b/package.json index 167f7765d8..ea873e4bc9 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@babel/core": "^7.8.4", "@babel/register": "^7.8.3", "@babel/runtime": "^7.8.4", - "@polkadot/dev": "^0.40.17", + "@polkadot/dev": "^0.40.18", "@polkadot/ts": "^0.2.3", "copyfiles": "^2.2.0" } diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index 43cfbc96f4..22c1b5aaf6 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-contract", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Interfaces for interacting with contracts and contract ABIs", "main": "index.js", "keywords": [ @@ -27,10 +27,10 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/api": "^1.3.0-beta.11", - "@polkadot/rpc-core": "^1.3.0-beta.11", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", + "@polkadot/api": "^1.3.0", + "@polkadot/rpc-core": "^1.3.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", "bn.js": "^5.1.1", "rxjs": "^6.5.4" } diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index a080b86f1a..1248edd2e3 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-derive", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Common functions used across Polkadot, derived from RPC calls and storage queries.", "main": "index.js", "keywords": [ @@ -28,17 +28,17 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/api": "^1.3.0-beta.11", - "@polkadot/rpc-core": "^1.3.0-beta.11", - "@polkadot/rpc-provider": "^1.3.0-beta.11", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", - "@polkadot/util-crypto": "^2.4.0-beta.0", + "@polkadot/api": "^1.3.0", + "@polkadot/rpc-core": "^1.3.0", + "@polkadot/rpc-provider": "^1.3.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", + "@polkadot/util-crypto": "^2.4.1", "bn.js": "^5.1.1", "memoizee": "^0.4.14", "rxjs": "^6.5.4" }, "devDependencies": { - "@polkadot/keyring": "^2.4.0-beta.0" + "@polkadot/keyring": "^2.4.1" } } diff --git a/packages/api/package.json b/packages/api/package.json index 5caa0078e8..00ec1799d2 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Promise and RxJS wrappers around the Polkadot JS RPC", "main": "index.js", "keywords": [ @@ -27,19 +27,19 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/api-derive": "^1.3.0-beta.11", - "@polkadot/keyring": "^2.4.0-beta.0", - "@polkadot/metadata": "^1.3.0-beta.11", - "@polkadot/rpc-core": "^1.3.0-beta.11", - "@polkadot/rpc-provider": "^1.3.0-beta.11", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", - "@polkadot/util-crypto": "^2.4.0-beta.0", + "@polkadot/api-derive": "^1.3.0", + "@polkadot/keyring": "^2.4.1", + "@polkadot/metadata": "^1.3.0", + "@polkadot/rpc-core": "^1.3.0", + "@polkadot/rpc-provider": "^1.3.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", + "@polkadot/util-crypto": "^2.4.1", "bn.js": "^5.1.1", "eventemitter3": "^4.0.0", "rxjs": "^6.5.4" }, "devDependencies": { - "@polkadot/keyring": "^2.4.0-beta.0" + "@polkadot/keyring": "^2.4.1" } } diff --git a/packages/api/src/promise/Api.spec.ts b/packages/api/src/promise/Api.spec.ts index da45cc6663..21f591f159 100644 --- a/packages/api/src/promise/Api.spec.ts +++ b/packages/api/src/promise/Api.spec.ts @@ -17,7 +17,8 @@ describe('ApiPromise', (): void => { const registry = new TypeRegistry(); const keyring = testKeyring({ type: 'ed25519' }); const aliceEd = keyring.addPair( - createPair('ed25519', { + // eslint-disable-next-line @typescript-eslint/unbound-method + createPair({ toSS58: keyring.encodeAddress, type: 'ed25519' }, { secretKey: hexToU8a('0xabf8e5bdbe30c65656c0a3cbd181ff8a56294a69dfedd27982aace4a7690911588dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee'), publicKey: hexToU8a('0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee') }) diff --git a/packages/jsonrpc/package.json b/packages/jsonrpc/package.json index c9ecbd29c4..fc9d76245b 100644 --- a/packages/jsonrpc/package.json +++ b/packages/jsonrpc/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/jsonrpc", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Method definitions for the Polkadot RPC layer", "main": "index.js", "publishConfig": { @@ -27,7 +27,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/jsonrpc#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0" + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1" } } diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 1906578c94..bc11966fb8 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/metadata", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Helpers to extract information from runtime metadata", "main": "index.js", "publishConfig": { @@ -27,12 +27,12 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", - "@polkadot/util-crypto": "^2.4.0-beta.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", + "@polkadot/util-crypto": "^2.4.1", "bn.js": "^5.1.1" }, "devDependencies": { - "@polkadot/keyring": "^2.4.0-beta.0" + "@polkadot/keyring": "^2.4.1" } } diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 9fc04a685d..ede2792f85 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-core", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "keywords": [ @@ -27,15 +27,15 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/jsonrpc": "^1.3.0-beta.11", - "@polkadot/metadata": "^1.3.0-beta.11", - "@polkadot/rpc-provider": "^1.3.0-beta.11", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", + "@polkadot/jsonrpc": "^1.3.0", + "@polkadot/metadata": "^1.3.0", + "@polkadot/rpc-provider": "^1.3.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", "memoizee": "^0.4.14", "rxjs": "^6.5.4" }, "devDependencies": { - "@polkadot/keyring": "^2.4.0-beta.0" + "@polkadot/keyring": "^2.4.1" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index af353b2942..54e4806a7e 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-provider", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Transport providers for the API", "main": "index.js", "keywords": [ @@ -27,18 +27,18 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/jsonrpc": "^1.3.0-beta.11", - "@polkadot/metadata": "^1.3.0-beta.11", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", - "@polkadot/util-crypto": "^2.4.0-beta.0", + "@polkadot/jsonrpc": "^1.3.0", + "@polkadot/metadata": "^1.3.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", + "@polkadot/util-crypto": "^2.4.1", "bn.js": "^5.1.1", "eventemitter3": "^4.0.0", "isomorphic-fetch": "^2.2.1", "websocket": "^1.0.31" }, "devDependencies": { - "@polkadot/keyring": "^2.4.0-beta.0", + "@polkadot/keyring": "^2.4.1", "mock-socket": "^9.0.3", "nock": "^11.8.2" } diff --git a/packages/typegen/package.json b/packages/typegen/package.json index 6ff0383b35..f7192d5f1f 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/typegen", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Type generation scripts", "main": "index.js", "bin": { @@ -36,11 +36,11 @@ "@babel/core": "^7.8.3", "@babel/register": "^7.8.3", "@babel/runtime": "^7.8.4", - "@polkadot/api": "^1.3.0-beta.11", - "@polkadot/jsonrpc": "^1.3.0-beta.11", - "@polkadot/metadata": "^1.3.0-beta.11", - "@polkadot/types": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", + "@polkadot/api": "^1.3.0", + "@polkadot/jsonrpc": "^1.3.0", + "@polkadot/metadata": "^1.3.0", + "@polkadot/types": "^1.3.0", + "@polkadot/util": "^2.4.1", "websocket": "^1.0.31", "yargs": "^15.1.0" }, diff --git a/packages/types/package.json b/packages/types/package.json index d93ec5b548..2d73239375 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types", - "version": "1.3.0-beta.11", + "version": "1.3.0", "description": "Implementation of the Parity codec", "main": "index.js", "keywords": [ @@ -27,16 +27,16 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.8.4", - "@polkadot/metadata": "^1.3.0-beta.11", - "@polkadot/util": "^2.4.0-beta.0", - "@polkadot/util-crypto": "^2.4.0-beta.0", + "@polkadot/metadata": "^1.3.0", + "@polkadot/util": "^2.4.1", + "@polkadot/util-crypto": "^2.4.1", "@types/bn.js": "^4.11.6", "bn.js": "^5.1.1", "memoizee": "^0.4.14", "rxjs": "^6.5.4" }, "devDependencies": { - "@polkadot/keyring": "^2.4.0-beta.0", + "@polkadot/keyring": "^2.4.1", "@types/memoizee": "^0.4.3" } } diff --git a/packages/types/src/codec/UInt.ts b/packages/types/src/codec/UInt.ts index 2bf6359f73..c86dea34b7 100644 --- a/packages/types/src/codec/UInt.ts +++ b/packages/types/src/codec/UInt.ts @@ -50,7 +50,7 @@ export default class UInt extends AbstractInt { public toHuman (isExpanded?: boolean): any { // FIXME we need proper expansion here return this instanceof ClassOf(this.registry, 'Balance') - ? formatBalance(this, { withSi: true, withUnit: this.registry.chainToken }, this.registry.chainDecimals) + ? formatBalance(this, { decimals: this.registry.chainDecimals, withSi: true, withUnit: this.registry.chainToken }) : super.toHuman(isExpanded); } diff --git a/yarn.lock b/yarn.lock index 32147c3963..87ce6e0cf8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2016,10 +2016,10 @@ dependencies: "@types/node" ">= 8" -"@polkadot/dev@^0.40.17": - version "0.40.17" - resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.40.17.tgz#493f4a7263797e416b12e6b735b39d428f6c0ef1" - integrity sha512-tAfUlcdOzixa6c4/5fxaXjO4cEmXpGZzx3EAIyqsQw+74FBFVR1BKEeGoGuWetTQfIWKqAMOKsFjF5O6VS+VfA== +"@polkadot/dev@^0.40.18": + version "0.40.18" + resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.40.18.tgz#6ca40304bcc7c75b26c0190d60cb5b892a512dc5" + integrity sha512-SEkmrdZPYcnFzXnfpIjnvNfrwdBS3uAenEt8ZYBMkay59+XgFnPKi7xKV92x5iGYEiAXfcKFYjCAN0Nk2rXV5Q== dependencies: "@babel/cli" "^7.8.4" "@babel/core" "^7.8.4" @@ -2077,14 +2077,14 @@ webpack-cli "^3.3.11" yargs "^15.1.0" -"@polkadot/keyring@^2.4.0-beta.0": - version "2.4.0-beta.0" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-2.4.0-beta.0.tgz#d43996daf38c53b35eccd3016246726a26c7b483" - integrity sha512-dv4wonHpWnXDNHyidWdKzXZQnDesxQWWbATbDeZUv4P1Hwbn4zpa8+nQoRuKi7v5OmFJvm0Ailb84/sWQweoYA== +"@polkadot/keyring@^2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-2.4.1.tgz#1f6e59dd55031481d3642f18e407141d596fd388" + integrity sha512-NBsw6ypCvTUNBUTB/LIZGcJE6R8qrsZ6CEa+Hu6uKrwhR/xjtPBCH2sPaXj+OeNAZ2sMQuEoUJlJUhYnMal2pg== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/util" "^2.4.0-beta.0" - "@polkadot/util-crypto" "^2.4.0-beta.0" + "@polkadot/util" "^2.4.1" + "@polkadot/util-crypto" "^2.4.1" "@polkadot/ts@^0.2.3": version "0.2.3" @@ -2093,13 +2093,13 @@ dependencies: "@types/chrome" "^0.0.95" -"@polkadot/util-crypto@^2.4.0-beta.0": - version "2.4.0-beta.0" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-2.4.0-beta.0.tgz#a821c29835ca6e23b0db6faecf3edc263fac75fb" - integrity sha512-fc6g5GNGDv1QbIeaa5BaBvdXQHmkBmsydVoZEzE49YLPHA142WzM1dof0SuP5/C/K6O11oq3yP9Ns7H+lWJf2g== +"@polkadot/util-crypto@^2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-2.4.1.tgz#f02e4dca225882c7f1a7762bc416530567c4803c" + integrity sha512-5mPuRhpvYXeLqqGEqOtJqp+lZCr1Z2NIxIKgabaFfrp1malbgWhKDnafkAg7kwL3BrRQbOge0vgK6VmDiuXljQ== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/util" "^2.4.0-beta.0" + "@polkadot/util" "^2.4.1" "@polkadot/wasm-crypto" "^1.0.1" base-x "^3.0.7" bip39 "^3.0.2" @@ -2112,12 +2112,13 @@ tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@^2.4.0-beta.0": - version "2.4.0-beta.0" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-2.4.0-beta.0.tgz#2a289a1a9da1f59b1e07399252fdf8fbe2bf5d76" - integrity sha512-mSC/NSpqImx45f9FWf6qjzjqDpRnF1v7dfeRfRxkPGX94zrRRS/jTjPbPmOhnbfA3+vokShq3/t3DvESwYH9ZQ== +"@polkadot/util@^2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-2.4.1.tgz#7c0d0619af6ced647e99d6bc8ccc24bc3202a2a7" + integrity sha512-60yBpgYgowx/TVuJyrjYYIJJpw4aCNzay8imy5L2Fug2y3lvgrHyTxPAgrykOmuFeZ3jq9ayjXk5bpAJ179vFg== dependencies: "@babel/runtime" "^7.8.4" + "@types/bn.js" "^4.11.6" bn.js "^5.1.1" camelcase "^5.3.1" chalk "^3.0.0"