Skip to content

Commit

Permalink
Chore/update readme with resolutions (#184)
Browse files Browse the repository at this point in the history
* Update APIs readme as well as resolutions from example to include jsonrpc and rpc-provider
* Updated readme in the doc examples
  • Loading branch information
KarishmaBothara authored Oct 1, 2020
1 parent 95b77e1 commit e7cfffc
Show file tree
Hide file tree
Showing 33 changed files with 157 additions and 141 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

The CENNZnet JavaScript API library for browsers and Node.js.

## Quick Start

You must use **yarn** with @cennznet/api and set the following **resolutions** in your package.json, otherwise your install may break due to breaking changes in downstream package versions.
```
"resolutions": {
"@polkadot/types": "1.2.1",
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1",
}
```
See the [getting started guide](docs/GET_STARTED.md), [example snippets](docs/examples), or the [wiki](https://github.com/cennznet/cennznet/wiki/Javascript-API-Reference) to get started.

# Components
Expand Down
12 changes: 7 additions & 5 deletions docs/GET_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ Therefore you need to have the following lines in your package.json:
"@cennznet/api": "^1.0.3"
},
"resolutions": {
"@polkadot/types": "1.2.1",
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/types": "1.2.1",
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1",
}
```
The next step for your project is that you import @cennznet/api in your js code. The best way to do that is through a line such as:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/01_simple_connect/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple Connect

The following example shows how to instantiate a Plugnet API object and use it to connect to a node using ApiPromise.
The following example shows how to instantiate a CENNZnet API object and use it to connect to a node using ApiPromise.

<<< @/docs/examples/promise/01_simple_connect/index.js
4 changes: 3 additions & 1 deletion docs/examples/promise/01_simple_connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/02_listen_to_blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Listen to balance changes

This example shows how to instantiate a Polkadot API object and use it to connect to a node and retrieve balance updates.
This example shows how to instantiate a CENNZnet API object and use it to connect to a node and retrieve balance updates.

<<< @/docs/examples/promise/03_listen_to_balance_change/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Listen to balance changes

This example shows how to instantiate a Polkadot API object and use it to connect to a node and retrieve balance updates.
This example shows how to instantiate a CENNZnet API object and use it to connect to a node and retrieve balance updates.

<<< @/docs/examples/promise/03_listen_to_balance_change/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/05_unsubscribe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/06_make_transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/07_read_storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/08_read_storage_at/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/10_system_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/11_transfer_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/promise/12_upgrade_chain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/01_simple_connect/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple Connect

The following example shows how to instantiate a Polkadot API object and use it to connect to a node using ApiRx.
The following example shows how to instantiate a CENNZnet API object and use it to connect to a node using ApiRx.

<<< @/docs/examples/rx/01_simple_connect/index.js
4 changes: 3 additions & 1 deletion docs/examples/rx/01_simple_connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/rx/02_listen_to_blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/03_listen_to_balance_change/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Listen to balance changes

This example shows how to instantiate a Polkadot API object and use it to connect to a node and retrieve balance updates.
This example shows how to instantiate a CENNZnet API object and use it to connect to a node and retrieve balance updates.

<<< @/docs/examples/rx/03_listent_to_balance_change/index.js
4 changes: 3 additions & 1 deletion docs/examples/rx/03_listen_to_balance_change/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/rx/04_unsubscribe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/rx/05_read_storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/06_make_transfer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Make a simple transfer

This sample shows how to create a transaction to make a transfer from one an account to another.
This sample shows how to create a transaction to make a transfer from one account to another.

<<< @/docs/examples/rx/06_make_transfer/index.js
4 changes: 3 additions & 1 deletion docs/examples/rx/06_make_transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/rx/07_system_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/rx/08_transfer_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/rx/09_upgrade_chain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"@polkadot/metadata": "1.2.1",
"@polkadot/api": "1.2.1",
"@polkadot/api-derive": "1.2.1",
"@polkadot/rpc-core": "1.2.1"
"@polkadot/rpc-core": "1.2.1",
"@polkadot/rpc-provider": "1.2.1",
"@polkadot/jsonrpc": "1.2.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Loading

0 comments on commit e7cfffc

Please sign in to comment.