[CI Skip] 0.31.1
This commit is contained in:
+20
-20
@@ -100,12 +100,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="api/">
|
||||
<li class="chapter " data-level="1.2" data-path="rpc-core/">
|
||||
|
||||
<a href="api/">
|
||||
<a href="rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -114,12 +114,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="api/classes/_index_.api.html">
|
||||
<a href="rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -132,12 +132,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="rpc-provider/">
|
||||
|
||||
<a href="api-provider/">
|
||||
<a href="rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -146,9 +146,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -159,9 +159,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -177,12 +177,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="rpc-rx/">
|
||||
|
||||
<a href="api-rx/">
|
||||
<a href="rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -191,12 +191,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"GLOSSARY.md","mtime":"2018-10-10T07:28:28.436Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":".","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"GLOSSARY.md","mtime":"2018-10-10T08:02:18.116Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":".","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new ApiBase**(api: *`RxApiInterface`*): [ApiBase](_base_.apibase.md)
|
||||
⊕ **new ApiBase**(api: *`RxRpcInterface`*): [ApiBase](_base_.apibase.md)
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| api | `RxApiInterface` |
|
||||
| api | `RxRpcInterface` |
|
||||
|
||||
**Returns:** [ApiBase](_base_.apibase.md)
|
||||
|
||||
@@ -32,9 +32,9 @@ ___
|
||||
|
||||
## `<Protected>` _api
|
||||
|
||||
**● _api**: *`RxApiInterface`*
|
||||
**● _api**: *`RxRpcInterface`*
|
||||
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L28)*
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L28)*
|
||||
|
||||
___
|
||||
<a id="_genesishash"></a>
|
||||
@@ -43,7 +43,7 @@ ___
|
||||
|
||||
**● _genesisHash**: *`Hash`*
|
||||
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L29)*
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="whenready"></a>
|
||||
@@ -52,7 +52,7 @@ ___
|
||||
|
||||
**● whenReady**: *`Observable`<`boolean`>*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
___
|
||||
<a id="extrinsics"></a>
|
||||
@@ -61,7 +61,7 @@ ___
|
||||
|
||||
**● extrinsics**: *`Extrinsics`* = extrinsicsStatic
|
||||
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L40)*
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L40)*
|
||||
|
||||
___
|
||||
<a id="storage"></a>
|
||||
@@ -70,7 +70,7 @@ ___
|
||||
|
||||
**● storage**: *`Storage`* = storageStatic
|
||||
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L41)*
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
@@ -82,7 +82,7 @@ ___
|
||||
|
||||
getgenesisHash(): `Hash`
|
||||
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L80)*
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L80)*
|
||||
|
||||
**Returns:** `Hash`
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
▸ **combine**<`T`,`R`>(observables: *`Array`<`Observable`<`any`>>*, mapfn?: *`MapFn`<`R`, `T`>*): `Observable`<`T`>
|
||||
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L73)*
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L73)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -118,7 +118,7 @@ ___
|
||||
|
||||
▸ **isConnected**(): `Observable`<`boolean`>
|
||||
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L84)*
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L84)*
|
||||
|
||||
**Returns:** `Observable`<`boolean`>
|
||||
|
||||
@@ -129,7 +129,7 @@ ___
|
||||
|
||||
▸ **rawCall**<`T`>(__namedParameters: *`object`*, ...params: *`Array`<`any`>*): `Observable`<`T`>
|
||||
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L88)*
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L88)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -150,7 +150,7 @@ ___
|
||||
|
||||
▸ **rawStorage**<`T`>(key: *`StorageFunction`*, ...params: *`Array`<`any`>*): `Observable`< `T` | `undefined`>
|
||||
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L100)*
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L100)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -171,7 +171,7 @@ ___
|
||||
|
||||
▸ **rawStorageMulti**<`T`>(...keys: *`Array`< [`StorageFunction`] | [`StorageFunction`, `any`]>*): `Observable`<`T`>
|
||||
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L112)*
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L112)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new ApiCalls**(api: *`RxApiInterface`*): [ApiCalls](_calls_.apicalls.md)
|
||||
⊕ **new ApiCalls**(api: *`RxRpcInterface`*): [ApiCalls](_calls_.apicalls.md)
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| api | `RxApiInterface` |
|
||||
| api | `RxRpcInterface` |
|
||||
|
||||
**Returns:** [ApiCalls](_calls_.apicalls.md)
|
||||
|
||||
@@ -36,11 +36,11 @@ ___
|
||||
|
||||
## `<Protected>` _api
|
||||
|
||||
**● _api**: *`RxApiInterface`*
|
||||
**● _api**: *`RxRpcInterface`*
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_api](_base_.apibase.md#_api)*
|
||||
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L28)*
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L28)*
|
||||
|
||||
___
|
||||
<a id="_genesishash"></a>
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_genesisHash](_base_.apibase.md#_genesishash)*
|
||||
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L29)*
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="whenready"></a>
|
||||
@@ -62,7 +62,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[whenReady](_base_.apibase.md#whenready)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
___
|
||||
<a id="extrinsics"></a>
|
||||
@@ -73,7 +73,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[extrinsics](_base_.apibase.md#extrinsics)*
|
||||
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L40)*
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L40)*
|
||||
|
||||
___
|
||||
<a id="storage"></a>
|
||||
@@ -84,7 +84,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[storage](_base_.apibase.md#storage)*
|
||||
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L41)*
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +98,7 @@ getgenesisHash(): `Hash`
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
|
||||
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L80)*
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L80)*
|
||||
|
||||
**Returns:** `Hash`
|
||||
|
||||
@@ -114,7 +114,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[accountNonce](_queries_.apiqueries.md#accountnonce)*
|
||||
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L21)*
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L21)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -133,7 +133,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[balanceFree](_queries_.apiqueries.md#balancefree)*
|
||||
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L25)*
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L25)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -152,7 +152,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[balanceReserved](_queries_.apiqueries.md#balancereserved)*
|
||||
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L29)*
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -169,7 +169,7 @@ ___
|
||||
|
||||
▸ **bestNumber**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:13](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L13)*
|
||||
*Defined in [Calls.ts:13](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L13)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -182,7 +182,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[blockNow](_queries_.apiqueries.md#blocknow)*
|
||||
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L37)*
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L37)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -195,7 +195,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[blockPeriod](_queries_.apiqueries.md#blockperiod)*
|
||||
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L33)*
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -206,7 +206,7 @@ ___
|
||||
|
||||
▸ **chain**(): `Observable`< `Text` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L25)*
|
||||
*Defined in [Calls.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L25)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -219,7 +219,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[combine](_base_.apibase.md#combine)*
|
||||
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L73)*
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L73)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -243,7 +243,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyLaunchPeriod](_queries_.apiqueries.md#democracylaunchperiod)*
|
||||
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L41)*
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L41)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -256,7 +256,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyNextTally](_queries_.apiqueries.md#democracynexttally)*
|
||||
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L45)*
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L45)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -269,7 +269,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyVotingPeriod](_queries_.apiqueries.md#democracyvotingperiod)*
|
||||
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L115)*
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L115)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -282,7 +282,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[eraLastLengthChange](_queries_.apiqueries.md#eralastlengthchange)*
|
||||
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L140)*
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L140)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -295,7 +295,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[fees](_queries_.apiqueries.md#fees)*
|
||||
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L119)*
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L119)*
|
||||
|
||||
**Returns:** `Observable`<[RxFees](../modules/_types_d_.md#rxfees)>
|
||||
|
||||
@@ -306,7 +306,7 @@ ___
|
||||
|
||||
▸ **getBlock**(hash: *`Uint8Array`*): `Observable`< `SignedBlock` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L29)*
|
||||
*Defined in [Calls.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -325,7 +325,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[isConnected](_base_.apibase.md#isconnected)*
|
||||
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L84)*
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L84)*
|
||||
|
||||
**Returns:** `Observable`<`boolean`>
|
||||
|
||||
@@ -336,7 +336,7 @@ ___
|
||||
|
||||
▸ **newHead**(): `Observable`< `Header` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L33)*
|
||||
*Defined in [Calls.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Header` | `undefined`>
|
||||
|
||||
@@ -349,7 +349,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[proposalDeposits](_queries_.apiqueries.md#proposaldeposits)*
|
||||
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L49)*
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -368,7 +368,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[publicProposals](_queries_.apiqueries.md#publicproposals)*
|
||||
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L62)*
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L62)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<[RxProposal](_classes_.rxproposal.md)>>
|
||||
|
||||
@@ -381,7 +381,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawCall](_base_.apibase.md#rawcall)*
|
||||
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L88)*
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L88)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -404,7 +404,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorage](_base_.apibase.md#rawstorage)*
|
||||
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L100)*
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L100)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -427,7 +427,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorageMulti](_base_.apibase.md#rawstoragemulti)*
|
||||
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L112)*
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L112)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -449,7 +449,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumCount](_queries_.apiqueries.md#referendumcount)*
|
||||
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L81)*
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L81)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -462,7 +462,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumInfo](_queries_.apiqueries.md#referenduminfo)*
|
||||
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L85)*
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L85)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -481,7 +481,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumVote](_queries_.apiqueries.md#referendumvote)*
|
||||
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L98)*
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L98)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -501,7 +501,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumVoters](_queries_.apiqueries.md#referendumvoters)*
|
||||
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L102)*
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L102)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -520,7 +520,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionCurrentIndex](_queries_.apiqueries.md#sessioncurrentindex)*
|
||||
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L152)*
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L152)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -533,7 +533,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionCurrentStart](_queries_.apiqueries.md#sessioncurrentstart)*
|
||||
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L156)*
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L156)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -546,7 +546,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionLastLengthChange](_queries_.apiqueries.md#sessionlastlengthchange)*
|
||||
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L160)*
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L160)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -559,7 +559,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionLength](_queries_.apiqueries.md#sessionlength)*
|
||||
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L164)*
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L164)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -572,7 +572,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionReward](_queries_.apiqueries.md#sessionreward)*
|
||||
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L144)*
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L144)*
|
||||
|
||||
**Returns:** `Observable`< `Perbill` | `undefined`>
|
||||
|
||||
@@ -585,7 +585,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionRewardCurrent](_queries_.apiqueries.md#sessionrewardcurrent)*
|
||||
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L148)*
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L148)*
|
||||
|
||||
**Returns:** `Observable`< `Balance` | `undefined`>
|
||||
|
||||
@@ -598,7 +598,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionValidators](_queries_.apiqueries.md#sessionvalidators)*
|
||||
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L172)*
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L172)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -611,7 +611,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionsPerEra](_queries_.apiqueries.md#sessionsperera)*
|
||||
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L168)*
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L168)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -624,7 +624,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingIntentions](_queries_.apiqueries.md#stakingintentions)*
|
||||
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L185)*
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L185)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -637,7 +637,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingNominating](_queries_.apiqueries.md#stakingnominating)*
|
||||
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L211)*
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L211)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -656,7 +656,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingNominatorsFor](_queries_.apiqueries.md#stakingnominatorsfor)*
|
||||
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L198)*
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L198)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -673,7 +673,7 @@ ___
|
||||
|
||||
▸ **submitExtrinsic**(extrinsic: *`Extrinsic`*): `Observable`< `Hash` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:47](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L47)*
|
||||
*Defined in [Calls.ts:47](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L47)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -690,7 +690,7 @@ ___
|
||||
|
||||
▸ **systemName**(): `Observable`< `Text` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:39](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L39)*
|
||||
*Defined in [Calls.ts:39](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L39)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -701,7 +701,7 @@ ___
|
||||
|
||||
▸ **systemVersion**(): `Observable`< `Text` | `undefined`>
|
||||
|
||||
*Defined in [Calls.ts:43](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L43)*
|
||||
*Defined in [Calls.ts:43](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L43)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -714,7 +714,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[validatorCount](_queries_.apiqueries.md#validatorcount)*
|
||||
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L215)*
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L215)*
|
||||
|
||||
**Returns:** `Observable`< `u32` | `undefined`>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
*Overrides Struct.__constructor*
|
||||
|
||||
*Defined in [classes.ts:9](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L9)*
|
||||
*Defined in [classes.ts:9](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L9)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -43,7 +43,7 @@ ___
|
||||
|
||||
*Inherited from Struct._Types*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L30)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L30)*
|
||||
|
||||
___
|
||||
<a id="_jsonmap"></a>
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
*Inherited from Struct._jsonMap*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L29)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="raw"></a>
|
||||
@@ -65,7 +65,7 @@ ___
|
||||
|
||||
*Inherited from Base.raw*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Base.ts:19](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Base.ts#L19)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Base.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Base.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
@@ -79,7 +79,7 @@ getType(): `E`
|
||||
|
||||
*Inherited from Struct.Type*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:108](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L108)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:108](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L108)*
|
||||
|
||||
**Returns:** `E`
|
||||
|
||||
@@ -90,7 +90,7 @@ ___
|
||||
|
||||
getaddress(): `AccountId`
|
||||
|
||||
*Defined in [classes.ts:18](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L18)*
|
||||
*Defined in [classes.ts:18](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L18)*
|
||||
|
||||
**Returns:** `AccountId`
|
||||
|
||||
@@ -101,7 +101,7 @@ ___
|
||||
|
||||
getid(): `PropIndex`
|
||||
|
||||
*Defined in [classes.ts:22](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L22)*
|
||||
*Defined in [classes.ts:22](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L22)*
|
||||
|
||||
**Returns:** `PropIndex`
|
||||
|
||||
@@ -112,7 +112,7 @@ ___
|
||||
|
||||
getproposal(): `Proposal`
|
||||
|
||||
*Defined in [classes.ts:26](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L26)*
|
||||
*Defined in [classes.ts:26](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L26)*
|
||||
|
||||
**Returns:** `Proposal`
|
||||
|
||||
@@ -130,7 +130,7 @@ ___
|
||||
|
||||
*Overrides Base.byteLength*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L112)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L112)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -145,7 +145,7 @@ ___
|
||||
|
||||
*Overrides Base.fromJSON*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:118](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L118)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:118](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L118)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -166,7 +166,7 @@ ___
|
||||
|
||||
*Overrides Base.fromU8a*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:138](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L138)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:138](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L138)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -185,7 +185,7 @@ ___
|
||||
|
||||
*Inherited from Struct.get*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L148)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L148)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -204,7 +204,7 @@ ___
|
||||
|
||||
*Inherited from Struct.keys*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:163](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L163)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:163](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L163)*
|
||||
|
||||
**Returns:** `Array`<`string`>
|
||||
|
||||
@@ -219,7 +219,7 @@ ___
|
||||
|
||||
*Overrides Base.toJSON*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L152)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L152)*
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
@@ -234,7 +234,7 @@ ___
|
||||
|
||||
*Overrides Base.toString*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:175](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L175)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:175](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L175)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -249,7 +249,7 @@ ___
|
||||
|
||||
*Overrides Base.toU8a*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L167)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L167)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -268,7 +268,7 @@ ___
|
||||
|
||||
*Inherited from Struct.values*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L184)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L184)*
|
||||
|
||||
**Returns:** `Array`<`Base`>
|
||||
|
||||
@@ -281,7 +281,7 @@ ___
|
||||
|
||||
*Inherited from Struct.decodeStruct*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:48](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L48)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:48](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L48)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -306,7 +306,7 @@ ___
|
||||
|
||||
*Inherited from Struct.with*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L98)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L98)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
*Overrides Struct.__constructor*
|
||||
|
||||
*Defined in [classes.ts:31](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L31)*
|
||||
*Defined in [classes.ts:31](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L31)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -43,7 +43,7 @@ ___
|
||||
|
||||
*Inherited from Struct._Types*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L30)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L30)*
|
||||
|
||||
___
|
||||
<a id="_jsonmap"></a>
|
||||
@@ -54,7 +54,7 @@ ___
|
||||
|
||||
*Inherited from Struct._jsonMap*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L29)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="raw"></a>
|
||||
@@ -65,7 +65,7 @@ ___
|
||||
|
||||
*Inherited from Base.raw*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Base.ts:19](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Base.ts#L19)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Base.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Base.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
@@ -79,7 +79,7 @@ getType(): `E`
|
||||
|
||||
*Inherited from Struct.Type*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:108](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L108)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:108](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L108)*
|
||||
|
||||
**Returns:** `E`
|
||||
|
||||
@@ -90,7 +90,7 @@ ___
|
||||
|
||||
getaddresses(): `Vector`<`AccountId`>
|
||||
|
||||
*Defined in [classes.ts:39](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L39)*
|
||||
*Defined in [classes.ts:39](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L39)*
|
||||
|
||||
**Returns:** `Vector`<`AccountId`>
|
||||
|
||||
@@ -101,7 +101,7 @@ ___
|
||||
|
||||
getbalance(): `Balance`
|
||||
|
||||
*Defined in [classes.ts:43](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L43)*
|
||||
*Defined in [classes.ts:43](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L43)*
|
||||
|
||||
**Returns:** `Balance`
|
||||
|
||||
@@ -119,7 +119,7 @@ ___
|
||||
|
||||
*Overrides Base.byteLength*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L112)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L112)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -134,7 +134,7 @@ ___
|
||||
|
||||
*Overrides Base.fromJSON*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:118](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L118)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:118](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L118)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -155,7 +155,7 @@ ___
|
||||
|
||||
*Overrides Base.fromU8a*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:138](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L138)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:138](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L138)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -174,7 +174,7 @@ ___
|
||||
|
||||
*Inherited from Struct.get*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L148)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L148)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -193,7 +193,7 @@ ___
|
||||
|
||||
*Inherited from Struct.keys*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:163](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L163)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:163](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L163)*
|
||||
|
||||
**Returns:** `Array`<`string`>
|
||||
|
||||
@@ -208,7 +208,7 @@ ___
|
||||
|
||||
*Overrides Base.toJSON*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L152)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L152)*
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
@@ -223,7 +223,7 @@ ___
|
||||
|
||||
*Overrides Base.toString*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:175](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L175)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:175](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L175)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -238,7 +238,7 @@ ___
|
||||
|
||||
*Overrides Base.toU8a*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L167)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L167)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -257,7 +257,7 @@ ___
|
||||
|
||||
*Inherited from Struct.values*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L184)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L184)*
|
||||
|
||||
**Returns:** `Array`<`Base`>
|
||||
|
||||
@@ -270,7 +270,7 @@ ___
|
||||
|
||||
*Inherited from Struct.decodeStruct*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:48](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L48)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:48](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L48)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -295,7 +295,7 @@ ___
|
||||
|
||||
*Inherited from Struct.with*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L98)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L98)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
*Overrides Struct.__constructor*
|
||||
|
||||
*Defined in [classes.ts:48](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L48)*
|
||||
*Defined in [classes.ts:48](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L48)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -44,7 +44,7 @@ ___
|
||||
|
||||
*Inherited from Struct._Types*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L30)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L30)*
|
||||
|
||||
___
|
||||
<a id="_jsonmap"></a>
|
||||
@@ -55,7 +55,7 @@ ___
|
||||
|
||||
*Inherited from Struct._jsonMap*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L29)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="raw"></a>
|
||||
@@ -66,7 +66,7 @@ ___
|
||||
|
||||
*Inherited from Base.raw*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Base.ts:19](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Base.ts#L19)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Base.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Base.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
@@ -80,7 +80,7 @@ getType(): `E`
|
||||
|
||||
*Inherited from Struct.Type*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:108](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L108)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:108](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L108)*
|
||||
|
||||
**Returns:** `E`
|
||||
|
||||
@@ -91,7 +91,7 @@ ___
|
||||
|
||||
getblockNumber(): `BlockNumber`
|
||||
|
||||
*Defined in [classes.ts:58](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L58)*
|
||||
*Defined in [classes.ts:58](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L58)*
|
||||
|
||||
**Returns:** `BlockNumber`
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
getid(): `ReferendumIndex`
|
||||
|
||||
*Defined in [classes.ts:62](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L62)*
|
||||
*Defined in [classes.ts:62](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L62)*
|
||||
|
||||
**Returns:** `ReferendumIndex`
|
||||
|
||||
@@ -113,7 +113,7 @@ ___
|
||||
|
||||
getproposal(): `Proposal`
|
||||
|
||||
*Defined in [classes.ts:66](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L66)*
|
||||
*Defined in [classes.ts:66](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L66)*
|
||||
|
||||
**Returns:** `Proposal`
|
||||
|
||||
@@ -124,7 +124,7 @@ ___
|
||||
|
||||
getvoteThreshold(): `VoteThreshold`
|
||||
|
||||
*Defined in [classes.ts:70](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/classes.ts#L70)*
|
||||
*Defined in [classes.ts:70](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/classes.ts#L70)*
|
||||
|
||||
**Returns:** `VoteThreshold`
|
||||
|
||||
@@ -142,7 +142,7 @@ ___
|
||||
|
||||
*Overrides Base.byteLength*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L112)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L112)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -157,7 +157,7 @@ ___
|
||||
|
||||
*Overrides Base.fromJSON*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:118](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L118)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:118](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L118)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -178,7 +178,7 @@ ___
|
||||
|
||||
*Overrides Base.fromU8a*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:138](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L138)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:138](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L138)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -197,7 +197,7 @@ ___
|
||||
|
||||
*Inherited from Struct.get*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L148)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L148)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -216,7 +216,7 @@ ___
|
||||
|
||||
*Inherited from Struct.keys*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:163](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L163)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:163](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L163)*
|
||||
|
||||
**Returns:** `Array`<`string`>
|
||||
|
||||
@@ -231,7 +231,7 @@ ___
|
||||
|
||||
*Overrides Base.toJSON*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L152)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L152)*
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
@@ -246,7 +246,7 @@ ___
|
||||
|
||||
*Overrides Base.toString*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:175](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L175)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:175](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L175)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -261,7 +261,7 @@ ___
|
||||
|
||||
*Overrides Base.toU8a*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L167)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L167)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -280,7 +280,7 @@ ___
|
||||
|
||||
*Inherited from Struct.values*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L184)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L184)*
|
||||
|
||||
**Returns:** `Array`<`Base`>
|
||||
|
||||
@@ -293,7 +293,7 @@ ___
|
||||
|
||||
*Inherited from Struct.decodeStruct*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:48](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L48)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:48](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L48)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -318,7 +318,7 @@ ___
|
||||
|
||||
*Inherited from Struct.with*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Struct.ts#L98)*
|
||||
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Struct.ts#L98)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new ApiCombined**(api: *`RxApiInterface`*): [ApiCombined](_combined_.apicombined.md)
|
||||
⊕ **new ApiCombined**(api: *`RxRpcInterface`*): [ApiCombined](_combined_.apicombined.md)
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| api | `RxApiInterface` |
|
||||
| api | `RxRpcInterface` |
|
||||
|
||||
**Returns:** [ApiCombined](_combined_.apicombined.md)
|
||||
|
||||
@@ -36,11 +36,11 @@ ___
|
||||
|
||||
## `<Protected>` _api
|
||||
|
||||
**● _api**: *`RxApiInterface`*
|
||||
**● _api**: *`RxRpcInterface`*
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_api](_base_.apibase.md#_api)*
|
||||
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L28)*
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L28)*
|
||||
|
||||
___
|
||||
<a id="_genesishash"></a>
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_genesisHash](_base_.apibase.md#_genesishash)*
|
||||
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L29)*
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="whenready"></a>
|
||||
@@ -62,7 +62,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[whenReady](_base_.apibase.md#whenready)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
___
|
||||
<a id="extrinsics"></a>
|
||||
@@ -73,7 +73,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[extrinsics](_base_.apibase.md#extrinsics)*
|
||||
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L40)*
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L40)*
|
||||
|
||||
___
|
||||
<a id="storage"></a>
|
||||
@@ -84,7 +84,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[storage](_base_.apibase.md#storage)*
|
||||
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L41)*
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +98,7 @@ getgenesisHash(): `Hash`
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
|
||||
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L80)*
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L80)*
|
||||
|
||||
**Returns:** `Hash`
|
||||
|
||||
@@ -114,7 +114,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[accountNonce](_queries_.apiqueries.md#accountnonce)*
|
||||
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L21)*
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L21)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -133,7 +133,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[balanceFree](_queries_.apiqueries.md#balancefree)*
|
||||
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L25)*
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L25)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -152,7 +152,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[balanceReserved](_queries_.apiqueries.md#balancereserved)*
|
||||
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L29)*
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -171,7 +171,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[bestNumber](_calls_.apicalls.md#bestnumber)*
|
||||
|
||||
*Defined in [Calls.ts:13](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L13)*
|
||||
*Defined in [Calls.ts:13](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L13)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -184,7 +184,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[blockNow](_queries_.apiqueries.md#blocknow)*
|
||||
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L37)*
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L37)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -197,7 +197,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[blockPeriod](_queries_.apiqueries.md#blockperiod)*
|
||||
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L33)*
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -210,7 +210,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[chain](_calls_.apicalls.md#chain)*
|
||||
|
||||
*Defined in [Calls.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L25)*
|
||||
*Defined in [Calls.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L25)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -223,7 +223,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[combine](_base_.apibase.md#combine)*
|
||||
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L73)*
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L73)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -247,7 +247,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyLaunchPeriod](_queries_.apiqueries.md#democracylaunchperiod)*
|
||||
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L41)*
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L41)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -260,7 +260,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyNextTally](_queries_.apiqueries.md#democracynexttally)*
|
||||
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L45)*
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L45)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -271,7 +271,7 @@ ___
|
||||
|
||||
▸ **democracyReferendumVoters**(referendumId: * `ReferendumIndex` | `BN` | `number`*): `Observable`<`Array`<[RxReferendumVote](../modules/_types_d_.md#rxreferendumvote)>>
|
||||
|
||||
*Defined in [Combined.ts:42](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L42)*
|
||||
*Defined in [Combined.ts:42](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L42)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -288,7 +288,7 @@ ___
|
||||
|
||||
▸ **democracyVotersBalancesOf**(referendumId: * `ReferendumIndex` | `BN` | `number`*): `Observable`<`Array`<`Balance`>>
|
||||
|
||||
*Defined in [Combined.ts:87](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L87)*
|
||||
*Defined in [Combined.ts:87](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L87)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -305,7 +305,7 @@ ___
|
||||
|
||||
▸ **democracyVotersVotesOf**(referendumId: * `ReferendumIndex` | `BN` | `number`*): `Observable`<`Array`<`Bool`>>
|
||||
|
||||
*Defined in [Combined.ts:103](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L103)*
|
||||
*Defined in [Combined.ts:103](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L103)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -324,7 +324,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyVotingPeriod](_queries_.apiqueries.md#democracyvotingperiod)*
|
||||
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L115)*
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L115)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -335,7 +335,7 @@ ___
|
||||
|
||||
▸ **eraBlockLength**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:114](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L114)*
|
||||
*Defined in [Combined.ts:114](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L114)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -346,7 +346,7 @@ ___
|
||||
|
||||
▸ **eraBlockProgress**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:129](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L129)*
|
||||
*Defined in [Combined.ts:129](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L129)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -357,7 +357,7 @@ ___
|
||||
|
||||
▸ **eraBlockRemaining**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L152)*
|
||||
*Defined in [Combined.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L152)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -370,7 +370,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[eraLastLengthChange](_queries_.apiqueries.md#eralastlengthchange)*
|
||||
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L140)*
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L140)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -383,7 +383,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[fees](_queries_.apiqueries.md#fees)*
|
||||
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L119)*
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L119)*
|
||||
|
||||
**Returns:** `Observable`<[RxFees](../modules/_types_d_.md#rxfees)>
|
||||
|
||||
@@ -396,7 +396,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[getBlock](_calls_.apicalls.md#getblock)*
|
||||
|
||||
*Defined in [Calls.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L29)*
|
||||
*Defined in [Calls.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -415,7 +415,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[isConnected](_base_.apibase.md#isconnected)*
|
||||
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L84)*
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L84)*
|
||||
|
||||
**Returns:** `Observable`<`boolean`>
|
||||
|
||||
@@ -428,7 +428,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[newHead](_calls_.apicalls.md#newhead)*
|
||||
|
||||
*Defined in [Calls.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L33)*
|
||||
*Defined in [Calls.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Header` | `undefined`>
|
||||
|
||||
@@ -441,7 +441,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[proposalDeposits](_queries_.apiqueries.md#proposaldeposits)*
|
||||
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L49)*
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -458,7 +458,7 @@ ___
|
||||
|
||||
▸ **publicProposalCount**(): `Observable`<`number`>
|
||||
|
||||
*Defined in [Combined.ts:20](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L20)*
|
||||
*Defined in [Combined.ts:20](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L20)*
|
||||
|
||||
**Returns:** `Observable`<`number`>
|
||||
|
||||
@@ -471,7 +471,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[publicProposals](_queries_.apiqueries.md#publicproposals)*
|
||||
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L62)*
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L62)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<[RxProposal](_classes_.rxproposal.md)>>
|
||||
|
||||
@@ -484,7 +484,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawCall](_base_.apibase.md#rawcall)*
|
||||
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L88)*
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L88)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -507,7 +507,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorage](_base_.apibase.md#rawstorage)*
|
||||
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L100)*
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L100)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -530,7 +530,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorageMulti](_base_.apibase.md#rawstoragemulti)*
|
||||
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L112)*
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L112)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -552,7 +552,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumCount](_queries_.apiqueries.md#referendumcount)*
|
||||
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L81)*
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L81)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -565,7 +565,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumInfo](_queries_.apiqueries.md#referenduminfo)*
|
||||
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L85)*
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L85)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -584,7 +584,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumVote](_queries_.apiqueries.md#referendumvote)*
|
||||
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L98)*
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L98)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -604,7 +604,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumVoters](_queries_.apiqueries.md#referendumvoters)*
|
||||
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L102)*
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L102)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -621,7 +621,7 @@ ___
|
||||
|
||||
▸ **referendumVotes**(index: * `ReferendumIndex` | `BN` | `number`*, addresses: *`Array`< `AccountId` | `string`>*): `Observable`<`boolean`>
|
||||
|
||||
*Defined in [Combined.ts:79](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L79)*
|
||||
*Defined in [Combined.ts:79](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L79)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -639,7 +639,7 @@ ___
|
||||
|
||||
▸ **referendums**(): `Observable`<`Array`<[RxReferendum](_classes_.rxreferendum.md)>>
|
||||
|
||||
*Defined in [Combined.ts:58](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L58)*
|
||||
*Defined in [Combined.ts:58](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L58)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<[RxReferendum](_classes_.rxreferendum.md)>>
|
||||
|
||||
@@ -650,7 +650,7 @@ ___
|
||||
|
||||
▸ **referendumsInfo**(referendumIds: *`Array`< `ReferendumIndex` | `BN` | `number`>*): `Observable`<`Array`<[RxReferendum](_classes_.rxreferendum.md)>>
|
||||
|
||||
*Defined in [Combined.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L30)*
|
||||
*Defined in [Combined.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L30)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -667,7 +667,7 @@ ___
|
||||
|
||||
▸ **sessionBlockProgress**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:167](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L167)*
|
||||
*Defined in [Combined.ts:167](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L167)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -678,7 +678,7 @@ ___
|
||||
|
||||
▸ **sessionBlockRemaining**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:187](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L187)*
|
||||
*Defined in [Combined.ts:187](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L187)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -689,7 +689,7 @@ ___
|
||||
|
||||
▸ **sessionBrokenValue**(): `Observable`< `Moment` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:202](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L202)*
|
||||
*Defined in [Combined.ts:202](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L202)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -702,7 +702,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionCurrentIndex](_queries_.apiqueries.md#sessioncurrentindex)*
|
||||
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L152)*
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L152)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -715,7 +715,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionCurrentStart](_queries_.apiqueries.md#sessioncurrentstart)*
|
||||
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L156)*
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L156)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -728,7 +728,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionLastLengthChange](_queries_.apiqueries.md#sessionlastlengthchange)*
|
||||
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L160)*
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L160)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -741,7 +741,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionLength](_queries_.apiqueries.md#sessionlength)*
|
||||
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L164)*
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L164)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -754,7 +754,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionReward](_queries_.apiqueries.md#sessionreward)*
|
||||
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L144)*
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L144)*
|
||||
|
||||
**Returns:** `Observable`< `Perbill` | `undefined`>
|
||||
|
||||
@@ -767,7 +767,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionRewardCurrent](_queries_.apiqueries.md#sessionrewardcurrent)*
|
||||
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L148)*
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L148)*
|
||||
|
||||
**Returns:** `Observable`< `Balance` | `undefined`>
|
||||
|
||||
@@ -778,7 +778,7 @@ ___
|
||||
|
||||
▸ **sessionTimeExpected**(): `Observable`< `Moment` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:221](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L221)*
|
||||
*Defined in [Combined.ts:221](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L221)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -789,7 +789,7 @@ ___
|
||||
|
||||
▸ **sessionTimeRemaining**(): `Observable`< `Moment` | `undefined`>
|
||||
|
||||
*Defined in [Combined.ts:236](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L236)*
|
||||
*Defined in [Combined.ts:236](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L236)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -802,7 +802,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionValidators](_queries_.apiqueries.md#sessionvalidators)*
|
||||
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L172)*
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L172)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -815,7 +815,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionsPerEra](_queries_.apiqueries.md#sessionsperera)*
|
||||
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L168)*
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L168)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -828,7 +828,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingIntentions](_queries_.apiqueries.md#stakingintentions)*
|
||||
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L185)*
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L185)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -841,7 +841,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingNominating](_queries_.apiqueries.md#stakingnominating)*
|
||||
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L211)*
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L211)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -860,7 +860,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingNominatorsFor](_queries_.apiqueries.md#stakingnominatorsfor)*
|
||||
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L198)*
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L198)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -879,7 +879,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[submitExtrinsic](_calls_.apicalls.md#submitextrinsic)*
|
||||
|
||||
*Defined in [Calls.ts:47](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L47)*
|
||||
*Defined in [Calls.ts:47](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L47)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -898,7 +898,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[systemName](_calls_.apicalls.md#systemname)*
|
||||
|
||||
*Defined in [Calls.ts:39](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L39)*
|
||||
*Defined in [Calls.ts:39](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L39)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -911,7 +911,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[systemVersion](_calls_.apicalls.md#systemversion)*
|
||||
|
||||
*Defined in [Calls.ts:43](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L43)*
|
||||
*Defined in [Calls.ts:43](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L43)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -922,7 +922,7 @@ ___
|
||||
|
||||
▸ **validatingBalance**(address: * `AccountId` | `string`*): `Observable`<[RxBalance](../modules/_types_d_.md#rxbalance)>
|
||||
|
||||
*Defined in [Combined.ts:251](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L251)*
|
||||
*Defined in [Combined.ts:251](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L251)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -939,7 +939,7 @@ ___
|
||||
|
||||
▸ **validatingBalances**(...addresses: *`Array`< `AccountId` | `string`>*): `Observable`<[RxBalanceMap](../modules/_types_d_.md#rxbalancemap)>
|
||||
|
||||
*Defined in [Combined.ts:276](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L276)*
|
||||
*Defined in [Combined.ts:276](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L276)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -958,7 +958,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[validatorCount](_queries_.apiqueries.md#validatorcount)*
|
||||
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L215)*
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L215)*
|
||||
|
||||
**Returns:** `Observable`< `u32` | `undefined`>
|
||||
|
||||
@@ -969,7 +969,7 @@ ___
|
||||
|
||||
▸ **votingBalance**(_address: * `AccountId` | `string`*): `Observable`<[RxBalance](../modules/_types_d_.md#rxbalance)>
|
||||
|
||||
*Defined in [Combined.ts:290](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L290)*
|
||||
*Defined in [Combined.ts:290](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L290)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -986,7 +986,7 @@ ___
|
||||
|
||||
▸ **votingBalances**(...addresses: *`Array`< `AccountId` | `string`>*): `Observable`<[RxBalance](../modules/_types_d_.md#rxbalance)[]>
|
||||
|
||||
*Defined in [Combined.ts:324](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L324)*
|
||||
*Defined in [Combined.ts:324](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L324)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -1003,7 +1003,7 @@ ___
|
||||
|
||||
▸ **votingBalancesNominatorsFor**(address: * `AccountId` | `string`*): `Observable`<`any`>
|
||||
|
||||
*Defined in [Combined.ts:313](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L313)*
|
||||
*Defined in [Combined.ts:313](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L313)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -12,17 +12,17 @@
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new Api**(api: *`RxApiInterface`*): [Api](_index_.api.md)
|
||||
⊕ **new Api**(api: *`RxRpcInterface`*): [Api](_index_.api.md)
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| api | `RxApiInterface` |
|
||||
| api | `RxRpcInterface` |
|
||||
|
||||
**Returns:** [Api](_index_.api.md)
|
||||
|
||||
@@ -34,11 +34,11 @@ ___
|
||||
|
||||
## `<Protected>` _api
|
||||
|
||||
**● _api**: *`RxApiInterface`*
|
||||
**● _api**: *`RxRpcInterface`*
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_api](_base_.apibase.md#_api)*
|
||||
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L28)*
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L28)*
|
||||
|
||||
___
|
||||
<a id="_genesishash"></a>
|
||||
@@ -49,7 +49,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_genesisHash](_base_.apibase.md#_genesishash)*
|
||||
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L29)*
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="whenready"></a>
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[whenReady](_base_.apibase.md#whenready)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
___
|
||||
<a id="extrinsics"></a>
|
||||
@@ -71,7 +71,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[extrinsics](_base_.apibase.md#extrinsics)*
|
||||
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L40)*
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L40)*
|
||||
|
||||
___
|
||||
<a id="storage"></a>
|
||||
@@ -82,7 +82,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[storage](_base_.apibase.md#storage)*
|
||||
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L41)*
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
@@ -96,7 +96,7 @@ getgenesisHash(): `Hash`
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
|
||||
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L80)*
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L80)*
|
||||
|
||||
**Returns:** `Hash`
|
||||
|
||||
@@ -112,7 +112,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[accountNonce](_queries_.apiqueries.md#accountnonce)*
|
||||
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L21)*
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L21)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -131,7 +131,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[balanceFree](_queries_.apiqueries.md#balancefree)*
|
||||
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L25)*
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L25)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -150,7 +150,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[balanceReserved](_queries_.apiqueries.md#balancereserved)*
|
||||
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L29)*
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -169,7 +169,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[bestNumber](_calls_.apicalls.md#bestnumber)*
|
||||
|
||||
*Defined in [Calls.ts:13](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L13)*
|
||||
*Defined in [Calls.ts:13](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L13)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -182,7 +182,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[blockNow](_queries_.apiqueries.md#blocknow)*
|
||||
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L37)*
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L37)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -195,7 +195,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[blockPeriod](_queries_.apiqueries.md#blockperiod)*
|
||||
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L33)*
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -208,7 +208,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[chain](_calls_.apicalls.md#chain)*
|
||||
|
||||
*Defined in [Calls.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L25)*
|
||||
*Defined in [Calls.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L25)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -221,7 +221,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[combine](_base_.apibase.md#combine)*
|
||||
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L73)*
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L73)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -245,7 +245,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyLaunchPeriod](_queries_.apiqueries.md#democracylaunchperiod)*
|
||||
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L41)*
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L41)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -258,7 +258,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyNextTally](_queries_.apiqueries.md#democracynexttally)*
|
||||
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L45)*
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L45)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -271,7 +271,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[democracyReferendumVoters](_combined_.apicombined.md#democracyreferendumvoters)*
|
||||
|
||||
*Defined in [Combined.ts:42](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L42)*
|
||||
*Defined in [Combined.ts:42](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L42)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -290,7 +290,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[democracyVotersBalancesOf](_combined_.apicombined.md#democracyvotersbalancesof)*
|
||||
|
||||
*Defined in [Combined.ts:87](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L87)*
|
||||
*Defined in [Combined.ts:87](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L87)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -309,7 +309,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[democracyVotersVotesOf](_combined_.apicombined.md#democracyvotersvotesof)*
|
||||
|
||||
*Defined in [Combined.ts:103](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L103)*
|
||||
*Defined in [Combined.ts:103](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L103)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -328,7 +328,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[democracyVotingPeriod](_queries_.apiqueries.md#democracyvotingperiod)*
|
||||
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L115)*
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L115)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -341,7 +341,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[eraBlockLength](_combined_.apicombined.md#erablocklength)*
|
||||
|
||||
*Defined in [Combined.ts:114](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L114)*
|
||||
*Defined in [Combined.ts:114](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L114)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -354,7 +354,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[eraBlockProgress](_combined_.apicombined.md#erablockprogress)*
|
||||
|
||||
*Defined in [Combined.ts:129](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L129)*
|
||||
*Defined in [Combined.ts:129](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L129)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -367,7 +367,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[eraBlockRemaining](_combined_.apicombined.md#erablockremaining)*
|
||||
|
||||
*Defined in [Combined.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L152)*
|
||||
*Defined in [Combined.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L152)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -380,7 +380,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[eraLastLengthChange](_queries_.apiqueries.md#eralastlengthchange)*
|
||||
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L140)*
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L140)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -393,7 +393,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[fees](_queries_.apiqueries.md#fees)*
|
||||
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L119)*
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L119)*
|
||||
|
||||
**Returns:** `Observable`<[RxFees](../modules/_types_d_.md#rxfees)>
|
||||
|
||||
@@ -406,7 +406,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[getBlock](_calls_.apicalls.md#getblock)*
|
||||
|
||||
*Defined in [Calls.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L29)*
|
||||
*Defined in [Calls.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -425,7 +425,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[isConnected](_base_.apibase.md#isconnected)*
|
||||
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L84)*
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L84)*
|
||||
|
||||
**Returns:** `Observable`<`boolean`>
|
||||
|
||||
@@ -438,7 +438,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[newHead](_calls_.apicalls.md#newhead)*
|
||||
|
||||
*Defined in [Calls.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L33)*
|
||||
*Defined in [Calls.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Header` | `undefined`>
|
||||
|
||||
@@ -451,7 +451,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[proposalDeposits](_queries_.apiqueries.md#proposaldeposits)*
|
||||
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L49)*
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -470,7 +470,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[publicProposalCount](_combined_.apicombined.md#publicproposalcount)*
|
||||
|
||||
*Defined in [Combined.ts:20](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L20)*
|
||||
*Defined in [Combined.ts:20](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L20)*
|
||||
|
||||
**Returns:** `Observable`<`number`>
|
||||
|
||||
@@ -483,7 +483,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[publicProposals](_queries_.apiqueries.md#publicproposals)*
|
||||
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L62)*
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L62)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<[RxProposal](_classes_.rxproposal.md)>>
|
||||
|
||||
@@ -496,7 +496,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawCall](_base_.apibase.md#rawcall)*
|
||||
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L88)*
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L88)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -519,7 +519,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorage](_base_.apibase.md#rawstorage)*
|
||||
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L100)*
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L100)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -542,7 +542,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorageMulti](_base_.apibase.md#rawstoragemulti)*
|
||||
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L112)*
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L112)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -564,7 +564,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumCount](_queries_.apiqueries.md#referendumcount)*
|
||||
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L81)*
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L81)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -577,7 +577,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumInfo](_queries_.apiqueries.md#referenduminfo)*
|
||||
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L85)*
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L85)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -596,7 +596,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumVote](_queries_.apiqueries.md#referendumvote)*
|
||||
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L98)*
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L98)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -616,7 +616,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[referendumVoters](_queries_.apiqueries.md#referendumvoters)*
|
||||
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L102)*
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L102)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -635,7 +635,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[referendumVotes](_combined_.apicombined.md#referendumvotes)*
|
||||
|
||||
*Defined in [Combined.ts:79](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L79)*
|
||||
*Defined in [Combined.ts:79](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L79)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -655,7 +655,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[referendums](_combined_.apicombined.md#referendums)*
|
||||
|
||||
*Defined in [Combined.ts:58](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L58)*
|
||||
*Defined in [Combined.ts:58](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L58)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<[RxReferendum](_classes_.rxreferendum.md)>>
|
||||
|
||||
@@ -668,7 +668,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[referendumsInfo](_combined_.apicombined.md#referendumsinfo)*
|
||||
|
||||
*Defined in [Combined.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L30)*
|
||||
*Defined in [Combined.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L30)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -687,7 +687,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[sessionBlockProgress](_combined_.apicombined.md#sessionblockprogress)*
|
||||
|
||||
*Defined in [Combined.ts:167](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L167)*
|
||||
*Defined in [Combined.ts:167](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L167)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -700,7 +700,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[sessionBlockRemaining](_combined_.apicombined.md#sessionblockremaining)*
|
||||
|
||||
*Defined in [Combined.ts:187](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L187)*
|
||||
*Defined in [Combined.ts:187](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L187)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -713,7 +713,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[sessionBrokenValue](_combined_.apicombined.md#sessionbrokenvalue)*
|
||||
|
||||
*Defined in [Combined.ts:202](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L202)*
|
||||
*Defined in [Combined.ts:202](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L202)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -726,7 +726,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionCurrentIndex](_queries_.apiqueries.md#sessioncurrentindex)*
|
||||
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L152)*
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L152)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -739,7 +739,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionCurrentStart](_queries_.apiqueries.md#sessioncurrentstart)*
|
||||
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L156)*
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L156)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -752,7 +752,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionLastLengthChange](_queries_.apiqueries.md#sessionlastlengthchange)*
|
||||
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L160)*
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L160)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -765,7 +765,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionLength](_queries_.apiqueries.md#sessionlength)*
|
||||
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L164)*
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L164)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -778,7 +778,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionReward](_queries_.apiqueries.md#sessionreward)*
|
||||
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L144)*
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L144)*
|
||||
|
||||
**Returns:** `Observable`< `Perbill` | `undefined`>
|
||||
|
||||
@@ -791,7 +791,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionRewardCurrent](_queries_.apiqueries.md#sessionrewardcurrent)*
|
||||
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L148)*
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L148)*
|
||||
|
||||
**Returns:** `Observable`< `Balance` | `undefined`>
|
||||
|
||||
@@ -804,7 +804,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[sessionTimeExpected](_combined_.apicombined.md#sessiontimeexpected)*
|
||||
|
||||
*Defined in [Combined.ts:221](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L221)*
|
||||
*Defined in [Combined.ts:221](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L221)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -817,7 +817,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[sessionTimeRemaining](_combined_.apicombined.md#sessiontimeremaining)*
|
||||
|
||||
*Defined in [Combined.ts:236](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L236)*
|
||||
*Defined in [Combined.ts:236](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L236)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -830,7 +830,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionValidators](_queries_.apiqueries.md#sessionvalidators)*
|
||||
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L172)*
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L172)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -843,7 +843,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[sessionsPerEra](_queries_.apiqueries.md#sessionsperera)*
|
||||
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L168)*
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L168)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -856,7 +856,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingIntentions](_queries_.apiqueries.md#stakingintentions)*
|
||||
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L185)*
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L185)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -869,7 +869,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingNominating](_queries_.apiqueries.md#stakingnominating)*
|
||||
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L211)*
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L211)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -888,7 +888,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[stakingNominatorsFor](_queries_.apiqueries.md#stakingnominatorsfor)*
|
||||
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L198)*
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L198)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -907,7 +907,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[submitExtrinsic](_calls_.apicalls.md#submitextrinsic)*
|
||||
|
||||
*Defined in [Calls.ts:47](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L47)*
|
||||
*Defined in [Calls.ts:47](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L47)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -926,7 +926,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[systemName](_calls_.apicalls.md#systemname)*
|
||||
|
||||
*Defined in [Calls.ts:39](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L39)*
|
||||
*Defined in [Calls.ts:39](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L39)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -939,7 +939,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCalls](_calls_.apicalls.md).[systemVersion](_calls_.apicalls.md#systemversion)*
|
||||
|
||||
*Defined in [Calls.ts:43](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Calls.ts#L43)*
|
||||
*Defined in [Calls.ts:43](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Calls.ts#L43)*
|
||||
|
||||
**Returns:** `Observable`< `Text` | `undefined`>
|
||||
|
||||
@@ -952,7 +952,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[validatingBalance](_combined_.apicombined.md#validatingbalance)*
|
||||
|
||||
*Defined in [Combined.ts:251](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L251)*
|
||||
*Defined in [Combined.ts:251](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L251)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -971,7 +971,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[validatingBalances](_combined_.apicombined.md#validatingbalances)*
|
||||
|
||||
*Defined in [Combined.ts:276](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L276)*
|
||||
*Defined in [Combined.ts:276](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L276)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -990,7 +990,7 @@ ___
|
||||
|
||||
*Inherited from [ApiQueries](_queries_.apiqueries.md).[validatorCount](_queries_.apiqueries.md#validatorcount)*
|
||||
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L215)*
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L215)*
|
||||
|
||||
**Returns:** `Observable`< `u32` | `undefined`>
|
||||
|
||||
@@ -1003,7 +1003,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[votingBalance](_combined_.apicombined.md#votingbalance)*
|
||||
|
||||
*Defined in [Combined.ts:290](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L290)*
|
||||
*Defined in [Combined.ts:290](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L290)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -1022,7 +1022,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[votingBalances](_combined_.apicombined.md#votingbalances)*
|
||||
|
||||
*Defined in [Combined.ts:324](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L324)*
|
||||
*Defined in [Combined.ts:324](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L324)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -1041,7 +1041,7 @@ ___
|
||||
|
||||
*Inherited from [ApiCombined](_combined_.apicombined.md).[votingBalancesNominatorsFor](_combined_.apicombined.md#votingbalancesnominatorsfor)*
|
||||
|
||||
*Defined in [Combined.ts:313](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Combined.ts#L313)*
|
||||
*Defined in [Combined.ts:313](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Combined.ts#L313)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new ApiQueries**(api: *`RxApiInterface`*): [ApiQueries](_queries_.apiqueries.md)
|
||||
⊕ **new ApiQueries**(api: *`RxRpcInterface`*): [ApiQueries](_queries_.apiqueries.md)
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| api | `RxApiInterface` |
|
||||
| api | `RxRpcInterface` |
|
||||
|
||||
**Returns:** [ApiQueries](_queries_.apiqueries.md)
|
||||
|
||||
@@ -36,11 +36,11 @@ ___
|
||||
|
||||
## `<Protected>` _api
|
||||
|
||||
**● _api**: *`RxApiInterface`*
|
||||
**● _api**: *`RxRpcInterface`*
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_api](_base_.apibase.md#_api)*
|
||||
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L28)*
|
||||
*Defined in [Base.ts:28](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L28)*
|
||||
|
||||
___
|
||||
<a id="_genesishash"></a>
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[_genesisHash](_base_.apibase.md#_genesishash)*
|
||||
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L29)*
|
||||
*Defined in [Base.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L29)*
|
||||
|
||||
___
|
||||
<a id="whenready"></a>
|
||||
@@ -62,7 +62,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[whenReady](_base_.apibase.md#whenready)*
|
||||
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L32)*
|
||||
*Defined in [Base.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L32)*
|
||||
|
||||
___
|
||||
<a id="extrinsics"></a>
|
||||
@@ -73,7 +73,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[extrinsics](_base_.apibase.md#extrinsics)*
|
||||
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L40)*
|
||||
*Defined in [Base.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L40)*
|
||||
|
||||
___
|
||||
<a id="storage"></a>
|
||||
@@ -84,7 +84,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[storage](_base_.apibase.md#storage)*
|
||||
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L41)*
|
||||
*Defined in [Base.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L41)*
|
||||
|
||||
___
|
||||
|
||||
@@ -98,7 +98,7 @@ getgenesisHash(): `Hash`
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
|
||||
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L80)*
|
||||
*Defined in [Base.ts:80](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L80)*
|
||||
|
||||
**Returns:** `Hash`
|
||||
|
||||
@@ -112,7 +112,7 @@ ___
|
||||
|
||||
▸ **accountNonce**(address: * `AccountId` | `string`*): `Observable`< `Index` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L21)*
|
||||
*Defined in [Queries.ts:21](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L21)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -129,7 +129,7 @@ ___
|
||||
|
||||
▸ **balanceFree**(address: * `AccountId` | `string`*): `Observable`< `Balance` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L25)*
|
||||
*Defined in [Queries.ts:25](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L25)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -146,7 +146,7 @@ ___
|
||||
|
||||
▸ **balanceReserved**(address: * `AccountId` | `string`*): `Observable`< `Balance` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L29)*
|
||||
*Defined in [Queries.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L29)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -163,7 +163,7 @@ ___
|
||||
|
||||
▸ **blockNow**(): `Observable`< `Moment` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L37)*
|
||||
*Defined in [Queries.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L37)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -174,7 +174,7 @@ ___
|
||||
|
||||
▸ **blockPeriod**(): `Observable`< `Moment` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L33)*
|
||||
*Defined in [Queries.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L33)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -187,7 +187,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[combine](_base_.apibase.md#combine)*
|
||||
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L73)*
|
||||
*Defined in [Base.ts:73](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L73)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -209,7 +209,7 @@ ___
|
||||
|
||||
▸ **democracyLaunchPeriod**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L41)*
|
||||
*Defined in [Queries.ts:41](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L41)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -220,7 +220,7 @@ ___
|
||||
|
||||
▸ **democracyNextTally**(): `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L45)*
|
||||
*Defined in [Queries.ts:45](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L45)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -231,7 +231,7 @@ ___
|
||||
|
||||
▸ **democracyVotingPeriod**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L115)*
|
||||
*Defined in [Queries.ts:115](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L115)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -242,7 +242,7 @@ ___
|
||||
|
||||
▸ **eraLastLengthChange**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L140)*
|
||||
*Defined in [Queries.ts:140](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L140)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -253,7 +253,7 @@ ___
|
||||
|
||||
▸ **fees**(): `Observable`<[RxFees](../modules/_types_d_.md#rxfees)>
|
||||
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L119)*
|
||||
*Defined in [Queries.ts:119](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L119)*
|
||||
|
||||
**Returns:** `Observable`<[RxFees](../modules/_types_d_.md#rxfees)>
|
||||
|
||||
@@ -266,7 +266,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[isConnected](_base_.apibase.md#isconnected)*
|
||||
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L84)*
|
||||
*Defined in [Base.ts:84](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L84)*
|
||||
|
||||
**Returns:** `Observable`<`boolean`>
|
||||
|
||||
@@ -277,7 +277,7 @@ ___
|
||||
|
||||
▸ **proposalDeposits**(proposalId: * `PropIndex` | `BN` | `number`*): `Observable`< [RxProposalDeposits](_classes_.rxproposaldeposits.md) | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L49)*
|
||||
*Defined in [Queries.ts:49](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -294,7 +294,7 @@ ___
|
||||
|
||||
▸ **publicProposals**(): `Observable`<`Array`<[RxProposal](_classes_.rxproposal.md)>>
|
||||
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L62)*
|
||||
*Defined in [Queries.ts:62](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L62)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<[RxProposal](_classes_.rxproposal.md)>>
|
||||
|
||||
@@ -307,7 +307,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawCall](_base_.apibase.md#rawcall)*
|
||||
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L88)*
|
||||
*Defined in [Base.ts:88](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L88)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -330,7 +330,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorage](_base_.apibase.md#rawstorage)*
|
||||
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L100)*
|
||||
*Defined in [Base.ts:100](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L100)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -353,7 +353,7 @@ ___
|
||||
|
||||
*Inherited from [ApiBase](_base_.apibase.md).[rawStorageMulti](_base_.apibase.md#rawstoragemulti)*
|
||||
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Base.ts#L112)*
|
||||
*Defined in [Base.ts:112](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Base.ts#L112)*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
@@ -373,7 +373,7 @@ ___
|
||||
|
||||
▸ **referendumCount**(): `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L81)*
|
||||
*Defined in [Queries.ts:81](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L81)*
|
||||
|
||||
**Returns:** `Observable`< `ReferendumIndex` | `undefined`>
|
||||
|
||||
@@ -384,7 +384,7 @@ ___
|
||||
|
||||
▸ **referendumInfo**(referendumId: * `ReferendumIndex` | `BN` | `number`*): `Observable`< [RxReferendum](_classes_.rxreferendum.md) | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L85)*
|
||||
*Defined in [Queries.ts:85](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L85)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -401,7 +401,7 @@ ___
|
||||
|
||||
▸ **referendumVote**(index: * `ReferendumIndex` | `BN` | `number`*, address: * `AccountId` | `string`*): `Observable`< `Bool` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L98)*
|
||||
*Defined in [Queries.ts:98](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L98)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -419,7 +419,7 @@ ___
|
||||
|
||||
▸ **referendumVoters**(index: * `ReferendumIndex` | `BN` | `number`*): `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L102)*
|
||||
*Defined in [Queries.ts:102](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L102)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -436,7 +436,7 @@ ___
|
||||
|
||||
▸ **sessionCurrentIndex**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L152)*
|
||||
*Defined in [Queries.ts:152](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L152)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -447,7 +447,7 @@ ___
|
||||
|
||||
▸ **sessionCurrentStart**(): `Observable`< `Moment` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L156)*
|
||||
*Defined in [Queries.ts:156](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L156)*
|
||||
|
||||
**Returns:** `Observable`< `Moment` | `undefined`>
|
||||
|
||||
@@ -458,7 +458,7 @@ ___
|
||||
|
||||
▸ **sessionLastLengthChange**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L160)*
|
||||
*Defined in [Queries.ts:160](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L160)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -469,7 +469,7 @@ ___
|
||||
|
||||
▸ **sessionLength**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L164)*
|
||||
*Defined in [Queries.ts:164](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L164)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -480,7 +480,7 @@ ___
|
||||
|
||||
▸ **sessionReward**(): `Observable`< `Perbill` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L144)*
|
||||
*Defined in [Queries.ts:144](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L144)*
|
||||
|
||||
**Returns:** `Observable`< `Perbill` | `undefined`>
|
||||
|
||||
@@ -491,7 +491,7 @@ ___
|
||||
|
||||
▸ **sessionRewardCurrent**(): `Observable`< `Balance` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L148)*
|
||||
*Defined in [Queries.ts:148](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L148)*
|
||||
|
||||
**Returns:** `Observable`< `Balance` | `undefined`>
|
||||
|
||||
@@ -502,7 +502,7 @@ ___
|
||||
|
||||
▸ **sessionValidators**(): `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L172)*
|
||||
*Defined in [Queries.ts:172](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L172)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -513,7 +513,7 @@ ___
|
||||
|
||||
▸ **sessionsPerEra**(): `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L168)*
|
||||
*Defined in [Queries.ts:168](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L168)*
|
||||
|
||||
**Returns:** `Observable`< `BlockNumber` | `undefined`>
|
||||
|
||||
@@ -524,7 +524,7 @@ ___
|
||||
|
||||
▸ **stakingIntentions**(): `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L185)*
|
||||
*Defined in [Queries.ts:185](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L185)*
|
||||
|
||||
**Returns:** `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
@@ -535,7 +535,7 @@ ___
|
||||
|
||||
▸ **stakingNominating**(address: * `AccountId` | `string`*): `Observable`< `AccountId` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L211)*
|
||||
*Defined in [Queries.ts:211](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L211)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -552,7 +552,7 @@ ___
|
||||
|
||||
▸ **stakingNominatorsFor**(address: * `AccountId` | `string`*): `Observable`<`Array`<`AccountId`>>
|
||||
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L198)*
|
||||
*Defined in [Queries.ts:198](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L198)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -569,7 +569,7 @@ ___
|
||||
|
||||
▸ **validatorCount**(): `Observable`< `u32` | `undefined`>
|
||||
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/Queries.ts#L215)*
|
||||
*Defined in [Queries.ts:215](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/Queries.ts#L215)*
|
||||
|
||||
**Returns:** `Observable`< `u32` | `undefined`>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
**Ƭ ApiFunctions**: * `keyof ApiBase` | `keyof ApiCalls` | `keyof ApiCombined` | `keyof ApiQueries`
|
||||
*
|
||||
|
||||
*Defined in [types.d.ts:14](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/types.d.ts#L14)*
|
||||
*Defined in [types.d.ts:14](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/types.d.ts#L14)*
|
||||
|
||||
___
|
||||
<a id="rxbalance"></a>
|
||||
@@ -18,7 +18,7 @@ ___
|
||||
|
||||
**Ƭ RxBalance**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:16](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/types.d.ts#L16)*
|
||||
*Defined in [types.d.ts:16](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/types.d.ts#L16)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -29,7 +29,7 @@ ___
|
||||
|
||||
**Ƭ RxBalanceMap**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:40](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/types.d.ts#L40)*
|
||||
*Defined in [types.d.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/types.d.ts#L40)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -42,7 +42,7 @@ ___
|
||||
|
||||
**Ƭ RxFees**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:26](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/types.d.ts#L26)*
|
||||
*Defined in [types.d.ts:26](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/types.d.ts#L26)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -53,7 +53,7 @@ ___
|
||||
|
||||
**Ƭ RxReferendumVote**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:34](https://github.com/polkadot-js/api/blob/7f270cb/packages/api-observable/src/types.d.ts#L34)*
|
||||
*Defined in [types.d.ts:34](https://github.com/polkadot-js/api/blob/4344f33/packages/api-observable/src/types.d.ts#L34)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -371,10 +371,10 @@
|
||||
|
||||
<h1 id="simple-connect">Simple Connect</h1>
|
||||
<p>The following example shows how to instantiate a Polkadot API object and use it to connect to a node.</p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Api</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Rpc</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Rpc</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">async</span> <span class="sunlight-keyword">function</span> <span class="sunlight-named-ident">getChain</span> <span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-keyword">return</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">system</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -431,7 +431,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Simple connect","level":"2.2","depth":1,"next":{"title":"Listen to blocks","level":"2.3","depth":1,"path":"examples/02_listen_to_blocks/README.md","ref":"examples/02_listen_to_blocks/README.md","articles":[]},"previous":{"title":"Overview","level":"2.1","depth":1,"path":"examples/README.md","ref":"examples/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/01_simple_connect/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Simple connect","level":"2.2","depth":1,"next":{"title":"Listen to blocks","level":"2.3","depth":1,"path":"examples/02_listen_to_blocks/README.md","ref":"examples/02_listen_to_blocks/README.md","articles":[]},"previous":{"title":"Overview","level":"2.1","depth":1,"path":"examples/README.md","ref":"examples/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/01_simple_connect/README.md","mtime":"2018-10-10T08:02:18.116Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -374,10 +374,10 @@
|
||||
<p>It displays the block number every time a new block is seen by the node you are connected to.</p>
|
||||
<p>NOTE: The example runs until you stop it with CTRL+C</p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">BN</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'bn.js'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Api</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Rpc</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Rpc</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-keyword">function</span> <span class="sunlight-named-ident">main</span> <span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'Blocks will be shown as they come in, CTRL+C to stop:'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -433,7 +433,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to blocks","level":"2.3","depth":1,"next":{"title":"Listen to balance change","level":"2.4","depth":1,"path":"examples/03_listen_to_balance_change/README.md","ref":"examples/03_listen_to_balance_change/README.md","articles":[]},"previous":{"title":"Simple connect","level":"2.2","depth":1,"path":"examples/01_simple_connect/README.md","ref":"examples/01_simple_connect/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/02_listen_to_blocks/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to blocks","level":"2.3","depth":1,"next":{"title":"Listen to balance change","level":"2.4","depth":1,"path":"examples/03_listen_to_balance_change/README.md","ref":"examples/03_listen_to_balance_change/README.md","articles":[]},"previous":{"title":"Simple connect","level":"2.2","depth":1,"path":"examples/01_simple_connect/README.md","ref":"examples/01_simple_connect/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/02_listen_to_blocks/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -372,11 +372,12 @@
|
||||
<h1 id="listen-to-balance-changes">Listen to balance changes</h1>
|
||||
<p>This example shows how to instantiate a Polkadot API object and use it to connect to a node.</p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">BN</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'bn.js'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Api</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Rpc</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">storage</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/storage'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Rpc</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Alice</span> <span class="sunlight-operator">=</span> <span class="sunlight-string">'5GoKvZWG5ZPYL1WUovuHW3zJBWBP5eT8CbqjdRY4Q6iMaDtZ'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'You may leave this example running and start example 06 or send DOTs to '</span> <span class="sunlight-operator">+</span> <span class="sunlight-ident">Alice</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -432,7 +433,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to balance change","level":"2.4","depth":1,"next":{"title":"Generate Accounts","level":"2.5","depth":1,"path":"examples/04_generate_account/README.md","ref":"examples/04_generate_account/README.md","articles":[]},"previous":{"title":"Listen to blocks","level":"2.3","depth":1,"path":"examples/02_listen_to_blocks/README.md","ref":"examples/02_listen_to_blocks/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/03_listen_to_balance_change/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to balance change","level":"2.4","depth":1,"next":{"title":"Generate Accounts","level":"2.5","depth":1,"path":"examples/04_generate_account/README.md","ref":"examples/04_generate_account/README.md","articles":[]},"previous":{"title":"Listen to blocks","level":"2.3","depth":1,"path":"examples/02_listen_to_blocks/README.md","ref":"examples/02_listen_to_blocks/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/03_listen_to_balance_change/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Generate Accounts","level":"2.5","depth":1,"next":{"title":"Read Storage","level":"2.6","depth":1,"path":"examples/05_read_storage/README.md","ref":"examples/05_read_storage/README.md","articles":[]},"previous":{"title":"Listen to balance change","level":"2.4","depth":1,"path":"examples/03_listen_to_balance_change/README.md","ref":"examples/03_listen_to_balance_change/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/04_generate_account/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Generate Accounts","level":"2.5","depth":1,"next":{"title":"Read Storage","level":"2.6","depth":1,"path":"examples/05_read_storage/README.md","ref":"examples/05_read_storage/README.md","articles":[]},"previous":{"title":"Listen to balance change","level":"2.4","depth":1,"path":"examples/03_listen_to_balance_change/README.md","ref":"examples/03_listen_to_balance_change/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/04_generate_account/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -372,12 +372,12 @@
|
||||
<h1 id="read-storage">Read storage</h1>
|
||||
<p>Many important variables are available through the storage API. This example shows how to call a few of those APIs.</p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">BN</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'bn.js'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Api</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Rpc</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">storage</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/storage'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Rpc</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">async</span> <span class="sunlight-keyword">function</span> <span class="sunlight-named-ident">getAccountIndex</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">address</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-keyword">return</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">state</span><span class="sunlight-operator">.</span><span class="sunlight-ident">getStorage</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">[</span><span class="sunlight-ident">storage</span><span class="sunlight-operator">.</span><span class="sunlight-ident">system</span><span class="sunlight-operator">.</span><span class="sunlight-reservedWord">public</span><span class="sunlight-operator">.</span><span class="sunlight-ident">accountIndexOf</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">address</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -447,7 +447,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Read Storage","level":"2.6","depth":1,"next":{"title":"Craft Extrinsic","level":"2.7","depth":1,"path":"examples/06_craft_extrinsic/README.md","ref":"examples/06_craft_extrinsic/README.md","articles":[]},"previous":{"title":"Generate Accounts","level":"2.5","depth":1,"path":"examples/04_generate_account/README.md","ref":"examples/04_generate_account/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/05_read_storage/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Read Storage","level":"2.6","depth":1,"next":{"title":"Craft Extrinsic","level":"2.7","depth":1,"path":"examples/06_craft_extrinsic/README.md","ref":"examples/06_craft_extrinsic/README.md","articles":[]},"previous":{"title":"Generate Accounts","level":"2.5","depth":1,"path":"examples/04_generate_account/README.md","ref":"examples/04_generate_account/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/05_read_storage/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -372,8 +372,8 @@
|
||||
<h1 id="craft-extrinsic">Craft Extrinsic</h1>
|
||||
<p>In the current version, crafting an extrinsic is a rather cumbersome process. This sample guides you through it and shows how to tranfer DOTs from one an account to another.</p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">BN</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'bn.js'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Api</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Rpc</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">extrinsics</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/extrinsics'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">encodeExtrinsic</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/extrinsics/codec/encode'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">encodeLength</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/extrinsics/codec/encode/length'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -383,7 +383,7 @@
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Encoder</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">TextEncoder</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">keyring</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Keyring</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Rpc</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">async</span> <span class="sunlight-keyword">function</span> <span class="sunlight-named-ident">getAccountIndex</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">address</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-keyword">return</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">state</span><span class="sunlight-operator">.</span><span class="sunlight-ident">getStorage</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">[</span><span class="sunlight-ident">storage</span><span class="sunlight-operator">.</span><span class="sunlight-ident">system</span><span class="sunlight-operator">.</span><span class="sunlight-reservedWord">public</span><span class="sunlight-operator">.</span><span class="sunlight-ident">accountIndexOf</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">address</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -471,7 +471,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Craft Extrinsic","level":"2.7","depth":1,"next":{"title":"Transfer DOTs","level":"2.8","depth":1,"path":"examples/07_transfer_dots/README.md","ref":"examples/07_transfer_dots/README.md","articles":[]},"previous":{"title":"Read Storage","level":"2.6","depth":1,"path":"examples/05_read_storage/README.md","ref":"examples/05_read_storage/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/06_craft_extrinsic/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Craft Extrinsic","level":"2.7","depth":1,"next":{"title":"Transfer DOTs","level":"2.8","depth":1,"path":"examples/07_transfer_dots/README.md","ref":"examples/07_transfer_dots/README.md","articles":[]},"previous":{"title":"Read Storage","level":"2.6","depth":1,"path":"examples/05_read_storage/README.md","ref":"examples/05_read_storage/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/06_craft_extrinsic/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -102,12 +102,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../api/">
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -116,12 +116,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../api/classes/_index_.api.html">
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -134,12 +134,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../api-provider/">
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -148,9 +148,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -161,9 +161,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -179,12 +179,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../api-rx/">
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -193,12 +193,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -370,8 +370,8 @@
|
||||
<h1 id="tranfer-dots">Tranfer DOTs</h1>
|
||||
<p>This sample is more 'straight to the point' and shows the easiest way to transfer DOTs from one an account to another.</p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">BN</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'bn.js'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Api</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/api-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Rpc</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">extrinsics</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/extrinsics'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">encodeExtrinsic</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/extrinsics/codec/encode/uncheckedLength'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Keyring</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/util-keyring'</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -380,7 +380,7 @@
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">Encoder</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">TextEncoder</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">keyring</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Keyring</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Rpc</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">async</span> <span class="sunlight-keyword">function</span> <span class="sunlight-named-ident">getAccountIndex</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">address</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-keyword">return</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">state</span><span class="sunlight-operator">.</span><span class="sunlight-ident">getStorage</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">[</span><span class="sunlight-ident">storage</span><span class="sunlight-operator">.</span><span class="sunlight-ident">system</span><span class="sunlight-operator">.</span><span class="sunlight-reservedWord">public</span><span class="sunlight-operator">.</span><span class="sunlight-ident">accountIndexOf</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">address</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -451,7 +451,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Transfer DOTs","level":"2.8","depth":1,"previous":{"title":"Craft Extrinsic","level":"2.7","depth":1,"path":"examples/06_craft_extrinsic/README.md","ref":"examples/06_craft_extrinsic/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/07_transfer_dots/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Transfer DOTs","level":"2.8","depth":1,"previous":{"title":"Craft Extrinsic","level":"2.7","depth":1,"path":"examples/06_craft_extrinsic/README.md","ref":"examples/06_craft_extrinsic/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/07_transfer_dots/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
+22
-22
@@ -60,7 +60,7 @@
|
||||
<link rel="next" href="01_simple_connect/" />
|
||||
|
||||
|
||||
<link rel="prev" href="../api-rx/classes/_index_.rxapi.html" />
|
||||
<link rel="prev" href="../rpc-rx/classes/_index_.rxapi.md" />
|
||||
|
||||
|
||||
</head>
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../api/">
|
||||
<li class="chapter " data-level="1.2" data-path="../rpc-core/">
|
||||
|
||||
<a href="../api/">
|
||||
<a href="../rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../api/classes/_index_.api.html">
|
||||
<a href="../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -136,12 +136,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="../rpc-provider/">
|
||||
|
||||
<a href="../api-provider/">
|
||||
<a href="../rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -163,9 +163,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -181,12 +181,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="../rpc-rx/">
|
||||
|
||||
<a href="../api-rx/">
|
||||
<a href="../rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -195,12 +195,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="../api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -411,7 +411,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../api-rx/classes/_index_.rxapi.html" class="navigation navigation-prev " aria-label="Previous page: ApiRx">
|
||||
<a href="../rpc-rx/classes/_index_.rxapi.md" class="navigation navigation-prev " aria-label="Previous page: RpcRx">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Overview","level":"2.1","depth":1,"next":{"title":"Simple connect","level":"2.2","depth":1,"path":"examples/01_simple_connect/README.md","ref":"examples/01_simple_connect/README.md","articles":[]},"previous":{"title":"ApiRx","level":"1.4.1","depth":2,"path":"api-rx/classes/_index_.rxapi.md","ref":"api-rx/classes/_index_.rxapi.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/README.md","mtime":"2018-10-10T07:28:28.440Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Overview","level":"2.1","depth":1,"next":{"title":"Simple connect","level":"2.2","depth":1,"path":"examples/01_simple_connect/README.md","ref":"examples/01_simple_connect/README.md","articles":[]},"previous":{"title":"RpcRx","level":"1.4.1","depth":2,"path":"rpc-rx/classes/_index_.rxapi.md","ref":"rpc-rx/classes/_index_.rxapi.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"examples/README.md","mtime":"2018-10-10T08:02:18.120Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
+29
-29
@@ -57,7 +57,7 @@
|
||||
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
|
||||
|
||||
|
||||
<link rel="next" href="api/" />
|
||||
<link rel="next" href="rpc-core/" />
|
||||
|
||||
|
||||
|
||||
@@ -102,12 +102,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="api/">
|
||||
<li class="chapter " data-level="1.2" data-path="rpc-core/">
|
||||
|
||||
<a href="api/">
|
||||
<a href="rpc-core/">
|
||||
|
||||
|
||||
api
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
@@ -116,12 +116,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="api/classes/_index_.api.html">
|
||||
<li class="chapter " data-level="1.2.1" data-path="rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="api/classes/_index_.api.html">
|
||||
<a href="rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Api
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
@@ -134,12 +134,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="api-provider/">
|
||||
<li class="chapter " data-level="1.3" data-path="rpc-provider/">
|
||||
|
||||
<a href="api-provider/">
|
||||
<a href="rpc-provider/">
|
||||
|
||||
|
||||
api-provider
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
@@ -148,9 +148,9 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="api-provider/classes/_http_index_.httpprovider.html">
|
||||
<li class="chapter " data-level="1.3.1" data-path="rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="api-provider/classes/_http_index_.httpprovider.html">
|
||||
<a href="rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
@@ -161,9 +161,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<li class="chapter " data-level="1.3.2" data-path="rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="api-provider/classes/_ws_index_.wsprovider.html">
|
||||
<a href="rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
@@ -179,12 +179,12 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="api-rx/">
|
||||
<li class="chapter " data-level="1.4" data-path="rpc-rx/">
|
||||
|
||||
<a href="api-rx/">
|
||||
<a href="rpc-rx/">
|
||||
|
||||
|
||||
api-rx
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -193,12 +193,12 @@
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="api-rx/classes/_index_.rxapi.html">
|
||||
<li class="chapter " data-level="1.4.1" data-path="rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<a href="api-rx/classes/_index_.rxapi.html">
|
||||
<span>
|
||||
|
||||
|
||||
ApiRx
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
@@ -371,17 +371,17 @@
|
||||
<p>You can query a node and interact with the Polkadot network using Javascript. This guide describes the Polkadot Javascript API.</p>
|
||||
<h2 id="packages">Packages</h2>
|
||||
<ul>
|
||||
<li><a href="api/">api</a><ul>
|
||||
<li><a href="api/classes/_index_.api.html">Api</a></li>
|
||||
<li><a href="rpc-core/">rpc-core</a><ul>
|
||||
<li><a href="rpc-core/classes/_index_.rpc.html">Rpc</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="api-provider/">api-provider</a><ul>
|
||||
<li><a href="api-provider/classes/_http_index_.httpprovider.html">HttpProvider</a></li>
|
||||
<li><a href="api-provider/classes/_ws_index_.wsprovider.html">WsProvider</a></li>
|
||||
<li><a href="rpc-provider/">rpc-provider</a><ul>
|
||||
<li><a href="rpc-provider/classes/_http_index_.httpprovider.html">HttpProvider</a></li>
|
||||
<li><a href="rpc-provider/classes/_ws_index_.wsprovider.html">WsProvider</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="api-rx/">api-rx</a><ul>
|
||||
<li><a href="api-rx/classes/_index_.rxapi.html">ApiRx</a></li>
|
||||
<li><a href="rpc-rx/">rpc-rx</a><ul>
|
||||
<li><a href="rpc-rx/classes/_index_.rxapi.md">RpcRx</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -436,7 +436,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="api/" class="navigation navigation-next navigation-unique" aria-label="Next page: api">
|
||||
<a href="rpc-core/" class="navigation navigation-next navigation-unique" aria-label="Next page: rpc-core">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"api","level":"1.2","depth":1,"path":"api/README.md","ref":"api/README.md","articles":[{"title":"Api","level":"1.2.1","depth":2,"path":"api/classes/_index_.api.md","ref":"api/classes/_index_.api.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"README.md","mtime":"2018-10-10T07:28:28.436Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T07:31:27.069Z"},"basePath":".","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"rpc-core","level":"1.2","depth":1,"path":"rpc-core/README.md","ref":"rpc-core/README.md","articles":[{"title":"Rpc","level":"1.2.1","depth":2,"path":"rpc-core/classes/_index_.rpc.md","ref":"rpc-core/classes/_index_.rpc.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"README.md","mtime":"2018-10-10T08:02:18.116Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"basePath":".","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
[](https://polkadot.js.org)  [](https://github.com/Flet/semistandard) [](https://www.npmjs.com/package/@polkadot/api) [](https://travis-ci.org/polkadot-js/api) [](https://codeclimate.com/github/polkadot-js/api/maintainability) [](https://coveralls.io/github/polkadot-js/api?branch=master) [](https://david-dm.org/polkadot-js/api?path=package/rpc-core) [](https://david-dm.org/polkadot-js/api?path=package/rpc-core#info=devDependencies)
|
||||
|
||||
@polkadot/api
|
||||
=============
|
||||
|
||||
This library provides a clean wrapper around all the methods exposed by a Polkadot network client.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Installation -
|
||||
|
||||
```
|
||||
npm install --save @polkadot/rpc-core
|
||||
```
|
||||
|
||||
Initialisation -
|
||||
|
||||
```js
|
||||
import Api from '@polkadot/rpc-core';
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
|
||||
const provider = new WsProvider('http://127.0.0.1:9944');
|
||||
const api = new Api(provider);
|
||||
```
|
||||
|
||||
Making calls -
|
||||
|
||||
```js
|
||||
api.chain
|
||||
.getHeader('0x1234567890')
|
||||
.then((header) => console.log(header))
|
||||
.catch((error) => console.error(error));
|
||||
```
|
||||
|
||||
Retrieving the best block (once-off) -
|
||||
|
||||
```js
|
||||
api.chain
|
||||
.getHead()
|
||||
.then((headerHash) => {
|
||||
return api.chain.getHeader(headerHash);
|
||||
})
|
||||
.then((header) => {
|
||||
console.log(`best #${header.number.toString()}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('error:', error);
|
||||
});
|
||||
```
|
||||
|
||||
Retrieving best header via subscription -
|
||||
|
||||
```js
|
||||
api.chain
|
||||
.newHead((error, header) => {
|
||||
if (error) {
|
||||
console.error('error:', error);
|
||||
}
|
||||
|
||||
console.log(`best #${header.number.toString()}`);
|
||||
})
|
||||
.then((subscriptionId) => {
|
||||
// id for the subscription, can unsubscribe via
|
||||
// api.chain.newHead.unsubscribe(subscriptionId)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('error subscribing:', error);
|
||||
});
|
||||
```
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
* ["index"](modules/_index_.md)
|
||||
* [Rpc](classes/_index_.rpc.md)
|
||||
* ["types.d"](modules/_types_d_.md)
|
||||
* [RpcInterface$Section$Method](interfaces/_types_d_.rpcinterface_section_method.md)
|
||||
@@ -0,0 +1,543 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>Rpc · 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-sunlight-highlighter/sunlight.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="../../rpc-provider/" />
|
||||
|
||||
|
||||
<link rel="prev" href="../" />
|
||||
|
||||
|
||||
</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">Packages</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.1" data-path="../../">
|
||||
|
||||
<a href="../../">
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../">
|
||||
|
||||
<a href="../">
|
||||
|
||||
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter active" data-level="1.2.1" data-path="_index_.rpc.html">
|
||||
|
||||
<a href="_index_.rpc.html">
|
||||
|
||||
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../../rpc-provider/">
|
||||
|
||||
<a href="../../rpc-provider/">
|
||||
|
||||
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<span>
|
||||
|
||||
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="header">Examples</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="2.1" data-path="../../examples/">
|
||||
|
||||
<a href="../../examples/">
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.2" data-path="../../examples/01_simple_connect/">
|
||||
|
||||
<a href="../../examples/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.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="2.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="2.5" data-path="../../examples/04_generate_account/">
|
||||
|
||||
<a href="../../examples/04_generate_account/">
|
||||
|
||||
|
||||
Generate Accounts
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.6" data-path="../../examples/05_read_storage/">
|
||||
|
||||
<a href="../../examples/05_read_storage/">
|
||||
|
||||
|
||||
Read Storage
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.7" data-path="../../examples/06_craft_extrinsic/">
|
||||
|
||||
<a href="../../examples/06_craft_extrinsic/">
|
||||
|
||||
|
||||
Craft Extrinsic
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.8" data-path="../../examples/07_transfer_dots/">
|
||||
|
||||
<a href="../../examples/07_transfer_dots/">
|
||||
|
||||
|
||||
Transfer DOTs
|
||||
|
||||
</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="../.." >Rpc</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><em><strong>name</strong></em>: Rpc</p>
|
||||
<p><em><strong>summary</strong></em>: The API may use a HTTP or WebSockets provider.</p>
|
||||
<p><em><strong>description</strong></em>: It allows for querying a Polkadot Client Node.</p>
|
||||
<p><em><strong>example</strong></em>: </p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">Api</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<h1 id="hierarchy">Hierarchy</h1>
|
||||
<p><strong>Rpc</strong></p>
|
||||
<h1 id="implements">Implements</h1>
|
||||
<ul>
|
||||
<li><code>object</code></li>
|
||||
</ul>
|
||||
<h1 id="constructors">Constructors</h1>
|
||||
<p><a id="constructor"></a></p>
|
||||
<h2 id="constructor">constructor</h2>
|
||||
<p>⊕ <strong>new Rpc</strong>(provider: <em><code>ProviderInterface</code></em>): <a href="_index_.rpc.html">Rpc</a></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L37" target="_blank">index.ts:37</a></em></p>
|
||||
<p><em><strong>constructor</strong></em>: Default constructor for the Api Object</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>provider</td>
|
||||
<td><code>ProviderInterface</code></td>
|
||||
<td>An API provider using HTTP or WebSocket</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <a href="_index_.rpc.html">Rpc</a></p>
|
||||
<hr>
|
||||
<h1 id="properties">Properties</h1>
|
||||
<p><a id="author"></a></p>
|
||||
<h2 id="author">author</h2>
|
||||
<p><strong>● author</strong>: <em><a href="../modules/_types_d_.md#rpcinterface_section">RpcInterface$Section</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L34" target="_blank">index.ts:34</a></em></p>
|
||||
<hr>
|
||||
<p><a id="chain"></a></p>
|
||||
<h2 id="chain">chain</h2>
|
||||
<p><strong>● chain</strong>: <em><a href="../modules/_types_d_.md#rpcinterface_section">RpcInterface$Section</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L35" target="_blank">index.ts:35</a></em></p>
|
||||
<hr>
|
||||
<p><a id="state"></a></p>
|
||||
<h2 id="state">state</h2>
|
||||
<p><strong>● state</strong>: <em><a href="../modules/_types_d_.md#rpcinterface_section">RpcInterface$Section</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L36" target="_blank">index.ts:36</a></em></p>
|
||||
<hr>
|
||||
<p><a id="system"></a></p>
|
||||
<h2 id="system">system</h2>
|
||||
<p><strong>● system</strong>: <em><a href="../modules/_types_d_.md#rpcinterface_section">RpcInterface$Section</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L37" target="_blank">index.ts:37</a></em></p>
|
||||
<hr>
|
||||
<h1 id="methods">Methods</h1>
|
||||
<p><a id="signature"></a></p>
|
||||
<h2 id="static-signature"><code><Static></code> signature</h2>
|
||||
<p>▸ <strong>signature</strong>(__namedParameters: <em><code>object</code></em>): <code>string</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L72" target="_blank">index.ts:72</a></em></p>
|
||||
<p><em><strong>name</strong></em>: signature</p>
|
||||
<p><em><strong>summary</strong></em>: Returns a string representation of the method with inputs and outputs.</p>
|
||||
<p><em><strong>description</strong></em>: Formats the name, inputs and outputs into a human-readable string. This contains the input parameter names input types and output type.</p>
|
||||
<p><em><strong>example</strong></em>: </p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">Api</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">Api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">signature</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span> <span class="sunlight-ident">name</span><span class="sunlight-operator">:</span> <span class="sunlight-string">'test_method'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">params</span><span class="sunlight-operator">:</span> <span class="sunlight-punctuation">[</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">name</span><span class="sunlight-operator">:</span> <span class="sunlight-string">'dest'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span><span class="sunlight-operator">:</span> <span class="sunlight-string">'Address'</span> <span class="sunlight-punctuation">}</span> <span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span><span class="sunlight-operator">:</span> <span class="sunlight-string">'Address'</span> <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span> <span class="sunlight-comment">// => test_method (dest: Address): Address</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<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>string</code></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="../" class="navigation navigation-prev " aria-label="Previous page: rpc-core">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../../rpc-provider/" class="navigation navigation-next " aria-label="Next page: rpc-provider">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Rpc","level":"1.2.1","depth":2,"next":{"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":[]}]},"previous":{"title":"rpc-core","level":"1.2","depth":1,"path":"rpc-core/README.md","ref":"rpc-core/README.md","articles":[{"title":"Rpc","level":"1.2.1","depth":2,"path":"rpc-core/classes/_index_.rpc.md","ref":"rpc-core/classes/_index_.rpc.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"rpc-core/classes/_index_.rpc.md","mtime":"2018-10-10T08:04:17.080Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"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>
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
|
||||
|
||||
*__name__*: Rpc
|
||||
|
||||
*__summary__*: The API may use a HTTP or WebSockets provider.
|
||||
|
||||
*__description__*: It allows for querying a Polkadot Client Node.
|
||||
|
||||
*__example__*:
|
||||
```javascript
|
||||
import Api from '@polkadot/rpc-core';
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
|
||||
const provider = new WsProvider('ws://127.0.0.1:9944');
|
||||
const api = new Api(provider);
|
||||
```
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**Rpc**
|
||||
|
||||
# Implements
|
||||
|
||||
* `object`
|
||||
|
||||
# Constructors
|
||||
|
||||
<a id="constructor"></a>
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new Rpc**(provider: *`ProviderInterface`*): [Rpc](_index_.rpc.md)
|
||||
|
||||
*Defined in [index.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L37)*
|
||||
|
||||
*__constructor__*: Default constructor for the Api Object
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| provider | `ProviderInterface` | An API provider using HTTP or WebSocket |
|
||||
|
||||
**Returns:** [Rpc](_index_.rpc.md)
|
||||
|
||||
___
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="author"></a>
|
||||
|
||||
## author
|
||||
|
||||
**● author**: *[RpcInterface$Section](../modules/_types_d_.md#rpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:34](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L34)*
|
||||
|
||||
___
|
||||
<a id="chain"></a>
|
||||
|
||||
## chain
|
||||
|
||||
**● chain**: *[RpcInterface$Section](../modules/_types_d_.md#rpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:35](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L35)*
|
||||
|
||||
___
|
||||
<a id="state"></a>
|
||||
|
||||
## state
|
||||
|
||||
**● state**: *[RpcInterface$Section](../modules/_types_d_.md#rpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:36](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L36)*
|
||||
|
||||
___
|
||||
<a id="system"></a>
|
||||
|
||||
## system
|
||||
|
||||
**● system**: *[RpcInterface$Section](../modules/_types_d_.md#rpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L37)*
|
||||
|
||||
___
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="signature"></a>
|
||||
|
||||
## `<Static>` signature
|
||||
|
||||
▸ **signature**(__namedParameters: *`object`*): `string`
|
||||
|
||||
*Defined in [index.ts:72](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/index.ts#L72)*
|
||||
|
||||
*__name__*: signature
|
||||
|
||||
*__summary__*: Returns a string representation of the method with inputs and outputs.
|
||||
|
||||
*__description__*: Formats the name, inputs and outputs into a human-readable string. This contains the input parameter names input types and output type.
|
||||
|
||||
*__example__*:
|
||||
```javascript
|
||||
import Api from '@polkadot/rpc-core';
|
||||
|
||||
Api.signature({ name: 'test_method', params: [ { name: 'dest', type: 'Address' } ], type: 'Address' }); // => test_method (dest: Address): Address
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| __namedParameters | `object` |
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,500 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>rpc-core · 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-sunlight-highlighter/sunlight.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="classes/_index_.rpc.html" />
|
||||
|
||||
|
||||
<link rel="prev" href="../" />
|
||||
|
||||
|
||||
</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">Packages</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.1" data-path="../">
|
||||
|
||||
<a href="../">
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="1.2" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="classes/_index_.rpc.html">
|
||||
|
||||
<a href="classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../rpc-provider/">
|
||||
|
||||
<a href="../rpc-provider/">
|
||||
|
||||
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../rpc-rx/">
|
||||
|
||||
<a href="../rpc-rx/">
|
||||
|
||||
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<span>
|
||||
|
||||
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="header">Examples</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="2.1" data-path="../examples/">
|
||||
|
||||
<a href="../examples/">
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.2" data-path="../examples/01_simple_connect/">
|
||||
|
||||
<a href="../examples/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.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="2.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="2.5" data-path="../examples/04_generate_account/">
|
||||
|
||||
<a href="../examples/04_generate_account/">
|
||||
|
||||
|
||||
Generate Accounts
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.6" data-path="../examples/05_read_storage/">
|
||||
|
||||
<a href="../examples/05_read_storage/">
|
||||
|
||||
|
||||
Read Storage
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.7" data-path="../examples/06_craft_extrinsic/">
|
||||
|
||||
<a href="../examples/06_craft_extrinsic/">
|
||||
|
||||
|
||||
Craft Extrinsic
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.8" data-path="../examples/07_transfer_dots/">
|
||||
|
||||
<a href="../examples/07_transfer_dots/">
|
||||
|
||||
|
||||
Transfer DOTs
|
||||
|
||||
</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=".." >rpc-core</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" target="_blank"><img src="https://img.shields.io/npm/v/@polkadot/api.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=package/rpc-core" target="_blank"><img src="https://david-dm.org/polkadot-js/api.svg?style=flat-square&path=package/rpc-core" alt="dependency"></a> <a href="https://david-dm.org/polkadot-js/api?path=package/rpc-core#info=devDependencies" target="_blank"><img src="https://david-dm.org/polkadot-js/api/dev-status.svg?style=flat-square&path=package/rpc-core" alt="devDependency"></a></p>
|
||||
<h1 id="polkadotapi">@polkadot/api</h1>
|
||||
<p>This library provides a clean wrapper around all the methods exposed by a Polkadot network client.</p>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<p>Installation -</p>
|
||||
<pre><code>npm install --save @polkadot/rpc-core
|
||||
</code></pre><p>Initialisation -</p>
|
||||
<pre><code class="lang-js"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">Api</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'http://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<p>Making calls -</p>
|
||||
<pre><code class="lang-js"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">getHeader</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'0x1234567890'</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">then</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">header</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">header</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-keyword">catch</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<p>Retrieving the best block (once-off) -</p>
|
||||
<pre><code class="lang-js"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">getHead</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">then</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">headerHash</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-keyword">return</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span><span class="sunlight-operator">.</span><span class="sunlight-ident">getHeader</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">headerHash</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
  <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">then</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">header</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">`</span><span class="sunlight-ident">best</span> <span class="sunlight-punctuation">#</span><span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">header</span><span class="sunlight-operator">.</span><span class="sunlight-ident">number</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toString</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">`</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
  <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-keyword">catch</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'error:'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
  <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<p>Retrieving best header via subscription -</p>
|
||||
<pre><code class="lang-js"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">newHead</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">header</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-keyword">if</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
      <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'error:'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
    <span class="sunlight-punctuation">}</span>
|
||||
|
||||
    <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">`</span><span class="sunlight-ident">best</span> <span class="sunlight-punctuation">#</span><span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">header</span><span class="sunlight-operator">.</span><span class="sunlight-ident">number</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toString</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">`</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
  <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-ident">then</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">subscriptionId</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-comment">// id for the subscription, can unsubscribe via</span>
|
||||
    <span class="sunlight-comment">// api.chain.newHead.unsubscribe(subscriptionId)</span>
|
||||
  <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-operator">.</span><span class="sunlight-keyword">catch</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'error subscribing:'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
  <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
|
||||
|
||||
</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="../" class="navigation navigation-prev " aria-label="Previous page: Introduction">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="classes/_index_.rpc.html" class="navigation navigation-next " aria-label="Next page: Rpc">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"rpc-core","level":"1.2","depth":1,"next":{"title":"Rpc","level":"1.2.1","depth":2,"path":"rpc-core/classes/_index_.rpc.md","ref":"rpc-core/classes/_index_.rpc.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"rpc-core/README.md","mtime":"2018-10-10T08:04:16.944Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"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>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**RpcInterface$Section$Method**
|
||||
|
||||
# Callable
|
||||
▸ **__call**(...params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Defined in [types.d.ts:7](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/types.d.ts#L7)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Rest` params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="subscription"></a>
|
||||
|
||||
## subscription
|
||||
|
||||
**● subscription**: *`string`*
|
||||
|
||||
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/types.d.ts#L10)*
|
||||
|
||||
___
|
||||
<a id="unsubscribe"></a>
|
||||
|
||||
## unsubscribe
|
||||
|
||||
**● unsubscribe**: *`function`*
|
||||
|
||||
*Defined in [types.d.ts:11](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/types.d.ts#L11)*
|
||||
|
||||
#### Type declaration
|
||||
▸(id: *`number`*): `Promise`<`any`>
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [Rpc](../classes/_index_.rpc.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="rpcinterface"></a>
|
||||
|
||||
## RpcInterface
|
||||
|
||||
**Ƭ RpcInterface**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:18](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/types.d.ts#L18)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="rpcinterface_section"></a>
|
||||
|
||||
## RpcInterface$Section
|
||||
|
||||
**Ƭ RpcInterface$Section**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:14](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-core/src/types.d.ts#L14)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
[index: `string`]: [RpcInterface$Section$Method](../interfaces/_types_d_.rpcinterface_section_method.md)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
[](https://polkadot.js.org)  [](https://github.com/Flet/semistandard) [](https://www.npmjs.com/package/@polkadot/rpc-provider) [](https://travis-ci.org/polkadot-js/api) [](https://codeclimate.com/github/polkadot-js/api/maintainability) [](https://coveralls.io/github/polkadot-js/api?branch=master) [](https://david-dm.org/polkadot-js/api?path=packages/rpc-provider) [](https://david-dm.org/polkadot-js/api?path=packages/rpc-provider#info=devDependencies)
|
||||
|
||||
@polkadot/rpc-provider
|
||||
======================
|
||||
|
||||
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't be directly used. API interfaces building on top these providers can support various transports with the same underlying interfaces.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Installation -
|
||||
|
||||
```
|
||||
npm install --save @polkadot/rpc-provider
|
||||
```
|
||||
|
||||
Initialisation -
|
||||
|
||||
```js
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
|
||||
const provider = new WsProvider('http://127.0.0.1:9944');
|
||||
const version = await provider.send('client_version', []);
|
||||
|
||||
console.log('clientVersion', version);
|
||||
```
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
* ["coder/json/decodeResponse"](modules/_coder_json_decoderesponse_.md)
|
||||
* ["coder/json/encodeJson"](modules/_coder_json_encodejson_.md)
|
||||
* ["coder/json/encodeObject"](modules/_coder_json_encodeobject_.md)
|
||||
* ["coder/json/index"](modules/_coder_json_index_.md)
|
||||
* ["coder/json/types.d"](modules/_coder_json_types_d_.md)
|
||||
* ["http/index"](modules/_http_index_.md)
|
||||
* [HttpProvider](classes/_http_index_.httpprovider.md)
|
||||
* ["http/polyfill"](modules/_http_polyfill_.md)
|
||||
* ["http/types.d"](modules/_http_types_d_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* ["mock/index"](modules/_mock_index_.md)
|
||||
* ["mock/mocks"](modules/_mock_mocks_.md)
|
||||
* ["mock/on"](modules/_mock_on_.md)
|
||||
* ["mock/send"](modules/_mock_send_.md)
|
||||
* ["mock/state"](modules/_mock_state_.md)
|
||||
* ["mock/subscribe"](modules/_mock_subscribe_.md)
|
||||
* ["mock/types.d"](modules/_mock_types_d_.md)
|
||||
* ["mock/unsubscribe"](modules/_mock_unsubscribe_.md)
|
||||
* ["types.d"](modules/_types_d_.md)
|
||||
* [ProviderInterface](interfaces/_types_d_.providerinterface.md)
|
||||
* ["ws/index"](modules/_ws_index_.md)
|
||||
* [WsProvider](classes/_ws_index_.wsprovider.md)
|
||||
* ["ws/polyfill"](modules/_ws_polyfill_.md)
|
||||
@@ -0,0 +1,623 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>HttpProvider · 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-sunlight-highlighter/sunlight.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="_ws_index_.wsprovider.html" />
|
||||
|
||||
|
||||
<link rel="prev" href="../" />
|
||||
|
||||
|
||||
</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">Packages</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.1" data-path="../../">
|
||||
|
||||
<a href="../../">
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../">
|
||||
|
||||
<a href="../">
|
||||
|
||||
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter active" data-level="1.3.1" data-path="_http_index_.httpprovider.html">
|
||||
|
||||
<a href="_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<span>
|
||||
|
||||
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="header">Examples</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="2.1" data-path="../../examples/">
|
||||
|
||||
<a href="../../examples/">
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.2" data-path="../../examples/01_simple_connect/">
|
||||
|
||||
<a href="../../examples/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.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="2.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="2.5" data-path="../../examples/04_generate_account/">
|
||||
|
||||
<a href="../../examples/04_generate_account/">
|
||||
|
||||
|
||||
Generate Accounts
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.6" data-path="../../examples/05_read_storage/">
|
||||
|
||||
<a href="../../examples/05_read_storage/">
|
||||
|
||||
|
||||
Read Storage
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.7" data-path="../../examples/06_craft_extrinsic/">
|
||||
|
||||
<a href="../../examples/06_craft_extrinsic/">
|
||||
|
||||
|
||||
Craft Extrinsic
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.8" data-path="../../examples/07_transfer_dots/">
|
||||
|
||||
<a href="../../examples/07_transfer_dots/">
|
||||
|
||||
|
||||
Transfer DOTs
|
||||
|
||||
</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="../.." >HttpProvider</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><em><strong>name</strong></em>: HttpProvider</p>
|
||||
<p><em><strong>summary</strong></em>: The HTTP Provider allows sending requests using HTTP to a HTTP RPC server TCP port.</p>
|
||||
<p><em><strong>description</strong></em>: 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 <a href="_ws_index_.wsprovider.html">WsProvider</a>.</p>
|
||||
<p><em><strong>example</strong></em>: </p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">Api</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">HttpProvider</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-provider/http'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">HttpProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'http://127.0.0.1:9933'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<p><em><strong>see</strong></em>: <a href="_ws_index_.wsprovider.html">WsProvider</a></p>
|
||||
<h1 id="hierarchy">Hierarchy</h1>
|
||||
<p><strong>HttpProvider</strong></p>
|
||||
<h1 id="implements">Implements</h1>
|
||||
<ul>
|
||||
<li><a href="../interfaces/_types_d_.providerinterface.md">ProviderInterface</a></li>
|
||||
</ul>
|
||||
<h1 id="constructors">Constructors</h1>
|
||||
<p><a id="constructor"></a></p>
|
||||
<h2 id="constructor">constructor</h2>
|
||||
<p>⊕ <strong>new HttpProvider</strong>(endpoint: <em><code>string</code></em>): <a href="_http_index_.httpprovider.html">HttpProvider</a></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L40" target="_blank">http/index.ts:40</a></em></p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>endpoint</td>
|
||||
<td><code>string</code></td>
|
||||
<td>The endpoint url starting with http://</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <a href="_http_index_.httpprovider.html">HttpProvider</a></p>
|
||||
<hr>
|
||||
<h1 id="methods">Methods</h1>
|
||||
<p><a id="isconnected"></a></p>
|
||||
<h2 id="isconnected">isConnected</h2>
|
||||
<p>▸ <strong>isConnected</strong>(): <code>boolean</code></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_d_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_d_.providerinterface.md#isconnected">isConnected</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L57" target="_blank">http/index.ts:57</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Whether the node is connected or not.</p>
|
||||
<p><strong>Returns:</strong> <code>boolean</code>
|
||||
true if connected</p>
|
||||
<hr>
|
||||
<p><a id="on"></a></p>
|
||||
<h2 id="on">on</h2>
|
||||
<p>▸ <strong>on</strong>(type: <em><a href="../modules/_types_d_.md#providerinterface_emitted">ProviderInterface$Emitted</a></em>, sub: <em><a href="../modules/_types_d_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></em>): <code>void</code></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_d_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_d_.providerinterface.md#on">on</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L65" target="_blank">http/index.ts:65</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Events are not supported with the HttpProvider, see <a href="_ws_index_.wsprovider.html">WsProvider</a>.</p>
|
||||
<p><em><strong>description</strong></em>: HTTP Provider does not have 'on' emitters. WebSockets should be used instead.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><a href="../modules/_types_d_.md#providerinterface_emitted">ProviderInterface$Emitted</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sub</td>
|
||||
<td><a href="../modules/_types_d_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>void</code></p>
|
||||
<hr>
|
||||
<p><a id="send"></a></p>
|
||||
<h2 id="send">send</h2>
|
||||
<p>▸ <strong>send</strong>(method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>): <code>Promise</code><<code>any</code>></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_d_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_d_.providerinterface.md#send">send</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L72" target="_blank">http/index.ts:72</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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>method</td>
|
||||
<td><code>string</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>params</td>
|
||||
<td><code>Array</code><<code>any</code>></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>Promise</code><<code>any</code>></p>
|
||||
<hr>
|
||||
<p><a id="subscribe"></a></p>
|
||||
<h2 id="subscribe">subscribe</h2>
|
||||
<p>▸ <strong>subscribe</strong>(types: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, cb: <em><a href="../modules/_types_d_.md#providerinterface_callback">ProviderInterface$Callback</a></em>): <code>Promise</code><<code>number</code>></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_d_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_d_.providerinterface.md#subscribe">subscribe</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L94" target="_blank">http/index.ts:94</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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>types</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><<code>any</code>></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cb</td>
|
||||
<td><a href="../modules/_types_d_.md#providerinterface_callback">ProviderInterface$Callback</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>Promise</code><<code>number</code>></p>
|
||||
<hr>
|
||||
<p><a id="unsubscribe"></a></p>
|
||||
<h2 id="unsubscribe">unsubscribe</h2>
|
||||
<p>▸ <strong>unsubscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, id: <em><code>number</code></em>): <code>Promise</code><<code>boolean</code>></p>
|
||||
<p><em>Implementation of <a href="../interfaces/_types_d_.providerinterface.md">ProviderInterface</a>.<a href="../interfaces/_types_d_.providerinterface.md#unsubscribe">unsubscribe</a></em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L103" target="_blank">http/index.ts:103</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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><code>string</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>method</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><<code>boolean</code>></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="../" class="navigation navigation-prev " aria-label="Previous page: rpc-provider">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="_ws_index_.wsprovider.html" class="navigation navigation-next " aria-label="Next page: WsProvider">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<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","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"rpc-provider/classes/_http_index_.httpprovider.md","mtime":"2018-10-10T08:04:24.788Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"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>
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
|
||||
|
||||
*__name__*: HttpProvider
|
||||
|
||||
*__summary__*: The HTTP Provider allows sending requests using HTTP to a HTTP RPC server TCP port.
|
||||
|
||||
*__description__*: 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/rpc-core';
|
||||
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_d_.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/4344f33/packages/rpc-provider/src/http/index.ts#L40)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| endpoint | `string` | The endpoint url starting with http:// |
|
||||
|
||||
**Returns:** [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
___
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="isconnected"></a>
|
||||
|
||||
## isConnected
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_d_.providerinterface.md).[isConnected](../interfaces/_types_d_.providerinterface.md#isconnected)*
|
||||
|
||||
*Defined in [http/index.ts:57](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L57)*
|
||||
|
||||
*__summary__*: Whether the node is connected or not.
|
||||
|
||||
**Returns:** `boolean`
|
||||
true if connected
|
||||
|
||||
___
|
||||
<a id="on"></a>
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_d_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_d_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_d_.providerinterface.md).[on](../interfaces/_types_d_.providerinterface.md#on)*
|
||||
|
||||
*Defined in [http/index.ts:65](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L65)*
|
||||
|
||||
*__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:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_d_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_d_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="send"></a>
|
||||
|
||||
## send
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_d_.providerinterface.md).[send](../interfaces/_types_d_.providerinterface.md#send)*
|
||||
|
||||
*Defined in [http/index.ts:72](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L72)*
|
||||
|
||||
*__summary__*: Send HTTP POST Request with Body to configured HTTP Endpoint.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | 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_d_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*Implementation of [ProviderInterface](../interfaces/_types_d_.providerinterface.md).[subscribe](../interfaces/_types_d_.providerinterface.md#subscribe)*
|
||||
|
||||
*Defined in [http/index.ts:94](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L94)*
|
||||
|
||||
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| types | `string` |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
| cb | [ProviderInterface$Callback](../modules/_types_d_.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_d_.providerinterface.md).[unsubscribe](../interfaces/_types_d_.providerinterface.md#unsubscribe)*
|
||||
|
||||
*Defined in [http/index.ts:103](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/index.ts#L103)*
|
||||
|
||||
*__summary__*: Subscriptions are not supported with the HttpProvider, see [WsProvider](_ws_index_.wsprovider.md).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,904 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>WsProvider · 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-sunlight-highlighter/sunlight.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="../../rpc-rx/" />
|
||||
|
||||
|
||||
<link rel="prev" href="_http_index_.httpprovider.html" />
|
||||
|
||||
|
||||
</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">Packages</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.1" data-path="../../">
|
||||
|
||||
<a href="../../">
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../../rpc-core/">
|
||||
|
||||
<a href="../../rpc-core/">
|
||||
|
||||
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../">
|
||||
|
||||
<a href="../">
|
||||
|
||||
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="_http_index_.httpprovider.html">
|
||||
|
||||
<a href="_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="1.3.2" data-path="_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../../rpc-rx/">
|
||||
|
||||
<a href="../../rpc-rx/">
|
||||
|
||||
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<span>
|
||||
|
||||
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="header">Examples</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="2.1" data-path="../../examples/">
|
||||
|
||||
<a href="../../examples/">
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.2" data-path="../../examples/01_simple_connect/">
|
||||
|
||||
<a href="../../examples/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.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="2.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="2.5" data-path="../../examples/04_generate_account/">
|
||||
|
||||
<a href="../../examples/04_generate_account/">
|
||||
|
||||
|
||||
Generate Accounts
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.6" data-path="../../examples/05_read_storage/">
|
||||
|
||||
<a href="../../examples/05_read_storage/">
|
||||
|
||||
|
||||
Read Storage
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.7" data-path="../../examples/06_craft_extrinsic/">
|
||||
|
||||
<a href="../../examples/06_craft_extrinsic/">
|
||||
|
||||
|
||||
Craft Extrinsic
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.8" data-path="../../examples/07_transfer_dots/">
|
||||
|
||||
<a href="../../examples/07_transfer_dots/">
|
||||
|
||||
|
||||
Transfer DOTs
|
||||
|
||||
</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="../.." >WsProvider</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><em><strong>name</strong></em>: WsProvider</p>
|
||||
<p><em><strong>summary</strong></em>: The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port.</p>
|
||||
<p><em><strong>description</strong></em>: Unlike the <a href="_http_index_.httpprovider.html">HttpProvider</a>, it does support subscriptions and allows listening to events such as new blocks or balance changes.</p>
|
||||
<p><em><strong>example</strong></em>: </p>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">Api</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-core'</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<p><em><strong>see</strong></em>: <a href="_http_index_.httpprovider.html">HttpProvider</a></p>
|
||||
<h1 id="type-parameters">Type parameters</h1>
|
||||
<h4 id="eventtypes----string--symbol">EventTypes : <code>string</code> | <code>symbol</code></h4>
|
||||
<h1 id="hierarchy">Hierarchy</h1>
|
||||
<p> <code>EventEmitter</code></p>
|
||||
<p><strong>↳ WsProvider</strong></p>
|
||||
<h1 id="implements">Implements</h1>
|
||||
<ul>
|
||||
<li><code>WSProviderInterface</code></li>
|
||||
</ul>
|
||||
<h1 id="constructors">Constructors</h1>
|
||||
<p><a id="constructor"></a></p>
|
||||
<h2 id="constructor">constructor</h2>
|
||||
<p>⊕ <strong>new WsProvider</strong>(endpoint: <em><code>string</code></em>, autoConnect?: <em><code>boolean</code></em>): <a href="_ws_index_.wsprovider.html">WsProvider</a></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L73" target="_blank">ws/index.ts:73</a></em></p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Default value</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>endpoint</td>
|
||||
<td><code>string</code></td>
|
||||
<td>-</td>
|
||||
<td>The endpoint url. Usually `ws://ip:9944` or `wss://ip:9944`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Default value</code> autoConnect</td>
|
||||
<td><code>boolean</code></td>
|
||||
<td>true</td>
|
||||
<td>Whether to connect automatically or not.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <a href="_ws_index_.wsprovider.html">WsProvider</a></p>
|
||||
<hr>
|
||||
<h1 id="properties">Properties</h1>
|
||||
<p><a id="prefixed"></a></p>
|
||||
<h2 id="static-prefixed"><code><Static></code> prefixed</h2>
|
||||
<p><strong>● prefixed</strong>: <em> <code>string</code> | <code>boolean</code>
|
||||
</em></p>
|
||||
<p><em>Inherited from EventEmitter.prefixed</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:6</em></p>
|
||||
<hr>
|
||||
<h1 id="methods">Methods</h1>
|
||||
<p><a id="addlistener"></a></p>
|
||||
<h2 id="addlistener">addListener</h2>
|
||||
<p>▸ <strong>addListener</strong>(event: <em><code>EventTypes</code></em>, fn: <em><code>ListenerFn</code></em>, context?: <em><code>any</code></em>): <code>this</code></p>
|
||||
<p><em>Inherited from EventEmitter.addListener</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:33</em></p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fn</td>
|
||||
<td><code>ListenerFn</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> context</td>
|
||||
<td><code>any</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>this</code></p>
|
||||
<hr>
|
||||
<p><a id="connect"></a></p>
|
||||
<h2 id="connect">connect</h2>
|
||||
<p>▸ <strong>connect</strong>(): <code>void</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L104" target="_blank">ws/index.ts:104</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>
|
||||
<hr>
|
||||
<p><a id="emit"></a></p>
|
||||
<h2 id="emit">emit</h2>
|
||||
<p>▸ <strong>emit</strong>(event: <em><code>EventTypes</code></em>, ...args: <em><code>Array</code><<code>any</code>></em>): <code>boolean</code></p>
|
||||
<p><em>Inherited from EventEmitter.emit</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:27</em></p>
|
||||
<p>Calls each of the listeners registered for a given event.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Rest</code> args</td>
|
||||
<td><code>Array</code><<code>any</code>></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>boolean</code></p>
|
||||
<hr>
|
||||
<p><a id="eventnames"></a></p>
|
||||
<h2 id="eventnames">eventNames</h2>
|
||||
<p>▸ <strong>eventNames</strong>(): <code>Array</code><<code>EventTypes</code>></p>
|
||||
<p><em>Inherited from EventEmitter.eventNames</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:12</em></p>
|
||||
<p>Return an array listing the events for which the emitter has registered listeners.</p>
|
||||
<p><strong>Returns:</strong> <code>Array</code><<code>EventTypes</code>></p>
|
||||
<hr>
|
||||
<p><a id="isconnected"></a></p>
|
||||
<h2 id="isconnected">isConnected</h2>
|
||||
<p>▸ <strong>isConnected</strong>(): <code>boolean</code></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L121" target="_blank">ws/index.ts:121</a></em></p>
|
||||
<p><em><strong>summary</strong></em>: Whether the node is connected or not.</p>
|
||||
<p><strong>Returns:</strong> <code>boolean</code>
|
||||
true if connected</p>
|
||||
<hr>
|
||||
<p><a id="listenercount"></a></p>
|
||||
<h2 id="listenercount">listenerCount</h2>
|
||||
<p>▸ <strong>listenerCount</strong>(event: <em><code>EventTypes</code></em>): <code>number</code></p>
|
||||
<p><em>Inherited from EventEmitter.listenerCount</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:22</em></p>
|
||||
<p>Return the number of listeners listening to a given event.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>number</code></p>
|
||||
<hr>
|
||||
<p><a id="listeners"></a></p>
|
||||
<h2 id="listeners">listeners</h2>
|
||||
<p>▸ <strong>listeners</strong>(event: <em><code>EventTypes</code></em>): <code>Array</code><<code>ListenerFn</code>></p>
|
||||
<p><em>Inherited from EventEmitter.listeners</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:17</em></p>
|
||||
<p>Return the listeners registered for a given event.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>Array</code><<code>ListenerFn</code>></p>
|
||||
<hr>
|
||||
<p><a id="off"></a></p>
|
||||
<h2 id="off">off</h2>
|
||||
<p>▸ <strong>off</strong>(event: <em><code>EventTypes</code></em>, fn?: <em><a href="../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md">ListenerFn</a></em>, context?: <em><code>any</code></em>, once?: <em> <code>undefined</code> | <code>false</code> | <code>true</code></em>): <code>this</code></p>
|
||||
<p><em>Inherited from EventEmitter.off</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:44</em></p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> fn</td>
|
||||
<td><a href="../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md">ListenerFn</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> context</td>
|
||||
<td><code>any</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> once</td>
|
||||
<td><code>undefined</code> | <code>false</code> | <code>true</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>this</code></p>
|
||||
<hr>
|
||||
<p><a id="on"></a></p>
|
||||
<h2 id="on">on</h2>
|
||||
<p>▸ <strong>on</strong>(type: <em><a href="../modules/_types_d_.md#providerinterface_emitted">ProviderInterface$Emitted</a></em>, sub: <em><a href="../modules/_types_d_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></em>): <code>this</code></p>
|
||||
<p><em>Overrides EventEmitter.on</em></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L131" target="_blank">ws/index.ts:131</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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><a href="../modules/_types_d_.md#providerinterface_emitted">ProviderInterface$Emitted</a></td>
|
||||
<td>Event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sub</td>
|
||||
<td><a href="../modules/_types_d_.md#providerinterface_emitcb">ProviderInterface$EmitCb</a></td>
|
||||
<td>Callback</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>this</code>
|
||||
[description]</p>
|
||||
<hr>
|
||||
<p><a id="once"></a></p>
|
||||
<h2 id="once">once</h2>
|
||||
<p>▸ <strong>once</strong>(event: <em><code>EventTypes</code></em>, fn: <em><code>ListenerFn</code></em>, context?: <em><code>any</code></em>): <code>this</code></p>
|
||||
<p><em>Inherited from EventEmitter.once</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:38</em></p>
|
||||
<p>Add a one-time listener for a given event.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fn</td>
|
||||
<td><code>ListenerFn</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> context</td>
|
||||
<td><code>any</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>this</code></p>
|
||||
<hr>
|
||||
<p><a id="removealllisteners"></a></p>
|
||||
<h2 id="removealllisteners">removeAllListeners</h2>
|
||||
<p>▸ <strong>removeAllListeners</strong>(event?: <em><a href="">EventTypes</a></em>): <code>this</code></p>
|
||||
<p><em>Inherited from EventEmitter.removeAllListeners</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:49</em></p>
|
||||
<p>Remove all listeners, or those of the specified event.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>Optional</code> event</td>
|
||||
<td><a href="">EventTypes</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>this</code></p>
|
||||
<hr>
|
||||
<p><a id="removelistener"></a></p>
|
||||
<h2 id="removelistener">removeListener</h2>
|
||||
<p>▸ <strong>removeListener</strong>(event: <em><code>EventTypes</code></em>, fn?: <em><a href="../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md">ListenerFn</a></em>, context?: <em><code>any</code></em>, once?: <em> <code>undefined</code> | <code>false</code> | <code>true</code></em>): <code>this</code></p>
|
||||
<p><em>Inherited from EventEmitter.removeListener</em></p>
|
||||
<p><em>Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:43</em></p>
|
||||
<p>Remove the listeners of a given event.</p>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>event</td>
|
||||
<td><code>EventTypes</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> fn</td>
|
||||
<td><a href="../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md">ListenerFn</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> context</td>
|
||||
<td><code>any</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> once</td>
|
||||
<td><code>undefined</code> | <code>false</code> | <code>true</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>this</code></p>
|
||||
<hr>
|
||||
<p><a id="send"></a></p>
|
||||
<h2 id="send">send</h2>
|
||||
<p>▸ <strong>send</strong>(method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, subscription?: <em><code>SubscriptionHandler</code></em>): <code>Promise</code><<code>any</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L138" target="_blank">ws/index.ts:138</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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>method</td>
|
||||
<td><code>string</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>params</td>
|
||||
<td><code>Array</code><<code>any</code>></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Optional</code> subscription</td>
|
||||
<td><code>SubscriptionHandler</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>Promise</code><<code>any</code>></p>
|
||||
<hr>
|
||||
<p><a id="subscribe"></a></p>
|
||||
<h2 id="subscribe">subscribe</h2>
|
||||
<p>▸ <strong>subscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, params: <em><code>Array</code><<code>any</code>></em>, callback: <em><a href="../modules/_types_d_.md#providerinterface_callback">ProviderInterface$Callback</a></em>): <code>Promise</code><<code>number</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L194" target="_blank">ws/index.ts:194</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>
|
||||
<pre><code class="lang-javascript"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'ws://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">api</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">Api</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">provider</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">state</span><span class="sunlight-operator">.</span><span class="sunlight-ident">storage</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">[</span><span class="sunlight-punctuation">[</span><span class="sunlight-ident">storage</span><span class="sunlight-operator">.</span><span class="sunlight-ident">balances</span><span class="sunlight-operator">.</span><span class="sunlight-ident">freeBalance</span><span class="sunlight-punctuation">,</span> <span class="sunlight-operator"><</span><span class="sunlight-ident">Address</span><span class="sunlight-operator">></span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">,</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">_</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">values</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">values</span><span class="sunlight-punctuation">)</span>
|
||||
<span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-ident">then</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">subscriptionId</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
  <span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'balance changes subscription id: '</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">subscriptionId</span><span class="sunlight-punctuation">)</span>
|
||||
<span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
<p><strong>Parameters:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><code>string</code></td>
|
||||
<td>Subscription type</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>method</td>
|
||||
<td><code>string</code></td>
|
||||
<td>Subscription method</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>params</td>
|
||||
<td><code>Array</code><<code>any</code>></td>
|
||||
<td>Parameters</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>callback</td>
|
||||
<td><a href="../modules/_types_d_.md#providerinterface_callback">ProviderInterface$Callback</a></td>
|
||||
<td>Callback</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Returns:</strong> <code>Promise</code><<code>number</code>>
|
||||
Promise resolving to the dd of the subscription you can use with [[unsubscribe]].</p>
|
||||
<hr>
|
||||
<p><a id="unsubscribe"></a></p>
|
||||
<h2 id="unsubscribe">unsubscribe</h2>
|
||||
<p>▸ <strong>unsubscribe</strong>(type: <em><code>string</code></em>, method: <em><code>string</code></em>, id: <em><code>number</code></em>): <code>Promise</code><<code>boolean</code>></p>
|
||||
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L203" target="_blank">ws/index.ts:203</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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td><code>string</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>method</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><<code>boolean</code>></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="_http_index_.httpprovider.html" class="navigation navigation-prev " aria-label="Previous page: HttpProvider">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../../rpc-rx/" class="navigation navigation-next " aria-label="Next page: rpc-rx">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"WsProvider","level":"1.3.2","depth":2,"next":{"title":"rpc-rx","level":"1.4","depth":1,"path":"rpc-rx/README.md","ref":"rpc-rx/README.md","articles":[{"title":"RpcRx","level":"1.4.1","depth":2,"path":"rpc-rx/classes/_index_.rxapi.md","ref":"rpc-rx/classes/_index_.rxapi.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","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"rpc-provider/classes/_ws_index_.wsprovider.md","mtime":"2018-10-10T08:04:24.888Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"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>
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
|
||||
|
||||
*__name__*: WsProvider
|
||||
|
||||
*__summary__*: The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port.
|
||||
|
||||
*__description__*: Unlike the [HttpProvider](_http_index_.httpprovider.md), it does support subscriptions and allows listening to events such as new blocks or balance changes.
|
||||
|
||||
*__example__*:
|
||||
```javascript
|
||||
import Api from '@polkadot/rpc-core';
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
|
||||
const provider = new WsProvider('ws://127.0.0.1:9944');
|
||||
const api = new Api(provider);
|
||||
```
|
||||
|
||||
*__see__*: [HttpProvider](_http_index_.httpprovider.md)
|
||||
|
||||
# Type parameters
|
||||
#### EventTypes : `string` | `symbol`
|
||||
|
||||
# Hierarchy
|
||||
|
||||
`EventEmitter`
|
||||
|
||||
**↳ WsProvider**
|
||||
|
||||
# Implements
|
||||
|
||||
* `WSProviderInterface`
|
||||
|
||||
# Constructors
|
||||
|
||||
<a id="constructor"></a>
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new WsProvider**(endpoint: *`string`*, autoConnect?: *`boolean`*): [WsProvider](_ws_index_.wsprovider.md)
|
||||
|
||||
*Defined in [ws/index.ts:73](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L73)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value | Description |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| endpoint | `string` | - | 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)
|
||||
|
||||
___
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="prefixed"></a>
|
||||
|
||||
## `<Static>` prefixed
|
||||
|
||||
**● prefixed**: * `string` | `boolean`
|
||||
*
|
||||
|
||||
*Inherited from EventEmitter.prefixed*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:6*
|
||||
|
||||
___
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="addlistener"></a>
|
||||
|
||||
## addListener
|
||||
|
||||
▸ **addListener**(event: *`EventTypes`*, fn: *`ListenerFn`*, context?: *`any`*): `this`
|
||||
|
||||
*Inherited from EventEmitter.addListener*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:33*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
| fn | `ListenerFn` |
|
||||
| `Optional` context | `any` |
|
||||
|
||||
**Returns:** `this`
|
||||
|
||||
___
|
||||
<a id="connect"></a>
|
||||
|
||||
## connect
|
||||
|
||||
▸ **connect**(): `void`
|
||||
|
||||
*Defined in [ws/index.ts:104](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L104)*
|
||||
|
||||
*__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.
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="emit"></a>
|
||||
|
||||
## emit
|
||||
|
||||
▸ **emit**(event: *`EventTypes`*, ...args: *`Array`<`any`>*): `boolean`
|
||||
|
||||
*Inherited from EventEmitter.emit*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:27*
|
||||
|
||||
Calls each of the listeners registered for a given event.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
| `Rest` args | `Array`<`any`> |
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
___
|
||||
<a id="eventnames"></a>
|
||||
|
||||
## eventNames
|
||||
|
||||
▸ **eventNames**(): `Array`<`EventTypes`>
|
||||
|
||||
*Inherited from EventEmitter.eventNames*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:12*
|
||||
|
||||
Return an array listing the events for which the emitter has registered listeners.
|
||||
|
||||
**Returns:** `Array`<`EventTypes`>
|
||||
|
||||
___
|
||||
<a id="isconnected"></a>
|
||||
|
||||
## isConnected
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [ws/index.ts:121](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L121)*
|
||||
|
||||
*__summary__*: Whether the node is connected or not.
|
||||
|
||||
**Returns:** `boolean`
|
||||
true if connected
|
||||
|
||||
___
|
||||
<a id="listenercount"></a>
|
||||
|
||||
## listenerCount
|
||||
|
||||
▸ **listenerCount**(event: *`EventTypes`*): `number`
|
||||
|
||||
*Inherited from EventEmitter.listenerCount*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:22*
|
||||
|
||||
Return the number of listeners listening to a given event.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
___
|
||||
<a id="listeners"></a>
|
||||
|
||||
## listeners
|
||||
|
||||
▸ **listeners**(event: *`EventTypes`*): `Array`<`ListenerFn`>
|
||||
|
||||
*Inherited from EventEmitter.listeners*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:17*
|
||||
|
||||
Return the listeners registered for a given event.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
|
||||
**Returns:** `Array`<`ListenerFn`>
|
||||
|
||||
___
|
||||
<a id="off"></a>
|
||||
|
||||
## off
|
||||
|
||||
▸ **off**(event: *`EventTypes`*, fn?: *[ListenerFn](../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md)*, context?: *`any`*, once?: * `undefined` | `false` | `true`*): `this`
|
||||
|
||||
*Inherited from EventEmitter.off*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:44*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
| `Optional` fn | [ListenerFn](../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md) |
|
||||
| `Optional` context | `any` |
|
||||
| `Optional` once | `undefined` | `false` | `true`|
|
||||
|
||||
**Returns:** `this`
|
||||
|
||||
___
|
||||
<a id="on"></a>
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_d_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_d_.md#providerinterface_emitcb)*): `this`
|
||||
|
||||
*Overrides EventEmitter.on*
|
||||
|
||||
*Defined in [ws/index.ts:131](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L131)*
|
||||
|
||||
*__summary__*: Listens on events after having subscribed using the [subscribe](_ws_index_.wsprovider.md#subscribe) function.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_d_.md#providerinterface_emitted) | Event |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_d_.md#providerinterface_emitcb) | Callback |
|
||||
|
||||
**Returns:** `this`
|
||||
[description]
|
||||
|
||||
___
|
||||
<a id="once"></a>
|
||||
|
||||
## once
|
||||
|
||||
▸ **once**(event: *`EventTypes`*, fn: *`ListenerFn`*, context?: *`any`*): `this`
|
||||
|
||||
*Inherited from EventEmitter.once*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:38*
|
||||
|
||||
Add a one-time listener for a given event.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
| fn | `ListenerFn` |
|
||||
| `Optional` context | `any` |
|
||||
|
||||
**Returns:** `this`
|
||||
|
||||
___
|
||||
<a id="removealllisteners"></a>
|
||||
|
||||
## removeAllListeners
|
||||
|
||||
▸ **removeAllListeners**(event?: *[EventTypes]()*): `this`
|
||||
|
||||
*Inherited from EventEmitter.removeAllListeners*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:49*
|
||||
|
||||
Remove all listeners, or those of the specified event.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Optional` event | [EventTypes]() |
|
||||
|
||||
**Returns:** `this`
|
||||
|
||||
___
|
||||
<a id="removelistener"></a>
|
||||
|
||||
## removeListener
|
||||
|
||||
▸ **removeListener**(event: *`EventTypes`*, fn?: *[ListenerFn](../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md)*, context?: *`any`*, once?: * `undefined` | `false` | `true`*): `this`
|
||||
|
||||
*Inherited from EventEmitter.removeListener*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:43*
|
||||
|
||||
Remove the listeners of a given event.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| event | `EventTypes` |
|
||||
| `Optional` fn | [ListenerFn](../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md) |
|
||||
| `Optional` context | `any` |
|
||||
| `Optional` once | `undefined` | `false` | `true`|
|
||||
|
||||
**Returns:** `this`
|
||||
|
||||
___
|
||||
<a id="send"></a>
|
||||
|
||||
## send
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*, subscription?: *`SubscriptionHandler`*): `Promise`<`any`>
|
||||
|
||||
*Defined in [ws/index.ts:138](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L138)*
|
||||
|
||||
*__summary__*: Send JSON data using WebSockets to configured HTTP Endpoint or queue.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
| `Optional` subscription | `SubscriptionHandler` |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
___
|
||||
<a id="subscribe"></a>
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, callback: *[ProviderInterface$Callback](../modules/_types_d_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*Defined in [ws/index.ts:194](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L194)*
|
||||
|
||||
*__name__*: subscribe
|
||||
|
||||
*__summary__*: Allows subscribing to a specific event.
|
||||
|
||||
*__example__*:
|
||||
```javascript
|
||||
const provider = new WsProvider('ws://127.0.0.1:9944');
|
||||
const api = new Api(provider);
|
||||
|
||||
api.state.storage([[storage.balances.freeBalance, <Address>]], (_, values) => {
|
||||
console.log(values)
|
||||
}).then((subscriptionId) => {
|
||||
console.log('balance changes subscription id: ', subscriptionId)
|
||||
})
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| type | `string` | Subscription type |
|
||||
| method | `string` | Subscription method |
|
||||
| params | `Array`<`any`> | Parameters |
|
||||
| callback | [ProviderInterface$Callback](../modules/_types_d_.md#providerinterface_callback) | Callback |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
Promise resolving to the dd of the subscription you can use with [[unsubscribe]].
|
||||
|
||||
___
|
||||
<a id="unsubscribe"></a>
|
||||
|
||||
## unsubscribe
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [ws/index.ts:203](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/ws/index.ts#L203)*
|
||||
|
||||
*__summary__*: Allows unsubscribing to subscriptions made with [subscribe](_ws_index_.wsprovider.md#subscribe).
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,465 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>rpc-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-sunlight-highlighter/sunlight.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="classes/_http_index_.httpprovider.html" />
|
||||
|
||||
|
||||
<link rel="prev" href="../rpc-core/classes/_index_.rpc.html" />
|
||||
|
||||
|
||||
</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">Packages</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.1" data-path="../">
|
||||
|
||||
<a href="../">
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../rpc-core/">
|
||||
|
||||
<a href="../rpc-core/">
|
||||
|
||||
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="1.3" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.4" data-path="../rpc-rx/">
|
||||
|
||||
<a href="../rpc-rx/">
|
||||
|
||||
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="../rpc-rx/classes/_index_.rxapi.md">
|
||||
|
||||
<span>
|
||||
|
||||
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="header">Examples</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="2.1" data-path="../examples/">
|
||||
|
||||
<a href="../examples/">
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.2" data-path="../examples/01_simple_connect/">
|
||||
|
||||
<a href="../examples/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.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="2.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="2.5" data-path="../examples/04_generate_account/">
|
||||
|
||||
<a href="../examples/04_generate_account/">
|
||||
|
||||
|
||||
Generate Accounts
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.6" data-path="../examples/05_read_storage/">
|
||||
|
||||
<a href="../examples/05_read_storage/">
|
||||
|
||||
|
||||
Read Storage
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.7" data-path="../examples/06_craft_extrinsic/">
|
||||
|
||||
<a href="../examples/06_craft_extrinsic/">
|
||||
|
||||
|
||||
Craft Extrinsic
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.8" data-path="../examples/07_transfer_dots/">
|
||||
|
||||
<a href="../examples/07_transfer_dots/">
|
||||
|
||||
|
||||
Transfer DOTs
|
||||
|
||||
</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=".." >rpc-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/rpc-provider" target="_blank"><img src="https://img.shields.io/npm/v/@polkadot/rpc-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/rpc-provider" target="_blank"><img src="https://david-dm.org/polkadot-js/api.svg?style=flat-square&path=packages/rpc-provider" alt="dependency"></a> <a href="https://david-dm.org/polkadot-js/api?path=packages/rpc-provider#info=devDependencies" target="_blank"><img src="https://david-dm.org/polkadot-js/api/dev-status.svg?style=flat-square&path=packages/rpc-provider" alt="devDependency"></a></p>
|
||||
<h1 id="polkadotrpc-provider">@polkadot/rpc-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'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/rpc-provider
|
||||
</code></pre><p>Initialisation -</p>
|
||||
<pre><code class="lang-js"><div class="sunlight-container sunlight-theme-gitbook"><div class="sunlight-code-container"><pre class="sunlight-highlight-javascript sunlight-highlighted"><span class="sunlight-javascript"><span class="sunlight-reservedWord">import</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-ident">from</span> <span class="sunlight-string">'@polkadot/rpc-provider/ws'</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">provider</span> <span class="sunlight-operator">=</span> <span class="sunlight-keyword">new</span> <span class="sunlight-ident">WsProvider</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'http://127.0.0.1:9944'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">version</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">await</span> <span class="sunlight-ident">provider</span><span class="sunlight-operator">.</span><span class="sunlight-ident">send</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'client_version'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-punctuation">[</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">log</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'clientVersion'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">version</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
</span></pre></div></div></code></pre>
|
||||
|
||||
|
||||
</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="../rpc-core/classes/_index_.rpc.html" class="navigation navigation-prev " aria-label="Previous page: Rpc">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="classes/_http_index_.httpprovider.html" class="navigation navigation-next " aria-label="Next page: HttpProvider">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"rpc-provider","level":"1.3","depth":1,"next":{"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":[]},"previous":{"title":"Rpc","level":"1.2.1","depth":2,"path":"rpc-core/classes/_index_.rpc.md","ref":"rpc-core/classes/_index_.rpc.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"rpc-provider/README.md","mtime":"2018-10-10T08:04:24.632Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"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>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**ProviderInterface**
|
||||
|
||||
# Implemented by
|
||||
|
||||
* [HttpProvider](../classes/_http_index_.httpprovider.md)
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="isconnected"></a>
|
||||
|
||||
## isConnected
|
||||
|
||||
▸ **isConnected**(): `boolean`
|
||||
|
||||
*Defined in [types.d.ts:45](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L45)*
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
___
|
||||
<a id="on"></a>
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(type: *[ProviderInterface$Emitted](../modules/_types_d_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](../modules/_types_d_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Defined in [types.d.ts:46](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L46)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| type | [ProviderInterface$Emitted](../modules/_types_d_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](../modules/_types_d_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="send"></a>
|
||||
|
||||
## send
|
||||
|
||||
▸ **send**(method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Defined in [types.d.ts:47](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L47)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
___
|
||||
<a id="subscribe"></a>
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(type: *`string`*, method: *`string`*, params: *`Array`<`any`>*, cb: *[ProviderInterface$Callback](../modules/_types_d_.md#providerinterface_callback)*): `Promise`<`number`>
|
||||
|
||||
*Defined in [types.d.ts:48](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L48)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
| cb | [ProviderInterface$Callback](../modules/_types_d_.md#providerinterface_callback) |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
|
||||
___
|
||||
<a id="unsubscribe"></a>
|
||||
|
||||
## unsubscribe
|
||||
|
||||
▸ **unsubscribe**(type: *`string`*, method: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [types.d.ts:49](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**EventEmitterStatic**
|
||||
|
||||
# Constructors
|
||||
|
||||
<a id="constructor"></a>
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new EventEmitterStatic**<`EventTypes`>(): `EventEmitter`<`EventTypes`>
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:57*
|
||||
|
||||
**Type parameters:**
|
||||
|
||||
#### EventTypes : `string` | `symbol`
|
||||
|
||||
**Returns:** `EventEmitter`<`EventTypes`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**ListenerFn**
|
||||
|
||||
# Callable
|
||||
▸ **__call**(...args: *`Array`<`any`>*): `void`
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:53*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Rest` args | `Array`<`any`> |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="decoderesponse"></a>
|
||||
|
||||
## decodeResponse
|
||||
|
||||
▸ **decodeResponse**(self: *[RpcCoderState](_coder_json_types_d_.md#rpccoderstate)*, response: *[JsonRpcResponse](_types_d_.md#jsonrpcresponse)*): `any`
|
||||
|
||||
*Defined in [coder/json/decodeResponse.ts:22](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/coder/json/decodeResponse.ts#L22)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| self | [RpcCoderState](_coder_json_types_d_.md#rpccoderstate) |
|
||||
| response | [JsonRpcResponse](_types_d_.md#jsonrpcresponse) |
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="encodejson"></a>
|
||||
|
||||
## encodeJson
|
||||
|
||||
▸ **encodeJson**(self: *[RpcCoderState](_coder_json_types_d_.md#rpccoderstate)*, method: *`string`*, params: *`Array`<`any`>*): `string`
|
||||
|
||||
*Defined in [coder/json/encodeJson.ts:9](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/coder/json/encodeJson.ts#L9)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| self | [RpcCoderState](_coder_json_types_d_.md#rpccoderstate) |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="encodeobject"></a>
|
||||
|
||||
## encodeObject
|
||||
|
||||
▸ **encodeObject**(self: *[RpcCoderState](_coder_json_types_d_.md#rpccoderstate)*, method: *`string`*, params: *`Array`<`any`>*): [JsonRpcRequest](_types_d_.md#jsonrpcrequest)
|
||||
|
||||
*Defined in [coder/json/encodeObject.ts:8](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/coder/json/encodeObject.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| self | [RpcCoderState](_coder_json_types_d_.md#rpccoderstate) |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** [JsonRpcRequest](_types_d_.md#jsonrpcrequest)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="rpccoder"></a>
|
||||
|
||||
## rpcCoder
|
||||
|
||||
▸ **rpcCoder**(): [RpcCoder](_coder_json_types_d_.md#rpccoder)
|
||||
|
||||
*Defined in [coder/json/index.ts:12](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/coder/json/index.ts#L12)*
|
||||
|
||||
**Returns:** [RpcCoder](_coder_json_types_d_.md#rpccoder)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="rpccoder"></a>
|
||||
|
||||
## RpcCoder
|
||||
|
||||
**Ƭ RpcCoder**: *`object`*
|
||||
|
||||
*Defined in [coder/json/types.d.ts:7](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/coder/json/types.d.ts#L7)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="rpccoderstate"></a>
|
||||
|
||||
## RpcCoderState
|
||||
|
||||
**Ƭ RpcCoderState**: *`object`*
|
||||
|
||||
*Defined in [coder/json/types.d.ts:14](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/coder/json/types.d.ts#L14)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [HttpProvider](../classes/_http_index_.httpprovider.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="httpstate"></a>
|
||||
|
||||
## HttpState
|
||||
|
||||
**Ƭ HttpState**: *`object`*
|
||||
|
||||
*Defined in [http/types.d.ts:8](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/http/types.d.ts#L8)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="mockprovider"></a>
|
||||
|
||||
## mockProvider
|
||||
|
||||
▸ **mockProvider**(): [ProviderInterface](../interfaces/_types_d_.providerinterface.md)
|
||||
|
||||
*Defined in [mock/index.ts:18](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/index.ts#L18)*
|
||||
|
||||
A moock provider mainly used for testing.
|
||||
|
||||
**Returns:** [ProviderInterface](../interfaces/_types_d_.providerinterface.md)
|
||||
The mock provider
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="mocks"></a>
|
||||
|
||||
## mocks
|
||||
|
||||
▸ **mocks**(__namedParameters: *`object`*): `void`
|
||||
|
||||
*Defined in [mock/mocks.ts:63](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/mocks.ts#L63)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| __namedParameters | `object` |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="on"></a>
|
||||
|
||||
## on
|
||||
|
||||
▸ **on**(self: *[MockState](_mock_types_d_.md#mockstate)*, type: *[ProviderInterface$Emitted](_types_d_.md#providerinterface_emitted)*, sub: *[ProviderInterface$EmitCb](_types_d_.md#providerinterface_emitcb)*): `void`
|
||||
|
||||
*Defined in [mock/on.ts:8](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/on.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| self | [MockState](_mock_types_d_.md#mockstate) |
|
||||
| type | [ProviderInterface$Emitted](_types_d_.md#providerinterface_emitted) |
|
||||
| sub | [ProviderInterface$EmitCb](_types_d_.md#providerinterface_emitcb) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="send"></a>
|
||||
|
||||
## send
|
||||
|
||||
▸ **send**(__namedParameters: *`object`*, method: *`string`*, params: *`Array`<`any`>*): `Promise`<`any`>
|
||||
|
||||
*Defined in [mock/send.ts:7](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/send.ts#L7)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| __namedParameters | `object` |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`any`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="state"></a>
|
||||
|
||||
## state
|
||||
|
||||
▸ **state**(): [MockState](_mock_types_d_.md#mockstate)
|
||||
|
||||
*Defined in [mock/state.ts:38](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/state.ts#L38)*
|
||||
|
||||
**Returns:** [MockState](_mock_types_d_.md#mockstate)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="subscribe"></a>
|
||||
|
||||
## subscribe
|
||||
|
||||
▸ **subscribe**(self: *[MockState](_mock_types_d_.md#mockstate)*, type: *`string`*, method: *`string`*, params: *`Array`<`any`>*): `Promise`<`number`>
|
||||
|
||||
*Defined in [mock/subscribe.ts:7](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/subscribe.ts#L7)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| self | [MockState](_mock_types_d_.md#mockstate) |
|
||||
| type | `string` |
|
||||
| method | `string` |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Promise`<`number`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="mockstate"></a>
|
||||
|
||||
## MockState
|
||||
|
||||
**Ƭ MockState**: *`object`*
|
||||
|
||||
*Defined in [mock/types.d.ts:27](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/types.d.ts#L27)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="mockstate_db"></a>
|
||||
|
||||
## MockState$Db
|
||||
|
||||
**Ƭ MockState$Db**: *`object`*
|
||||
|
||||
*Defined in [mock/types.d.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/types.d.ts#L19)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
[index: `string`]: `Uint8Array`
|
||||
|
||||
___
|
||||
<a id="mockstate_requests"></a>
|
||||
|
||||
## MockState$Requests
|
||||
|
||||
**Ƭ MockState$Requests**: *`object`*
|
||||
|
||||
*Defined in [mock/types.d.ts:23](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/types.d.ts#L23)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
[index: `string`]: `function`
|
||||
|
||||
▸(db: *[MockState$Db](_mock_types_d_.md#mockstate_db)*, params: *`Array`<`any`>*): `string`
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| db | [MockState$Db](_mock_types_d_.md#mockstate_db) |
|
||||
| params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
___
|
||||
<a id="mockstate_subscription_callback"></a>
|
||||
|
||||
## MockState$Subscription$Callback
|
||||
|
||||
**Ƭ MockState$Subscription$Callback**: *`function`*
|
||||
|
||||
*Defined in [mock/types.d.ts:8](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/types.d.ts#L8)*
|
||||
|
||||
#### Type declaration
|
||||
▸(error: * `Error` | `null`*, value: *`any`*): `void`
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| error | `Error` | `null`|
|
||||
| value | `any` |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="mockstate_subscriptions"></a>
|
||||
|
||||
## MockState$Subscriptions
|
||||
|
||||
**Ƭ MockState$Subscriptions**: *`object`*
|
||||
|
||||
*Defined in [mock/types.d.ts:10](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/types.d.ts#L10)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
[index: `string`]: `object`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="unsubscribe"></a>
|
||||
|
||||
## unsubscribe
|
||||
|
||||
▸ **unsubscribe**(self: *[MockState](_mock_types_d_.md#mockstate)*, type: *`string`*, name: *`string`*, id: *`number`*): `Promise`<`boolean`>
|
||||
|
||||
*Defined in [mock/unsubscribe.ts:7](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/mock/unsubscribe.ts#L7)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| self | [MockState](_mock_types_d_.md#mockstate) |
|
||||
| type | `string` |
|
||||
| name | `string` |
|
||||
| id | `number` |
|
||||
|
||||
**Returns:** `Promise`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="jsonrpcobject"></a>
|
||||
|
||||
## JsonRpcObject
|
||||
|
||||
**Ƭ JsonRpcObject**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:5](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L5)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="jsonrpcrequest"></a>
|
||||
|
||||
## JsonRpcRequest
|
||||
|
||||
**Ƭ JsonRpcRequest**: * [JsonRpcObject](_types_d_.md#jsonrpcobject) & `object`
|
||||
*
|
||||
|
||||
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L10)*
|
||||
|
||||
___
|
||||
<a id="jsonrpcresponse"></a>
|
||||
|
||||
## JsonRpcResponse
|
||||
|
||||
**Ƭ JsonRpcResponse**: * [JsonRpcObject](_types_d_.md#jsonrpcobject) & [JsonRpcResponseBase](_types_d_.md#jsonrpcresponsebase)
|
||||
*
|
||||
|
||||
*Defined in [types.d.ts:36](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L36)*
|
||||
|
||||
___
|
||||
<a id="jsonrpcresponsebase"></a>
|
||||
|
||||
## JsonRpcResponseBase
|
||||
|
||||
**Ƭ JsonRpcResponseBase**: * `JsonRpcResponse$Single` & `JsonRpcResponse$Subscription`
|
||||
*
|
||||
|
||||
*Defined in [types.d.ts:34](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L34)*
|
||||
|
||||
___
|
||||
<a id="jsonrpcresponsebase_error"></a>
|
||||
|
||||
## JsonRpcResponseBase$Error
|
||||
|
||||
**Ƭ JsonRpcResponseBase$Error**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:15](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L15)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="providerinterface_callback"></a>
|
||||
|
||||
## ProviderInterface$Callback
|
||||
|
||||
**Ƭ ProviderInterface$Callback**: *`function`*
|
||||
|
||||
*Defined in [types.d.ts:38](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L38)*
|
||||
|
||||
#### Type declaration
|
||||
▸(error: * `Error` | `null`*, result: *`any`*): `void`
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| error | `Error` | `null`|
|
||||
| result | `any` |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
<a id="providerinterface_emitcb"></a>
|
||||
|
||||
## ProviderInterface$EmitCb
|
||||
|
||||
**Ƭ ProviderInterface$EmitCb**: *`function`*
|
||||
|
||||
*Defined in [types.d.ts:42](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L42)*
|
||||
|
||||
#### Type declaration
|
||||
▸(value?: *`any`*): `any`
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Optional` value | `any` |
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
___
|
||||
<a id="providerinterface_emitted"></a>
|
||||
|
||||
## ProviderInterface$Emitted
|
||||
|
||||
**Ƭ ProviderInterface$Emitted**: * "connected" | "disconnected"
|
||||
*
|
||||
|
||||
*Defined in [types.d.ts:40](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-provider/src/types.d.ts#L40)*
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [WsProvider](../classes/_ws_index_.wsprovider.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Interfaces
|
||||
|
||||
* [EventEmitterStatic](../interfaces/_ws_index_.wsprovider.eventemitter.eventemitterstatic.md)
|
||||
* [ListenerFn](../interfaces/_ws_index_.wsprovider.eventemitter.listenerfn.md)
|
||||
|
||||
### Variables
|
||||
|
||||
* [EventEmitter](_ws_index_.wsprovider.eventemitter.md#eventemitter)
|
||||
|
||||
---
|
||||
|
||||
# Variables
|
||||
|
||||
<a id="eventemitter"></a>
|
||||
|
||||
## `<Const>` EventEmitter
|
||||
|
||||
**● EventEmitter**: *`EventEmitterStatic`*
|
||||
|
||||
*Defined in /home/travis/build/polkadot-js/api/node_modules/eventemitter3/index.d.ts:61*
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
[](https://polkadot.js.org)  [](https://github.com/Flet/semistandard) [](https://www.npmjs.com/package/@polkadot/rpc-rx) [](https://travis-ci.org/polkadot-js/api) [](https://codeclimate.com/github/polkadot-js/api/maintainability) [](https://coveralls.io/github/polkadot-js/api?branch=master) [](https://david-dm.org/polkadot-js/api?path=packages/rpc-rx) [](https://david-dm.org/polkadot-js/api?path=packages/rpc-rx#info=devDependencies)
|
||||
|
||||
@polkadot/rpc-rx
|
||||
================
|
||||
|
||||
An RxJs wrapper around the [@polkadot/api](../api).
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
* ["defaults"](modules/_defaults_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* [RpcRx](classes/_index_.rpcrx.md)
|
||||
* ["types.d"](modules/_types_d_.md)
|
||||
@@ -0,0 +1,98 @@
|
||||
|
||||
|
||||
*__name__*: RpcRx
|
||||
|
||||
*__summary__*: The RxJS API is a wrapper around the API.
|
||||
|
||||
*__description__*: It allows wrapping API components with observables using RxJS.
|
||||
|
||||
*__example__*:
|
||||
```javascript
|
||||
import Rpc from '@polkadot/rpc-rx';
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
|
||||
const provider = new WsProvider('http://127.0.0.1:9944');
|
||||
const api = new Rpc(provider);
|
||||
```
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**RpcRx**
|
||||
|
||||
# Implements
|
||||
|
||||
* `object`
|
||||
|
||||
# Constructors
|
||||
|
||||
<a id="constructor"></a>
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new RpcRx**(provider?: *`ProviderInterface`*): [RpcRx](_index_.rpcrx.md)
|
||||
|
||||
*Defined in [index.ts:46](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/index.ts#L46)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value | Description |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| `Default value` provider | `ProviderInterface` | new Ws(defaults.WS_URL) | An API provider using HTTP or WebSocket |
|
||||
|
||||
**Returns:** [RpcRx](_index_.rpcrx.md)
|
||||
|
||||
___
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="author"></a>
|
||||
|
||||
## author
|
||||
|
||||
**● author**: *[RxRpcInterface$Section](../modules/_types_d_.md#rxrpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:43](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/index.ts#L43)*
|
||||
|
||||
___
|
||||
<a id="chain"></a>
|
||||
|
||||
## chain
|
||||
|
||||
**● chain**: *[RxRpcInterface$Section](../modules/_types_d_.md#rxrpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:44](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/index.ts#L44)*
|
||||
|
||||
___
|
||||
<a id="state"></a>
|
||||
|
||||
## state
|
||||
|
||||
**● state**: *[RxRpcInterface$Section](../modules/_types_d_.md#rxrpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:45](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/index.ts#L45)*
|
||||
|
||||
___
|
||||
<a id="system"></a>
|
||||
|
||||
## system
|
||||
|
||||
**● system**: *[RxRpcInterface$Section](../modules/_types_d_.md#rxrpcinterface_section)*
|
||||
|
||||
*Defined in [index.ts:46](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/index.ts#L46)*
|
||||
|
||||
___
|
||||
|
||||
# Methods
|
||||
|
||||
<a id="isconnected"></a>
|
||||
|
||||
## isConnected
|
||||
|
||||
▸ **isConnected**(): `BehaviorSubject`<`boolean`>
|
||||
|
||||
*Defined in [index.ts:65](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/index.ts#L65)*
|
||||
|
||||
**Returns:** `BehaviorSubject`<`boolean`>
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,454 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>rpc-rx · 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-sunlight-highlighter/sunlight.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="classes/_index_.rxapi.md" />
|
||||
|
||||
|
||||
<link rel="prev" href="../rpc-provider/classes/_ws_index_.wsprovider.html" />
|
||||
|
||||
|
||||
</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">Packages</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.1" data-path="../">
|
||||
|
||||
<a href="../">
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.2" data-path="../rpc-core/">
|
||||
|
||||
<a href="../rpc-core/">
|
||||
|
||||
|
||||
rpc-core
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.2.1" data-path="../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
<a href="../rpc-core/classes/_index_.rpc.html">
|
||||
|
||||
|
||||
Rpc
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3" data-path="../rpc-provider/">
|
||||
|
||||
<a href="../rpc-provider/">
|
||||
|
||||
|
||||
rpc-provider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
<a href="../rpc-provider/classes/_http_index_.httpprovider.html">
|
||||
|
||||
|
||||
HttpProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
<a href="../rpc-provider/classes/_ws_index_.wsprovider.html">
|
||||
|
||||
|
||||
WsProvider
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="1.4" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
rpc-rx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.4.1" data-path="classes/_index_.rxapi.md">
|
||||
|
||||
<span>
|
||||
|
||||
|
||||
RpcRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="header">Examples</li>
|
||||
|
||||
|
||||
|
||||
<li class="chapter " data-level="2.1" data-path="../examples/">
|
||||
|
||||
<a href="../examples/">
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.2" data-path="../examples/01_simple_connect/">
|
||||
|
||||
<a href="../examples/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.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="2.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="2.5" data-path="../examples/04_generate_account/">
|
||||
|
||||
<a href="../examples/04_generate_account/">
|
||||
|
||||
|
||||
Generate Accounts
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.6" data-path="../examples/05_read_storage/">
|
||||
|
||||
<a href="../examples/05_read_storage/">
|
||||
|
||||
|
||||
Read Storage
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.7" data-path="../examples/06_craft_extrinsic/">
|
||||
|
||||
<a href="../examples/06_craft_extrinsic/">
|
||||
|
||||
|
||||
Craft Extrinsic
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="2.8" data-path="../examples/07_transfer_dots/">
|
||||
|
||||
<a href="../examples/07_transfer_dots/">
|
||||
|
||||
|
||||
Transfer DOTs
|
||||
|
||||
</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=".." >rpc-rx</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/rpc-rx" target="_blank"><img src="https://img.shields.io/npm/v/@polkadot/rpc-rx.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/rpc-rx" target="_blank"><img src="https://david-dm.org/polkadot-js/api.svg?style=flat-square&path=packages/rpc-rx" alt="dependency"></a> <a href="https://david-dm.org/polkadot-js/api?path=packages/rpc-rx#info=devDependencies" target="_blank"><img src="https://david-dm.org/polkadot-js/api/dev-status.svg?style=flat-square&path=packages/rpc-rx" alt="devDependency"></a></p>
|
||||
<h1 id="polkadotrpc-rx">@polkadot/rpc-rx</h1>
|
||||
<p>An RxJs wrapper around the <a href="../api">@polkadot/api</a>.</p>
|
||||
|
||||
|
||||
</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="../rpc-provider/classes/_ws_index_.wsprovider.html" class="navigation navigation-prev " aria-label="Previous page: WsProvider">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="classes/_index_.rxapi.md" class="navigation navigation-next " aria-label="Next page: RpcRx">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"rpc-rx","level":"1.4","depth":1,"next":{"title":"RpcRx","level":"1.4.1","depth":2,"path":"rpc-rx/classes/_index_.rxapi.md","ref":"rpc-rx/classes/_index_.rxapi.md","articles":[]},"previous":{"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","-highlight","sunlight-highlighter"],"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":{"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"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":"rpc-rx/README.md","mtime":"2018-10-10T08:04:32.480Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-10T08:05:29.107Z"},"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>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [RpcRx](../classes/_index_.rpcrx.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="rxrpcinterface"></a>
|
||||
|
||||
## RxRpcInterface
|
||||
|
||||
**Ƭ RxRpcInterface**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:15](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/types.d.ts#L15)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="rxrpcinterface_method"></a>
|
||||
|
||||
## RxRpcInterface$Method
|
||||
|
||||
**Ƭ RxRpcInterface$Method**: *`function`*
|
||||
|
||||
*Defined in [types.d.ts:9](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/types.d.ts#L9)*
|
||||
|
||||
#### Type declaration
|
||||
▸(...params: *`Array`<`any`>*): `Observable`<`any`> | `BehaviorSubject`<`any`>
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Rest` params | `Array`<`any`> |
|
||||
|
||||
**Returns:** `Observable`<`any`> | `BehaviorSubject`<`any`>
|
||||
|
||||
___
|
||||
<a id="rxrpcinterface_section"></a>
|
||||
|
||||
## RxRpcInterface$Section
|
||||
|
||||
**Ƭ RxRpcInterface$Section**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:11](https://github.com/polkadot-js/api/blob/4344f33/packages/rpc-rx/src/types.d.ts#L11)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
[index: `string`]: [RxRpcInterface$Method](_types_d_.md#rxrpcinterface_method)
|
||||
|
||||
___
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
|
||||
@polkadot/extrinsics
|
||||
====================
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
* ["fromMetadata"](modules/_frommetadata_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* ["static"](modules/_static_.md)
|
||||
* ["types.d"](modules/_types_d_.md)
|
||||
* [ExtrinsicFunction](interfaces/_types_d_.extrinsicfunction.md)
|
||||
* [Extrinsics](interfaces/_types_d_.extrinsics.md)
|
||||
* [ModuleExtrinsics](interfaces/_types_d_.moduleextrinsics.md)
|
||||
* ["utils/createUnchecked"](modules/_utils_createunchecked_.md)
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**ExtrinsicFunction**
|
||||
|
||||
# Callable
|
||||
▸ **__call**(...args: *`any`[]*): `Extrinsic`
|
||||
|
||||
*Defined in [types.d.ts:8](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/types.d.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Rest` args | `any`[] |
|
||||
|
||||
**Returns:** `Extrinsic`
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="callindex"></a>
|
||||
|
||||
## callIndex
|
||||
|
||||
**● callIndex**: *`Uint8Array`*
|
||||
|
||||
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/types.d.ts#L10)*
|
||||
|
||||
___
|
||||
<a id="meta"></a>
|
||||
|
||||
## meta
|
||||
|
||||
**● meta**: *`FunctionMetadata`*
|
||||
|
||||
*Defined in [types.d.ts:11](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/types.d.ts#L11)*
|
||||
|
||||
___
|
||||
<a id="method"></a>
|
||||
|
||||
## method
|
||||
|
||||
**● method**: *`string`*
|
||||
|
||||
*Defined in [types.d.ts:12](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/types.d.ts#L12)*
|
||||
|
||||
___
|
||||
<a id="section"></a>
|
||||
|
||||
## section
|
||||
|
||||
**● section**: *`string`*
|
||||
|
||||
*Defined in [types.d.ts:13](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/types.d.ts#L13)*
|
||||
|
||||
___
|
||||
<a id="tojson"></a>
|
||||
|
||||
## toJSON
|
||||
|
||||
**● toJSON**: *`function`*
|
||||
|
||||
*Defined in [types.d.ts:14](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/types.d.ts#L14)*
|
||||
|
||||
#### Type declaration
|
||||
▸(): `any`
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**Extrinsics**
|
||||
|
||||
# Indexable
|
||||
|
||||
\[key: `string`\]: [ModuleExtrinsics](_types_d_.moduleextrinsics.md)
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**ModuleExtrinsics**
|
||||
|
||||
# Indexable
|
||||
|
||||
\[key: `string`\]: [ExtrinsicFunction](_types_d_.extrinsicfunction.md)
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="frommetadata"></a>
|
||||
|
||||
## fromMetadata
|
||||
|
||||
▸ **fromMetadata**(metadata: *`Metadata`*): [Extrinsics](../interfaces/_types_d_.extrinsics.md)
|
||||
|
||||
*Defined in [fromMetadata.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/fromMetadata.ts#L19)*
|
||||
|
||||
Extend a storage object with the storage modules & module functions present in the metadata.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| metadata | `Metadata` | The metadata to extend the storage object against. |
|
||||
|
||||
**Returns:** [Extrinsics](../interfaces/_types_d_.extrinsics.md)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="createdescriptor"></a>
|
||||
|
||||
## createDescriptor
|
||||
|
||||
▸ **createDescriptor**(section: *`string`*, method: *`string`*, index: *`number`*, meta: *`FunctionMetadata`*): [ExtrinsicFunction](../interfaces/_types_d_.extrinsicfunction.md)
|
||||
|
||||
*Defined in [utils/createUnchecked.ts:16](https://github.com/polkadot-js/api/blob/4344f33/packages/type-extrinsics/src/utils/createUnchecked.ts#L16)*
|
||||
|
||||
From the metadata of a function in the module's storage, generate the function that will return the an UncheckExtrinsic.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| section | `string` |
|
||||
| method | `string` |
|
||||
| index | `number` | Index of the module section in the modules array. |
|
||||
| meta | `FunctionMetadata` |
|
||||
|
||||
**Returns:** [ExtrinsicFunction](../interfaces/_types_d_.extrinsicfunction.md)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
[](https://polkadot.js.org)  [](https://github.com/Flet/semistandard) [](https://www.npmjs.com/package/@polkadot/jsonrpc) [](https://travis-ci.org/polkadot-js/api) [](https://codeclimate.com/github/polkadot-js/api/maintainability) [](https://coveralls.io/github/polkadot-js/api?branch=master) [](https://david-dm.org/polkadot-js/api?path=packages/type-jsonrpc) [](https://david-dm.org/polkadot-js/api?path=packages/type-jsonrpc#info=devDependencies)
|
||||
|
||||
@polkadot/jsonrpc
|
||||
=================
|
||||
|
||||
A defintion of all the methods exposed in a general Polkadot client application. These are used not only to provide a comprehensive code-generated document of the available methods, but are also used in the API to auto-generate endpoints with the required type-checking.
|
||||
|
||||
For a list of currently exposed methods, see the [method documentation](docs/README.md).
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Installation -
|
||||
|
||||
```
|
||||
npm install --save @polkadot/jsonrpc
|
||||
```
|
||||
|
||||
Adding methods
|
||||
--------------
|
||||
|
||||
As methods are added, simply adding the name, inputs & output will prepare it for use.
|
||||
|
||||
* Add the method to the correct file in [src/rpc/](src/rpc/) (Input/Output types as cross-referenced from the canonical implementation and match one-to-one)
|
||||
* Should a new type be required, add it to the type list, [src/types.js](src/types.js) (Required for flow type checking)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
* ["author"](modules/_author_.md)
|
||||
* ["chain"](modules/_chain_.md)
|
||||
* ["create/method"](modules/_create_method_.md)
|
||||
* ["create/param"](modules/_create_param_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* ["state"](modules/_state_.md)
|
||||
* ["system"](modules/_system_.md)
|
||||
* ["types.d"](modules/_types_d_.md)
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="createmethod"></a>
|
||||
|
||||
## createMethod
|
||||
|
||||
▸ **createMethod**(section: *`string`*, method: *`string`*, __namedParameters: *`object`*): [RpcMethod](_types_d_.md#rpcmethod)
|
||||
|
||||
*Defined in [create/method.ts:9](https://github.com/polkadot-js/api/blob/4344f33/packages/type-jsonrpc/src/create/method.ts#L9)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| section | `string` |
|
||||
| method | `string` |
|
||||
| __namedParameters | `object` |
|
||||
|
||||
**Returns:** [RpcMethod](_types_d_.md#rpcmethod)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="createparam"></a>
|
||||
|
||||
## createParam
|
||||
|
||||
▸ **createParam**(name: *`string`*, type: *`CodecTypes`*, __namedParameters?: *`object`*): [RpcParam](_types_d_.md#rpcparam)
|
||||
|
||||
*Defined in [create/param.ts:12](https://github.com/polkadot-js/api/blob/4344f33/packages/type-jsonrpc/src/create/param.ts#L12)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value |
|
||||
| ------ | ------ | ------ |
|
||||
| name | `string` | - |
|
||||
| type | `CodecTypes` | - |
|
||||
| `Default value` __namedParameters | `object` | { isOptional: false } |
|
||||
|
||||
**Returns:** [RpcParam](_types_d_.md#rpcparam)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="rpcmethod"></a>
|
||||
|
||||
## RpcMethod
|
||||
|
||||
**Ƭ RpcMethod**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:24](https://github.com/polkadot-js/api/blob/4344f33/packages/type-jsonrpc/src/types.d.ts#L24)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="rpcmethodopt"></a>
|
||||
|
||||
## RpcMethodOpt
|
||||
|
||||
**Ƭ RpcMethodOpt**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:13](https://github.com/polkadot-js/api/blob/4344f33/packages/type-jsonrpc/src/types.d.ts#L13)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="rpcparam"></a>
|
||||
|
||||
## RpcParam
|
||||
|
||||
**Ƭ RpcParam**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:7](https://github.com/polkadot-js/api/blob/4344f33/packages/type-jsonrpc/src/types.d.ts#L7)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="rpcsection"></a>
|
||||
|
||||
## RpcSection
|
||||
|
||||
**Ƭ RpcSection**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:38](https://github.com/polkadot-js/api/blob/4344f33/packages/type-jsonrpc/src/types.d.ts#L38)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
[](https://polkadot.js.org)  [](https://github.com/Flet/semistandard) [](https://www.npmjs.com/package/@polkadot/storage) [](https://travis-ci.org/polkadot-js/api) [](https://codeclimate.com/github/polkadot-js/api/maintainability) [](https://coveralls.io/github/polkadot-js/api?branch=master) [](https://david-dm.org/polkadot-js/api?path=packages/type-storage) [](https://david-dm.org/polkadot-js/api?path=packages/type-storage#info=devDependencies)
|
||||
|
||||
@polkadot/storage
|
||||
=================
|
||||
|
||||
An base interface to the storage layer
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
* ["fromMetadata"](modules/_frommetadata_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* ["static"](modules/_static_.md)
|
||||
* ["storage"](modules/_storage_.md)
|
||||
* ["substrate"](modules/_substrate_.md)
|
||||
* ["types.d"](modules/_types_d_.md)
|
||||
* [ModuleStorage](interfaces/_types_d_.modulestorage.md)
|
||||
* [Storage](interfaces/_types_d_.storage.md)
|
||||
* ["utils/createFunction"](modules/_utils_createfunction_.md)
|
||||
* [CreateItemOptions](interfaces/_utils_createfunction_.createitemoptions.md)
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**ModuleStorage**
|
||||
|
||||
# Indexable
|
||||
|
||||
\[key: `string`\]: `StorageFunction`
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**Storage**
|
||||
|
||||
# Indexable
|
||||
|
||||
\[key: `string`\]: [ModuleStorage](_types_d_.modulestorage.md)
|
||||
# Properties
|
||||
|
||||
<a id="substrate"></a>
|
||||
|
||||
## substrate
|
||||
|
||||
**● substrate**: *`object`*
|
||||
|
||||
*Defined in [types.d.ts:18](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/types.d.ts#L18)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**CreateItemOptions**
|
||||
|
||||
# Properties
|
||||
|
||||
<a id="isunhashed"></a>
|
||||
|
||||
## `<Optional>` isUnhashed
|
||||
|
||||
**● isUnhashed**: * `undefined` | `false` | `true`
|
||||
*
|
||||
|
||||
*Defined in [utils/createFunction.ts:15](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/utils/createFunction.ts#L15)*
|
||||
|
||||
___
|
||||
<a id="method"></a>
|
||||
|
||||
## `<Optional>` method
|
||||
|
||||
**● method**: * `undefined` | `string`
|
||||
*
|
||||
|
||||
*Defined in [utils/createFunction.ts:16](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/utils/createFunction.ts#L16)*
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="frommetadata"></a>
|
||||
|
||||
## fromMetadata
|
||||
|
||||
▸ **fromMetadata**(metadata: *`Metadata`*): [Storage](../interfaces/_types_d_.storage.md)
|
||||
|
||||
*Defined in [fromMetadata.ts:20](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/fromMetadata.ts#L20)*
|
||||
|
||||
Extend a storage object with the storage modules & module functions present in the metadata.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Description |
|
||||
| ------ | ------ | ------ |
|
||||
| metadata | `Metadata` | The metadata to extend the storage object against. |
|
||||
|
||||
**Returns:** [Storage](../interfaces/_types_d_.storage.md)
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Object literals
|
||||
|
||||
<a id="storage"></a>
|
||||
|
||||
## `<Const>` storage
|
||||
|
||||
**storage**: *`object`*
|
||||
|
||||
*Defined in [storage.ts:8](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/storage.ts#L8)*
|
||||
|
||||
<a id="storage.substrate"></a>
|
||||
|
||||
### substrate
|
||||
|
||||
**● substrate**: *["substrate"](_substrate_.md)*
|
||||
|
||||
*Defined in [storage.ts:9](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/storage.ts#L9)*
|
||||
|
||||
___
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
|
||||
# Variables
|
||||
|
||||
<a id="authoritycount"></a>
|
||||
|
||||
## `<Const>` authorityCount
|
||||
|
||||
**● authorityCount**: *`StorageFunction`* = createRuntimeFunction('authorityCount', ':auth:len', {
|
||||
documentation: 'Number of authorities.',
|
||||
type: 'u32'
|
||||
})
|
||||
|
||||
*Defined in [substrate.ts:44](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/substrate.ts#L44)*
|
||||
|
||||
___
|
||||
<a id="authorityprefix"></a>
|
||||
|
||||
## `<Const>` authorityPrefix
|
||||
|
||||
**● authorityPrefix**: *`StorageFunction`* = createRuntimeFunction('authorityPrefix', ':auth:', {
|
||||
documentation: 'Prefix under which authorities are storied.',
|
||||
type: 'u32'
|
||||
})
|
||||
|
||||
*Defined in [substrate.ts:49](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/substrate.ts#L49)*
|
||||
|
||||
___
|
||||
<a id="changestrieconfig"></a>
|
||||
|
||||
## `<Const>` changesTrieConfig
|
||||
|
||||
**● changesTrieConfig**: *`StorageFunction`* = createRuntimeFunction('changesTrieConfig', ':changes_trie', {
|
||||
documentation: 'Changes trie configuration is stored under this key.',
|
||||
type: 'u32'
|
||||
})
|
||||
|
||||
*Defined in [substrate.ts:59](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/substrate.ts#L59)*
|
||||
|
||||
___
|
||||
<a id="code"></a>
|
||||
|
||||
## `<Const>` code
|
||||
|
||||
**● code**: *`StorageFunction`* = createRuntimeFunction('code', ':code', {
|
||||
documentation: 'Wasm code of the runtime.',
|
||||
type: 'Bytes'
|
||||
})
|
||||
|
||||
*Defined in [substrate.ts:34](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/substrate.ts#L34)*
|
||||
|
||||
___
|
||||
<a id="extrinsicindex"></a>
|
||||
|
||||
## `<Const>` extrinsicIndex
|
||||
|
||||
**● extrinsicIndex**: *`StorageFunction`* = createRuntimeFunction('extrinsicIndex', ':extrinsic_index', {
|
||||
documentation: 'Current extrinsic index (u32) is stored under this key.',
|
||||
type: 'u32'
|
||||
})
|
||||
|
||||
*Defined in [substrate.ts:54](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/substrate.ts#L54)*
|
||||
|
||||
___
|
||||
<a id="heappages"></a>
|
||||
|
||||
## `<Const>` heapPages
|
||||
|
||||
**● heapPages**: *`StorageFunction`* = createRuntimeFunction('heapPages', ':heappages', {
|
||||
documentation: 'Number of wasm linear memory pages required for execution of the runtime.',
|
||||
type: 'u64'
|
||||
})
|
||||
|
||||
*Defined in [substrate.ts:39](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/substrate.ts#L39)*
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="createfunction"></a>
|
||||
|
||||
## createFunction
|
||||
|
||||
▸ **createFunction**(section: *`Text`*, method: *`Text`*, meta: *`StorageFunctionMetadata`*, options?: *[CreateItemOptions](../interfaces/_utils_createfunction_.createitemoptions.md)*): `StorageFunction`
|
||||
|
||||
*Defined in [utils/createFunction.ts:29](https://github.com/polkadot-js/api/blob/4344f33/packages/type-storage/src/utils/createFunction.ts#L29)*
|
||||
|
||||
From the schema of a function in the module's storage, generate the function that will return the correct storage key.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value | Description |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| section | `Text` | - |
|
||||
| method | `Text` | - |
|
||||
| meta | `StorageFunctionMetadata` | - |
|
||||
| `Default value` options | [CreateItemOptions](../interfaces/_utils_createfunction_.createitemoptions.md) | {} | Additional options when creating the function. These options are not known at runtime (from state_getMetadata), they need to be supplied by us manually at compile time. |
|
||||
|
||||
**Returns:** `StorageFunction`
|
||||
|
||||
___
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
*Overrides [U8aFixed](_codec_u8afixed_.u8afixed.md).[constructor](_codec_u8afixed_.u8afixed.md#constructor)*
|
||||
|
||||
*Defined in [AccountId.ts:20](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L20)*
|
||||
*Defined in [AccountId.ts:20](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L20)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -40,7 +40,7 @@ ___
|
||||
|
||||
*Inherited from [U8aFixed](_codec_u8afixed_.u8afixed.md).[_bitLength](_codec_u8afixed_.u8afixed.md#_bitlength)*
|
||||
|
||||
*Defined in [codec/U8aFixed.ts:14](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8aFixed.ts#L14)*
|
||||
*Defined in [codec/U8aFixed.ts:14](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8aFixed.ts#L14)*
|
||||
|
||||
___
|
||||
<a id="raw"></a>
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
*Inherited from [Base](_codec_base_.base.md).[raw](_codec_base_.base.md#raw)*
|
||||
|
||||
*Defined in [codec/Base.ts:19](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Base.ts#L19)*
|
||||
*Defined in [codec/Base.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Base.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
@@ -65,7 +65,7 @@ getlength(): `number`
|
||||
|
||||
*Inherited from [U8a](_codec_u8a_.u8a.md).[length](_codec_u8a_.u8a.md#length)*
|
||||
|
||||
*Defined in [codec/U8a.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L33)*
|
||||
*Defined in [codec/U8a.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L33)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -83,7 +83,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[byteLength](_codec_u8a_.u8a.md#bytelength)*
|
||||
|
||||
*Defined in [codec/U8aFixed.ts:32](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8aFixed.ts#L32)*
|
||||
*Defined in [codec/U8aFixed.ts:32](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8aFixed.ts#L32)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -96,7 +96,7 @@ ___
|
||||
|
||||
*Overrides [U8aFixed](_codec_u8afixed_.u8afixed.md).[fromJSON](_codec_u8afixed_.u8afixed.md#fromjson)*
|
||||
|
||||
*Defined in [AccountId.ts:44](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L44)*
|
||||
*Defined in [AccountId.ts:44](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L44)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -115,7 +115,7 @@ ___
|
||||
|
||||
*Overrides [U8aFixed](_codec_u8afixed_.u8afixed.md).[fromU8a](_codec_u8afixed_.u8afixed.md#fromu8a)*
|
||||
|
||||
*Defined in [AccountId.ts:50](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L50)*
|
||||
*Defined in [AccountId.ts:50](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L50)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -134,7 +134,7 @@ ___
|
||||
|
||||
*Inherited from [U8a](_codec_u8a_.u8a.md).[toHex](_codec_u8a_.u8a.md#tohex)*
|
||||
|
||||
*Defined in [codec/U8a.ts:53](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L53)*
|
||||
*Defined in [codec/U8a.ts:53](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L53)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -147,7 +147,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[toJSON](_codec_u8a_.u8a.md#tojson)*
|
||||
|
||||
*Defined in [AccountId.ts:56](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L56)*
|
||||
*Defined in [AccountId.ts:56](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L56)*
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
@@ -160,7 +160,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[toString](_codec_u8a_.u8a.md#tostring)*
|
||||
|
||||
*Defined in [AccountId.ts:60](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L60)*
|
||||
*Defined in [AccountId.ts:60](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L60)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -175,7 +175,7 @@ ___
|
||||
|
||||
*Overrides [Base](_codec_base_.base.md).[toU8a](_codec_base_.base.md#tou8a)*
|
||||
|
||||
*Defined in [codec/U8a.ts:61](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L61)*
|
||||
*Defined in [codec/U8a.ts:61](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L61)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -192,7 +192,7 @@ ___
|
||||
|
||||
▸ **decode**(value: * `string` | `Uint8Array` | `Array`<`number`>*): `Uint8Array`
|
||||
|
||||
*Defined in [AccountId.ts:34](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L34)*
|
||||
*Defined in [AccountId.ts:34](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L34)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -211,7 +211,7 @@ ___
|
||||
|
||||
*Inherited from [U8a](_codec_u8a_.u8a.md).[decodeU8a](_codec_u8a_.u8a.md#decodeu8a)*
|
||||
|
||||
*Defined in [codec/U8a.ts:23](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L23)*
|
||||
*Defined in [codec/U8a.ts:23](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L23)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -228,7 +228,7 @@ ___
|
||||
|
||||
▸ **encode**(value: *`Uint8Array`*): `string`
|
||||
|
||||
*Defined in [AccountId.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountId.ts#L30)*
|
||||
*Defined in [AccountId.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountId.ts#L30)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[constructor](_codec_u8a_.u8a.md#constructor)*
|
||||
|
||||
*Defined in [AccountIndex.ts:15](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L15)*
|
||||
*Defined in [AccountIndex.ts:15](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -38,7 +38,7 @@ ___
|
||||
|
||||
*Inherited from [Base](_codec_base_.base.md).[raw](_codec_base_.base.md#raw)*
|
||||
|
||||
*Defined in [codec/Base.ts:19](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/Base.ts#L19)*
|
||||
*Defined in [codec/Base.ts:19](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/Base.ts#L19)*
|
||||
|
||||
___
|
||||
|
||||
@@ -52,7 +52,7 @@ getlength(): `number`
|
||||
|
||||
*Inherited from [U8a](_codec_u8a_.u8a.md).[length](_codec_u8a_.u8a.md#length)*
|
||||
|
||||
*Defined in [codec/U8a.ts:33](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L33)*
|
||||
*Defined in [codec/U8a.ts:33](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L33)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -70,7 +70,7 @@ ___
|
||||
|
||||
*Overrides [Base](_codec_base_.base.md).[byteLength](_codec_base_.base.md#bytelength)*
|
||||
|
||||
*Defined in [codec/U8a.ts:37](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L37)*
|
||||
*Defined in [codec/U8a.ts:37](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L37)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -83,7 +83,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[fromJSON](_codec_u8a_.u8a.md#fromjson)*
|
||||
|
||||
*Defined in [AccountIndex.ts:51](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L51)*
|
||||
*Defined in [AccountIndex.ts:51](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L51)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -102,7 +102,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[fromU8a](_codec_u8a_.u8a.md#fromu8a)*
|
||||
|
||||
*Defined in [AccountIndex.ts:57](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L57)*
|
||||
*Defined in [AccountIndex.ts:57](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L57)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -121,7 +121,7 @@ ___
|
||||
|
||||
*Inherited from [U8a](_codec_u8a_.u8a.md).[toHex](_codec_u8a_.u8a.md#tohex)*
|
||||
|
||||
*Defined in [codec/U8a.ts:53](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L53)*
|
||||
*Defined in [codec/U8a.ts:53](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L53)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -134,7 +134,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[toJSON](_codec_u8a_.u8a.md#tojson)*
|
||||
|
||||
*Defined in [AccountIndex.ts:65](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L65)*
|
||||
*Defined in [AccountIndex.ts:65](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L65)*
|
||||
|
||||
**Returns:** `any`
|
||||
|
||||
@@ -147,7 +147,7 @@ ___
|
||||
|
||||
*Overrides [U8a](_codec_u8a_.u8a.md).[toString](_codec_u8a_.u8a.md#tostring)*
|
||||
|
||||
*Defined in [AccountIndex.ts:69](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L69)*
|
||||
*Defined in [AccountIndex.ts:69](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L69)*
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
@@ -162,7 +162,7 @@ ___
|
||||
|
||||
*Overrides [Base](_codec_base_.base.md).[toU8a](_codec_base_.base.md#tou8a)*
|
||||
|
||||
*Defined in [codec/U8a.ts:61](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L61)*
|
||||
*Defined in [codec/U8a.ts:61](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L61)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -179,7 +179,7 @@ ___
|
||||
|
||||
▸ **decode**(value: * `string` | `Uint8Array` | `Array`<`number`>*): `Uint8Array`
|
||||
|
||||
*Defined in [AccountIndex.ts:30](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L30)*
|
||||
*Defined in [AccountIndex.ts:30](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L30)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -198,7 +198,7 @@ ___
|
||||
|
||||
*Inherited from [U8a](_codec_u8a_.u8a.md).[decodeU8a](_codec_u8a_.u8a.md#decodeu8a)*
|
||||
|
||||
*Defined in [codec/U8a.ts:23](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/codec/U8a.ts#L23)*
|
||||
*Defined in [codec/U8a.ts:23](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/codec/U8a.ts#L23)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -215,7 +215,7 @@ ___
|
||||
|
||||
▸ **encode**(value: *`Uint8Array`*): `string`
|
||||
|
||||
*Defined in [AccountIndex.ts:26](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L26)*
|
||||
*Defined in [AccountIndex.ts:26](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L26)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -232,7 +232,7 @@ ___
|
||||
|
||||
▸ **readLength**(input: *`Uint8Array`*): `number`
|
||||
|
||||
*Defined in [AccountIndex.ts:35](https://github.com/polkadot-js/api/blob/7f270cb/packages/types/src/AccountIndex.ts#L35)*
|
||||
*Defined in [AccountIndex.ts:35](https://github.com/polkadot-js/api/blob/4344f33/packages/types/src/AccountIndex.ts#L35)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user