Skip to content

Commit

Permalink
Merge ddcd137 into cd7c17b
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Oct 10, 2018
2 parents cd7c17b + ddcd137 commit ca3f8f4
Show file tree
Hide file tree
Showing 168 changed files with 257 additions and 1,058 deletions.
14 changes: 7 additions & 7 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Packages

- [api](api/README.md)
- [Api](api/classes/_index_.api.md)
- [api-provider](api-provider/README.md)
- [HttpProvider](api-provider/classes/_http_index_.httpprovider.md)
- [WsProvider](api-provider/classes/_ws_index_.wsprovider.md)
- [api-rx](api-rx/README.md)
- [ApiRx](api-rx/classes/_index_.rxapi.md)
- [rpc-core](rpc-core/README.md)
- [Rpc](rpc-core/classes/_index_.rpc.md)
- [rpc-provider](rpc-provider/README.md)
- [HttpProvider](rpc-provider/classes/_http_index_.httpprovider.md)
- [WsProvider](rpc-provider/classes/_ws_index_.wsprovider.md)
- [rpc-rx](rpc-rx/README.md)
- [RpcRx](rpc-rx/classes/_index_.rxapi.md)

## Examples

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/01_simple_connect/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Api = require('@polkadot/api').default;
const WsProvider = require('@polkadot/api-provider/ws').default;
const Rpc = require('@polkadot/rpc-core').default;
const WsProvider = require('@polkadot/rpc-provider/ws').default;
const provider = new WsProvider('ws://127.0.0.1:9944');
const api = new Api(provider);
const api = new Rpc(provider);

async function getChain () {
return api.system.chain();
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/01_simple_connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},

"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/api-provider": "^0.29.1"
"@polkadot/rpc-core": "^0.31.1",
"@polkadot/rpc-provider": "^0.31.1"
},
"devDependencies": {
"rimraf": "^2.6.2"
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/02_listen_to_blocks/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const BN = require('bn.js');
const Api = require('@polkadot/api').default;
const WsProvider = require('@polkadot/api-provider/ws').default;
const Rpc = require('@polkadot/rpc-core').default;
const WsProvider = require('@polkadot/rpc-provider/ws').default;
const provider = new WsProvider('ws://127.0.0.1:9944');
const api = new Api(provider);
const api = new Rpc(provider);

function main () {
console.log('Blocks will be shown as they come in, CTRL+C to stop:');
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/02_listen_to_blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/rpc-core": "^0.31.1",
"bn.js": "^4.11.8"
},
"devDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions docs/examples/03_listen_to_balance_change/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const BN = require('bn.js');
const Api = require('@polkadot/api').default;
const WsProvider = require('@polkadot/api-provider/ws').default;
const Rpc = require('@polkadot/rpc-core').default;
const WsProvider = require('@polkadot/rpc-provider/ws').default;
const storage = require('@polkadot/storage').default;
const provider = new WsProvider('ws://127.0.0.1:9944');
const api = new Api(provider);
const api = new Rpc(provider);

const Alice = '5GoKvZWG5ZPYL1WUovuHW3zJBWBP5eT8CbqjdRY4Q6iMaDtZ';

console.log('You may leave this example running and start example 06 or send DOTs to ' + Alice);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/03_listen_to_balance_change/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/rpc-core": "^0.31.1",
"bn.js": "^4.11.8"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/04_generate_account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/rpc-core": "^0.31.1",
"@polkadot/util": "0.30.3",
"@polkadot/util-keyring": "0.30.3"
},
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/05_read_storage/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const BN = require('bn.js');
const Api = require('@polkadot/api').default;
const WsProvider = require('@polkadot/api-provider/ws').default;
const Rpc = require('@polkadot/rpc-core').default;
const WsProvider = require('@polkadot/rpc-provider/ws').default;
const storage = require('@polkadot/storage').default;

const provider = new WsProvider('ws://127.0.0.1:9944');
const api = new Api(provider);
const api = new Rpc(provider);

async function getAccountIndex (address) {
return api.state.getStorage([storage.system.public.accountIndexOf, address]);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/05_read_storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/rpc-core": "^0.31.1",
"bn.js": "^4.11.8"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/06_craft_extrinsic/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const BN = require('bn.js');
const Api = require('@polkadot/api').default;
const WsProvider = require('@polkadot/api-provider/ws').default;
const Rpc = require('@polkadot/rpc-core').default;
const WsProvider = require('@polkadot/rpc-provider/ws').default;
const extrinsics = require('@polkadot/extrinsics').default;
const encodeExtrinsic = require('@polkadot/extrinsics/codec/encode').default;
const encodeLength = require('@polkadot/extrinsics/codec/encode/length').default;
Expand All @@ -10,7 +10,7 @@ const storage = require('@polkadot/storage').default;
const Encoder = new TextEncoder();
const keyring = new Keyring();
const provider = new WsProvider('ws://127.0.0.1:9944');
const api = new Api(provider);
const api = new Rpc(provider);

async function getAccountIndex (address) {
return api.state.getStorage([storage.system.public.accountIndexOf, address]);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/06_craft_extrinsic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/rpc-core": "^0.31.1",
"bn.js": "^4.11.8"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/07_transfer_dots/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const BN = require('bn.js');
const Api = require('@polkadot/api').default;
const WsProvider = require('@polkadot/api-provider/ws').default;
const Rpc = require('@polkadot/rpc-core').default;
const WsProvider = require('@polkadot/rpc-provider/ws').default;
const extrinsics = require('@polkadot/extrinsics').default;
const encodeExtrinsic = require('@polkadot/extrinsics/codec/encode/uncheckedLength').default;
const Keyring = require('@polkadot/util-keyring').default;
Expand All @@ -9,7 +9,7 @@ const storage = require('@polkadot/storage').default;
const Encoder = new TextEncoder();
const keyring = new Keyring();
const provider = new WsProvider('ws://127.0.0.1:9944');
const api = new Api(provider);
const api = new Rpc(provider);

async function getAccountIndex (address) {
return api.state.getStorage([storage.system.public.accountIndexOf, address]);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/07_transfer_dots/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@polkadot/api": "0.29.1",
"@polkadot/rpc-core": "^0.31.1",
"bn.js": "^4.11.8"
},
"devDependencies": {
Expand Down
8 changes: 0 additions & 8 deletions docs/guides/create_api.adoc

This file was deleted.

8 changes: 8 additions & 0 deletions docs/guides/create_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

```javascript
import Rpc from '@polkadot/rpc-core';
import WsProvider from '@polkadot/rpc-provider/ws';

const provider = new WsProvider('ws://127.0.0.1:9944');
const rpc = new Rpc(provider);
```
168 changes: 0 additions & 168 deletions docs/types/SUMMARY.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/types/modules/_accountid_.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/types/modules/_accountindex_.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/types/modules/_address_.md

This file was deleted.

0 comments on commit ca3f8f4

Please sign in to comment.