[CI Skip] 0.29.4

This commit is contained in:
Travis CI
2018-09-17 12:37:37 +00:00
parent f5b0e23e4b
commit ef78f2a024
69 changed files with 16231 additions and 280 deletions
+27 -27
View File
@@ -80,7 +80,7 @@ console.log('clientVersion', version);
**Ƭ HttpState**: *`object`*
*Defined in [http/types.d.ts:8](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/types.d.ts#L8)*
*Defined in [http/types.d.ts:8](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/types.d.ts#L8)*
#### Type declaration
@@ -91,7 +91,7 @@ ___
**Ƭ JsonRpcObject**: *`object`*
*Defined in [types.d.ts:5](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L5)*
*Defined in [types.d.ts:5](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L5)*
#### Type declaration
@@ -103,7 +103,7 @@ ___
**Ƭ JsonRpcRequest**: * [JsonRpcObject](#jsonrpcobject) & `object`
*
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L10)*
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L10)*
___
<a id="jsonrpcresponse"></a>
@@ -113,7 +113,7 @@ ___
**Ƭ JsonRpcResponse**: * [JsonRpcObject](#jsonrpcobject) & [JsonRpcResponseBase](#jsonrpcresponsebase)
*
*Defined in [types.d.ts:36](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L36)*
*Defined in [types.d.ts:36](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L36)*
___
<a id="jsonrpcresponsebase"></a>
@@ -123,7 +123,7 @@ ___
**Ƭ JsonRpcResponseBase**: * `JsonRpcResponse$Single` & `JsonRpcResponse$Subscription`
*
*Defined in [types.d.ts:34](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L34)*
*Defined in [types.d.ts:34](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L34)*
___
<a id="jsonrpcresponsebase_error"></a>
@@ -132,7 +132,7 @@ ___
**Ƭ JsonRpcResponseBase$Error**: *`object`*
*Defined in [types.d.ts:15](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L15)*
*Defined in [types.d.ts:15](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L15)*
#### Type declaration
@@ -143,7 +143,7 @@ ___
**Ƭ MockState**: *`object`*
*Defined in [mock/types.d.ts:27](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/types.d.ts#L27)*
*Defined in [mock/types.d.ts:27](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L27)*
#### Type declaration
@@ -154,7 +154,7 @@ ___
**Ƭ MockState$Requests**: *`object`*
*Defined in [mock/types.d.ts:23](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/types.d.ts#L23)*
*Defined in [mock/types.d.ts:23](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L23)*
#### Type declaration
@@ -178,7 +178,7 @@ ___
**Ƭ MockState$Storage**: *`object`*
*Defined in [mock/types.d.ts:19](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/types.d.ts#L19)*
*Defined in [mock/types.d.ts:19](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L19)*
#### Type declaration
@@ -191,7 +191,7 @@ ___
**Ƭ MockState$Subscription$Callback**: *`function`*
*Defined in [mock/types.d.ts:8](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/types.d.ts#L8)*
*Defined in [mock/types.d.ts:8](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L8)*
#### Type declaration
▸(error: * `Error` &#124; `null`*, value: *`any`*): `void`
@@ -212,7 +212,7 @@ ___
**Ƭ MockState$Subscriptions**: *`object`*
*Defined in [mock/types.d.ts:10](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/types.d.ts#L10)*
*Defined in [mock/types.d.ts:10](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L10)*
#### Type declaration
@@ -225,7 +225,7 @@ ___
**Ƭ ProviderInterface$Callback**: *`function`*
*Defined in [types.d.ts:38](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L38)*
*Defined in [types.d.ts:38](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L38)*
#### Type declaration
▸(error: * `Error` &#124; `null`*, result: *`any`*): `void`
@@ -246,7 +246,7 @@ ___
**Ƭ ProviderInterface$EmitCb**: *`function`*
*Defined in [types.d.ts:42](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L42)*
*Defined in [types.d.ts:42](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L42)*
#### Type declaration
▸(value?: *`any`*): `any`
@@ -267,7 +267,7 @@ ___
**Ƭ ProviderInterface$Emitted**: * "connected" &#124; "disconnected"
*
*Defined in [types.d.ts:40](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L40)*
*Defined in [types.d.ts:40](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L40)*
___
<a id="rpccoder"></a>
@@ -276,7 +276,7 @@ ___
**Ƭ RpcCoder**: *`object`*
*Defined in [coder/json/types.d.ts:7](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/coder/json/types.d.ts#L7)*
*Defined in [coder/json/types.d.ts:7](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/types.d.ts#L7)*
#### Type declaration
@@ -287,7 +287,7 @@ ___
**Ƭ RpcCoderState**: *`object`*
*Defined in [coder/json/types.d.ts:14](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/coder/json/types.d.ts#L14)*
*Defined in [coder/json/types.d.ts:14](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/types.d.ts#L14)*
#### Type declaration
@@ -301,7 +301,7 @@ ___
▸ **decodeResponse**(self: *[RpcCoderState](#rpccoderstate)*, response: *[JsonRpcResponse](#jsonrpcresponse)*): `any`
*Defined in [coder/json/decodeResponse.ts:22](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/coder/json/decodeResponse.ts#L22)*
*Defined in [coder/json/decodeResponse.ts:22](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/decodeResponse.ts#L22)*
**Parameters:**
@@ -319,7 +319,7 @@ ___
▸ **encodeJson**(self: *[RpcCoderState](#rpccoderstate)*, method: *`string`*, params: *`Array`<`any`>*): `string`
*Defined in [coder/json/encodeJson.ts:9](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/coder/json/encodeJson.ts#L9)*
*Defined in [coder/json/encodeJson.ts:9](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/encodeJson.ts#L9)*
**Parameters:**
@@ -338,7 +338,7 @@ ___
▸ **encodeObject**(self: *[RpcCoderState](#rpccoderstate)*, method: *`string`*, params: *`Array`<`any`>*): [JsonRpcRequest](#jsonrpcrequest)
*Defined in [coder/json/encodeObject.ts:8](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/coder/json/encodeObject.ts#L8)*
*Defined in [coder/json/encodeObject.ts:8](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/encodeObject.ts#L8)*
**Parameters:**
@@ -357,7 +357,7 @@ ___
▸ **mockProvider**(): [ProviderInterface](interfaces/providerinterface.md)
*Defined in [mock/index.ts:18](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/index.ts#L18)*
*Defined in [mock/index.ts:18](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/index.ts#L18)*
A moock provider mainly used for testing.
@@ -371,7 +371,7 @@ ___
▸ **mocks**(__namedParameters: *`object`*): `void`
*Defined in [mock/mocks.ts:68](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/mocks.ts#L68)*
*Defined in [mock/mocks.ts:68](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/mocks.ts#L68)*
**Parameters:**
@@ -388,7 +388,7 @@ ___
▸ **on**(self: *[MockState](#mockstate)*, type: *[ProviderInterface$Emitted](#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](#providerinterface_emitcb)*): `void`
*Defined in [mock/on.ts:8](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/on.ts#L8)*
*Defined in [mock/on.ts:8](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/on.ts#L8)*
**Parameters:**
@@ -407,7 +407,7 @@ ___
▸ **rpcCoder**(): [RpcCoder](#rpccoder)
*Defined in [coder/json/index.ts:12](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/coder/json/index.ts#L12)*
*Defined in [coder/json/index.ts:12](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/index.ts#L12)*
**Returns:** [RpcCoder](#rpccoder)
@@ -418,7 +418,7 @@ ___
▸ **send**(__namedParameters: *`object`*, method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
*Defined in [mock/send.ts:7](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/send.ts#L7)*
*Defined in [mock/send.ts:7](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/send.ts#L7)*
**Parameters:**
@@ -437,7 +437,7 @@ ___
▸ **state**(): [MockState](#mockstate)
*Defined in [mock/state.ts:38](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/state.ts#L38)*
*Defined in [mock/state.ts:38](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/state.ts#L38)*
**Returns:** [MockState](#mockstate)
@@ -448,7 +448,7 @@ ___
▸ **subscribe**(self: *[MockState](#mockstate)*, type: *`string`*, method: *`string`*, params: *`Array`<`any`>*): `Promise`<`number`>
*Defined in [mock/subscribe.ts:7](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/subscribe.ts#L7)*
*Defined in [mock/subscribe.ts:7](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/subscribe.ts#L7)*
**Parameters:**
@@ -468,7 +468,7 @@ ___
▸ **unsubscribe**(self: *[MockState](#mockstate)*, type: *`string`*, name: *`string`*, id: *`number`*): `Promise`<`boolean`>
*Defined in [mock/unsubscribe.ts:7](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/mock/unsubscribe.ts#L7)*
*Defined in [mock/unsubscribe.ts:7](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/unsubscribe.ts#L7)*
**Parameters:**
+6 -6
View File
@@ -44,7 +44,7 @@ const api = createApi(provider);
⊕ **new HttpProvider**(endpoint: *`string`*): [HttpProvider](httpprovider.md)
*Defined in [http/index.ts:35](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/index.ts#L35)*
*Defined in [http/index.ts:35](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/index.ts#L35)*
**Parameters:**
@@ -66,7 +66,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/providerinterface.md).[isConnected](../interfaces/providerinterface.md#isconnected)*
*Defined in [http/index.ts:49](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/index.ts#L49)*
*Defined in [http/index.ts:49](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/index.ts#L49)*
Whether the node is connected or not.
@@ -82,7 +82,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/providerinterface.md).[on](../interfaces/providerinterface.md#on)*
*Defined in [http/index.ts:56](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/index.ts#L56)*
*Defined in [http/index.ts:56](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/index.ts#L56)*
Events are not supported with the HttpProvider, see [WsProvider](wsprovider.md).
@@ -104,7 +104,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/providerinterface.md).[send](../interfaces/providerinterface.md#send)*
*Defined in [http/index.ts:60](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/index.ts#L60)*
*Defined in [http/index.ts:60](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/index.ts#L60)*
**Parameters:**
@@ -124,7 +124,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/providerinterface.md).[subscribe](../interfaces/providerinterface.md#subscribe)*
*Defined in [http/index.ts:82](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/index.ts#L82)*
*Defined in [http/index.ts:82](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/index.ts#L82)*
Subscriptions are not supported with the HttpProvider, see [WsProvider](wsprovider.md).
@@ -148,7 +148,7 @@ ___
*Implementation of [ProviderInterface](../interfaces/providerinterface.md).[unsubscribe](../interfaces/providerinterface.md#unsubscribe)*
*Defined in [http/index.ts:91](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/http/index.ts#L91)*
*Defined in [http/index.ts:91](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/index.ts#L91)*
Subscriptions are not supported with the HttpProvider, see [WsProvider](wsprovider.md).
+7 -7
View File
@@ -74,7 +74,7 @@ const api = createApi(provider);
⊕ **new WsProvider**(endpoint: *`string`*, autoConnect?: *`boolean`*): [WsProvider](wsprovider.md)
*Defined in [ws/index.ts:69](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L69)*
*Defined in [ws/index.ts:69](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L69)*
**Parameters:**
@@ -131,7 +131,7 @@ ___
▸ **connect**(): `void`
*Defined in [ws/index.ts:99](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L99)*
*Defined in [ws/index.ts:99](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L99)*
The [WsProvider](wsprovider.md) connects automatically by default. if you decided otherwise, you may connect manually using this method.
@@ -181,7 +181,7 @@ ___
▸ **isConnected**(): `boolean`
*Defined in [ws/index.ts:116](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L116)*
*Defined in [ws/index.ts:116](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L116)*
Whether the node is connected or not.
@@ -261,7 +261,7 @@ ___
*Overrides EventEmitter.on*
*Defined in [ws/index.ts:126](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L126)*
*Defined in [ws/index.ts:126](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L126)*
Listens on events after having subscribed using the [subscribe](wsprovider.md#subscribe) function.
@@ -350,7 +350,7 @@ ___
▸ **send**(method: *`string`*, params: *`Array`<`any`>*, subscription?: *`SubscriptionHandler`*): `Promise`<`any`>
*Defined in [ws/index.ts:130](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L130)*
*Defined in [ws/index.ts:130](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L130)*
**Parameters:**
@@ -369,7 +369,7 @@ ___
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, callback: *[ProviderInterface$Callback](../#providerinterface_callback)*): `Promise`<`number`>
*Defined in [ws/index.ts:182](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L182)*
*Defined in [ws/index.ts:182](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L182)*
Allows subscribing to a specific event.
*__example__*: ```javascript
@@ -401,7 +401,7 @@ ___
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
*Defined in [ws/index.ts:191](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/ws/index.ts#L191)*
*Defined in [ws/index.ts:191](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/ws/index.ts#L191)*
Allows unsubscribing to subscriptions made with [subscribe](wsprovider.md#subscribe).
+970
View File
@@ -0,0 +1,970 @@
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>api-provider · Polkadot API Book</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../api-rx/" />
<link rel="prev" href="../api-format/" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="header">Intro</li>
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
Introduction
</a>
</li>
<li class="header">API</li>
<li class="chapter " data-level="2.1" data-path="../api/">
<a href="../api/">
api
</a>
</li>
<li class="chapter " data-level="2.2" data-path="../api-format/">
<a href="../api-format/">
api-format
</a>
</li>
<li class="chapter active" data-level="2.3" data-path="./">
<a href="./">
api-provider
</a>
</li>
<li class="chapter " data-level="2.4" data-path="../api-rx/">
<a href="../api-rx/">
api-rx
</a>
</li>
<li class="chapter " data-level="2.5" data-path="../type-extrinsics/">
<a href="../type-extrinsics/">
type-extrinsics
</a>
</li>
<li class="chapter " data-level="2.6" data-path="../type-jsonrpc/">
<a href="../type-jsonrpc/">
type-jsonrpc
</a>
</li>
<li class="chapter " data-level="2.7" data-path="../type-params/">
<a href="../type-params/">
type-params
</a>
</li>
<li class="chapter " data-level="2.8" data-path="../type-primitives/">
<a href="../type-primitives/">
type-primitives
</a>
</li>
<li class="chapter " data-level="2.9" data-path="../type-storage/">
<a href="../type-storage/">
type-storage
</a>
</li>
<li class="header">Examples</li>
<li class="chapter " data-level="3.1" data-path="../examples/">
<a href="../examples/">
Overview
</a>
</li>
<li class="chapter " data-level="3.2" data-path="../examples/01_simple_connect/">
<a href="../examples/01_simple_connect/">
Simple connect
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../examples/02_listen_to_blocks/">
<a href="../examples/02_listen_to_blocks/">
Listen to blocks
</a>
</li>
<li class="chapter " data-level="3.4" data-path="../examples/03_listen_to_balance_change/">
<a href="../examples/03_listen_to_balance_change/">
Listen to balance change
</a>
</li>
<li class="chapter " data-level="3.5" data-path="../examples/04_generate_account/">
<a href="../examples/04_generate_account/">
Generate Accounts
</a>
</li>
<li class="chapter " data-level="3.6" data-path="../examples/05_read_storage/">
<a href="../examples/05_read_storage/">
Read Storage
</a>
</li>
<li class="chapter " data-level="3.7" data-path="../examples/06_craft_extrinsic/">
<a href="../examples/06_craft_extrinsic/">
Craft Extrinsic
</a>
</li>
<li class="chapter " data-level="3.8" data-path="../examples/07_transfer_dots/">
<a href="../examples/07_transfer_dots/">
Transfer DOTs
</a>
</li>
<li class="header">Contributing</li>
<li class="chapter " data-level="4.1" data-path="../CONTRIBUTING.html">
<a href="../CONTRIBUTING.html">
Contributing guide
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >api-provider</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<p><a href="https://polkadot.js.org" target="_blank"><img src="https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square" alt="polkadotjs"></a> <img src="https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square" alt="isc"> <a href="https://github.com/Flet/semistandard" target="_blank"><img src="https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square" alt="style"></a> <a href="https://www.npmjs.com/package/@polkadot/api-provider" target="_blank"><img src="https://img.shields.io/npm/v/@polkadot/api-provider.svg?style=flat-square" alt="npm"></a> <a href="https://travis-ci.org/polkadot-js/api" target="_blank"><img src="https://img.shields.io/travis/polkadot-js/api.svg?style=flat-square" alt="travis"></a> <a href="https://codeclimate.com/github/polkadot-js/api/maintainability" target="_blank"><img src="https://img.shields.io/codeclimate/maintainability/polkadot-js/api.svg?style=flat-square" alt="maintainability"></a> <a href="https://coveralls.io/github/polkadot-js/api?branch=master" target="_blank"><img src="https://img.shields.io/coveralls/polkadot-js/api.svg?style=flat-square" alt="coverage"></a> <a href="https://david-dm.org/polkadot-js/api?path=packages/api-provider" target="_blank"><img src="https://david-dm.org/polkadot-js/api.svg?style=flat-square&amp;path=packages/api-provider" alt="dependency"></a> <a href="https://david-dm.org/polkadot-js/api?path=packages/api-provider#info=devDependencies" target="_blank"><img src="https://david-dm.org/polkadot-js/api/dev-status.svg?style=flat-square&amp;path=packages/api-provider" alt="devDependency"></a></p>
<h1 id="polkadotapi-provider">@polkadot/api-provider</h1>
<p>Generic transport providers to handle the transport of method calls to and from Polkadot clients from applications interacting with it. Generally, unless you are operating at a low-level and taking care of encoding and decoding of parameters/results, it won&apos;t be directly used. API interfaces building on top these providers can support various transports with the same underlying interfaces.</p>
<h2 id="usage">Usage</h2>
<p>Installation -</p>
<pre><code>npm install --save @polkadot/api-provider
</code></pre><p>Initialisation -</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> WsProvider <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@polkadot/api-provider/ws&apos;</span>;
<span class="hljs-keyword">const</span> provider = <span class="hljs-keyword">new</span> WsProvider(<span class="hljs-string">&apos;http://127.0.0.1:9944&apos;</span>);
<span class="hljs-keyword">const</span> version = <span class="hljs-keyword">await</span> provider.send(<span class="hljs-string">&apos;client_version&apos;</span>, []);
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;clientVersion&apos;</span>, version);
</code></pre>
<h2 id="index">Index</h2>
<h3 id="classes">Classes</h3>
<ul>
<li><a href="classes/httpprovider.md">HttpProvider</a></li>
<li><a href="classes/wsprovider.md">WsProvider</a></li>
</ul>
<h3 id="interfaces">Interfaces</h3>
<ul>
<li><a href="interfaces/providerinterface.md">ProviderInterface</a></li>
</ul>
<h3 id="type-aliases">Type aliases</h3>
<ul>
<li><a href="#httpstate">HttpState</a></li>
<li><a href="#jsonrpcobject">JsonRpcObject</a></li>
<li><a href="#jsonrpcrequest">JsonRpcRequest</a></li>
<li><a href="#jsonrpcresponse">JsonRpcResponse</a></li>
<li><a href="#jsonrpcresponsebase">JsonRpcResponseBase</a></li>
<li><a href="#jsonrpcresponsebase_error">JsonRpcResponseBase$Error</a></li>
<li><a href="#mockstate">MockState</a></li>
<li><a href="#mockstate_requests">MockState$Requests</a></li>
<li><a href="#mockstate_storage">MockState$Storage</a></li>
<li><a href="#mockstate_subscription_callback">MockState$Subscription$Callback</a></li>
<li><a href="#mockstate_subscriptions">MockState$Subscriptions</a></li>
<li><a href="#providerinterface_callback">ProviderInterface$Callback</a></li>
<li><a href="#providerinterface_emitcb">ProviderInterface$EmitCb</a></li>
<li><a href="#providerinterface_emitted">ProviderInterface$Emitted</a></li>
<li><a href="#rpccoder">RpcCoder</a></li>
<li><a href="#rpccoderstate">RpcCoderState</a></li>
</ul>
<h3 id="functions">Functions</h3>
<ul>
<li><a href="#decoderesponse">decodeResponse</a></li>
<li><a href="#encodejson">encodeJson</a></li>
<li><a href="#encodeobject">encodeObject</a></li>
<li><a href="#mockprovider">mockProvider</a></li>
<li><a href="#mocks">mocks</a></li>
<li><a href="#on">on</a></li>
<li><a href="#rpccoder">rpcCoder</a></li>
<li><a href="#send">send</a></li>
<li><a href="#state">state</a></li>
<li><a href="#subscribe">subscribe</a></li>
<li><a href="#unsubscribe">unsubscribe</a></li>
</ul>
<hr>
<h2 id="type-aliases">Type aliases</h2>
<p><a id="httpstate"></a></p>
<h3 id="httpstate">HttpState</h3>
<p><strong>&#x1AC; HttpState</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/http/types.d.ts#L8" target="_blank">http/types.d.ts:8</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="jsonrpcobject"></a></p>
<h3 id="jsonrpcobject">JsonRpcObject</h3>
<p><strong>&#x1AC; JsonRpcObject</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L5" target="_blank">types.d.ts:5</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="jsonrpcrequest"></a></p>
<h3 id="jsonrpcrequest">JsonRpcRequest</h3>
<p><strong>&#x1AC; JsonRpcRequest</strong>: <em> <a href="#jsonrpcobject">JsonRpcObject</a> &amp; <code>object</code>
</em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L10" target="_blank">types.d.ts:10</a></em></p>
<hr>
<p><a id="jsonrpcresponse"></a></p>
<h3 id="jsonrpcresponse">JsonRpcResponse</h3>
<p><strong>&#x1AC; JsonRpcResponse</strong>: <em> <a href="#jsonrpcobject">JsonRpcObject</a> &amp; <a href="#jsonrpcresponsebase">JsonRpcResponseBase</a>
</em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L36" target="_blank">types.d.ts:36</a></em></p>
<hr>
<p><a id="jsonrpcresponsebase"></a></p>
<h3 id="jsonrpcresponsebase">JsonRpcResponseBase</h3>
<p><strong>&#x1AC; JsonRpcResponseBase</strong>: <em> <code>JsonRpcResponse$Single</code> &amp; <code>JsonRpcResponse$Subscription</code>
</em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L34" target="_blank">types.d.ts:34</a></em></p>
<hr>
<p><a id="jsonrpcresponsebase_error"></a></p>
<h3 id="jsonrpcresponsebaseerror">JsonRpcResponseBase$Error</h3>
<p><strong>&#x1AC; JsonRpcResponseBase$Error</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L15" target="_blank">types.d.ts:15</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="mockstate"></a></p>
<h3 id="mockstate">MockState</h3>
<p><strong>&#x1AC; MockState</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L27" target="_blank">mock/types.d.ts:27</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="mockstate_requests"></a></p>
<h3 id="mockstaterequests">MockState$Requests</h3>
<p><strong>&#x1AC; MockState$Requests</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L23" target="_blank">mock/types.d.ts:23</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<p>&#x25B8;(storage: <em><a href="#mockstate_storage">MockState$Storage</a></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>): <code>string</code></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>storage</td>
<td><a href="#mockstate_storage">MockState$Storage</a></td>
</tr>
<tr>
<td>params</td>
<td><code>Array</code>&lt;<code>any</code>&gt;</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>string</code></p>
<hr>
<p><a id="mockstate_storage"></a></p>
<h3 id="mockstatestorage">MockState$Storage</h3>
<p><strong>&#x1AC; MockState$Storage</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L19" target="_blank">mock/types.d.ts:19</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="mockstate_subscription_callback"></a></p>
<h3 id="mockstatesubscriptioncallback">MockState$Subscription$Callback</h3>
<p><strong>&#x1AC; MockState$Subscription$Callback</strong>: <em><code>function</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L8" target="_blank">mock/types.d.ts:8</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<p>&#x25B8;(error: <em> <code>Error</code> | <code>null</code></em>, value: <em><code>any</code></em>): <code>void</code></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>error</td>
<td><code>Error</code> | <code>null</code></td>
</tr>
<tr>
<td>value</td>
<td><code>any</code></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>void</code></p>
<hr>
<p><a id="mockstate_subscriptions"></a></p>
<h3 id="mockstatesubscriptions">MockState$Subscriptions</h3>
<p><strong>&#x1AC; MockState$Subscriptions</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/types.d.ts#L10" target="_blank">mock/types.d.ts:10</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="providerinterface_callback"></a></p>
<h3 id="providerinterfacecallback">ProviderInterface$Callback</h3>
<p><strong>&#x1AC; ProviderInterface$Callback</strong>: <em><code>function</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L38" target="_blank">types.d.ts:38</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<p>&#x25B8;(error: <em> <code>Error</code> | <code>null</code></em>, result: <em><code>any</code></em>): <code>void</code></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>error</td>
<td><code>Error</code> | <code>null</code></td>
</tr>
<tr>
<td>result</td>
<td><code>any</code></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>void</code></p>
<hr>
<p><a id="providerinterface_emitcb"></a></p>
<h3 id="providerinterfaceemitcb">ProviderInterface$EmitCb</h3>
<p><strong>&#x1AC; ProviderInterface$EmitCb</strong>: <em><code>function</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L42" target="_blank">types.d.ts:42</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<p>&#x25B8;(value?: <em><code>any</code></em>): <code>any</code></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Optional</code> value</td>
<td><code>any</code></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>any</code></p>
<hr>
<p><a id="providerinterface_emitted"></a></p>
<h3 id="providerinterfaceemitted">ProviderInterface$Emitted</h3>
<p><strong>&#x1AC; ProviderInterface$Emitted</strong>: <em> &quot;connected&quot; | &quot;disconnected&quot;
</em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L40" target="_blank">types.d.ts:40</a></em></p>
<hr>
<p><a id="rpccoder"></a></p>
<h3 id="rpccoder">RpcCoder</h3>
<p><strong>&#x1AC; RpcCoder</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/types.d.ts#L7" target="_blank">coder/json/types.d.ts:7</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="rpccoderstate"></a></p>
<h3 id="rpccoderstate">RpcCoderState</h3>
<p><strong>&#x1AC; RpcCoderState</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/types.d.ts#L14" target="_blank">coder/json/types.d.ts:14</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<h2 id="functions">Functions</h2>
<p><a id="decoderesponse"></a></p>
<h3 id="decoderesponse">decodeResponse</h3>
<p>&#x25B8; <strong>decodeResponse</strong>(self: <em><a href="#rpccoderstate">RpcCoderState</a></em>, response: <em><a href="#jsonrpcresponse">JsonRpcResponse</a></em>): <code>any</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/decodeResponse.ts#L22" target="_blank">coder/json/decodeResponse.ts:22</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>self</td>
<td><a href="#rpccoderstate">RpcCoderState</a></td>
</tr>
<tr>
<td>response</td>
<td><a href="#jsonrpcresponse">JsonRpcResponse</a></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>any</code></p>
<hr>
<p><a id="encodejson"></a></p>
<h3 id="encodejson">encodeJson</h3>
<p>&#x25B8; <strong>encodeJson</strong>(self: <em><a href="#rpccoderstate">RpcCoderState</a></em>, method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>): <code>string</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/encodeJson.ts#L9" target="_blank">coder/json/encodeJson.ts:9</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>self</td>
<td><a href="#rpccoderstate">RpcCoderState</a></td>
</tr>
<tr>
<td>method</td>
<td><code>string</code></td>
</tr>
<tr>
<td>params</td>
<td><code>Array</code>&lt;<code>any</code>&gt;</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>string</code></p>
<hr>
<p><a id="encodeobject"></a></p>
<h3 id="encodeobject">encodeObject</h3>
<p>&#x25B8; <strong>encodeObject</strong>(self: <em><a href="#rpccoderstate">RpcCoderState</a></em>, method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>): <a href="#jsonrpcrequest">JsonRpcRequest</a></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/encodeObject.ts#L8" target="_blank">coder/json/encodeObject.ts:8</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>self</td>
<td><a href="#rpccoderstate">RpcCoderState</a></td>
</tr>
<tr>
<td>method</td>
<td><code>string</code></td>
</tr>
<tr>
<td>params</td>
<td><code>Array</code>&lt;<code>any</code>&gt;</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <a href="#jsonrpcrequest">JsonRpcRequest</a></p>
<hr>
<p><a id="mockprovider"></a></p>
<h3 id="mockprovider">mockProvider</h3>
<p>&#x25B8; <strong>mockProvider</strong>(): <a href="interfaces/providerinterface.md">ProviderInterface</a></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/index.ts#L18" target="_blank">mock/index.ts:18</a></em></p>
<p>A moock provider mainly used for testing.</p>
<p><strong>Returns:</strong> <a href="interfaces/providerinterface.md">ProviderInterface</a>
The mock provider</p>
<hr>
<p><a id="mocks"></a></p>
<h3 id="mocks">mocks</h3>
<p>&#x25B8; <strong>mocks</strong>(__namedParameters: <em><code>object</code></em>): <code>void</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/mocks.ts#L68" target="_blank">mock/mocks.ts:68</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>__namedParameters</td>
<td><code>object</code></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>void</code></p>
<hr>
<p><a id="on"></a></p>
<h3 id="on">on</h3>
<p>&#x25B8; <strong>on</strong>(self: <em><a href="#mockstate">MockState</a></em>, type: <em><a href="#providerinterface_emitted">ProviderInterface$Emitted</a></em>, sub: <em><a href="#providerinterface_emitcb">ProviderInterface$EmitCb</a></em>): <code>void</code></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/on.ts#L8" target="_blank">mock/on.ts:8</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>self</td>
<td><a href="#mockstate">MockState</a></td>
</tr>
<tr>
<td>type</td>
<td><a href="#providerinterface_emitted">ProviderInterface$Emitted</a></td>
</tr>
<tr>
<td>sub</td>
<td><a href="#providerinterface_emitcb">ProviderInterface$EmitCb</a></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>void</code></p>
<hr>
<p><a id="rpccoder"></a></p>
<h3 id="rpccoder">rpcCoder</h3>
<p>&#x25B8; <strong>rpcCoder</strong>(): <a href="#rpccoder">RpcCoder</a></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/coder/json/index.ts#L12" target="_blank">coder/json/index.ts:12</a></em></p>
<p><strong>Returns:</strong> <a href="#rpccoder">RpcCoder</a></p>
<hr>
<p><a id="send"></a></p>
<h3 id="send">send</h3>
<p>&#x25B8; <strong>send</strong>(__namedParameters: <em><code>object</code></em>, 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>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/send.ts#L7" target="_blank">mock/send.ts:7</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>__namedParameters</td>
<td><code>object</code></td>
</tr>
<tr>
<td>method</td>
<td><code>string</code></td>
</tr>
<tr>
<td>params</td>
<td><code>Array</code>&lt;<code>any</code>&gt;</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>Promise</code>&lt;<code>any</code>&gt;</p>
<hr>
<p><a id="state"></a></p>
<h3 id="state">state</h3>
<p>&#x25B8; <strong>state</strong>(): <a href="#mockstate">MockState</a></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/state.ts#L38" target="_blank">mock/state.ts:38</a></em></p>
<p><strong>Returns:</strong> <a href="#mockstate">MockState</a></p>
<hr>
<p><a id="subscribe"></a></p>
<h3 id="subscribe">subscribe</h3>
<p>&#x25B8; <strong>subscribe</strong>(self: <em><a href="#mockstate">MockState</a></em>, type: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code>&lt;<code>any</code>&gt;</em>): <code>Promise</code>&lt;<code>number</code>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/mock/subscribe.ts#L7" target="_blank">mock/subscribe.ts:7</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>self</td>
<td><a href="#mockstate">MockState</a></td>
</tr>
<tr>
<td>type</td>
<td><code>string</code></td>
</tr>
<tr>
<td>method</td>
<td><code>string</code></td>
</tr>
<tr>
<td>params</td>
<td><code>Array</code>&lt;<code>any</code>&gt;</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>Promise</code>&lt;<code>number</code>&gt;</p>
<hr>
<p><a id="unsubscribe"></a></p>
<h3 id="unsubscribe">unsubscribe</h3>
<p>&#x25B8; <strong>unsubscribe</strong>(self: <em><a href="#mockstate">MockState</a></em>, type: <em><code>string</code></em>, name: <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/f5b0e23/packages/api-provider/src/mock/unsubscribe.ts#L7" target="_blank">mock/unsubscribe.ts:7</a></em></p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>self</td>
<td><a href="#mockstate">MockState</a></td>
</tr>
<tr>
<td>type</td>
<td><code>string</code></td>
</tr>
<tr>
<td>name</td>
<td><code>string</code></td>
</tr>
<tr>
<td>id</td>
<td><code>number</code></td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong> <code>Promise</code>&lt;<code>boolean</code>&gt;</p>
<hr>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../api-format/" class="navigation navigation-prev " aria-label="Previous page: api-format">
<i class="fa fa-angle-left"></i>
</a>
<a href="../api-rx/" class="navigation navigation-next " aria-label="Next page: api-rx">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"api-provider","level":"2.3","depth":1,"next":{"title":"api-rx","level":"2.4","depth":1,"path":"api-rx/README.md","ref":"api-rx/README.md","articles":[]},"previous":{"title":"api-format","level":"2.2","depth":1,"path":"api-format/README.md","ref":"api-format/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["asciidoc-include"],"root":"docs","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"},"pluginsConfig":{"asciidoc-include":{"syntax":"asciidoc"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"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}},"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":"api-provider/README.md","mtime":"2018-09-17T12:35:52.445Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-17T12:37:27.221Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>
@@ -30,7 +30,7 @@
▸ **isConnected**(): `boolean`
*Defined in [types.d.ts:45](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L45)*
*Defined in [types.d.ts:45](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L45)*
**Returns:** `boolean`
@@ -41,7 +41,7 @@ ___
▸ **on**(type: *[ProviderInterface$Emitted](../#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../#providerinterface_emitcb)*): `void`
*Defined in [types.d.ts:46](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L46)*
*Defined in [types.d.ts:46](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L46)*
**Parameters:**
@@ -59,7 +59,7 @@ ___
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
*Defined in [types.d.ts:47](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L47)*
*Defined in [types.d.ts:47](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L47)*
**Parameters:**
@@ -77,7 +77,7 @@ ___
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, cb: *[ProviderInterface$Callback](../#providerinterface_callback)*): `Promise`<`number`>
*Defined in [types.d.ts:48](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L48)*
*Defined in [types.d.ts:48](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L48)*
**Parameters:**
@@ -97,7 +97,7 @@ ___
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
*Defined in [types.d.ts:49](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api-provider/src/types.d.ts#L49)*
*Defined in [types.d.ts:49](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api-provider/src/types.d.ts#L49)*
**Parameters:**