[CI Skip] 0.31.77

This commit is contained in:
Travis CI
2018-10-24 15:51:55 +00:00
parent eb143b3fdd
commit 3480c918d8
184 changed files with 2014 additions and 1974 deletions
+13 -8
View File
@@ -24,11 +24,12 @@
⊕ **new ApiBase**(wsProvider?: *`WsProvider`*): [ApiBase](_base_.apibase.md)
*Defined in [Base.ts:38](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L38)*
*Defined in [Base.ts:38](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L38)*
*__description__*: Create an instance of the class
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
@@ -57,7 +58,7 @@ ___
getgenesisHash(): `Hash`
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L69)*
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L69)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
@@ -70,13 +71,14 @@ ___
getquery(): `S`
*Defined in [Base.ts:107](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L107)*
*Defined in [Base.ts:107](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L107)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
@@ -92,13 +94,14 @@ ___
getrpc(): `R`
*Defined in [Base.ts:127](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L127)*
*Defined in [Base.ts:127](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L127)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
@@ -114,7 +117,7 @@ ___
getruntimeMetadata(): `RuntimeMetadata`
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L78)*
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L78)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
@@ -127,7 +130,7 @@ ___
getruntimeVersion(): `RuntimeVersion`
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L87)*
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L87)*
*__description__*: Contains the version information for the current runtime.
@@ -140,11 +143,12 @@ ___
gettx(): `E`
*Defined in [Base.ts:146](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L146)*
*Defined in [Base.ts:146](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L146)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
@@ -166,11 +170,12 @@ ___
▸ **on**(type: *`ApiInterface$Events`*, handler: *`function`*): `void`
*Defined in [Base.ts:171](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L171)*
*Defined in [Base.ts:171](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L171)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('disconnected', () => {
console.log('API has been connected to the endpoint');
@@ -12,7 +12,7 @@
⊕ **new Combinator**(fns: *`Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction)>*, callback: *[CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback)*): [Combinator](_promise_combinator_.combinator.md)
*Defined in [promise/Combinator.ts:14](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/Combinator.ts#L14)*
*Defined in [promise/Combinator.ts:14](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/Combinator.ts#L14)*
**Parameters:**
@@ -469,7 +469,7 @@
<h2 id="constructor">constructor</h2>
<p>&#x2295; <strong>new ApiPromise</strong>(wsProvider?: <em><code>WsProvider</code></em>): <a href="_promise_index_.apipromise.html">ApiPromise</a></p>
<p><em>Overrides <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#constructor">constructor</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L128" target="_blank">promise/index.ts:128</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L128" target="_blank">promise/index.ts:128</a></em></p>
<p><em><strong>description</strong></em>: Creates an instance of the ApiPromise class</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>&#xA0;<span class="sunlight-ident">Api</span>&#xA0;<span class="sunlight-ident">from</span>&#xA0;<span class="sunlight-string">&apos;@polkadot/api/promise&apos;</span><span class="sunlight-punctuation">;</span>
@@ -504,14 +504,14 @@
<h2 id="genesishash">genesisHash</h2>
<p>getgenesisHash(): <code>Hash</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#genesishash">genesisHash</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L69" target="_blank">Base.ts:69</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L69" target="_blank">Base.ts:69</a></em></p>
<p><em><strong>description</strong></em>: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.</p>
<p><strong>Returns:</strong> <code>Hash</code></p>
<hr>
<p><a id="isready"></a></p>
<h2 id="isready">isReady</h2>
<p>getisReady(): <code>Promise</code>&lt;<a href="_promise_index_.apipromise.html">ApiPromise</a>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L161" target="_blank">promise/index.ts:161</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L161" target="_blank">promise/index.ts:161</a></em></p>
<p><em><strong>description</strong></em>: Promise that returns the first time we are connected and loaded</p>
<p><strong>Returns:</strong> <code>Promise</code>&lt;<a href="_promise_index_.apipromise.html">ApiPromise</a>&gt;</p>
<hr>
@@ -519,7 +519,7 @@
<h2 id="query">query</h2>
<p>getquery(): <code>QueryableStorage</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#query">query</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L107" target="_blank">Base.ts:107</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L107" target="_blank">Base.ts:107</a></em></p>
<p><em><strong>description</strong></em>: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.</p>
<p>All calls inside the namespace, is denoted by <code>section</code>.<code>method</code> and may take an optional query parameter. As an example, <code>api.query.timestamp.now()</code> (current block timestamp) does not take parameters, while <code>api.query.system.accountNonce(&lt;accountId&gt;)</code> (retrieving the associated nonce for an account), takes the <code>AccountId</code> as a parameter.</p>
<p><em><strong>example</strong></em>: </p>
@@ -533,7 +533,7 @@
<h2 id="rpc">rpc</h2>
<p>getrpc(): <code>Rpc</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#rpc">rpc</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L127" target="_blank">Base.ts:127</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L127" target="_blank">Base.ts:127</a></em></p>
<p><em><strong>description</strong></em>: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic <code>api.query</code> and <code>api.tx</code> sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.</p>
<p>RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.</p>
<p><em><strong>example</strong></em>: </p>
@@ -547,7 +547,7 @@
<h2 id="runtimemetadata">runtimeMetadata</h2>
<p>getruntimeMetadata(): <code>RuntimeMetadata</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#runtimemetadata">runtimeMetadata</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L78" target="_blank">Base.ts:78</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L78" target="_blank">Base.ts:78</a></em></p>
<p><em><strong>description</strong></em>: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics &amp; storage, but is useful for current runtime inspection.</p>
<p><strong>Returns:</strong> <code>RuntimeMetadata</code></p>
<hr>
@@ -555,7 +555,7 @@
<h2 id="runtimeversion">runtimeVersion</h2>
<p>getruntimeVersion(): <code>RuntimeVersion</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#runtimeversion">runtimeVersion</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L87" target="_blank">Base.ts:87</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L87" target="_blank">Base.ts:87</a></em></p>
<p><em><strong>description</strong></em>: Contains the version information for the current runtime.</p>
<p><strong>Returns:</strong> <code>RuntimeVersion</code></p>
<hr>
@@ -563,7 +563,7 @@
<h2 id="tx">tx</h2>
<p>gettx(): <code>SubmittableExtrinsics</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#tx">tx</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L146" target="_blank">Base.ts:146</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L146" target="_blank">Base.ts:146</a></em></p>
<p><em><strong>description</strong></em>: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.</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-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">tx</span><span class="sunlight-operator">.</span><span class="sunlight-ident">balances</span>
@@ -579,7 +579,7 @@
<p><a id="combinelatest"></a></p>
<h2 id="combinelatest">combineLatest</h2>
<p>&#x25B8; <strong>combineLatest</strong>(fns: <em><code>Array</code>&lt;<a href="../modules/_promise_combinator_.md#combinatorfunction">CombinatorFunction</a>&gt;</em>, callback: <em><a href="../modules/_promise_combinator_.md#combinatorcallback">CombinatorCallback</a></em>): <a href="_promise_combinator_.combinator.md">Combinator</a></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L189" target="_blank">promise/index.ts:189</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L189" target="_blank">promise/index.ts:189</a></em></p>
<p><em><strong>description</strong></em>: Creates a combinator that can be used to combine the latest results from multiple subscriptions</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>&#xA0;<span class="sunlight-ident">address</span>&#xA0;<span class="sunlight-operator">=</span>&#xA0;<span class="sunlight-string">&apos;5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFacT7&apos;</span><span class="sunlight-punctuation">;</span>
@@ -606,7 +606,7 @@
<tr>
<td>fns</td>
<td><code>Array</code>&lt;<a href="../modules/_promise_combinator_.md#combinatorfunction">CombinatorFunction</a>&gt;</td>
<td>An array of function to combine, each in the form of <code>(cb: (value: void)) =&gt; void</code></td>
<td>An array of function to combine, each in the form of `(cb: (value: void)) =&gt; void`</td>
</tr>
<tr>
<td>callback</td>
@@ -621,7 +621,7 @@
<h2 id="on">on</h2>
<p>&#x25B8; <strong>on</strong>(type: <em><code>ApiInterface$Events</code></em>, handler: <em><code>function</code></em>): <code>void</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#on">on</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L171" target="_blank">Base.ts:171</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L171" target="_blank">Base.ts:171</a></em></p>
<p><em><strong>description</strong></em>: Attach an eventemitter handler to listen 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-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">on</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">&apos;disconnected&apos;</span><span class="sunlight-punctuation">,</span>&#xA0;<span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span>&#xA0;<span class="sunlight-operator">=</span><span class="sunlight-operator">&gt;</span>&#xA0;<span class="sunlight-punctuation">{</span>
@@ -659,7 +659,7 @@
<p><a id="create"></a></p>
<h2 id="static-create"><code>&lt;Static&gt;</code> create</h2>
<p>&#x25B8; <strong>create</strong>(wsProvider?: <em><code>WsProvider</code></em>): <code>Promise</code>&lt;<a href="_promise_index_.apipromise.html">ApiPromise</a>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L126" target="_blank">promise/index.ts:126</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L126" target="_blank">promise/index.ts:126</a></em></p>
<p><em><strong>description</strong></em>: Creates an ApiPromise instance using the supplied provider. Returns an Promise containing the actual Api instance.</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>&#xA0;<span class="sunlight-ident">Api</span>&#xA0;<span class="sunlight-ident">from</span>&#xA0;<span class="sunlight-string">&apos;@polkadot/api/promise&apos;</span><span class="sunlight-punctuation">;</span>
@@ -732,7 +732,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"ApiPromise","level":"1.2.1","depth":2,"next":{"title":"ApiRx","level":"1.2.2","depth":2,"path":"api/classes/_rx_index_.apirx.md","ref":"api/classes/_rx_index_.apirx.md","articles":[]},"previous":{"title":"api","level":"1.2","depth":1,"path":"api/README.md","ref":"api/README.md","articles":[{"title":"ApiPromise","level":"1.2.1","depth":2,"path":"api/classes/_promise_index_.apipromise.md","ref":"api/classes/_promise_index_.apipromise.md","articles":[]},{"title":"ApiRx","level":"1.2.2","depth":2,"path":"api/classes/_rx_index_.apirx.md","ref":"api/classes/_rx_index_.apirx.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/classes/_promise_index_.apipromise.md","mtime":"2018-10-24T12:44:15.663Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T12:45:52.736Z"},"basePath":"../..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"ApiPromise","level":"1.2.1","depth":2,"next":{"title":"ApiRx","level":"1.2.2","depth":2,"path":"api/classes/_rx_index_.apirx.md","ref":"api/classes/_rx_index_.apirx.md","articles":[]},"previous":{"title":"api","level":"1.2","depth":1,"path":"api/README.md","ref":"api/README.md","articles":[{"title":"ApiPromise","level":"1.2.1","depth":2,"path":"api/classes/_promise_index_.apipromise.md","ref":"api/classes/_promise_index_.apipromise.md","articles":[]},{"title":"ApiRx","level":"1.2.2","depth":2,"path":"api/classes/_rx_index_.apirx.md","ref":"api/classes/_rx_index_.apirx.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/classes/_promise_index_.apipromise.md","mtime":"2018-10-24T15:50:35.446Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T15:51:47.492Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>
+21 -12
View File
@@ -29,6 +29,7 @@ api.rpc.chain.subscribeNewHead((header) => {
console.log(`Chain is at #${header.blockNumber}`);
});
```
Subscribing to chain state -
@@ -57,6 +58,7 @@ api.query.timestamp.now((timestamp) => {
console.log(`timestamp ${timestamp}${elapsed} (${blockPeriod}s target)`);
});
```
Submitting a transaction -
@@ -104,11 +106,12 @@ ApiPromise.create().then((api) => {
*Overrides [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
*Defined in [promise/index.ts:128](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L128)*
*Defined in [promise/index.ts:128](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L128)*
*__description__*: Creates an instance of the ApiPromise class
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
@@ -139,7 +142,7 @@ getgenesisHash(): `Hash`
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L69)*
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L69)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
@@ -152,7 +155,7 @@ ___
getisReady(): `Promise`<[ApiPromise](_promise_index_.apipromise.md)>
*Defined in [promise/index.ts:161](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L161)*
*Defined in [promise/index.ts:161](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L161)*
*__description__*: Promise that returns the first time we are connected and loaded
@@ -167,13 +170,14 @@ getquery(): `QueryableStorage`
*Inherited from [ApiBase](_base_.apibase.md).[query](_base_.apibase.md#query)*
*Defined in [Base.ts:107](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L107)*
*Defined in [Base.ts:107](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L107)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
@@ -191,13 +195,14 @@ getrpc(): `Rpc`
*Inherited from [ApiBase](_base_.apibase.md).[rpc](_base_.apibase.md#rpc)*
*Defined in [Base.ts:127](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L127)*
*Defined in [Base.ts:127](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L127)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
@@ -215,7 +220,7 @@ getruntimeMetadata(): `RuntimeMetadata`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeMetadata](_base_.apibase.md#runtimemetadata)*
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L78)*
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L78)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
@@ -230,7 +235,7 @@ getruntimeVersion(): `RuntimeVersion`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeVersion](_base_.apibase.md#runtimeversion)*
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L87)*
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L87)*
*__description__*: Contains the version information for the current runtime.
@@ -245,11 +250,12 @@ gettx(): `SubmittableExtrinsics`
*Inherited from [ApiBase](_base_.apibase.md).[tx](_base_.apibase.md#tx)*
*Defined in [Base.ts:146](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L146)*
*Defined in [Base.ts:146](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L146)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
@@ -271,11 +277,12 @@ ___
▸ **combineLatest**(fns: *`Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction)>*, callback: *[CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback)*): [Combinator](_promise_combinator_.combinator.md)
*Defined in [promise/index.ts:189](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L189)*
*Defined in [promise/index.ts:189](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L189)*
*__description__*: Creates a combinator that can be used to combine the latest results from multiple subscriptions
*__example__*:
```javascript
const address = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFacT7';
@@ -293,7 +300,7 @@ api.combineLatest([
| Param | Type | Description |
| ------ | ------ | ------ |
| fns | `Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction)> | An array of function to combine, each in the form of `(cb: (value: void)) => void` |
| fns | `Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction)> | An array of function to combine, each in the form of \`(cb: (value: void)) => void\` |
| callback | [CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback) | A callback that will return an Array of all the values this combinator has been applied to |
**Returns:** [Combinator](_promise_combinator_.combinator.md)
@@ -307,11 +314,12 @@ ___
*Inherited from [ApiBase](_base_.apibase.md).[on](_base_.apibase.md#on)*
*Defined in [Base.ts:171](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L171)*
*Defined in [Base.ts:171](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L171)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('disconnected', () => {
console.log('API has been connected to the endpoint');
@@ -338,11 +346,12 @@ ___
▸ **create**(wsProvider?: *`WsProvider`*): `Promise`<[ApiPromise](_promise_index_.apipromise.md)>
*Defined in [promise/index.ts:126](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/index.ts#L126)*
*Defined in [promise/index.ts:126](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/index.ts#L126)*
*__description__*: Creates an ApiPromise instance using the supplied provider. Returns an Promise containing the actual Api instance.
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
@@ -25,7 +25,7 @@
*Overrides Extrinsic.__constructor*
*Defined in [promise/SubmittableExtrinsic.ts:12](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/SubmittableExtrinsic.ts#L12)*
*Defined in [promise/SubmittableExtrinsic.ts:12](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/SubmittableExtrinsic.ts#L12)*
**Parameters:**
@@ -59,7 +59,7 @@ ___
*Inherited from Struct.raw*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:25](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L25)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:25](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L25)*
___
<a id="size"></a>
@@ -84,7 +84,7 @@ getType(): `E`
*Inherited from Struct.Type*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:122](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L122)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:122](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L122)*
**Returns:** `E`
@@ -97,7 +97,7 @@ getargs(): `Array`<`Base`>
*Inherited from Extrinsic.args*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:70](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L70)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:70](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L70)*
**Returns:** `Array`<`Base`>
@@ -110,7 +110,7 @@ getcallIndex(): `Uint8Array`
*Inherited from Extrinsic.callIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:75](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L75)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:75](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L75)*
**Returns:** `Uint8Array`
@@ -123,7 +123,7 @@ getdata(): `Uint8Array`
*Inherited from Extrinsic.data*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:79](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L79)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:79](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L79)*
**Returns:** `Uint8Array`
@@ -138,7 +138,7 @@ getencodedLength(): `number`
*Overrides Struct.encodedLength*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:110](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L110)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:110](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L110)*
**Returns:** `number`
@@ -151,7 +151,7 @@ gethash(): `Hash`
*Inherited from Extrinsic.hash*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:84](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L84)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:84](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L84)*
**Returns:** `Hash`
@@ -164,7 +164,7 @@ getisSigned(): `boolean`
*Inherited from Extrinsic.isSigned*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:90](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L90)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:90](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L90)*
**Returns:** `boolean`
@@ -177,7 +177,7 @@ getlength(): `number`
*Inherited from Extrinsic.length*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:94](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L94)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:94](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L94)*
**Returns:** `number`
@@ -190,7 +190,7 @@ getmeta(): `FunctionMetadata`
*Inherited from Extrinsic.meta*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:98](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L98)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:98](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L98)*
**Returns:** `FunctionMetadata`
@@ -203,7 +203,7 @@ getmethod(): `Method`
*Inherited from Extrinsic.method*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:102](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L102)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:102](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L102)*
**Returns:** `Method`
@@ -216,7 +216,7 @@ getsignature(): `ExtrinsicSignature`
*Inherited from Extrinsic.signature*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:106](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L106)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:106](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L106)*
**Returns:** `ExtrinsicSignature`
@@ -333,7 +333,7 @@ ___
*Inherited from Struct.getAtIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:132](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L132)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:132](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L132)*
**Parameters:**
@@ -384,7 +384,7 @@ ___
▸ **send**(statusCb?: * `undefined` &#124; `function`*): `Promise`<`Hash`>
*Defined in [promise/SubmittableExtrinsic.ts:20](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/SubmittableExtrinsic.ts#L20)*
*Defined in [promise/SubmittableExtrinsic.ts:20](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/SubmittableExtrinsic.ts#L20)*
**Parameters:**
@@ -423,7 +423,7 @@ ___
*Overrides Extrinsic.sign*
*Defined in [promise/SubmittableExtrinsic.ts:28](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/SubmittableExtrinsic.ts#L28)*
*Defined in [promise/SubmittableExtrinsic.ts:28](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/SubmittableExtrinsic.ts#L28)*
**Parameters:**
@@ -446,7 +446,7 @@ ___
*Overrides Struct.toHex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:133](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L133)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:133](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L133)*
**Returns:** `string`
@@ -461,7 +461,7 @@ ___
*Overrides Struct.toJSON*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:137](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L137)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:137](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L137)*
**Returns:** `any`
@@ -474,7 +474,7 @@ ___
*Inherited from Struct.toString*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:151](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L151)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:151](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L151)*
**Returns:** `string`
@@ -489,7 +489,7 @@ ___
*Overrides Struct.toU8a*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:122](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L122)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:122](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L122)*
**Parameters:**
@@ -523,7 +523,7 @@ ___
*Inherited from Extrinsic.decodeExtrinsic*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:42](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L42)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:42](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L42)*
**Parameters:**
@@ -542,7 +542,7 @@ ___
*Inherited from Struct.with*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/0c23615/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/eb143b3/packages/types/src/codec/Struct.ts#L112)*
**Type parameters:**
+12 -12
View File
@@ -480,7 +480,7 @@
<h2 id="constructor">constructor</h2>
<p>&#x2295; <strong>new ApiRx</strong>(wsProvider?: <em><code>WsProvider</code></em>): <a href="_rx_index_.apirx.html">ApiRx</a></p>
<p><em>Overrides <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#constructor">constructor</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L143" target="_blank">rx/index.ts:143</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L143" target="_blank">rx/index.ts:143</a></em></p>
<p><em><strong>description</strong></em>: Create an instance of the ApiRx class</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>&#xA0;<span class="sunlight-ident">Api</span>&#xA0;<span class="sunlight-ident">from</span>&#xA0;<span class="sunlight-string">&apos;@polkadot/api/rx&apos;</span><span class="sunlight-punctuation">;</span>
@@ -515,21 +515,21 @@
<h2 id="genesishash">genesisHash</h2>
<p>getgenesisHash(): <code>Hash</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#genesishash">genesisHash</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L69" target="_blank">Base.ts:69</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L69" target="_blank">Base.ts:69</a></em></p>
<p><em><strong>description</strong></em>: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.</p>
<p><strong>Returns:</strong> <code>Hash</code></p>
<hr>
<p><a id="isconnected"></a></p>
<h2 id="isconnected">isConnected</h2>
<p>getisConnected(): <code>Observable</code>&lt;<code>boolean</code>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L179" target="_blank">rx/index.ts:179</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L179" target="_blank">rx/index.ts:179</a></em></p>
<p><em><strong>description</strong></em>: Observable that carries the connected state for the provider. Results in a boolean flag that is true/false based on the connectivity.</p>
<p><strong>Returns:</strong> <code>Observable</code>&lt;<code>boolean</code>&gt;</p>
<hr>
<p><a id="isready"></a></p>
<h2 id="isready">isReady</h2>
<p>getisReady(): <code>Observable</code>&lt;<a href="_rx_index_.apirx.html">ApiRx</a>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L186" target="_blank">rx/index.ts:186</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L186" target="_blank">rx/index.ts:186</a></em></p>
<p><em><strong>description</strong></em>: Observable that returns the first time we are connected and loaded</p>
<p><strong>Returns:</strong> <code>Observable</code>&lt;<a href="_rx_index_.apirx.html">ApiRx</a>&gt;</p>
<hr>
@@ -537,7 +537,7 @@
<h2 id="query">query</h2>
<p>getquery(): <code>QueryableStorage</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#query">query</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L107" target="_blank">Base.ts:107</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L107" target="_blank">Base.ts:107</a></em></p>
<p><em><strong>description</strong></em>: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.</p>
<p>All calls inside the namespace, is denoted by <code>section</code>.<code>method</code> and may take an optional query parameter. As an example, <code>api.query.timestamp.now()</code> (current block timestamp) does not take parameters, while <code>api.query.system.accountNonce(&lt;accountId&gt;)</code> (retrieving the associated nonce for an account), takes the <code>AccountId</code> as a parameter.</p>
<p><em><strong>example</strong></em>: </p>
@@ -551,7 +551,7 @@
<h2 id="rpc">rpc</h2>
<p>getrpc(): <code>RpcRx</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#rpc">rpc</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L127" target="_blank">Base.ts:127</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L127" target="_blank">Base.ts:127</a></em></p>
<p><em><strong>description</strong></em>: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic <code>api.query</code> and <code>api.tx</code> sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.</p>
<p>RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.</p>
<p><em><strong>example</strong></em>: </p>
@@ -565,7 +565,7 @@
<h2 id="runtimemetadata">runtimeMetadata</h2>
<p>getruntimeMetadata(): <code>RuntimeMetadata</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#runtimemetadata">runtimeMetadata</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L78" target="_blank">Base.ts:78</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L78" target="_blank">Base.ts:78</a></em></p>
<p><em><strong>description</strong></em>: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics &amp; storage, but is useful for current runtime inspection.</p>
<p><strong>Returns:</strong> <code>RuntimeMetadata</code></p>
<hr>
@@ -573,7 +573,7 @@
<h2 id="runtimeversion">runtimeVersion</h2>
<p>getruntimeVersion(): <code>RuntimeVersion</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#runtimeversion">runtimeVersion</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L87" target="_blank">Base.ts:87</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L87" target="_blank">Base.ts:87</a></em></p>
<p><em><strong>description</strong></em>: Contains the version information for the current runtime.</p>
<p><strong>Returns:</strong> <code>RuntimeVersion</code></p>
<hr>
@@ -581,7 +581,7 @@
<h2 id="tx">tx</h2>
<p>gettx(): <code>SubmittableExtrinsics</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#tx">tx</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L146" target="_blank">Base.ts:146</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L146" target="_blank">Base.ts:146</a></em></p>
<p><em><strong>description</strong></em>: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.</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-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">tx</span><span class="sunlight-operator">.</span><span class="sunlight-ident">balances</span>
@@ -598,7 +598,7 @@
<h2 id="on">on</h2>
<p>&#x25B8; <strong>on</strong>(type: <em><code>ApiInterface$Events</code></em>, handler: <em><code>function</code></em>): <code>void</code></p>
<p><em>Inherited from <a href="_base_.apibase.md">ApiBase</a>.<a href="_base_.apibase.md#on">on</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L171" target="_blank">Base.ts:171</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L171" target="_blank">Base.ts:171</a></em></p>
<p><em><strong>description</strong></em>: Attach an eventemitter handler to listen 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-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">on</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">&apos;disconnected&apos;</span><span class="sunlight-punctuation">,</span>&#xA0;<span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span>&#xA0;<span class="sunlight-operator">=</span><span class="sunlight-operator">&gt;</span>&#xA0;<span class="sunlight-punctuation">{</span>
@@ -636,7 +636,7 @@
<p><a id="create"></a></p>
<h2 id="static-create"><code>&lt;Static&gt;</code> create</h2>
<p>&#x25B8; <strong>create</strong>(wsProvider?: <em><code>WsProvider</code></em>): <code>Observable</code>&lt;<a href="_rx_index_.apirx.html">ApiRx</a>&gt;</p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L141" target="_blank">rx/index.ts:141</a></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L141" target="_blank">rx/index.ts:141</a></em></p>
<p><em><strong>description</strong></em>: Creates an ApiRx instance using the supplied provider. Returns an Observable containing the actual Api instance.</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>&#xA0;<span class="sunlight-ident">Api</span>&#xA0;<span class="sunlight-ident">from</span>&#xA0;<span class="sunlight-string">&apos;@polkadot/api/rx&apos;</span><span class="sunlight-punctuation">;</span>
@@ -709,7 +709,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"ApiRx","level":"1.2.2","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":"ApiPromise","level":"1.2.1","depth":2,"path":"api/classes/_promise_index_.apipromise.md","ref":"api/classes/_promise_index_.apipromise.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/classes/_rx_index_.apirx.md","mtime":"2018-10-24T12:44:15.807Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T12:45:52.736Z"},"basePath":"../..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"ApiRx","level":"1.2.2","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":"ApiPromise","level":"1.2.1","depth":2,"path":"api/classes/_promise_index_.apipromise.md","ref":"api/classes/_promise_index_.apipromise.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/classes/_rx_index_.apirx.md","mtime":"2018-10-24T15:50:35.562Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T15:51:47.492Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>
+19 -11
View File
@@ -29,6 +29,7 @@ api.rpc.chain.subscribeNewHead().subscribe((header) => {
console.log(`Chain is at #${header.blockNumber}`);
});
```
Subscribing to chain state -
@@ -63,6 +64,7 @@ new ApiRx(provider)
console.log(`timestamp ${timestamp}${elapsed} (${blockPeriod}s target)`);
});
```
Submitting a transaction -
@@ -115,11 +117,12 @@ api.query.system
*Overrides [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
*Defined in [rx/index.ts:143](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L143)*
*Defined in [rx/index.ts:143](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L143)*
*__description__*: Create an instance of the ApiRx class
*__example__*:
```javascript
import Api from '@polkadot/api/rx';
@@ -150,7 +153,7 @@ getgenesisHash(): `Hash`
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L69)*
*Defined in [Base.ts:69](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L69)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
@@ -163,7 +166,7 @@ ___
getisConnected(): `Observable`<`boolean`>
*Defined in [rx/index.ts:179](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L179)*
*Defined in [rx/index.ts:179](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L179)*
*__description__*: Observable that carries the connected state for the provider. Results in a boolean flag that is true/false based on the connectivity.
@@ -176,7 +179,7 @@ ___
getisReady(): `Observable`<[ApiRx](_rx_index_.apirx.md)>
*Defined in [rx/index.ts:186](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L186)*
*Defined in [rx/index.ts:186](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L186)*
*__description__*: Observable that returns the first time we are connected and loaded
@@ -191,13 +194,14 @@ getquery(): `QueryableStorage`
*Inherited from [ApiBase](_base_.apibase.md).[query](_base_.apibase.md#query)*
*Defined in [Base.ts:107](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L107)*
*Defined in [Base.ts:107](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L107)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
@@ -215,13 +219,14 @@ getrpc(): `RpcRx`
*Inherited from [ApiBase](_base_.apibase.md).[rpc](_base_.apibase.md#rpc)*
*Defined in [Base.ts:127](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L127)*
*Defined in [Base.ts:127](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L127)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
@@ -239,7 +244,7 @@ getruntimeMetadata(): `RuntimeMetadata`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeMetadata](_base_.apibase.md#runtimemetadata)*
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L78)*
*Defined in [Base.ts:78](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L78)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
@@ -254,7 +259,7 @@ getruntimeVersion(): `RuntimeVersion`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeVersion](_base_.apibase.md#runtimeversion)*
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L87)*
*Defined in [Base.ts:87](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L87)*
*__description__*: Contains the version information for the current runtime.
@@ -269,11 +274,12 @@ gettx(): `SubmittableExtrinsics`
*Inherited from [ApiBase](_base_.apibase.md).[tx](_base_.apibase.md#tx)*
*Defined in [Base.ts:146](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L146)*
*Defined in [Base.ts:146](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L146)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
@@ -297,11 +303,12 @@ ___
*Inherited from [ApiBase](_base_.apibase.md).[on](_base_.apibase.md#on)*
*Defined in [Base.ts:171](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/Base.ts#L171)*
*Defined in [Base.ts:171](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/Base.ts#L171)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('disconnected', () => {
console.log('API has been connected to the endpoint');
@@ -328,11 +335,12 @@ ___
▸ **create**(wsProvider?: *`WsProvider`*): `Observable`<[ApiRx](_rx_index_.apirx.md)>
*Defined in [rx/index.ts:141](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/index.ts#L141)*
*Defined in [rx/index.ts:141](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/index.ts#L141)*
*__description__*: Creates an ApiRx instance using the supplied provider. Returns an Observable containing the actual Api instance.
*__example__*:
```javascript
import Api from '@polkadot/api/rx';
@@ -25,7 +25,7 @@
*Overrides Extrinsic.__constructor*
*Defined in [rx/SubmittableExtrinsic.ts:13](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/SubmittableExtrinsic.ts#L13)*
*Defined in [rx/SubmittableExtrinsic.ts:13](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/SubmittableExtrinsic.ts#L13)*
**Parameters:**
@@ -59,7 +59,7 @@ ___
*Inherited from Struct.raw*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:25](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L25)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:25](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L25)*
___
<a id="size"></a>
@@ -84,7 +84,7 @@ getType(): `E`
*Inherited from Struct.Type*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:122](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L122)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:122](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L122)*
**Returns:** `E`
@@ -97,7 +97,7 @@ getargs(): `Array`<`Base`>
*Inherited from Extrinsic.args*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:70](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L70)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:70](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L70)*
**Returns:** `Array`<`Base`>
@@ -110,7 +110,7 @@ getcallIndex(): `Uint8Array`
*Inherited from Extrinsic.callIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:75](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L75)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:75](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L75)*
**Returns:** `Uint8Array`
@@ -123,7 +123,7 @@ getdata(): `Uint8Array`
*Inherited from Extrinsic.data*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:79](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L79)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:79](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L79)*
**Returns:** `Uint8Array`
@@ -138,7 +138,7 @@ getencodedLength(): `number`
*Overrides Struct.encodedLength*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:110](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L110)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:110](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L110)*
**Returns:** `number`
@@ -151,7 +151,7 @@ gethash(): `Hash`
*Inherited from Extrinsic.hash*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:84](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L84)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:84](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L84)*
**Returns:** `Hash`
@@ -164,7 +164,7 @@ getisSigned(): `boolean`
*Inherited from Extrinsic.isSigned*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:90](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L90)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:90](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L90)*
**Returns:** `boolean`
@@ -177,7 +177,7 @@ getlength(): `number`
*Inherited from Extrinsic.length*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:94](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L94)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:94](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L94)*
**Returns:** `number`
@@ -190,7 +190,7 @@ getmeta(): `FunctionMetadata`
*Inherited from Extrinsic.meta*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:98](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L98)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:98](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L98)*
**Returns:** `FunctionMetadata`
@@ -203,7 +203,7 @@ getmethod(): `Method`
*Inherited from Extrinsic.method*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:102](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L102)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:102](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L102)*
**Returns:** `Method`
@@ -216,7 +216,7 @@ getsignature(): `ExtrinsicSignature`
*Inherited from Extrinsic.signature*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:106](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L106)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:106](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L106)*
**Returns:** `ExtrinsicSignature`
@@ -333,7 +333,7 @@ ___
*Inherited from Struct.getAtIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:132](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L132)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:132](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L132)*
**Parameters:**
@@ -384,7 +384,7 @@ ___
▸ **send**(): `Observable`<`ExtrinsicStatus`>
*Defined in [rx/SubmittableExtrinsic.ts:21](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/SubmittableExtrinsic.ts#L21)*
*Defined in [rx/SubmittableExtrinsic.ts:21](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/SubmittableExtrinsic.ts#L21)*
**Returns:** `Observable`<`ExtrinsicStatus`>
@@ -417,7 +417,7 @@ ___
*Overrides Extrinsic.sign*
*Defined in [rx/SubmittableExtrinsic.ts:25](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/rx/SubmittableExtrinsic.ts#L25)*
*Defined in [rx/SubmittableExtrinsic.ts:25](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/rx/SubmittableExtrinsic.ts#L25)*
**Parameters:**
@@ -440,7 +440,7 @@ ___
*Overrides Struct.toHex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:133](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L133)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:133](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L133)*
**Returns:** `string`
@@ -455,7 +455,7 @@ ___
*Overrides Struct.toJSON*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:137](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L137)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:137](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L137)*
**Returns:** `any`
@@ -468,7 +468,7 @@ ___
*Inherited from Struct.toString*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:151](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/codec/Struct.ts#L151)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:151](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/codec/Struct.ts#L151)*
**Returns:** `string`
@@ -483,7 +483,7 @@ ___
*Overrides Struct.toU8a*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:122](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L122)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:122](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L122)*
**Parameters:**
@@ -517,7 +517,7 @@ ___
*Inherited from Extrinsic.decodeExtrinsic*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:42](https://github.com/polkadot-js/api/blob/0c23615/packages/types/src/Extrinsic.ts#L42)*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/Extrinsic.ts:42](https://github.com/polkadot-js/api/blob/eb143b3/packages/types/src/Extrinsic.ts#L42)*
**Parameters:**
@@ -536,7 +536,7 @@ ___
*Inherited from Struct.with*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:112](https://github.com/polkadot-js/api/blob/0c23615/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/eb143b3/packages/types/src/codec/Struct.ts#L112)*
**Type parameters:**
+1 -1
View File
@@ -495,7 +495,7 @@
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"api","level":"1.2","depth":1,"next":{"title":"ApiPromise","level":"1.2.1","depth":2,"path":"api/classes/_promise_index_.apipromise.md","ref":"api/classes/_promise_index_.apipromise.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/README.md","mtime":"2018-10-24T12:44:15.327Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T12:45:52.736Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"api","level":"1.2","depth":1,"next":{"title":"ApiPromise","level":"1.2.1","depth":2,"path":"api/classes/_promise_index_.apipromise.md","ref":"api/classes/_promise_index_.apipromise.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/api/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/README.md","mtime":"2018-10-24T15:50:35.102Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-24T15:51:47.492Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
+2 -2
View File
@@ -21,7 +21,7 @@
**Ƭ CombinatorCallback**: *`function`*
*Defined in [promise/Combinator.ts:7](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/Combinator.ts#L7)*
*Defined in [promise/Combinator.ts:7](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/Combinator.ts#L7)*
#### Type declaration
▸(value: *`Array`<`any`>*): `any`
@@ -41,7 +41,7 @@ ___
**Ƭ CombinatorFunction**: *`function`*
*Defined in [promise/Combinator.ts:8](https://github.com/polkadot-js/api/blob/0c23615/packages/api/src/promise/Combinator.ts#L8)*
*Defined in [promise/Combinator.ts:8](https://github.com/polkadot-js/api/blob/eb143b3/packages/api/src/promise/Combinator.ts#L8)*
#### Type declaration
▸(cb: *`function`*): `any`