Skip to content

Commit e0bde92

Browse files
authored
1.10 (#2158)
* 1.10 * CHANGELOG * key extract example
1 parent e569de5 commit e0bde92

File tree

13 files changed

+84
-73
lines changed

13 files changed

+84
-73
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 1.10.0-beta.x
1+
# 1.10.1 Apr 13, 2020
22

33
- **Important** Substrate master has updated staking, on older chains apply `StakingLedger: 'StakingLedgerTo240'`
44
- Add `rpc.system.chainType` to retrieve the chain type (Development. Local, Live & Custom)
@@ -8,7 +8,8 @@
88
- Cleanups to derives for democracy & staking to be more performant
99
- Add Centrifuge base types to `@polkadot/types-known`
1010
- Adjust with all the latest substrate master types
11-
- Internally all private/protected methods/variables are now indicated with `_` (Aligning with the `private/protected` indicators in the TS definitions)
11+
- Internally all private/protected methods/variables are now `_` prefixed (Aligning with the `private/protected` indicators in the TS definitions)
12+
- Update metadata/docs-from-metadata to the latest Substrate
1213

1314
# 1.9.1 Apr 1, 2020
1415

docs/start/api.query.other.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ When working maps and double-maps, it is possible to retrieve a list of all the
6262
// Retrieve the active era
6363
const activeEra = await api.query.staking.activeEra();
6464

65-
// retrieve all exposures int the active era
65+
// retrieve all exposures for the active era
6666
const exposures = await api.query.staking.erasStakers.entries(activeEra.index);
6767

6868
exposures.forEach(([key, exposure]) => {
@@ -73,7 +73,17 @@ exposures.forEach(([key, exposure]) => {
7373

7474
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)
7575

76-
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.
76+
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) -
77+
78+
```js
79+
// retrieve all the nominator keys
80+
const keys = await api.query.staking.nominators.keys();
81+
82+
// extract the first key argument (AccountId) as string
83+
const nominatorIds = keys.map((key) => key.args[0].toString());
84+
85+
console.log('all nominators:', nminatorIds.join(', '));
86+
```
7787

7888
## State entries
7989

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"packages": [
1010
"packages/*"
1111
],
12-
"version": "1.10.0-beta.29"
12+
"version": "1.10.0"
1313
}

packages/api-contract/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/api-contract",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "Interfaces for interacting with contracts and contract ABIs",
55
"main": "index.js",
66
"keywords": [
@@ -27,9 +27,9 @@
2727
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
2828
"dependencies": {
2929
"@babel/runtime": "^7.9.2",
30-
"@polkadot/api": "1.10.0-beta.29",
31-
"@polkadot/rpc-core": "1.10.0-beta.29",
32-
"@polkadot/types": "1.10.0-beta.29",
30+
"@polkadot/api": "1.10.0",
31+
"@polkadot/rpc-core": "1.10.0",
32+
"@polkadot/types": "1.10.0",
3333
"@polkadot/util": "^2.8.1",
3434
"bn.js": "^5.1.1",
3535
"rxjs": "^6.5.5"

packages/api-derive/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/api-derive",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
55
"main": "index.js",
66
"keywords": [
@@ -28,10 +28,10 @@
2828
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
2929
"dependencies": {
3030
"@babel/runtime": "^7.9.2",
31-
"@polkadot/api": "1.10.0-beta.29",
32-
"@polkadot/rpc-core": "1.10.0-beta.29",
33-
"@polkadot/rpc-provider": "1.10.0-beta.29",
34-
"@polkadot/types": "1.10.0-beta.29",
31+
"@polkadot/api": "1.10.0",
32+
"@polkadot/rpc-core": "1.10.0",
33+
"@polkadot/rpc-provider": "1.10.0",
34+
"@polkadot/types": "1.10.0",
3535
"@polkadot/util": "^2.8.1",
3636
"@polkadot/util-crypto": "^2.8.1",
3737
"bn.js": "^5.1.1",

packages/api/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/api",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
55
"main": "index.js",
66
"keywords": [
@@ -27,13 +27,13 @@
2727
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
2828
"dependencies": {
2929
"@babel/runtime": "^7.9.2",
30-
"@polkadot/api-derive": "1.10.0-beta.29",
30+
"@polkadot/api-derive": "1.10.0",
3131
"@polkadot/keyring": "^2.8.1",
32-
"@polkadot/metadata": "1.10.0-beta.29",
33-
"@polkadot/rpc-core": "1.10.0-beta.29",
34-
"@polkadot/rpc-provider": "1.10.0-beta.29",
35-
"@polkadot/types": "1.10.0-beta.29",
36-
"@polkadot/types-known": "1.10.0-beta.29",
32+
"@polkadot/metadata": "1.10.0",
33+
"@polkadot/rpc-core": "1.10.0",
34+
"@polkadot/rpc-provider": "1.10.0",
35+
"@polkadot/types": "1.10.0",
36+
"@polkadot/types-known": "1.10.0",
3737
"@polkadot/util": "^2.8.1",
3838
"@polkadot/util-crypto": "^2.8.1",
3939
"bn.js": "^5.1.1",

packages/metadata/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/metadata",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "Helpers to extract information from runtime metadata",
55
"main": "index.js",
66
"publishConfig": {
@@ -27,8 +27,8 @@
2727
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
2828
"dependencies": {
2929
"@babel/runtime": "^7.9.2",
30-
"@polkadot/types": "1.10.0-beta.29",
31-
"@polkadot/types-known": "1.10.0-beta.29",
30+
"@polkadot/types": "1.10.0",
31+
"@polkadot/types-known": "1.10.0",
3232
"@polkadot/util": "^2.8.1",
3333
"@polkadot/util-crypto": "^2.8.1",
3434
"bn.js": "^5.1.1"

packages/rpc-core/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/rpc-core",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
55
"main": "index.js",
66
"keywords": [
@@ -27,9 +27,9 @@
2727
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
2828
"dependencies": {
2929
"@babel/runtime": "^7.9.2",
30-
"@polkadot/metadata": "1.10.0-beta.29",
31-
"@polkadot/rpc-provider": "1.10.0-beta.29",
32-
"@polkadot/types": "1.10.0-beta.29",
30+
"@polkadot/metadata": "1.10.0",
31+
"@polkadot/rpc-provider": "1.10.0",
32+
"@polkadot/types": "1.10.0",
3333
"@polkadot/util": "^2.8.1",
3434
"memoizee": "^0.4.14",
3535
"rxjs": "^6.5.5"

packages/rpc-provider/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/rpc-provider",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "Transport providers for the API",
55
"main": "index.js",
66
"keywords": [
@@ -27,8 +27,8 @@
2727
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
2828
"dependencies": {
2929
"@babel/runtime": "^7.9.2",
30-
"@polkadot/metadata": "1.10.0-beta.29",
31-
"@polkadot/types": "1.10.0-beta.29",
30+
"@polkadot/metadata": "1.10.0",
31+
"@polkadot/types": "1.10.0",
3232
"@polkadot/util": "^2.8.1",
3333
"@polkadot/util-crypto": "^2.8.1",
3434
"bn.js": "^5.1.1",

packages/typegen/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkadot/typegen",
3-
"version": "1.10.0-beta.29",
3+
"version": "1.10.0",
44
"description": "Type generation scripts",
55
"main": "index.js",
66
"bin": {
@@ -36,10 +36,10 @@
3636
"@babel/core": "^7.9.0",
3737
"@babel/register": "^7.9.0",
3838
"@babel/runtime": "^7.9.2",
39-
"@polkadot/api": "1.10.0-beta.29",
40-
"@polkadot/metadata": "1.10.0-beta.29",
41-
"@polkadot/rpc-provider": "1.10.0-beta.29",
42-
"@polkadot/types": "1.10.0-beta.29",
39+
"@polkadot/api": "1.10.0",
40+
"@polkadot/metadata": "1.10.0",
41+
"@polkadot/rpc-provider": "1.10.0",
42+
"@polkadot/types": "1.10.0",
4343
"@polkadot/util": "^2.8.1",
4444
"websocket": "^1.0.31",
4545
"yargs": "^15.3.1"

0 commit comments

Comments
 (0)