[CI Skip] 0.32.11
This commit is contained in:
@@ -10,15 +10,15 @@
|
||||
|
||||
## decodeResponse
|
||||
|
||||
▸ **decodeResponse**(response: *`JsonRpcResponse`*): `any`
|
||||
▸ **decodeResponse**(response: *[JsonRpcResponse](../modules/_types_.md#jsonrpcresponse)*): `any`
|
||||
|
||||
*Defined in [coder/index.ts:12](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/coder/index.ts#L12)*
|
||||
*Defined in [coder/index.ts:12](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/coder/index.ts#L12)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| response | `JsonRpcResponse` |
|
||||
| response | [JsonRpcResponse](../modules/_types_.md#jsonrpcresponse) |
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
@@ -29,7 +29,7 @@ ___
|
||||
|
||||
▸ **encodeJson**(method: *`string`*, params: * `any` | `Array`<`any`>*): `string`
|
||||
|
||||
*Defined in [coder/index.ts:33](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/coder/index.ts#L33)*
|
||||
*Defined in [coder/index.ts:33](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/coder/index.ts#L33)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -45,9 +45,9 @@ ___
|
||||
|
||||
## encodeObject
|
||||
|
||||
▸ **encodeObject**(method: *`string`*, params: * `any` | `Array`<`any`>*): `JsonRpcRequest`
|
||||
▸ **encodeObject**(method: *`string`*, params: * `any` | `Array`<`any`>*): [JsonRpcRequest](../modules/_types_.md#jsonrpcrequest)
|
||||
|
||||
*Defined in [coder/index.ts:39](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/coder/index.ts#L39)*
|
||||
*Defined in [coder/index.ts:39](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/coder/index.ts#L39)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
| method | `string` |
|
||||
| params | `any` | `Array`<`any`>|
|
||||
|
||||
**Returns:** `JsonRpcRequest`
|
||||
**Returns:** [JsonRpcRequest](../modules/_types_.md#jsonrpcrequest)
|
||||
|
||||
___
|
||||
<a id="getid"></a>
|
||||
@@ -65,7 +65,7 @@ ___
|
||||
|
||||
▸ **getId**(): `number`
|
||||
|
||||
*Defined in [coder/index.ts:48](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/coder/index.ts#L48)*
|
||||
*Defined in [coder/index.ts:48](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/coder/index.ts#L48)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
|
||||
@@ -408,13 +408,13 @@
|
||||
<p><strong>HttpProvider</strong></p>
|
||||
<h1 id="implements">Implements</h1>
|
||||
<ul>
|
||||
<li><code>ProviderInterface</code></li>
|
||||
<li><a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a></li>
|
||||
</ul>
|
||||
<h1 id="constructors">Constructors</h1>
|
||||
<p><a id="constructor"></a></p>
|
||||
<h2 id="constructor">constructor</h2>
|
||||
<p>⊕ <strong>new HttpProvider</strong>(endpoint?: <em><code>string</code></em>): <a href="_http_index_.httpprovider.html">HttpProvider</a></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L40" target="_blank">http/index.ts:40</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L40" target="_blank">http/index.ts:40</a></em></p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -440,15 +440,17 @@
|
||||
<p><a id="isconnected"></a></p>
|
||||
<h2 id="isconnected">isConnected</h2>
|
||||
<p>▸ <strong>isConnected</strong>(): <code>boolean</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L56" target="_blank">http/index.ts:56</a></em></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#isconnected">isConnected</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L56" target="_blank">http/index.ts:56</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Whether the node is connected or not.</p>
|
||||
<p><strong>Returns:</strong> <code>boolean</code>
|
||||
true if connected</p>
|
||||
<hr>
|
||||
<p><a id="on"></a></p>
|
||||
<h2 id="on">on</h2>
|
||||
<p>▸ <strong>on</strong>(type: <em><code>ProviderInterface$Emitted</code></em>, sub: <em><code>ProviderInterface$EmitCb</code></em>): <code>void</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L64" target="_blank">http/index.ts:64</a></em></p>
|
||||
<p>▸ <strong>on</strong>(type: <em><a href="../modules/_types_.md#providerinterface_emitted">ProviderInterface$Emitted</a></em>, sub: <em><a href="../modules/_types_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></em>): <code>void</code></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#on">on</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L64" target="_blank">http/index.ts:64</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Events are not supported with the HttpProvider, see <a href="_ws_index_.wsprovider.html">WsProvider</a>.</p>
|
||||
<p><em><strong>description</strong></em>: HTTP Provider does not have 'on' emitters. WebSockets should be used instead.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
@@ -462,11 +464,11 @@ true if connected</p>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><code>ProviderInterface$Emitted</code></td>
|
||||
<td><a href="../modules/_types_.md#providerinterface_emitted">ProviderInterface$Emitted</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sub</td>
|
||||
<td><code>ProviderInterface$EmitCb</code></td>
|
||||
<td><a href="../modules/_types_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -475,7 +477,8 @@ true if connected</p>
|
||||
<p><a id="send"></a></p>
|
||||
<h2 id="send">send</h2>
|
||||
<p>▸ <strong>send</strong>(method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>): <code>Promise</code><<code>any</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L71" target="_blank">http/index.ts:71</a></em></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#send">send</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L71" target="_blank">http/index.ts:71</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Send HTTP POST Request with Body to configured HTTP Endpoint.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
@@ -500,8 +503,9 @@ true if connected</p>
|
||||
<hr>
|
||||
<p><a id="subscribe"></a></p>
|
||||
<h2 id="subscribe">subscribe</h2>
|
||||
<p>▸ <strong>subscribe</strong>(types: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, cb: <em><code>ProviderInterface$Callback</code></em>): <code>Promise</code><<code>number</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L93" target="_blank">http/index.ts:93</a></em></p>
|
||||
<p>▸ <strong>subscribe</strong>(types: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, cb: <em><a href="../modules/_types_.md#providerinterface_callback">ProviderInterface$Callback</a></em>): <code>Promise</code><<code>number</code>></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#subscribe">subscribe</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L93" target="_blank">http/index.ts:93</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Subscriptions are not supported with the HttpProvider, see <a href="_ws_index_.wsprovider.html">WsProvider</a>.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
@@ -526,7 +530,7 @@ true if connected</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cb</td>
|
||||
<td><code>ProviderInterface$Callback</code></td>
|
||||
<td><a href="../modules/_types_.md#providerinterface_callback">ProviderInterface$Callback</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -535,7 +539,8 @@ true if connected</p>
|
||||
<p><a id="unsubscribe"></a></p>
|
||||
<h2 id="unsubscribe">unsubscribe</h2>
|
||||
<p>▸ <strong>unsubscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, id: <em><code>number</code></em>): <code>Promise</code><<code>boolean</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L102" target="_blank">http/index.ts:102</a></em></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#unsubscribe">unsubscribe</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L102" target="_blank">http/index.ts:102</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Subscriptions are not supported with the HttpProvider, see <a href="_ws_index_.wsprovider.html">WsProvider</a>.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
@@ -605,7 +610,7 @@ true if connected</p>
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"HttpProvider","level":"1.3.1","depth":2,"next":{"title":"WsProvider","level":"1.3.2","depth":2,"path":"rpc-provider/classes/_ws_index_.wsprovider.md","ref":"rpc-provider/classes/_ws_index_.wsprovider.md","articles":[]},"previous":{"title":"rpc-provider","level":"1.3","depth":1,"path":"rpc-provider/README.md","ref":"rpc-provider/README.md","articles":[{"title":"HttpProvider","level":"1.3.1","depth":2,"path":"rpc-provider/classes/_http_index_.httpprovider.md","ref":"rpc-provider/classes/_http_index_.httpprovider.md","articles":[]},{"title":"WsProvider","level":"1.3.2","depth":2,"path":"rpc-provider/classes/_ws_index_.wsprovider.md","ref":"rpc-provider/classes/_ws_index_.wsprovider.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"rpc-provider/classes/_http_index_.httpprovider.md","mtime":"2018-11-29T10:25:12.124Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-29T10:26:16.157Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"HttpProvider","level":"1.3.1","depth":2,"next":{"title":"WsProvider","level":"1.3.2","depth":2,"path":"rpc-provider/classes/_ws_index_.wsprovider.md","ref":"rpc-provider/classes/_ws_index_.wsprovider.md","articles":[]},"previous":{"title":"rpc-provider","level":"1.3","depth":1,"path":"rpc-provider/README.md","ref":"rpc-provider/README.md","articles":[{"title":"HttpProvider","level":"1.3.1","depth":2,"path":"rpc-provider/classes/_http_index_.httpprovider.md","ref":"rpc-provider/classes/_http_index_.httpprovider.md","articles":[]},{"title":"WsProvider","level":"1.3.2","depth":2,"path":"rpc-provider/classes/_ws_index_.wsprovider.md","ref":"rpc-provider/classes/_ws_index_.wsprovider.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"rpc-provider/classes/_http_index_.httpprovider.md","mtime":"2018-11-29T11:17:11.305Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-29T11:18:15.414Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@ const api = new Api(provider);
|
||||
|
||||
# Implements
|
||||
|
||||
* `ProviderInterface`
|
||||
* [ProviderInterface](../interfaces/_types_.providerinterface.md)
|
||||
|
||||
# Constructors
|
||||
|
||||
@@ -34,7 +34,7 @@ const api = new Api(provider);
|
||||
|
||||
⊕ **new HttpProvider**(endpoint?: *`string`*): [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
*Defined in [http/index.ts:40](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L40)*
|
||||
*Defined in [http/index.ts:40](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L40)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -54,7 +54,9 @@ ___
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [http/index.ts:56](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L56)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[isConnected](../interfaces/_types_.providerinterface.md#isconnected)*
|
||||
|
||||
*Defined in [http/index.ts:56](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L56)*
|
||||
|
||||
*__summary__*: Whether the node is connected or not.
|
||||
|
||||
@@ -66,9 +68,11 @@ ___
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *`ProviderInterface$Emitted`*, sub: *`ProviderInterface$EmitCb`*): `void`
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Defined in [http/index.ts:64](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L64)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[on](../interfaces/_types_.providerinterface.md#on)*
|
||||
|
||||
*Defined in [http/index.ts:64](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L64)*
|
||||
|
||||
*__summary__*: Events are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
@@ -78,8 +82,8 @@ ___
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | `ProviderInterface$Emitted` |
|
||||
| sub | `ProviderInterface$EmitCb` |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -90,7 +94,9 @@ ___
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Defined in [http/index.ts:71](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L71)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[send](../interfaces/_types_.providerinterface.md#send)*
|
||||
|
||||
*Defined in [http/index.ts:71](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L71)*
|
||||
|
||||
*__summary__*: Send HTTP POST Request with Body to configured HTTP Endpoint.
|
||||
|
||||
@@ -108,9 +114,11 @@ ___
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(types: *`string`*, method: *`string`*, params: *`Array`<`any`>*, cb: *`ProviderInterface$Callback`*): `Promise`<`number`>
|
||||
▸ **subscribe**(types: *`string`*, method: *`string`*, params: *`Array`<`any`>*, cb: *[ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*Defined in [http/index.ts:93](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L93)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[subscribe](../interfaces/_types_.providerinterface.md#subscribe)*
|
||||
|
||||
*Defined in [http/index.ts:93](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L93)*
|
||||
|
||||
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
@@ -121,7 +129,7 @@ ___
|
||||
| types | `string` |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
| cb | `ProviderInterface$Callback` |
|
||||
| cb | [ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback) |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
|
||||
@@ -132,7 +140,9 @@ ___
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [http/index.ts:102](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/http/index.ts#L102)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[unsubscribe](../interfaces/_types_.providerinterface.md#unsubscribe)*
|
||||
|
||||
*Defined in [http/index.ts:102](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/http/index.ts#L102)*
|
||||
|
||||
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ A mock provider mainly used for testing.
|
||||
|
||||
# Implements
|
||||
|
||||
* `ProviderInterface`
|
||||
* [ProviderInterface](../interfaces/_types_.providerinterface.md)
|
||||
|
||||
# Constructors
|
||||
|
||||
@@ -19,7 +19,7 @@ A mock provider mainly used for testing.
|
||||
|
||||
⊕ **new Mock**(): [Mock](_mock_index_.mock.md)
|
||||
|
||||
*Defined in [mock/index.ts:64](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L64)*
|
||||
*Defined in [mock/index.ts:64](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L64)*
|
||||
|
||||
**Returns:** [Mock](_mock_index_.mock.md)
|
||||
|
||||
@@ -33,14 +33,14 @@ ___
|
||||
|
||||
**● isUpdating**: *`boolean`* = true
|
||||
|
||||
*Defined in [mock/index.ts:42](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L42)*
|
||||
*Defined in [mock/index.ts:42](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L42)*
|
||||
|
||||
___
|
||||
<a id="subscriptions"></a>
|
||||
|
||||
## subscriptions
|
||||
|
||||
**● subscriptions**: *`MockState$Subscriptions`* = SUBSCRIPTIONS.reduce((subs, name) => {
|
||||
**● subscriptions**: *[MockState$Subscriptions](../modules/_mock_types_.md#mockstate_subscriptions)* = SUBSCRIPTIONS.reduce((subs, name) => {
|
||||
subs[name] = {
|
||||
callbacks: {},
|
||||
lastValue: null
|
||||
@@ -49,7 +49,7 @@ ___
|
||||
return subs;
|
||||
}, ({} as MockState$Subscriptions))
|
||||
|
||||
*Defined in [mock/index.ts:53](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L53)*
|
||||
*Defined in [mock/index.ts:53](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L53)*
|
||||
|
||||
___
|
||||
|
||||
@@ -61,7 +61,9 @@ ___
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [mock/index.ts:70](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L70)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[isConnected](../interfaces/_types_.providerinterface.md#isconnected)*
|
||||
|
||||
*Defined in [mock/index.ts:70](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L70)*
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
@@ -70,16 +72,18 @@ ___
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *`ProviderInterface$Emitted`*, sub: *`ProviderInterface$EmitCb`*): `void`
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Defined in [mock/index.ts:74](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L74)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[on](../interfaces/_types_.providerinterface.md#on)*
|
||||
|
||||
*Defined in [mock/index.ts:74](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L74)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | `ProviderInterface$Emitted` |
|
||||
| sub | `ProviderInterface$EmitCb` |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -90,7 +94,9 @@ ___
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Defined in [mock/index.ts:78](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L78)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[send](../interfaces/_types_.providerinterface.md#send)*
|
||||
|
||||
*Defined in [mock/index.ts:78](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L78)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -108,7 +114,7 @@ ___
|
||||
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, ...params: *`Array`<`any`>*): `Promise`<`number`>
|
||||
|
||||
*Defined in [mock/index.ts:86](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L86)*
|
||||
*Defined in [mock/index.ts:86](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L86)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -127,7 +133,9 @@ ___
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [mock/index.ts:106](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/mock/index.ts#L106)*
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[unsubscribe](../interfaces/_types_.providerinterface.md#unsubscribe)*
|
||||
|
||||
*Defined in [mock/index.ts:106](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/mock/index.ts#L106)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@
|
||||
<p><a id="constructor"></a></p>
|
||||
<h2 id="constructor">constructor</h2>
|
||||
<p>⊕ <strong>new WsProvider</strong>(endpoint?: <em><code>string</code></em>, autoConnect?: <em><code>boolean</code></em>): <a href="_ws_index_.wsprovider.html">WsProvider</a></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L75" target="_blank">ws/index.ts:75</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L75" target="_blank">ws/index.ts:75</a></em></p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -446,7 +446,7 @@
|
||||
<p><a id="connect"></a></p>
|
||||
<h2 id="connect">connect</h2>
|
||||
<p>▸ <strong>connect</strong>(): <code>void</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L103" target="_blank">ws/index.ts:103</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L103" target="_blank">ws/index.ts:103</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Manually connect</p>
|
||||
<p><em><strong>description</strong></em>: The <a href="_ws_index_.wsprovider.html">WsProvider</a> connects automatically by default, however if you decided otherwise, you may connect manually using this method.</p>
|
||||
<p><strong>Returns:</strong> <code>void</code></p>
|
||||
@@ -454,15 +454,15 @@
|
||||
<p><a id="isconnected"></a></p>
|
||||
<h2 id="isconnected">isConnected</h2>
|
||||
<p>▸ <strong>isConnected</strong>(): <code>boolean</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L120" target="_blank">ws/index.ts:120</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L120" target="_blank">ws/index.ts:120</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Whether the node is connected or not.</p>
|
||||
<p><strong>Returns:</strong> <code>boolean</code>
|
||||
true if connected</p>
|
||||
<hr>
|
||||
<p><a id="on"></a></p>
|
||||
<h2 id="on">on</h2>
|
||||
<p>▸ <strong>on</strong>(type: <em><code>ProviderInterface$Emitted</code></em>, sub: <em><code>ProviderInterface$EmitCb</code></em>): <code>void</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L129" target="_blank">ws/index.ts:129</a></em></p>
|
||||
<p>▸ <strong>on</strong>(type: <em><a href="../modules/_types_.md#providerinterface_emitted">ProviderInterface$Emitted</a></em>, sub: <em><a href="../modules/_types_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></em>): <code>void</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L129" target="_blank">ws/index.ts:129</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Listens on events after having subscribed using the <a href="_ws_index_.wsprovider.html#subscribe">subscribe</a> function.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
@@ -476,12 +476,12 @@ true if connected</p>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><code>ProviderInterface$Emitted</code></td>
|
||||
<td><a href="../modules/_types_.md#providerinterface_emitted">ProviderInterface$Emitted</a></td>
|
||||
<td>Event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sub</td>
|
||||
<td><code>ProviderInterface$EmitCb</code></td>
|
||||
<td><a href="../modules/_types_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></td>
|
||||
<td>Callback</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -491,7 +491,7 @@ true if connected</p>
|
||||
<p><a id="send"></a></p>
|
||||
<h2 id="send">send</h2>
|
||||
<p>▸ <strong>send</strong>(method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, subscription?: <em><code>SubscriptionHandler</code></em>): <code>Promise</code><<code>any</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L139" target="_blank">ws/index.ts:139</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L139" target="_blank">ws/index.ts:139</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Send JSON data using WebSockets to configured HTTP Endpoint or queue.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
@@ -524,8 +524,8 @@ true if connected</p>
|
||||
<hr>
|
||||
<p><a id="subscribe"></a></p>
|
||||
<h2 id="subscribe">subscribe</h2>
|
||||
<p>▸ <strong>subscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, callback: <em><code>ProviderInterface$Callback</code></em>): <code>Promise</code><<code>number</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L195" target="_blank">ws/index.ts:195</a></em></p>
|
||||
<p>▸ <strong>subscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, callback: <em><a href="../modules/_types_.md#providerinterface_callback">ProviderInterface$Callback</a></em>): <code>Promise</code><<code>number</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L195" target="_blank">ws/index.ts:195</a></em></p>
|
||||
<p><em><strong>name</strong></em>: subscribe</p>
|
||||
<p><em><strong>summary</strong></em>: Allows subscribing to a specific event.</p>
|
||||
<p><em><strong>example</strong></em>: </p>
|
||||
@@ -565,7 +565,7 @@ true if connected</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>callback</td>
|
||||
<td><code>ProviderInterface$Callback</code></td>
|
||||
<td><a href="../modules/_types_.md#providerinterface_callback">ProviderInterface$Callback</a></td>
|
||||
<td>Callback</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -576,7 +576,7 @@ Promise resolving to the dd of the subscription you can use with [[unsubscribe]]
|
||||
<p><a id="unsubscribe"></a></p>
|
||||
<h2 id="unsubscribe">unsubscribe</h2>
|
||||
<p>▸ <strong>unsubscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, id: <em><code>number</code></em>): <code>Promise</code><<code>boolean</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L204" target="_blank">ws/index.ts:204</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L204" target="_blank">ws/index.ts:204</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Allows unsubscribing to subscriptions made with <a href="_ws_index_.wsprovider.html#subscribe">subscribe</a>.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
@@ -646,7 +646,7 @@ Promise resolving to the dd of the subscription you can use with [[unsubscribe]]
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"WsProvider","level":"1.3.2","depth":2,"next":{"title":"RPC","level":"2.1","depth":1,"path":"METHODS_RPC.md","ref":"METHODS_RPC.md","articles":[]},"previous":{"title":"HttpProvider","level":"1.3.1","depth":2,"path":"rpc-provider/classes/_http_index_.httpprovider.md","ref":"rpc-provider/classes/_http_index_.httpprovider.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"rpc-provider/classes/_ws_index_.wsprovider.md","mtime":"2018-11-29T10:25:12.212Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-29T10:26:16.157Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"WsProvider","level":"1.3.2","depth":2,"next":{"title":"RPC","level":"2.1","depth":1,"path":"METHODS_RPC.md","ref":"METHODS_RPC.md","articles":[]},"previous":{"title":"HttpProvider","level":"1.3.1","depth":2,"path":"rpc-provider/classes/_http_index_.httpprovider.md","ref":"rpc-provider/classes/_http_index_.httpprovider.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"rpc-provider/classes/_ws_index_.wsprovider.md","mtime":"2018-11-29T11:17:11.401Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-29T11:18:15.414Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@ const api = new Api(provider);
|
||||
|
||||
⊕ **new WsProvider**(endpoint?: *`string`*, autoConnect?: *`boolean`*): [WsProvider](_ws_index_.wsprovider.md)
|
||||
|
||||
*Defined in [ws/index.ts:75](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L75)*
|
||||
*Defined in [ws/index.ts:75](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L75)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -55,7 +55,7 @@ ___
|
||||
|
||||
▸ **connect**(): `void`
|
||||
|
||||
*Defined in [ws/index.ts:103](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L103)*
|
||||
*Defined in [ws/index.ts:103](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L103)*
|
||||
|
||||
*__summary__*: Manually connect
|
||||
|
||||
@@ -70,7 +70,7 @@ ___
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [ws/index.ts:120](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L120)*
|
||||
*Defined in [ws/index.ts:120](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L120)*
|
||||
|
||||
*__summary__*: Whether the node is connected or not.
|
||||
|
||||
@@ -82,9 +82,9 @@ ___
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *`ProviderInterface$Emitted`*, sub: *`ProviderInterface$EmitCb`*): `void`
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Defined in [ws/index.ts:129](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L129)*
|
||||
*Defined in [ws/index.ts:129](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L129)*
|
||||
|
||||
*__summary__*: Listens on events after having subscribed using the [subscribe](_ws_index_.wsprovider.md#subscribe) function.
|
||||
|
||||
@@ -92,8 +92,8 @@ ___
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| type | `ProviderInterface$Emitted` | Event |
|
||||
| sub | `ProviderInterface$EmitCb` | Callback |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted) | Event |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb) | Callback |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -104,7 +104,7 @@ ___
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*, subscription?: *`SubscriptionHandler`*): `Promise`<`any`>
|
||||
|
||||
*Defined in [ws/index.ts:139](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L139)*
|
||||
*Defined in [ws/index.ts:139](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L139)*
|
||||
|
||||
*__summary__*: Send JSON data using WebSockets to configured HTTP Endpoint or queue.
|
||||
|
||||
@@ -123,9 +123,9 @@ ___
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, callback: *`ProviderInterface$Callback`*): `Promise`<`number`>
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, callback: *[ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*Defined in [ws/index.ts:195](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L195)*
|
||||
*Defined in [ws/index.ts:195](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L195)*
|
||||
|
||||
*__name__*: subscribe
|
||||
|
||||
@@ -151,7 +151,7 @@ rpc.state.subscribeStorage([[storage.balances.freeBalance, <Address>]], (_, valu
|
||||
| type | `string` | Subscription type |
|
||||
| method | `string` | Subscription method |
|
||||
| params | `Array`<`any`> | Parameters |
|
||||
| callback | `ProviderInterface$Callback` | Callback |
|
||||
| callback | [ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback) | Callback |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
Promise resolving to the dd of the subscription you can use with [[unsubscribe]].
|
||||
@@ -163,7 +163,7 @@ ___
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [ws/index.ts:204](https://github.com/polkadot-js/api/blob/379e82a/packages/rpc-provider/src/ws/index.ts#L204)*
|
||||
*Defined in [ws/index.ts:204](https://github.com/polkadot-js/api/blob/9092250/packages/rpc-provider/src/ws/index.ts#L204)*
|
||||
|
||||
*__summary__*: Allows unsubscribing to subscriptions made with [subscribe](_ws_index_.wsprovider.md#subscribe).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user