[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
+30 -14
View File
@@ -24,7 +24,7 @@
⊕ **new ApiBase**(wsProvider?: *`WsProvider`*): [ApiBase](_base_.apibase.md)
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L40)*
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L40)*
*__example__*:
```javascript
@@ -41,7 +41,7 @@ new Api().isReady.subscribe((api) => {
| Param | Type | Description |
| ------ | ------ | ------ |
| `Optional` wsProvider | `WsProvider` | An optional WebSocket provider from rpc-provider/ws. If not specified, it will default to connecting to the localhost with the default port |
| `Optional` wsProvider | `WsProvider` | A WebSocket provider from rpc-provider/ws. If not specified, it will default to connecting to the localhost with the default port |
**Returns:** [ApiBase](_base_.apibase.md)
@@ -55,7 +55,7 @@ ___
getgenesisHash(): `Hash`
*Defined in [Base.ts:68](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L68)*
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L69)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
@@ -68,9 +68,11 @@ ___
getrpc(): `R`
*Defined in [Base.ts:105](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L105)*
*Defined in [Base.ts:109](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L109)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions.
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.st` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
@@ -90,7 +92,7 @@ ___
getruntimeMetadata(): `RuntimeMetadata`
*Defined in [Base.ts:77](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L77)*
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L78)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
@@ -103,7 +105,7 @@ ___
getruntimeVersion(): `RuntimeVersion`
*Defined in [Base.ts:86](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L86)*
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L87)*
*__description__*: Contains the version information for the current runtime.
@@ -116,10 +118,12 @@ ___
getst(): `S`
*Defined in [Base.ts:122](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L122)*
*Defined in [Base.ts:129](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L129)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.st.timestamp.now()` (current block timestamp) does not take parameters, while `api.st.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.st.balances
@@ -138,7 +142,7 @@ ___
gettx(): `E`
*Defined in [Base.ts:143](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L143)*
*Defined in [Base.ts:151](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L151)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
@@ -165,14 +169,26 @@ ___
▸ **on**(type: *`ApiInterface$Events`*, handler: *`function`*): `void`
*Defined in [Base.ts:149](https://github.com/polkadot-js/api/blob/e103e98/packages/api/src/Base.ts#L149)*
*Defined in [Base.ts:173](https://github.com/polkadot-js/api/blob/2b88a8f/packages/api/src/Base.ts#L173)*
*__description__*:
*__example&lt;br&gt;__*: ```javascript
* api.on('disconnected', () => {
console.log('API has been connected to the endpoint');
});
api.on('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Param | Type |
| ------ | ------ |
| type | `ApiInterface$Events` |
| handler | `function` |
| Param | Type | Description |
| ------ | ------ | ------ |
| type | `ApiInterface$Events` | The type of event to listen to. Availble events are \`connected\`, \`disconnected\` and \`ready\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `void`