diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a2b3db9590..f569f1104427 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.10.0-beta.x +# 1.10.1 Apr 13, 2020 - **Important** Substrate master has updated staking, on older chains apply `StakingLedger: 'StakingLedgerTo240'` - Add `rpc.system.chainType` to retrieve the chain type (Development. Local, Live & Custom) @@ -8,7 +8,8 @@ - Cleanups to derives for democracy & staking to be more performant - Add Centrifuge base types to `@polkadot/types-known` - Adjust with all the latest substrate master types -- Internally all private/protected methods/variables are now indicated with `_` (Aligning with the `private/protected` indicators in the TS definitions) +- Internally all private/protected methods/variables are now `_` prefixed (Aligning with the `private/protected` indicators in the TS definitions) +- Update metadata/docs-from-metadata to the latest Substrate # 1.9.1 Apr 1, 2020 diff --git a/docs/start/api.query.other.md b/docs/start/api.query.other.md index 95c857c10a41..4618f7e3e5f3 100644 --- a/docs/start/api.query.other.md +++ b/docs/start/api.query.other.md @@ -62,7 +62,7 @@ When working maps and double-maps, it is possible to retrieve a list of all the // Retrieve the active era const activeEra = await api.query.staking.activeEra(); -// retrieve all exposures int the active era +// retrieve all exposures for the active era const exposures = await api.query.staking.erasStakers.entries(activeEra.index); exposures.forEach(([key, exposure]) => { @@ -73,7 +73,17 @@ exposures.forEach(([key, exposure]) => { Here we are querying a double-map, so we supply 1 argument. No arguments on double-maps will be very costly, retrieving all the eras and associated entries. Additionally when `twox64_concat` & `blake2_concat` is used, the key `.args` will contain decoded values of the params, in this case it will contain the actual `AccountId` of the staker. (Since that was not supplied) -In the same way as above we can simply do `.keys(activeEra.index): StorageKey[]` to retrieve all the keys here, including the individual keys args decoding, as available on maps with decodable hashing functions. +In the same way as above we can simply do `.keys(activeEra.index): StorageKey[]` to retrieve all the keys here, including the individual keys args (available on maps with decodable hashing functions) - + +```js +// retrieve all the nominator keys +const keys = await api.query.staking.nominators.keys(); + +// extract the first key argument (AccountId) as string +const nominatorIds = keys.map((key) => key.args[0].toString()); + +console.log('all nominators:', nminatorIds.join(', ')); +``` ## State entries diff --git a/lerna.json b/lerna.json index 04c1d2875654..9673fb5fd95c 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ "packages": [ "packages/*" ], - "version": "1.10.0-beta.29" + "version": "1.10.0" } diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index 7b842c7b095d..1adb063d6f44 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-contract", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Interfaces for interacting with contracts and contract ABIs", "main": "index.js", "keywords": [ @@ -27,9 +27,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/api": "1.10.0-beta.29", - "@polkadot/rpc-core": "1.10.0-beta.29", - "@polkadot/types": "1.10.0-beta.29", + "@polkadot/api": "1.10.0", + "@polkadot/rpc-core": "1.10.0", + "@polkadot/types": "1.10.0", "@polkadot/util": "^2.8.1", "bn.js": "^5.1.1", "rxjs": "^6.5.5" diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index 312af98bfccd..9ed42dc7dd88 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api-derive", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Common functions used across Polkadot, derived from RPC calls and storage queries.", "main": "index.js", "keywords": [ @@ -28,10 +28,10 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/api": "1.10.0-beta.29", - "@polkadot/rpc-core": "1.10.0-beta.29", - "@polkadot/rpc-provider": "1.10.0-beta.29", - "@polkadot/types": "1.10.0-beta.29", + "@polkadot/api": "1.10.0", + "@polkadot/rpc-core": "1.10.0", + "@polkadot/rpc-provider": "1.10.0", + "@polkadot/types": "1.10.0", "@polkadot/util": "^2.8.1", "@polkadot/util-crypto": "^2.8.1", "bn.js": "^5.1.1", diff --git a/packages/api/package.json b/packages/api/package.json index 0d3462de9f03..8fae633e4f2d 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/api", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Promise and RxJS wrappers around the Polkadot JS RPC", "main": "index.js", "keywords": [ @@ -27,13 +27,13 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/api-derive": "1.10.0-beta.29", + "@polkadot/api-derive": "1.10.0", "@polkadot/keyring": "^2.8.1", - "@polkadot/metadata": "1.10.0-beta.29", - "@polkadot/rpc-core": "1.10.0-beta.29", - "@polkadot/rpc-provider": "1.10.0-beta.29", - "@polkadot/types": "1.10.0-beta.29", - "@polkadot/types-known": "1.10.0-beta.29", + "@polkadot/metadata": "1.10.0", + "@polkadot/rpc-core": "1.10.0", + "@polkadot/rpc-provider": "1.10.0", + "@polkadot/types": "1.10.0", + "@polkadot/types-known": "1.10.0", "@polkadot/util": "^2.8.1", "@polkadot/util-crypto": "^2.8.1", "bn.js": "^5.1.1", diff --git a/packages/metadata/package.json b/packages/metadata/package.json index a0217f59d2da..9d3b54502468 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/metadata", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Helpers to extract information from runtime metadata", "main": "index.js", "publishConfig": { @@ -27,8 +27,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/types": "1.10.0-beta.29", - "@polkadot/types-known": "1.10.0-beta.29", + "@polkadot/types": "1.10.0", + "@polkadot/types-known": "1.10.0", "@polkadot/util": "^2.8.1", "@polkadot/util-crypto": "^2.8.1", "bn.js": "^5.1.1" diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 4505eef6b454..3025a4a6491b 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-core", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "keywords": [ @@ -27,9 +27,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/metadata": "1.10.0-beta.29", - "@polkadot/rpc-provider": "1.10.0-beta.29", - "@polkadot/types": "1.10.0-beta.29", + "@polkadot/metadata": "1.10.0", + "@polkadot/rpc-provider": "1.10.0", + "@polkadot/types": "1.10.0", "@polkadot/util": "^2.8.1", "memoizee": "^0.4.14", "rxjs": "^6.5.5" diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 36b79b262a63..ba4f7ecd9b75 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/rpc-provider", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Transport providers for the API", "main": "index.js", "keywords": [ @@ -27,8 +27,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/metadata": "1.10.0-beta.29", - "@polkadot/types": "1.10.0-beta.29", + "@polkadot/metadata": "1.10.0", + "@polkadot/types": "1.10.0", "@polkadot/util": "^2.8.1", "@polkadot/util-crypto": "^2.8.1", "bn.js": "^5.1.1", diff --git a/packages/typegen/package.json b/packages/typegen/package.json index e7bef7b0bfce..1ffea41e643a 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/typegen", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Type generation scripts", "main": "index.js", "bin": { @@ -36,10 +36,10 @@ "@babel/core": "^7.9.0", "@babel/register": "^7.9.0", "@babel/runtime": "^7.9.2", - "@polkadot/api": "1.10.0-beta.29", - "@polkadot/metadata": "1.10.0-beta.29", - "@polkadot/rpc-provider": "1.10.0-beta.29", - "@polkadot/types": "1.10.0-beta.29", + "@polkadot/api": "1.10.0", + "@polkadot/metadata": "1.10.0", + "@polkadot/rpc-provider": "1.10.0", + "@polkadot/types": "1.10.0", "@polkadot/util": "^2.8.1", "websocket": "^1.0.31", "yargs": "^15.3.1" diff --git a/packages/types-known/package.json b/packages/types-known/package.json index 9a282facccb9..6e4063fd02e1 100644 --- a/packages/types-known/package.json +++ b/packages/types-known/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types-known", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "main": "index.js", "keywords": [ @@ -27,7 +27,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/types": "1.10.0-beta.29", + "@polkadot/types": "1.10.0", "@polkadot/util": "^2.8.1", "bn.js": "^5.1.1" }, diff --git a/packages/types/package.json b/packages/types/package.json index c8419cf2c6b8..887a57cccf11 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@polkadot/types", - "version": "1.10.0-beta.29", + "version": "1.10.0", "description": "Implementation of the Parity codec", "main": "index.js", "keywords": [ @@ -27,7 +27,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.9.2", - "@polkadot/metadata": "1.10.0-beta.29", + "@polkadot/metadata": "1.10.0", "@polkadot/util": "^2.8.1", "@polkadot/util-crypto": "^2.8.1", "@types/bn.js": "^4.11.6", diff --git a/yarn.lock b/yarn.lock index 1504b034e37d..44780baf7133 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2607,25 +2607,25 @@ __metadata: resolution: "@polkadot/api-contract@workspace:packages/api-contract" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/api": 1.10.0-beta.29 - "@polkadot/rpc-core": 1.10.0-beta.29 - "@polkadot/types": 1.10.0-beta.29 + "@polkadot/api": 1.10.0 + "@polkadot/rpc-core": 1.10.0 + "@polkadot/types": 1.10.0 "@polkadot/util": ^2.8.1 bn.js: ^5.1.1 rxjs: ^6.5.5 languageName: unknown linkType: soft -"@polkadot/api-derive@1.10.0-beta.29, @polkadot/api-derive@workspace:packages/api-derive": +"@polkadot/api-derive@1.10.0, @polkadot/api-derive@workspace:packages/api-derive": version: 0.0.0-use.local resolution: "@polkadot/api-derive@workspace:packages/api-derive" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/api": 1.10.0-beta.29 + "@polkadot/api": 1.10.0 "@polkadot/keyring": ^2.8.1 - "@polkadot/rpc-core": 1.10.0-beta.29 - "@polkadot/rpc-provider": 1.10.0-beta.29 - "@polkadot/types": 1.10.0-beta.29 + "@polkadot/rpc-core": 1.10.0 + "@polkadot/rpc-provider": 1.10.0 + "@polkadot/types": 1.10.0 "@polkadot/util": ^2.8.1 "@polkadot/util-crypto": ^2.8.1 bn.js: ^5.1.1 @@ -2634,18 +2634,18 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/api@1.10.0-beta.29, @polkadot/api@workspace:packages/api": +"@polkadot/api@1.10.0, @polkadot/api@workspace:packages/api": version: 0.0.0-use.local resolution: "@polkadot/api@workspace:packages/api" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/api-derive": 1.10.0-beta.29 + "@polkadot/api-derive": 1.10.0 "@polkadot/keyring": ^2.8.1 - "@polkadot/metadata": 1.10.0-beta.29 - "@polkadot/rpc-core": 1.10.0-beta.29 - "@polkadot/rpc-provider": 1.10.0-beta.29 - "@polkadot/types": 1.10.0-beta.29 - "@polkadot/types-known": 1.10.0-beta.29 + "@polkadot/metadata": 1.10.0 + "@polkadot/rpc-core": 1.10.0 + "@polkadot/rpc-provider": 1.10.0 + "@polkadot/types": 1.10.0 + "@polkadot/types-known": 1.10.0 "@polkadot/util": ^2.8.1 "@polkadot/util-crypto": ^2.8.1 bn.js: ^5.1.1 @@ -2752,43 +2752,43 @@ __metadata: languageName: node linkType: hard -"@polkadot/metadata@1.10.0-beta.29, @polkadot/metadata@workspace:packages/metadata": +"@polkadot/metadata@1.10.0, @polkadot/metadata@workspace:packages/metadata": version: 0.0.0-use.local resolution: "@polkadot/metadata@workspace:packages/metadata" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.8.1 - "@polkadot/types": 1.10.0-beta.29 - "@polkadot/types-known": 1.10.0-beta.29 + "@polkadot/types": 1.10.0 + "@polkadot/types-known": 1.10.0 "@polkadot/util": ^2.8.1 "@polkadot/util-crypto": ^2.8.1 bn.js: ^5.1.1 languageName: unknown linkType: soft -"@polkadot/rpc-core@1.10.0-beta.29, @polkadot/rpc-core@workspace:packages/rpc-core": +"@polkadot/rpc-core@1.10.0, @polkadot/rpc-core@workspace:packages/rpc-core": version: 0.0.0-use.local resolution: "@polkadot/rpc-core@workspace:packages/rpc-core" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.8.1 - "@polkadot/metadata": 1.10.0-beta.29 - "@polkadot/rpc-provider": 1.10.0-beta.29 - "@polkadot/types": 1.10.0-beta.29 + "@polkadot/metadata": 1.10.0 + "@polkadot/rpc-provider": 1.10.0 + "@polkadot/types": 1.10.0 "@polkadot/util": ^2.8.1 memoizee: ^0.4.14 rxjs: ^6.5.5 languageName: unknown linkType: soft -"@polkadot/rpc-provider@1.10.0-beta.29, @polkadot/rpc-provider@workspace:packages/rpc-provider": +"@polkadot/rpc-provider@1.10.0, @polkadot/rpc-provider@workspace:packages/rpc-provider": version: 0.0.0-use.local resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.8.1 - "@polkadot/metadata": 1.10.0-beta.29 - "@polkadot/types": 1.10.0-beta.29 + "@polkadot/metadata": 1.10.0 + "@polkadot/types": 1.10.0 "@polkadot/util": ^2.8.1 "@polkadot/util-crypto": ^2.8.1 bn.js: ^5.1.1 @@ -2816,10 +2816,10 @@ __metadata: "@babel/core": ^7.9.0 "@babel/register": ^7.9.0 "@babel/runtime": ^7.9.2 - "@polkadot/api": 1.10.0-beta.29 - "@polkadot/metadata": 1.10.0-beta.29 - "@polkadot/rpc-provider": 1.10.0-beta.29 - "@polkadot/types": 1.10.0-beta.29 + "@polkadot/api": 1.10.0 + "@polkadot/metadata": 1.10.0 + "@polkadot/rpc-provider": 1.10.0 + "@polkadot/types": 1.10.0 "@polkadot/util": ^2.8.1 "@types/websocket": ^1.0.0 "@types/yargs": ^15.0.4 @@ -2834,25 +2834,25 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/types-known@1.10.0-beta.29, @polkadot/types-known@workspace:packages/types-known": +"@polkadot/types-known@1.10.0, @polkadot/types-known@workspace:packages/types-known": version: 0.0.0-use.local resolution: "@polkadot/types-known@workspace:packages/types-known" dependencies: "@babel/runtime": ^7.9.2 - "@polkadot/types": 1.10.0-beta.29 + "@polkadot/types": 1.10.0 "@polkadot/util": ^2.8.1 "@types/bn.js": ^4.11.6 bn.js: ^5.1.1 languageName: unknown linkType: soft -"@polkadot/types@1.10.0-beta.29, @polkadot/types@workspace:packages/types": +"@polkadot/types@1.10.0, @polkadot/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@polkadot/types@workspace:packages/types" dependencies: "@babel/runtime": ^7.9.2 "@polkadot/keyring": ^2.8.1 - "@polkadot/metadata": 1.10.0-beta.29 + "@polkadot/metadata": 1.10.0 "@polkadot/util": ^2.8.1 "@polkadot/util-crypto": ^2.8.1 "@types/bn.js": ^4.11.6