[CI Skip] 0.31.13

This commit is contained in:
Travis CI
2018-10-11 19:01:37 +00:00
parent 2b88a8f43c
commit eba79f160a
177 changed files with 2392 additions and 5588 deletions
+13 -6
View File
@@ -8,17 +8,24 @@ The API wrappers provide a standard interface for use -
* A static `.create(<optional WsProvider>)` that returns an API istance when connected, decorated and ready-to use
* The above is just a wrapper for `new Api(<optional WsProvider>)`, exposing the `isReady` getter
* `api.rpc.*` provides access to actual RPC calls, be it for queries, submission or retrieving chain information
* `api.st.*` provides access to chain state queries. These are dynamically populated based on what the runtime provides
* `api.tx.*` provides the ability to create transaction, like chain state, this list is populated from a runtime query
* `api.rpc.<section>.<method>` provides access to actual RPC calls, be it for queries, submission or retrieving chain information
* `api.st.<section>.<method>` provides access to chain state queries. These are dynamically populated based on what the runtime provides
* `api.tx.<section>.<method>` provides the ability to create transaction, like chain state, this list is populated from a runtime query
API Selection
-------------
There are two flavours of the API provided, one allowing a standard interface via JavaScript Promises and the second provides an Observable wrapper using [RxJS](https://github.com/ReactiveX/rxjs). Depending on your use-case and familiarity, you can choose either (or even both) for your application.
* [ApiPromise](promise/) All interface calls returns Promises, including the static `.create(...)`. Additionally any subscription method use standard JavaScript `(error, value) => {}` callbacks.
* [ApiRx](rx/) All interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion and subscription-based methods return long-running Observables that update with the latest values.
* [ApiPromise](classes/_promise_index_.apipromise.md) All interface calls returns Promises, including the static `.create(...)`. Additionally any subscription method use standard JavaScript `(error, value) => {}` callbacks.
* [ApiRx](classes/_rx_index_.apirx.md) All interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion and subscription-based methods return long-running Observables that update with the latest values.
Dynamic by default
------------------
Subtrate (on which Polkadot is built) used on-chain on-chain WASM runtimes, allowing for upgradability. Each runtime defining the actual chain extrinsics (submitted transactions and block intrinsics) as well as available entries in the chain state. Due to this, the API endpoints for queries and transactions are dynamically populated from the running chain.
Due to this dynamic nature, this API departs from traditional APIs which only has fixed endpoints, driving use by what is available by the runtime. As a start, this generic nature has a learning curve, although the provided documentation, examples and linked documentation tries to make that experience as seamless as possible.
Installation & import
---------------------
@@ -26,7 +33,7 @@ Installation & import
Installation -
```
npm install --save @polkadot/api/rx
npm install --save @polkadot/api
```
Subscribing to blocks via Promise-based API -