[CI Skip] 0.45.15
This commit is contained in:
@@ -7,7 +7,7 @@ Generic transport providers to handle the transport of method calls to and from
|
||||
Provider Selection
|
||||
------------------
|
||||
|
||||
There are two flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets. It is generally recommended to use the [WsProvider](classes/_ws_index_.wsprovider.md) since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
|
||||
There are two flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets. It is generally recommended to use the [WsProvider](classes/_ws_provider_.wsprovider.md) since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
|
||||
|
||||
Both providers are usable (as is the API), in both browser-based and Node.js environments. Polyfills for unsupported functionality are automatically applied based on feature-detection.
|
||||
|
||||
@@ -44,3 +44,8 @@ const version = await provider.send('chain_getBlockHash', []);
|
||||
console.log('latest block Hash', hash);
|
||||
```
|
||||
|
||||
Classes
|
||||
-------
|
||||
|
||||
[Classes](SUMMARY.md)
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,23 +1,9 @@
|
||||
* ["coder/decodeResponse.spec"](modules/_coder_decoderesponse_spec_.md)
|
||||
* ["coder/encodeJson.spec"](modules/_coder_encodejson_spec_.md)
|
||||
* ["coder/encodeObject.spec"](modules/_coder_encodeobject_spec_.md)
|
||||
* ["coder/index"](modules/_coder_index_.md)
|
||||
* [RpcCoder](classes/_coder_index_.rpccoder.md)
|
||||
* ["defaults"](modules/_defaults_.md)
|
||||
* ["http/index"](modules/_http_index_.md)
|
||||
* [HttpProvider](classes/_http_index_.httpprovider.md)
|
||||
* ["http/polyfill"](modules/_http_polyfill_.md)
|
||||
* ["http/types"](modules/_http_types_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* ["mock/index"](modules/_mock_index_.md)
|
||||
* [Mock](classes/_mock_index_.mock.md)
|
||||
* ["mock/on.spec"](modules/_mock_on_spec_.md)
|
||||
* ["mock/send.spec"](modules/_mock_send_spec_.md)
|
||||
* ["mock/subscribe.spec"](modules/_mock_subscribe_spec_.md)
|
||||
* ["mock/types"](modules/_mock_types_.md)
|
||||
* ["mock/unsubscribe.spec"](modules/_mock_unsubscribe_spec_.md)
|
||||
* ["types"](modules/_types_.md)
|
||||
* [ProviderInterface](interfaces/_types_.providerinterface.md)
|
||||
* ["ws/index"](modules/_ws_index_.md)
|
||||
* [WsProvider](classes/_ws_index_.wsprovider.md)
|
||||
* ["ws/Provider"](modules/_ws_provider_.md)
|
||||
* [WsProvider](classes/_ws_provider_.wsprovider.md)
|
||||
* ["ws/polyfill"](modules/_ws_polyfill_.md)
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**RpcCoder**
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="decoderesponse"></a>
|
||||
|
||||
## decodeResponse
|
||||
|
||||
▸ **decodeResponse**(response: *[JsonRpcResponse](../modules/_types_.md#jsonrpcresponse)*): `any`
|
||||
|
||||
*Defined in [coder/index.ts:12](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/coder/index.ts#L12)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| response | [JsonRpcResponse](../modules/_types_.md#jsonrpcresponse) |
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
___
|
||||
<a id="encodejson"></a>
|
||||
|
||||
## encodeJson
|
||||
|
||||
▸ **encodeJson**(method: *`string`*, params: *`any` \| `Array`<`any`>*): `string`
|
||||
|
||||
*Defined in [coder/index.ts:33](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/coder/index.ts#L33)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| method | `string` |
|
||||
| params | `any` \| `Array`<`any`> |
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
___
|
||||
<a id="encodeobject"></a>
|
||||
|
||||
## encodeObject
|
||||
|
||||
▸ **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/0b9484f/packages/rpc-provider/src/coder/index.ts#L39)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| method | `string` |
|
||||
| params | `any` \| `Array`<`any`> |
|
||||
|
||||
**Returns:** [JsonRpcRequest](../modules/_types_.md#jsonrpcrequest)
|
||||
|
||||
___
|
||||
<a id="getid"></a>
|
||||
|
||||
## getId
|
||||
|
||||
▸ **getId**(): `number`
|
||||
|
||||
*Defined in [coder/index.ts:48](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/coder/index.ts#L48)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
___
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,207 +0,0 @@
|
||||
|
||||
|
||||
@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).
|
||||
|
||||
*__example__*:
|
||||
|
||||
```javascript
|
||||
import Api from '@polkadot/api/promise';
|
||||
import HttpProvider from '@polkadot/rpc-provider/http';
|
||||
|
||||
const provider = new HttpProvider('http://127.0.0.1:9933');
|
||||
const api = new Api(provider);
|
||||
```
|
||||
|
||||
*__see__*: [WsProvider](_ws_index_.wsprovider.md)
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**HttpProvider**
|
||||
|
||||
# Implements
|
||||
|
||||
* [ProviderInterface](../interfaces/_types_.providerinterface.md)
|
||||
|
||||
# Constructors
|
||||
|
||||
<a id="constructor"></a>
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new HttpProvider**(endpoint?: *`string`*): [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
*Defined in [http/index.ts:40](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/http/index.ts#L40)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| `Default value` endpoint | `string` | defaults.HTTP_URL | The endpoint url starting with http:// |
|
||||
|
||||
**Returns:** [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
___
|
||||
|
||||
# Accessors
|
||||
|
||||
<a id="hassubscriptions"></a>
|
||||
|
||||
## hasSubscriptions
|
||||
|
||||
**get hasSubscriptions**(): `boolean`
|
||||
|
||||
*Defined in [http/index.ts:55](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/http/index.ts#L55)*
|
||||
|
||||
*__summary__*: `true` when this provider supports subscriptions
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
___
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="clone"></a>
|
||||
|
||||
## clone
|
||||
|
||||
▸ **clone**(): [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L62)*
|
||||
|
||||
*__description__*: Returns a clone of the object
|
||||
|
||||
**Returns:** [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
___
|
||||
<a id="disconnect"></a>
|
||||
|
||||
## disconnect
|
||||
|
||||
▸ **disconnect**(): `void`
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L69)*
|
||||
|
||||
*__description__*: Manually disconnect from the connection
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="isconnected"></a>
|
||||
|
||||
## isConnected
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L77)*
|
||||
|
||||
*__summary__*: Whether the node is connected or not.
|
||||
|
||||
**Returns:** `boolean`
|
||||
true if connected
|
||||
|
||||
___
|
||||
<a id="on"></a>
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L85)*
|
||||
|
||||
*__summary__*: Events are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
*__description__*: HTTP Provider does not have 'on' emitters. WebSockets should be used instead.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="send"></a>
|
||||
|
||||
## send
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L92)*
|
||||
|
||||
*__summary__*: Send HTTP POST Request with Body to configured HTTP Endpoint.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
___
|
||||
<a id="subscribe"></a>
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(types: *`string`*, method: *`string`*, params: *`Array`<`any`>*, cb: *[ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L114)*
|
||||
|
||||
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| types | `string` |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
| cb | [ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback) |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
|
||||
___
|
||||
<a id="unsubscribe"></a>
|
||||
|
||||
## unsubscribe
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/http/index.ts#L123)*
|
||||
|
||||
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
|
||||
|
||||
A mock provider mainly used for testing.
|
||||
|
||||
*__returns__*: The mock provider
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**Mock**
|
||||
|
||||
# Implements
|
||||
|
||||
* [ProviderInterface](../interfaces/_types_.providerinterface.md)
|
||||
|
||||
# Constructors
|
||||
|
||||
<a id="constructor"></a>
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new Mock**(): [Mock](_mock_index_.mock.md)
|
||||
|
||||
*Defined in [mock/index.ts:68](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/index.ts#L68)*
|
||||
|
||||
**Returns:** [Mock](_mock_index_.mock.md)
|
||||
|
||||
___
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="isupdating"></a>
|
||||
|
||||
## isUpdating
|
||||
|
||||
**● isUpdating**: *`boolean`* = true
|
||||
|
||||
*Defined in [mock/index.ts:43](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/index.ts#L43)*
|
||||
|
||||
___
|
||||
<a id="subscriptions"></a>
|
||||
|
||||
## subscriptions
|
||||
|
||||
**● subscriptions**: *[MockState$Subscriptions](../modules/_mock_types_.md#mockstate_subscriptions)* = SUBSCRIPTIONS.reduce((subs, name) => {
|
||||
subs[name] = {
|
||||
callbacks: {},
|
||||
lastValue: null
|
||||
};
|
||||
|
||||
return subs;
|
||||
}, ({} as MockState$Subscriptions))
|
||||
|
||||
*Defined in [mock/index.ts:57](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/index.ts#L57)*
|
||||
|
||||
___
|
||||
|
||||
# Accessors
|
||||
|
||||
<a id="hassubscriptions"></a>
|
||||
|
||||
## hasSubscriptions
|
||||
|
||||
**get hasSubscriptions**(): `boolean`
|
||||
|
||||
*Defined in [mock/index.ts:74](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/index.ts#L74)*
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
___
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="clone"></a>
|
||||
|
||||
## clone
|
||||
|
||||
▸ **clone**(): [Mock](_mock_index_.mock.md)
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/mock/index.ts#L78)*
|
||||
|
||||
**Returns:** [Mock](_mock_index_.mock.md)
|
||||
|
||||
___
|
||||
<a id="disconnect"></a>
|
||||
|
||||
## disconnect
|
||||
|
||||
▸ **disconnect**(): `void`
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/mock/index.ts#L82)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="isconnected"></a>
|
||||
|
||||
## isConnected
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/mock/index.ts#L86)*
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
___
|
||||
<a id="on"></a>
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/mock/index.ts#L90)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="send"></a>
|
||||
|
||||
## send
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/mock/index.ts#L94)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
___
|
||||
<a id="subscribe"></a>
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, ...params: *`Array`<`any`>*): `Promise`<`number`>
|
||||
|
||||
*Defined in [mock/index.ts:102](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/index.ts#L102)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| `Rest` params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
|
||||
___
|
||||
<a id="unsubscribe"></a>
|
||||
|
||||
## unsubscribe
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*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/0b9484f/packages/rpc-provider/src/mock/index.ts#L122)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+19
-19
@@ -5,7 +5,7 @@
|
||||
|
||||
*__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.
|
||||
*__description__*: The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port. Unlike the \[\[HttpProvider\]\], it does support subscriptions and allows listening to events such as new blocks or balance changes.
|
||||
|
||||
*__example__*:
|
||||
|
||||
@@ -17,7 +17,7 @@ const provider = new WsProvider('ws://127.0.0.1:9944');
|
||||
const api = new Api(provider);
|
||||
```
|
||||
|
||||
*__see__*: [HttpProvider](_http_index_.httpprovider.md)
|
||||
*__see__*: \[\[HttpProvider\]\]
|
||||
|
||||
# Hierarchy
|
||||
|
||||
@@ -33,9 +33,9 @@ const api = new Api(provider);
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new WsProvider**(endpoint?: *`string`*, autoConnect?: *`boolean`*): [WsProvider](_ws_index_.wsprovider.md)
|
||||
⊕ **new WsProvider**(endpoint?: *`string`*, autoConnect?: *`boolean`*): [WsProvider](_ws_provider_.wsprovider.md)
|
||||
|
||||
*Defined in [ws/index.ts:75](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L75)*
|
||||
*Defined in [ws/Provider.ts:75](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L75)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -44,7 +44,7 @@ const api = new Api(provider);
|
||||
| `Default value` endpoint | `string` | defaults.WS_URL | The endpoint url. Usually \`ws://ip:9944\` or \`wss://ip:9944\` |
|
||||
| `Default value` autoConnect | `boolean` | true | Whether to connect automatically or not. |
|
||||
|
||||
**Returns:** [WsProvider](_ws_index_.wsprovider.md)
|
||||
**Returns:** [WsProvider](_ws_provider_.wsprovider.md)
|
||||
|
||||
___
|
||||
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
**get hasSubscriptions**(): `boolean`
|
||||
|
||||
*Defined in [ws/index.ts:101](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L101)*
|
||||
*Defined in [ws/Provider.ts:101](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L101)*
|
||||
|
||||
*__summary__*: `true` when this provider supports subscriptions
|
||||
|
||||
@@ -70,13 +70,13 @@ ___
|
||||
|
||||
## clone
|
||||
|
||||
▸ **clone**(): [WsProvider](_ws_index_.wsprovider.md)
|
||||
▸ **clone**(): [WsProvider](_ws_provider_.wsprovider.md)
|
||||
|
||||
*Defined in [ws/index.ts:108](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L108)*
|
||||
*Defined in [ws/Provider.ts:108](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L108)*
|
||||
|
||||
*__description__*: Returns a clone of the object
|
||||
|
||||
**Returns:** [WsProvider](_ws_index_.wsprovider.md)
|
||||
**Returns:** [WsProvider](_ws_provider_.wsprovider.md)
|
||||
|
||||
___
|
||||
<a id="connect"></a>
|
||||
@@ -85,11 +85,11 @@ ___
|
||||
|
||||
▸ **connect**(): `void`
|
||||
|
||||
*Defined in [ws/index.ts:117](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L117)*
|
||||
*Defined in [ws/Provider.ts:117](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L117)*
|
||||
|
||||
*__summary__*: Manually connect
|
||||
|
||||
*__description__*: The [WsProvider](_ws_index_.wsprovider.md) connects automatically by default, however if you decided otherwise, you may connect manually using this method.
|
||||
*__description__*: The [WsProvider](_ws_provider_.wsprovider.md) connects automatically by default, however if you decided otherwise, you may connect manually using this method.
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -100,7 +100,7 @@ ___
|
||||
|
||||
▸ **disconnect**(): `void`
|
||||
|
||||
*Defined in [ws/index.ts:133](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L133)*
|
||||
*Defined in [ws/Provider.ts:133](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L133)*
|
||||
|
||||
*__description__*: Manually disconnect from the connection, clearing autoconnect logic
|
||||
|
||||
@@ -113,7 +113,7 @@ ___
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [ws/index.ts:150](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L150)*
|
||||
*Defined in [ws/Provider.ts:150](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L150)*
|
||||
|
||||
*__summary__*: Whether the node is connected or not.
|
||||
|
||||
@@ -127,9 +127,9 @@ ___
|
||||
|
||||
▸ **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/0b9484f/packages/rpc-provider/src/ws/index.ts#L159)*
|
||||
*Defined in [ws/Provider.ts:159](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L159)*
|
||||
|
||||
*__summary__*: Listens on events after having subscribed using the [subscribe](_ws_index_.wsprovider.md#subscribe) function.
|
||||
*__summary__*: Listens on events after having subscribed using the [subscribe](_ws_provider_.wsprovider.md#subscribe) function.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -147,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/0b9484f/packages/rpc-provider/src/ws/index.ts#L169)*
|
||||
*Defined in [ws/Provider.ts:169](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L169)*
|
||||
|
||||
*__summary__*: Send JSON data using WebSockets to configured HTTP Endpoint or queue.
|
||||
|
||||
@@ -168,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/0b9484f/packages/rpc-provider/src/ws/index.ts#L223)*
|
||||
*Defined in [ws/Provider.ts:223](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L223)*
|
||||
|
||||
*__name__*: subscribe
|
||||
|
||||
@@ -206,9 +206,9 @@ ___
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [ws/index.ts:232](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/ws/index.ts#L232)*
|
||||
*Defined in [ws/Provider.ts:232](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/ws/Provider.ts#L232)*
|
||||
|
||||
*__summary__*: Allows unsubscribing to subscriptions made with [subscribe](_ws_index_.wsprovider.md#subscribe).
|
||||
*__summary__*: Allows unsubscribing to subscriptions made with [subscribe](_ws_provider_.wsprovider.md#subscribe).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
+35
-3048
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,11 +4,6 @@
|
||||
|
||||
**ProviderInterface**
|
||||
|
||||
# Implemented by
|
||||
|
||||
* [HttpProvider](../classes/_http_index_.httpprovider.md)
|
||||
* [Mock](../classes/_mock_index_.mock.md)
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="hassubscriptions"></a>
|
||||
@@ -17,7 +12,7 @@
|
||||
|
||||
**● hasSubscriptions**: *`boolean`*
|
||||
|
||||
*Defined in [types.ts:45](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L45)*
|
||||
*Defined in [types.ts:45](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L45)*
|
||||
|
||||
___
|
||||
|
||||
@@ -29,7 +24,7 @@ ___
|
||||
|
||||
▸ **clone**(): [ProviderInterface](_types_.providerinterface.md)
|
||||
|
||||
*Defined in [types.ts:46](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L46)*
|
||||
*Defined in [types.ts:46](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L46)*
|
||||
|
||||
**Returns:** [ProviderInterface](_types_.providerinterface.md)
|
||||
|
||||
@@ -40,7 +35,7 @@ ___
|
||||
|
||||
▸ **disconnect**(): `void`
|
||||
|
||||
*Defined in [types.ts:47](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L47)*
|
||||
*Defined in [types.ts:47](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L47)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -51,7 +46,7 @@ ___
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [types.ts:48](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L48)*
|
||||
*Defined in [types.ts:48](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L48)*
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
@@ -62,7 +57,7 @@ ___
|
||||
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Defined in [types.ts:49](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L49)*
|
||||
*Defined in [types.ts:49](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -80,7 +75,7 @@ ___
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Defined in [types.ts:50](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L50)*
|
||||
*Defined in [types.ts:50](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L50)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -98,7 +93,7 @@ ___
|
||||
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, cb: *[ProviderInterface$Callback](../modules/_types_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*Defined in [types.ts:51](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L51)*
|
||||
*Defined in [types.ts:51](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L51)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -118,7 +113,7 @@ ___
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [types.ts:52](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L52)*
|
||||
*Defined in [types.ts:52](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L52)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [RpcCoder](../classes/_coder_index_.rpccoder.md)
|
||||
|
||||
---
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [HttpProvider](../classes/_http_index_.httpprovider.md)
|
||||
|
||||
---
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@
|
||||
|
||||
**Ƭ HttpState**: *`object`*
|
||||
|
||||
*Defined in [http/types.ts:9](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/http/types.ts#L9)*
|
||||
*Defined in [http/types.ts:9](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/http/types.ts#L9)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [Mock](../classes/_mock_index_.mock.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@
|
||||
|
||||
**Ƭ MockState$Db**: *`object`*
|
||||
|
||||
*Defined in [mock/types.ts:16](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/types.ts#L16)*
|
||||
*Defined in [mock/types.ts:16](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/mock/types.ts#L16)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -21,7 +21,7 @@ ___
|
||||
|
||||
**Ƭ MockState$Requests**: *`object`*
|
||||
|
||||
*Defined in [mock/types.ts:20](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/types.ts#L20)*
|
||||
*Defined in [mock/types.ts:20](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/mock/types.ts#L20)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -45,7 +45,7 @@ ___
|
||||
|
||||
**Ƭ MockState$Subscription$Callback**: *`function`*
|
||||
|
||||
*Defined in [mock/types.ts:5](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/types.ts#L5)*
|
||||
*Defined in [mock/types.ts:5](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/mock/types.ts#L5)*
|
||||
|
||||
#### Type declaration
|
||||
▸(error: *`Error` \| `null`*, value: *`any`*): `void`
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
**Ƭ MockState$Subscriptions**: *`object`*
|
||||
|
||||
*Defined in [mock/types.ts:7](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/mock/types.ts#L7)*
|
||||
*Defined in [mock/types.ts:7](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/mock/types.ts#L7)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@
|
||||
|
||||
**Ƭ JsonRpcObject**: *`object`*
|
||||
|
||||
*Defined in [types.ts:5](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L5)*
|
||||
*Defined in [types.ts:5](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L5)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -38,7 +38,7 @@ ___
|
||||
|
||||
**Ƭ JsonRpcRequest**: *[JsonRpcObject](_types_.md#jsonrpcobject) & `object`*
|
||||
|
||||
*Defined in [types.ts:10](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L10)*
|
||||
*Defined in [types.ts:10](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L10)*
|
||||
|
||||
___
|
||||
<a id="jsonrpcresponse"></a>
|
||||
@@ -47,7 +47,7 @@ ___
|
||||
|
||||
**Ƭ JsonRpcResponse**: *[JsonRpcObject](_types_.md#jsonrpcobject) & [JsonRpcResponseBase](_types_.md#jsonrpcresponsebase)*
|
||||
|
||||
*Defined in [types.ts:36](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L36)*
|
||||
*Defined in [types.ts:36](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L36)*
|
||||
|
||||
___
|
||||
<a id="jsonrpcresponsebase"></a>
|
||||
@@ -56,7 +56,7 @@ ___
|
||||
|
||||
**Ƭ JsonRpcResponseBase**: *`JsonRpcResponse$Single` & `JsonRpcResponse$Subscription`*
|
||||
|
||||
*Defined in [types.ts:34](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L34)*
|
||||
*Defined in [types.ts:34](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L34)*
|
||||
|
||||
___
|
||||
<a id="jsonrpcresponsebase_error"></a>
|
||||
@@ -65,7 +65,7 @@ ___
|
||||
|
||||
**Ƭ JsonRpcResponseBase$Error**: *`object`*
|
||||
|
||||
*Defined in [types.ts:15](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L15)*
|
||||
*Defined in [types.ts:15](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L15)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -76,7 +76,7 @@ ___
|
||||
|
||||
**Ƭ ProviderInterface$Callback**: *`function`*
|
||||
|
||||
*Defined in [types.ts:38](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L38)*
|
||||
*Defined in [types.ts:38](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L38)*
|
||||
|
||||
#### Type declaration
|
||||
▸(result: *`any`*): `void`
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
**Ƭ ProviderInterface$EmitCb**: *`function`*
|
||||
|
||||
*Defined in [types.ts:42](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L42)*
|
||||
*Defined in [types.ts:42](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L42)*
|
||||
|
||||
#### Type declaration
|
||||
▸(value?: *`any`*): `any`
|
||||
@@ -116,7 +116,7 @@ ___
|
||||
|
||||
**Ƭ ProviderInterface$Emitted**: *"connected" \| "disconnected" \| "error"*
|
||||
|
||||
*Defined in [types.ts:40](https://github.com/polkadot-js/api/blob/0b9484f/packages/rpc-provider/src/types.ts#L40)*
|
||||
*Defined in [types.ts:40](https://github.com/polkadot-js/api/blob/73a5ea1/packages/rpc-provider/src/types.ts#L40)*
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [WsProvider](../classes/_ws_index_.wsprovider.md)
|
||||
|
||||
---
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [WsProvider](../classes/_ws_provider_.wsprovider.md)
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user