[CI Skip] 0.43.6

This commit is contained in:
Travis CI
2019-02-15 16:47:30 +00:00
parent 4735253cbd
commit aa656b0bc6
418 changed files with 175218 additions and 4853 deletions
@@ -12,7 +12,7 @@
▸ **decodeResponse**(response: *[JsonRpcResponse](../modules/_types_.md#jsonrpcresponse)*): `any`
*Defined in [coder/index.ts:12](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/coder/index.ts#L12)*
*Defined in [coder/index.ts:12](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/coder/index.ts#L12)*
**Parameters:**
@@ -27,16 +27,16 @@ ___
## encodeJson
▸ **encodeJson**(method: *`string`*, params: *`any` | `Array`<`any`>*): `string`
▸ **encodeJson**(method: *`string`*, params: *`any` \| `Array`<`any`>*): `string`
*Defined in [coder/index.ts:33](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/coder/index.ts#L33)*
*Defined in [coder/index.ts:33](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/coder/index.ts#L33)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| method | `string` |
| params | `any` | `Array`<`any`> |
| params | `any` \| `Array`<`any`> |
**Returns:** `string`
@@ -45,16 +45,16 @@ ___
## encodeObject
▸ **encodeObject**(method: *`string`*, params: *`any` | `Array`<`any`>*): [JsonRpcRequest](../modules/_types_.md#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/1b2694d/packages/rpc-provider/src/coder/index.ts#L39)*
*Defined in [coder/index.ts:39](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/coder/index.ts#L39)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| method | `string` |
| params | `any` | `Array`<`any`> |
| params | `any` \| `Array`<`any`> |
**Returns:** [JsonRpcRequest](../modules/_types_.md#jsonrpcrequest)
@@ -65,7 +65,7 @@ ___
▸ **getId**(): `number`
*Defined in [coder/index.ts:48](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/coder/index.ts#L48)*
*Defined in [coder/index.ts:48](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/coder/index.ts#L48)*
**Returns:** `number`
@@ -2156,7 +2156,7 @@
<p><a id="constructor"></a></p>
<h2 id="constructor">constructor</h2>
<p>&#x2295; <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/1b2694d/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/4735253/packages/rpc-provider/src/http/index.ts#L40" target="_blank">http/index.ts:40</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
@@ -2182,7 +2182,7 @@
<p><a id="hassubscriptions"></a></p>
<h2 id="hassubscriptions">hasSubscriptions</h2>
<p>gethasSubscriptions(): <code>boolean</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L55" target="_blank">http/index.ts:55</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L55" target="_blank">http/index.ts:55</a></em></p>
<p><em><strong>summary</strong></em>: <code>true</code> when this provider supports subscriptions</p>
<p><strong>Returns:</strong> <code>boolean</code></p>
<hr>
@@ -2191,7 +2191,7 @@
<h2 id="clone">clone</h2>
<p>&#x25B8; <strong>clone</strong>(): <a href="_http_index_.httpprovider.html">HttpProvider</a></p>
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#clone">clone</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L62" target="_blank">http/index.ts:62</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L62" target="_blank">http/index.ts:62</a></em></p>
<p><em><strong>description</strong></em>: Returns a clone of the object</p>
<p><strong>Returns:</strong> <a href="_http_index_.httpprovider.html">HttpProvider</a></p>
<hr>
@@ -2199,7 +2199,7 @@
<h2 id="disconnect">disconnect</h2>
<p>&#x25B8; <strong>disconnect</strong>(): <code>void</code></p>
<p><em>Implementation of <a href="../interfaces/_types_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_.providerinterface.md#disconnect">disconnect</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L69" target="_blank">http/index.ts:69</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L69" target="_blank">http/index.ts:69</a></em></p>
<p><em><strong>description</strong></em>: Manually disconnect from the connection</p>
<p><strong>Returns:</strong> <code>void</code></p>
<hr>
@@ -2207,7 +2207,7 @@
<h2 id="isconnected">isConnected</h2>
<p>&#x25B8; <strong>isConnected</strong>(): <code>boolean</code></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/1b2694d/packages/rpc-provider/src/http/index.ts#L77" target="_blank">http/index.ts:77</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L77" target="_blank">http/index.ts:77</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>
@@ -2216,7 +2216,7 @@ true if connected</p>
<h2 id="on">on</h2>
<p>&#x25B8; <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/1b2694d/packages/rpc-provider/src/http/index.ts#L85" target="_blank">http/index.ts:85</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L85" target="_blank">http/index.ts:85</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 &apos;on&apos; emitters. WebSockets should be used instead.</p>
<p><strong>Parameters:</strong></p>
@@ -2244,7 +2244,7 @@ true if connected</p>
<h2 id="send">send</h2>
<p>&#x25B8; <strong>send</strong>(method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>): <code>Promise</code>&lt;<code>any</code>&gt;</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/1b2694d/packages/rpc-provider/src/http/index.ts#L92" target="_blank">http/index.ts:92</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L92" target="_blank">http/index.ts:92</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>
@@ -2271,7 +2271,7 @@ true if connected</p>
<h2 id="subscribe">subscribe</h2>
<p>&#x25B8; <strong>subscribe</strong>(types: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>, cb: <em><a href="../modules/_types_.md#providerinterface_callback">ProviderInterface$Callback</a></em>): <code>Promise</code>&lt;<code>number</code>&gt;</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/1b2694d/packages/rpc-provider/src/http/index.ts#L114" target="_blank">http/index.ts:114</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L114" target="_blank">http/index.ts:114</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>
@@ -2306,7 +2306,7 @@ true if connected</p>
<h2 id="unsubscribe">unsubscribe</h2>
<p>&#x25B8; <strong>unsubscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, id: <em><code>number</code></em>): <code>Promise</code>&lt;<code>boolean</code>&gt;</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/1b2694d/packages/rpc-provider/src/http/index.ts#L123" target="_blank">http/index.ts:123</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L123" target="_blank">http/index.ts:123</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>
@@ -2376,7 +2376,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":"2019-02-15T11:58:05.323Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-15T11:59:16.061Z"},"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":"2019-02-15T16:45:06.111Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-15T16:46:32.065Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>
@@ -2,6 +2,7 @@
@polkadot/rpc-provider/https
============================
*__name__*: HttpProvider
*__description__*: The HTTP Provider allows sending requests using HTTP to a HTTP RPC server TCP port. It does not support subscriptions so you won't be able to listen to events such as new blocks or balance changes. It is usually preferrable using the [WsProvider](_ws_index_.wsprovider.md).
@@ -34,7 +35,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/1b2694d/packages/rpc-provider/src/http/index.ts#L40)*
*Defined in [http/index.ts:40](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L40)*
**Parameters:**
@@ -54,7 +55,7 @@ ___
gethasSubscriptions(): `boolean`
*Defined in [http/index.ts:55](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L55)*
*Defined in [http/index.ts:55](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L55)*
*__summary__*: `true` when this provider supports subscriptions
@@ -72,7 +73,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[clone](../interfaces/_types_.providerinterface.md#clone)*
*Defined in [http/index.ts:62](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L62)*
*Defined in [http/index.ts:62](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L62)*
*__description__*: Returns a clone of the object
@@ -87,7 +88,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[disconnect](../interfaces/_types_.providerinterface.md#disconnect)*
*Defined in [http/index.ts:69](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L69)*
*Defined in [http/index.ts:69](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L69)*
*__description__*: Manually disconnect from the connection
@@ -102,7 +103,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[isConnected](../interfaces/_types_.providerinterface.md#isconnected)*
*Defined in [http/index.ts:77](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L77)*
*Defined in [http/index.ts:77](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L77)*
*__summary__*: Whether the node is connected or not.
@@ -118,7 +119,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[on](../interfaces/_types_.providerinterface.md#on)*
*Defined in [http/index.ts:85](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L85)*
*Defined in [http/index.ts:85](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L85)*
*__summary__*: Events are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
@@ -142,7 +143,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[send](../interfaces/_types_.providerinterface.md#send)*
*Defined in [http/index.ts:92](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L92)*
*Defined in [http/index.ts:92](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L92)*
*__summary__*: Send HTTP POST Request with Body to configured HTTP Endpoint.
@@ -164,7 +165,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[subscribe](../interfaces/_types_.providerinterface.md#subscribe)*
*Defined in [http/index.ts:114](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L114)*
*Defined in [http/index.ts:114](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L114)*
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
@@ -188,7 +189,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[unsubscribe](../interfaces/_types_.providerinterface.md#unsubscribe)*
*Defined in [http/index.ts:123](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/http/index.ts#L123)*
*Defined in [http/index.ts:123](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/http/index.ts#L123)*
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
+12 -11
View File
@@ -1,6 +1,7 @@
A mock provider mainly used for testing.
*__returns__*: The mock provider
# Hierarchy
@@ -19,7 +20,7 @@ A mock provider mainly used for testing.
⊕ **new Mock**(): [Mock](_mock_index_.mock.md)
*Defined in [mock/index.ts:68](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L68)*
*Defined in [mock/index.ts:68](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L68)*
**Returns:** [Mock](_mock_index_.mock.md)
@@ -33,7 +34,7 @@ ___
**● isUpdating**: *`boolean`* = true
*Defined in [mock/index.ts:43](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L43)*
*Defined in [mock/index.ts:43](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L43)*
___
<a id="subscriptions"></a>
@@ -49,7 +50,7 @@ ___
return subs;
}, ({} as MockState$Subscriptions))
*Defined in [mock/index.ts:57](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L57)*
*Defined in [mock/index.ts:57](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L57)*
___
@@ -61,7 +62,7 @@ ___
gethasSubscriptions(): `boolean`
*Defined in [mock/index.ts:74](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L74)*
*Defined in [mock/index.ts:74](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L74)*
**Returns:** `boolean`
@@ -77,7 +78,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[clone](../interfaces/_types_.providerinterface.md#clone)*
*Defined in [mock/index.ts:78](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L78)*
*Defined in [mock/index.ts:78](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L78)*
**Returns:** [Mock](_mock_index_.mock.md)
@@ -90,7 +91,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[disconnect](../interfaces/_types_.providerinterface.md#disconnect)*
*Defined in [mock/index.ts:82](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L82)*
*Defined in [mock/index.ts:82](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L82)*
**Returns:** `void`
@@ -103,7 +104,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[isConnected](../interfaces/_types_.providerinterface.md#isconnected)*
*Defined in [mock/index.ts:86](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L86)*
*Defined in [mock/index.ts:86](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L86)*
**Returns:** `boolean`
@@ -116,7 +117,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[on](../interfaces/_types_.providerinterface.md#on)*
*Defined in [mock/index.ts:90](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L90)*
*Defined in [mock/index.ts:90](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L90)*
**Parameters:**
@@ -136,7 +137,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[send](../interfaces/_types_.providerinterface.md#send)*
*Defined in [mock/index.ts:94](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L94)*
*Defined in [mock/index.ts:94](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L94)*
**Parameters:**
@@ -154,7 +155,7 @@ ___
▸ **subscribe**(type: *`string`*, method: *`string`*, ...params: *`Array`<`any`>*): `Promise`<`number`>
*Defined in [mock/index.ts:102](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L102)*
*Defined in [mock/index.ts:102](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L102)*
**Parameters:**
@@ -175,7 +176,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/_types_.providerinterface.md).[unsubscribe](../interfaces/_types_.providerinterface.md#unsubscribe)*
*Defined in [mock/index.ts:122](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/mock/index.ts#L122)*
*Defined in [mock/index.ts:122](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/mock/index.ts#L122)*
**Parameters:**
@@ -2156,7 +2156,7 @@
<p><a id="constructor"></a></p>
<h2 id="constructor">constructor</h2>
<p>&#x2295; <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/1b2694d/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/4735253/packages/rpc-provider/src/ws/index.ts#L75" target="_blank">ws/index.ts:75</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
@@ -2188,7 +2188,7 @@
<p><a id="hassubscriptions"></a></p>
<h2 id="hassubscriptions">hasSubscriptions</h2>
<p>gethasSubscriptions(): <code>boolean</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L101" target="_blank">ws/index.ts:101</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L101" target="_blank">ws/index.ts:101</a></em></p>
<p><em><strong>summary</strong></em>: <code>true</code> when this provider supports subscriptions</p>
<p><strong>Returns:</strong> <code>boolean</code></p>
<hr>
@@ -2196,14 +2196,14 @@
<p><a id="clone"></a></p>
<h2 id="clone">clone</h2>
<p>&#x25B8; <strong>clone</strong>(): <a href="_ws_index_.wsprovider.html">WsProvider</a></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L108" target="_blank">ws/index.ts:108</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L108" target="_blank">ws/index.ts:108</a></em></p>
<p><em><strong>description</strong></em>: Returns a clone of the object</p>
<p><strong>Returns:</strong> <a href="_ws_index_.wsprovider.html">WsProvider</a></p>
<hr>
<p><a id="connect"></a></p>
<h2 id="connect">connect</h2>
<p>&#x25B8; <strong>connect</strong>(): <code>void</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L117" target="_blank">ws/index.ts:117</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L117" target="_blank">ws/index.ts:117</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>
@@ -2211,14 +2211,14 @@
<p><a id="disconnect"></a></p>
<h2 id="disconnect">disconnect</h2>
<p>&#x25B8; <strong>disconnect</strong>(): <code>void</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L133" target="_blank">ws/index.ts:133</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L133" target="_blank">ws/index.ts:133</a></em></p>
<p><em><strong>description</strong></em>: Manually disconnect from the connection, clearing autoconnect logic</p>
<p><strong>Returns:</strong> <code>void</code></p>
<hr>
<p><a id="isconnected"></a></p>
<h2 id="isconnected">isConnected</h2>
<p>&#x25B8; <strong>isConnected</strong>(): <code>boolean</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L150" target="_blank">ws/index.ts:150</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L150" target="_blank">ws/index.ts:150</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>
@@ -2226,7 +2226,7 @@ true if connected</p>
<p><a id="on"></a></p>
<h2 id="on">on</h2>
<p>&#x25B8; <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/1b2694d/packages/rpc-provider/src/ws/index.ts#L159" target="_blank">ws/index.ts:159</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L159" target="_blank">ws/index.ts:159</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>
@@ -2255,7 +2255,7 @@ true if connected</p>
<p><a id="send"></a></p>
<h2 id="send">send</h2>
<p>&#x25B8; <strong>send</strong>(method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>, subscription?: <em><code>SubscriptionHandler</code></em>): <code>Promise</code>&lt;<code>any</code>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L169" target="_blank">ws/index.ts:169</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L169" target="_blank">ws/index.ts:169</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>
@@ -2289,7 +2289,7 @@ true if connected</p>
<p><a id="subscribe"></a></p>
<h2 id="subscribe">subscribe</h2>
<p>&#x25B8; <strong>subscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>, callback: <em><a href="../modules/_types_.md#providerinterface_callback">ProviderInterface$Callback</a></em>): <code>Promise</code>&lt;<code>number</code>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L223" target="_blank">ws/index.ts:223</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L223" target="_blank">ws/index.ts:223</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>
@@ -2340,7 +2340,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>&#x25B8; <strong>unsubscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, id: <em><code>number</code></em>): <code>Promise</code>&lt;<code>boolean</code>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L232" target="_blank">ws/index.ts:232</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L232" target="_blank">ws/index.ts:232</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>
@@ -2410,7 +2410,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":"types (codec implementation)","level":"1.4","depth":1,"path":"types/README.md","ref":"types/README.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":"2019-02-15T11:58:05.427Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-15T11:59:16.061Z"},"basePath":"../..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"WsProvider","level":"1.3.2","depth":2,"next":{"title":"types (codec implementation)","level":"1.4","depth":1,"path":"types/README.md","ref":"types/README.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":"2019-02-15T16:45:06.211Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-15T16:46:32.065Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>
@@ -2,6 +2,7 @@
@polkadot/rpc-provider/ws
=========================
*__name__*: WsProvider
*__description__*: The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port. Unlike the [HttpProvider](_http_index_.httpprovider.md), it does support subscriptions and allows listening to events such as new blocks or balance changes.
@@ -34,7 +35,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/1b2694d/packages/rpc-provider/src/ws/index.ts#L75)*
*Defined in [ws/index.ts:75](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L75)*
**Parameters:**
@@ -55,7 +56,7 @@ ___
gethasSubscriptions(): `boolean`
*Defined in [ws/index.ts:101](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L101)*
*Defined in [ws/index.ts:101](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L101)*
*__summary__*: `true` when this provider supports subscriptions
@@ -71,7 +72,7 @@ ___
▸ **clone**(): [WsProvider](_ws_index_.wsprovider.md)
*Defined in [ws/index.ts:108](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L108)*
*Defined in [ws/index.ts:108](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L108)*
*__description__*: Returns a clone of the object
@@ -84,7 +85,7 @@ ___
▸ **connect**(): `void`
*Defined in [ws/index.ts:117](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L117)*
*Defined in [ws/index.ts:117](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L117)*
*__summary__*: Manually connect
@@ -99,7 +100,7 @@ ___
▸ **disconnect**(): `void`
*Defined in [ws/index.ts:133](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L133)*
*Defined in [ws/index.ts:133](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L133)*
*__description__*: Manually disconnect from the connection, clearing autoconnect logic
@@ -112,7 +113,7 @@ ___
▸ **isConnected**(): `boolean`
*Defined in [ws/index.ts:150](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L150)*
*Defined in [ws/index.ts:150](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L150)*
*__summary__*: Whether the node is connected or not.
@@ -126,7 +127,7 @@ ___
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
*Defined in [ws/index.ts:159](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L159)*
*Defined in [ws/index.ts:159](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L159)*
*__summary__*: Listens on events after having subscribed using the [subscribe](_ws_index_.wsprovider.md#subscribe) function.
@@ -146,7 +147,7 @@ ___
▸ **send**(method: *`string`*, params: *`Array`<`any`>*, subscription?: *`SubscriptionHandler`*): `Promise`<`any`>
*Defined in [ws/index.ts:169](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L169)*
*Defined in [ws/index.ts:169](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L169)*
*__summary__*: Send JSON data using WebSockets to configured HTTP Endpoint or queue.
@@ -167,7 +168,7 @@ ___
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, callback: *[ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback)*): `Promise`<`number`>
*Defined in [ws/index.ts:223](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L223)*
*Defined in [ws/index.ts:223](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L223)*
*__name__*: subscribe
@@ -205,7 +206,7 @@ ___
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
*Defined in [ws/index.ts:232](https://github.com/polkadot-js/api/blob/1b2694d/packages/rpc-provider/src/ws/index.ts#L232)*
*Defined in [ws/index.ts:232](https://github.com/polkadot-js/api/blob/4735253/packages/rpc-provider/src/ws/index.ts#L232)*
*__summary__*: Allows unsubscribing to subscriptions made with [subscribe](_ws_index_.wsprovider.md#subscribe).