Skip to content

Commit 9975f58

Browse files
authored
1.11 (#2198)
* 1.11 * isOptional is custom RPC sample * Names is one-liner for custom RPCs
1 parent 5363692 commit 9975f58

File tree

13 files changed

+78
-71
lines changed

13 files changed

+78
-71
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 1.11.0-beta.x
1+
# 1.11.1 Apr 21, 2020
22

33
- **Important** Substrate master has an updated `Weight` (to `u64`), on older chains apply `Weight: 'u32'` (This does affect event decoding if wrongly set)
44
- Allow user type augmentation to work with different versions of rxjs (Thanks to https://github.com/monitz87)

docs/start/rpc.custom.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ const api = await ApiPromise.create({
1717
{
1818
name: 'index',
1919
type: 'u64'
20+
},
21+
{
22+
name: 'at',
23+
type: 'Hash',
24+
isOptional: true
2025
}
2126
],
2227
type: 'Balance'
@@ -26,7 +31,9 @@ const api = await ApiPromise.create({
2631
});
2732
```
2833

29-
In the above example we have defined a new method, which is now available on the RPCs as `api.rpc.firstModule.testMethod(u64) => Promise<Balance>`. Do be aware that while defined, the method will only appear if it is in the list as returned by `api.rpc.rpc.methods()`, which is the list of known RPCs the node exposes. When making changes to the node, always ensure that it does expose the RPC method correctly, otherwise it will not be decorated.
34+
In the above example we have defined a new method, which is now available on the RPCs as `api.rpc.firstModule.testMethod(index: u64, at?: Hash) => Promise<Balance>`. In the case of optional params, we have added the `isOptional: true` flag alongside the `name` & `type` in the param definition.
35+
36+
Be aware that while defined, the method will only appear on the API if it is in the list as returned by `api.rpc.rpc.methods()`, which is the list of known RPCs the node exposes. When making changes to the node, always ensure that it does expose the RPC method correctly, otherwise it will not be decorated.
3037

3138
## Definition breakdown
3239

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.11.0-beta.35"
12+
"version": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
31-
"@polkadot/rpc-core": "1.11.0-beta.35",
32-
"@polkadot/types": "1.11.0-beta.35",
30+
"@polkadot/api": "1.11.0",
31+
"@polkadot/rpc-core": "1.11.0",
32+
"@polkadot/types": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
32-
"@polkadot/rpc-core": "1.11.0-beta.35",
33-
"@polkadot/rpc-provider": "1.11.0-beta.35",
34-
"@polkadot/types": "1.11.0-beta.35",
31+
"@polkadot/api": "1.11.0",
32+
"@polkadot/rpc-core": "1.11.0",
33+
"@polkadot/rpc-provider": "1.11.0",
34+
"@polkadot/types": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
30+
"@polkadot/api-derive": "1.11.0",
3131
"@polkadot/keyring": "^2.8.1",
32-
"@polkadot/metadata": "1.11.0-beta.35",
33-
"@polkadot/rpc-core": "1.11.0-beta.35",
34-
"@polkadot/rpc-provider": "1.11.0-beta.35",
35-
"@polkadot/types": "1.11.0-beta.35",
36-
"@polkadot/types-known": "1.11.0-beta.35",
32+
"@polkadot/metadata": "1.11.0",
33+
"@polkadot/rpc-core": "1.11.0",
34+
"@polkadot/rpc-provider": "1.11.0",
35+
"@polkadot/types": "1.11.0",
36+
"@polkadot/types-known": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
31-
"@polkadot/types-known": "1.11.0-beta.35",
30+
"@polkadot/types": "1.11.0",
31+
"@polkadot/types-known": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
31-
"@polkadot/rpc-provider": "1.11.0-beta.35",
32-
"@polkadot/types": "1.11.0-beta.35",
30+
"@polkadot/metadata": "1.11.0",
31+
"@polkadot/rpc-provider": "1.11.0",
32+
"@polkadot/types": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
31-
"@polkadot/types": "1.11.0-beta.35",
30+
"@polkadot/metadata": "1.11.0",
31+
"@polkadot/types": "1.11.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.11.0-beta.35",
3+
"version": "1.11.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.11.0-beta.35",
40-
"@polkadot/metadata": "1.11.0-beta.35",
41-
"@polkadot/rpc-provider": "1.11.0-beta.35",
42-
"@polkadot/types": "1.11.0-beta.35",
39+
"@polkadot/api": "1.11.0",
40+
"@polkadot/metadata": "1.11.0",
41+
"@polkadot/rpc-provider": "1.11.0",
42+
"@polkadot/types": "1.11.0",
4343
"@polkadot/util": "^2.8.1",
4444
"websocket": "^1.0.31",
4545
"yargs": "^15.3.1"

0 commit comments

Comments
 (0)