[CI Skip] 0.40.17
This commit is contained in:
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="../05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../05_read_storage/">
|
||||
|
||||
<a href="../05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="../08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="../08_system_events/">
|
||||
|
||||
<a href="../08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="../09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="../09_transfer_events/">
|
||||
|
||||
<a href="../09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="../10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="../10_upgrade_chain/">
|
||||
|
||||
<a href="../10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1987,7 +2136,7 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<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>
|
||||
<p>The following example shows how to instantiate a Polkadot API object and use it to connect to a node using ApiPromise.</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-comment">// Required imports</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">ApiPromise</span> <span class="sunlight-punctuation">}</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-punctuation">;</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">WsProvider</span> <span class="sunlight-punctuation">}</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/rpc-provider'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -2054,7 +2203,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Simple connect","level":"3.1.1","depth":2,"next":{"title":"Listen to blocks","level":"3.1.2","depth":2,"path":"examples/promise/02_listen_to_blocks/README.md","ref":"examples/promise/02_listen_to_blocks/README.md","articles":[]},"previous":{"title":"ApiPromise","level":"3.1","depth":1,"path":"examples/promise/README.md","ref":"examples/promise/README.md","articles":[{"title":"Simple connect","level":"3.1.1","depth":2,"path":"examples/promise/01_simple_connect/README.md","ref":"examples/promise/01_simple_connect/README.md","articles":[]},{"title":"Listen to blocks","level":"3.1.2","depth":2,"path":"examples/promise/02_listen_to_blocks/README.md","ref":"examples/promise/02_listen_to_blocks/README.md","articles":[]},{"title":"Listen to balance change","level":"3.1.3","depth":2,"path":"examples/promise/03_listen_to_balance_change/README.md","ref":"examples/promise/03_listen_to_balance_change/README.md","articles":[]},{"title":"Read chain state","level":"3.1.4","depth":2,"path":"examples/promise/05_read_storage/README.md","ref":"examples/promise/05_read_storage/README.md","articles":[]},{"title":"Make a transfer","level":"3.1.5","depth":2,"path":"examples/promise/07_transfer_dots/README.md","ref":"examples/promise/07_transfer_dots/README.md","articles":[]},{"title":"Display system events","level":"3.1.6","depth":2,"path":"examples/promise/08_system_events/README.md","ref":"examples/promise/08_system_events/README.md","articles":[]},{"title":"Transaction with events","level":"3.1.7","depth":2,"path":"examples/promise/09_transfer_events/README.md","ref":"examples/promise/09_transfer_events/README.md","articles":[]},{"title":"Upgrade via sudo","level":"3.1.8","depth":2,"path":"examples/promise/10_upgrade_chain/README.md","ref":"examples/promise/10_upgrade_chain/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":"examples/promise/01_simple_connect/README.md","mtime":"2019-01-17T16:15:44.321Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Simple connect","level":"3.1.1","depth":2,"next":{"title":"Listen to blocks","level":"3.1.2","depth":2,"path":"examples/promise/02_listen_to_blocks/README.md","ref":"examples/promise/02_listen_to_blocks/README.md","articles":[]},"previous":{"title":"ApiPromise","level":"3.1","depth":1,"path":"examples/promise/README.md","ref":"examples/promise/README.md","articles":[{"title":"Simple connect","level":"3.1.1","depth":2,"path":"examples/promise/01_simple_connect/README.md","ref":"examples/promise/01_simple_connect/README.md","articles":[]},{"title":"Listen to blocks","level":"3.1.2","depth":2,"path":"examples/promise/02_listen_to_blocks/README.md","ref":"examples/promise/02_listen_to_blocks/README.md","articles":[]},{"title":"Listen to balance change","level":"3.1.3","depth":2,"path":"examples/promise/03_listen_to_balance_change/README.md","ref":"examples/promise/03_listen_to_balance_change/README.md","articles":[]},{"title":"Unsubscribe from listening","level":"3.1.4","depth":2,"path":"examples/promise/04_unsubscribe/README.md","ref":"examples/promise/04_unsubscribe/README.md","articles":[]},{"title":"Read chain state","level":"3.1.5","depth":2,"path":"examples/promise/05_read_storage/README.md","ref":"examples/promise/05_read_storage/README.md","articles":[]},{"title":"Make a transfer","level":"3.1.6","depth":2,"path":"examples/promise/06_make_transfer/README.md","ref":"examples/promise/06_make_transfer/README.md","articles":[]},{"title":"Display system events","level":"3.1.7","depth":2,"path":"examples/promise/08_system_events/README.md","ref":"examples/promise/08_system_events/README.md","articles":[]},{"title":"Transaction with events","level":"3.1.8","depth":2,"path":"examples/promise/09_transfer_events/README.md","ref":"examples/promise/09_transfer_events/README.md","articles":[]},{"title":"Upgrade via sudo","level":"3.1.9","depth":2,"path":"examples/promise/10_upgrade_chain/README.md","ref":"examples/promise/10_upgrade_chain/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":"examples/promise/01_simple_connect/README.md","mtime":"2019-01-22T22:13:44.152Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="../05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../05_read_storage/">
|
||||
|
||||
<a href="../05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="../08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="../08_system_events/">
|
||||
|
||||
<a href="../08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="../09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="../09_transfer_events/">
|
||||
|
||||
<a href="../09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="../10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="../10_upgrade_chain/">
|
||||
|
||||
<a href="../10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2002,13 +2151,9 @@
|
||||
  <span class="sunlight-comment">// Subscribe to the new headers on-chain. The callback is fired when new headers</span>
|
||||
  <span class="sunlight-comment">// are found, the call itself returns a promise with a subscription that can be</span>
|
||||
  <span class="sunlight-comment">// used to unsubscribe from the newHead subscription</span>
|
||||
  <span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">subscriptionId</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">await</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">rpc</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span><span class="sunlight-operator">.</span><span class="sunlight-ident">subscribeNewHead</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">blockNumber</span><span class="sunlight-punctuation">}</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">unsubscribe</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">await</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">rpc</span><span class="sunlight-operator">.</span><span class="sunlight-ident">chain</span><span class="sunlight-operator">.</span><span class="sunlight-ident">subscribeNewHead</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">Chain</span> <span class="sunlight-ident">is</span> <span class="sunlight-ident">at</span> <span class="sunlight-ident">block</span><span class="sunlight-operator">:</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">blockNumber</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-comment">// Id for the subscription, we can cleanup and unsubscribe via</span>
|
||||
  <span class="sunlight-comment">// `api.chain.newHead.unsubscribe(subscriptionId)`</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">subsciptionId</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">$</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 class="sunlight-punctuation">;</span>
|
||||
<span class="sunlight-punctuation">}</span>
|
||||
|
||||
<span class="sunlight-ident">main</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-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -2056,7 +2201,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to blocks","level":"3.1.2","depth":2,"next":{"title":"Listen to balance change","level":"3.1.3","depth":2,"path":"examples/promise/03_listen_to_balance_change/README.md","ref":"examples/promise/03_listen_to_balance_change/README.md","articles":[]},"previous":{"title":"Simple connect","level":"3.1.1","depth":2,"path":"examples/promise/01_simple_connect/README.md","ref":"examples/promise/01_simple_connect/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":"examples/promise/02_listen_to_blocks/README.md","mtime":"2019-01-17T16:15:44.321Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to blocks","level":"3.1.2","depth":2,"next":{"title":"Listen to balance change","level":"3.1.3","depth":2,"path":"examples/promise/03_listen_to_balance_change/README.md","ref":"examples/promise/03_listen_to_balance_change/README.md","articles":[]},"previous":{"title":"Simple connect","level":"3.1.1","depth":2,"path":"examples/promise/01_simple_connect/README.md","ref":"examples/promise/01_simple_connect/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":"examples/promise/02_listen_to_blocks/README.md","mtime":"2019-01-22T22:13:44.152Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">
|
||||
|
||||
|
||||
<link rel="next" href="../05_read_storage/" />
|
||||
<link rel="next" href="../04_unsubscribe/" />
|
||||
|
||||
|
||||
<link rel="prev" href="../02_listen_to_blocks/" />
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="../05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../05_read_storage/">
|
||||
|
||||
<a href="../05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="../08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="../08_system_events/">
|
||||
|
||||
<a href="../08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="../09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="../09_transfer_events/">
|
||||
|
||||
<a href="../09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="../10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="../10_upgrade_chain/">
|
||||
|
||||
<a href="../10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1988,7 +2137,7 @@
|
||||
|
||||
<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 and retrieve balance updates.</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-comment">// Import the Api</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-comment">// Import the API</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">ApiPromise</span> <span class="sunlight-punctuation">}</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-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-comment">// Known account we want to use (available on dev chain, with funds)</span>
|
||||
@@ -2002,7 +2151,7 @@
|
||||
  <span class="sunlight-comment">// that resolves to the current on-chain value</span>
|
||||
  <span class="sunlight-ident">let</span> <span class="sunlight-ident">previous</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">await</span> <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">query</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-ident">Alice</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">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">Alice</span><span class="sunlight-punctuation">}</span> <span class="sunlight-ident">has</span> <span class="sunlight-ident">a</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">previous</span><span class="sunlight-punctuation">}</span> <span class="sunlight-ident">balance</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">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">Alice</span><span class="sunlight-punctuation">}</span> <span class="sunlight-ident">has</span> <span class="sunlight-ident">a</span> <span class="sunlight-ident">balance</span> <span class="sunlight-ident">of</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">previous</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-punctuation">`</span><span class="sunlight-ident">You</span> <span class="sunlight-ident">may</span> <span class="sunlight-ident">leave</span> <span class="sunlight-keyword">this</span> <span class="sunlight-ident">example</span> <span class="sunlight-ident">running</span> <span class="sunlight-ident">and</span> <span class="sunlight-ident">start</span> <span class="sunlight-ident">example</span> <span class="sunlight-number">06</span> <span class="sunlight-ident">or</span> <span class="sunlight-ident">transfer</span> <span class="sunlight-ident">any</span> <span class="sunlight-ident">value</span> <span class="sunlight-ident">to</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">Alice</span><span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">`</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
  <span class="sunlight-comment">// Here we subscribe to any balance changes and update the on-screen value</span>
|
||||
@@ -2012,13 +2161,10 @@
|
||||
|
||||
    <span class="sunlight-comment">// Only display positive value changes (Since we are pulling `previous` above already,</span>
|
||||
    <span class="sunlight-comment">// the initial balance change will also be zero)</span>
|
||||
    <span class="sunlight-keyword">if</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">change</span><span class="sunlight-operator">.</span><span class="sunlight-ident">isZero</span><span class="sunlight-punctuation">(</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-punctuation">;</span>
|
||||
    <span class="sunlight-keyword">if</span> <span class="sunlight-punctuation">(</span><span class="sunlight-operator">!</span><span class="sunlight-ident">change</span><span class="sunlight-operator">.</span><span class="sunlight-ident">isZero</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">previous</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">current</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">New</span> <span class="sunlight-ident">balance</span> <span class="sunlight-ident">change</span> <span class="sunlight-ident">of</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">change</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">previous</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">current</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">Balance</span> <span class="sunlight-ident">of</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">Alice</span><span class="sunlight-punctuation">}</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">current</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">change</span><span class="sunlight-punctuation">}</span> <span class="sunlight-ident">change</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>
|
||||
|
||||
@@ -2056,7 +2202,7 @@
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../05_read_storage/" class="navigation navigation-next " aria-label="Next page: Read chain state">
|
||||
<a href="../04_unsubscribe/" class="navigation navigation-next " aria-label="Next page: Unsubscribe from listening">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
@@ -2067,7 +2213,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to balance change","level":"3.1.3","depth":2,"next":{"title":"Read chain state","level":"3.1.4","depth":2,"path":"examples/promise/05_read_storage/README.md","ref":"examples/promise/05_read_storage/README.md","articles":[]},"previous":{"title":"Listen to blocks","level":"3.1.2","depth":2,"path":"examples/promise/02_listen_to_blocks/README.md","ref":"examples/promise/02_listen_to_blocks/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":"examples/promise/03_listen_to_balance_change/README.md","mtime":"2019-01-17T16:15:44.321Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Listen to balance change","level":"3.1.3","depth":2,"next":{"title":"Unsubscribe from listening","level":"3.1.4","depth":2,"path":"examples/promise/04_unsubscribe/README.md","ref":"examples/promise/04_unsubscribe/README.md","articles":[]},"previous":{"title":"Listen to blocks","level":"3.1.2","depth":2,"path":"examples/promise/02_listen_to_blocks/README.md","ref":"examples/promise/02_listen_to_blocks/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":"examples/promise/03_listen_to_balance_change/README.md","mtime":"2019-01-22T22:13:44.152Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,10 +61,10 @@
|
||||
<link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">
|
||||
|
||||
|
||||
<link rel="next" href="../07_transfer_dots/" />
|
||||
<link rel="next" href="../06_make_transfer/" />
|
||||
|
||||
|
||||
<link rel="prev" href="../03_listen_to_balance_change/" />
|
||||
<link rel="prev" href="../04_unsubscribe/" />
|
||||
|
||||
|
||||
</head>
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="3.1.4" data-path="./">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="3.1.5" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="../08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="../08_system_events/">
|
||||
|
||||
<a href="../08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="../09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="../09_transfer_events/">
|
||||
|
||||
<a href="../09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="../10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="../10_upgrade_chain/">
|
||||
|
||||
<a href="../10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2008,17 +2157,20 @@
|
||||
  <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">accountNonce</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">Alice</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">accountNonce</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-punctuation">`</span><span class="sunlight-ident">blockPeriod</span> <span class="sunlight-ident">$</span><span class="sunlight-punctuation">{</span><span class="sunlight-ident">blockPeriod</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toNumber</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">}</span> <span class="sunlight-ident">seconds</span><span class="sunlight-punctuation">`</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
  <span class="sunlight-comment">// Retrieve the balances for all validators</span>
|
||||
  <span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">validatorBalances</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">await</span> <span class="sunlight-ident">Promise</span><span class="sunlight-operator">.</span><span class="sunlight-ident">all</span><span class="sunlight-punctuation">(</span>
|
||||
    <span class="sunlight-ident">validators</span><span class="sunlight-operator">.</span><span class="sunlight-ident">map</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">authorityId</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span>
|
||||
      <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">query</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-ident">authorityId</span><span class="sunlight-punctuation">)</span>
|
||||
    <span class="sunlight-punctuation">)</span>
|
||||
  <span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
  <span class="sunlight-keyword">if</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">validators</span> <span class="sunlight-operator">&&</span> <span class="sunlight-ident">validators</span><span class="sunlight-operator">.</span><span class="sunlight-ident">length</span> <span class="sunlight-operator">></span> <span class="sunlight-number">0</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-comment">// Retrieve the balances for all validators</span>
|
||||
    <span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">validatorBalances</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">await</span> <span class="sunlight-ident">Promise</span><span class="sunlight-operator">.</span><span class="sunlight-ident">all</span><span class="sunlight-punctuation">(</span>
|
||||
      <span class="sunlight-ident">validators</span><span class="sunlight-operator">.</span><span class="sunlight-ident">map</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">authorityId</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span>
|
||||
        <span class="sunlight-ident">api</span><span class="sunlight-operator">.</span><span class="sunlight-ident">query</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-ident">authorityId</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">'validators'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">validators</span><span class="sunlight-operator">.</span><span class="sunlight-ident">map</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">authorityId</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">index</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span>
|
||||
    <span class="sunlight-ident">address</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">authorityId</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-ident">balance</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">validatorBalances</span><span class="sunlight-punctuation">[</span><span class="sunlight-ident">index</span><span class="sunlight-punctuation">]</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-comment">// Print out the authorityIds and balances of all validators</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">'validators'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">validators</span><span class="sunlight-operator">.</span><span class="sunlight-ident">map</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">authorityId</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">index</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span>
|
||||
      <span class="sunlight-ident">address</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">authorityId</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-ident">balance</span><span class="sunlight-operator">:</span> <span class="sunlight-ident">validatorBalances</span><span class="sunlight-punctuation">[</span><span class="sunlight-ident">index</span><span class="sunlight-punctuation">]</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-punctuation">}</span>
|
||||
|
||||
<span class="sunlight-ident">main</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-ident">console</span><span class="sunlight-operator">.</span><span class="sunlight-ident">error</span><span class="sunlight-punctuation">)</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">finally</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">_</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-ident">process</span><span class="sunlight-operator">.</span><span class="sunlight-ident">exit</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
@@ -2050,12 +2202,12 @@
|
||||
|
||||
|
||||
|
||||
<a href="../03_listen_to_balance_change/" class="navigation navigation-prev " aria-label="Previous page: Listen to balance change">
|
||||
<a href="../04_unsubscribe/" class="navigation navigation-prev " aria-label="Previous page: Unsubscribe from listening">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../07_transfer_dots/" class="navigation navigation-next " aria-label="Next page: Make a transfer">
|
||||
<a href="../06_make_transfer/" class="navigation navigation-next " aria-label="Next page: Make a transfer">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
@@ -2066,7 +2218,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Read chain state","level":"3.1.4","depth":2,"next":{"title":"Make a transfer","level":"3.1.5","depth":2,"path":"examples/promise/07_transfer_dots/README.md","ref":"examples/promise/07_transfer_dots/README.md","articles":[]},"previous":{"title":"Listen to balance change","level":"3.1.3","depth":2,"path":"examples/promise/03_listen_to_balance_change/README.md","ref":"examples/promise/03_listen_to_balance_change/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":"examples/promise/05_read_storage/README.md","mtime":"2019-01-17T16:15:44.321Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Read chain state","level":"3.1.5","depth":2,"next":{"title":"Make a transfer","level":"3.1.6","depth":2,"path":"examples/promise/06_make_transfer/README.md","ref":"examples/promise/06_make_transfer/README.md","articles":[]},"previous":{"title":"Unsubscribe from listening","level":"3.1.4","depth":2,"path":"examples/promise/04_unsubscribe/README.md","ref":"examples/promise/04_unsubscribe/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":"examples/promise/05_read_storage/README.md","mtime":"2019-01-22T22:13:44.152Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -64,7 +64,7 @@
|
||||
<link rel="next" href="../09_transfer_events/" />
|
||||
|
||||
|
||||
<link rel="prev" href="../07_transfer_dots/" />
|
||||
<link rel="prev" href="../06_make_transfer/" />
|
||||
|
||||
|
||||
</head>
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="../05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../05_read_storage/">
|
||||
|
||||
<a href="../05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="3.1.6" data-path="./">
|
||||
<li class="chapter active" data-level="3.1.7" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="../09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="../09_transfer_events/">
|
||||
|
||||
<a href="../09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="../10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="../10_upgrade_chain/">
|
||||
|
||||
<a href="../10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2049,7 +2198,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../07_transfer_dots/" class="navigation navigation-prev " aria-label="Previous page: Make a transfer">
|
||||
<a href="../06_make_transfer/" class="navigation navigation-prev " aria-label="Previous page: Make a transfer">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
@@ -2065,7 +2214,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Display system events","level":"3.1.6","depth":2,"next":{"title":"Transaction with events","level":"3.1.7","depth":2,"path":"examples/promise/09_transfer_events/README.md","ref":"examples/promise/09_transfer_events/README.md","articles":[]},"previous":{"title":"Make a transfer","level":"3.1.5","depth":2,"path":"examples/promise/07_transfer_dots/README.md","ref":"examples/promise/07_transfer_dots/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":"examples/promise/08_system_events/README.md","mtime":"2019-01-17T16:15:44.321Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Display system events","level":"3.1.7","depth":2,"next":{"title":"Transaction with events","level":"3.1.8","depth":2,"path":"examples/promise/09_transfer_events/README.md","ref":"examples/promise/09_transfer_events/README.md","articles":[]},"previous":{"title":"Make a transfer","level":"3.1.6","depth":2,"path":"examples/promise/06_make_transfer/README.md","ref":"examples/promise/06_make_transfer/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":"examples/promise/08_system_events/README.md","mtime":"2019-01-22T22:13:44.156Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="../05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../05_read_storage/">
|
||||
|
||||
<a href="../05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="../08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="../08_system_events/">
|
||||
|
||||
<a href="../08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="3.1.7" data-path="./">
|
||||
<li class="chapter active" data-level="3.1.8" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="../10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="../10_upgrade_chain/">
|
||||
|
||||
<a href="../10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2003,6 +2152,8 @@
|
||||
|
||||
<span class="sunlight-ident">async</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-comment">// create an instance of our testign keyring</span>
|
||||
  <span class="sunlight-comment">// If you're using ES6 module imports instead of require, just change this line to:</span>
|
||||
  <span class="sunlight-comment">// const keyring = testKeyring();</span>
|
||||
  <span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">keyring</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">testKeyring</span><span class="sunlight-operator">.</span><span class="sunlight-keyword">default</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
  <span class="sunlight-comment">// Create the API and wait until ready</span>
|
||||
@@ -2027,7 +2178,7 @@
|
||||
      <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">'Transaction status:'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
      <span class="sunlight-keyword">if</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">type</span> <span class="sunlight-operator">===</span> <span class="sunlight-string">'Finalised'</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">'Completed at block hash'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">status</span><span class="sunlight-operator">.</span><span class="sunlight-ident">value</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toHex</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">'Completed at block hash'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">status</span><span class="sunlight-operator">.</span><span class="sunlight-ident">asFinalised</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toHex</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">'Events:'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
        <span class="sunlight-ident">events</span><span class="sunlight-operator">.</span><span class="sunlight-ident">forEach</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span> <span class="sunlight-ident">phase</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">event</span><span class="sunlight-operator">:</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">data</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">method</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">section</span> <span class="sunlight-punctuation">}</span> <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
@@ -2084,7 +2235,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Transaction with events","level":"3.1.7","depth":2,"next":{"title":"Upgrade via sudo","level":"3.1.8","depth":2,"path":"examples/promise/10_upgrade_chain/README.md","ref":"examples/promise/10_upgrade_chain/README.md","articles":[]},"previous":{"title":"Display system events","level":"3.1.6","depth":2,"path":"examples/promise/08_system_events/README.md","ref":"examples/promise/08_system_events/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":"examples/promise/09_transfer_events/README.md","mtime":"2019-01-17T16:15:44.325Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Transaction with events","level":"3.1.8","depth":2,"next":{"title":"Upgrade via sudo","level":"3.1.9","depth":2,"path":"examples/promise/10_upgrade_chain/README.md","ref":"examples/promise/10_upgrade_chain/README.md","articles":[]},"previous":{"title":"Display system events","level":"3.1.7","depth":2,"path":"examples/promise/08_system_events/README.md","ref":"examples/promise/08_system_events/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":"examples/promise/09_transfer_events/README.md","mtime":"2019-01-22T22:13:44.156Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">
|
||||
|
||||
|
||||
<link rel="next" href="../../../types/classes/_accountid_.accountid.html" />
|
||||
<link rel="next" href="../../rx/" />
|
||||
|
||||
|
||||
<link rel="prev" href="../09_transfer_events/" />
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="../05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="../04_unsubscribe/">
|
||||
|
||||
<a href="../04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../05_read_storage/">
|
||||
|
||||
<a href="../05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="../07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="../06_make_transfer/">
|
||||
|
||||
<a href="../07_transfer_dots/">
|
||||
<a href="../06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="../08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="../08_system_events/">
|
||||
|
||||
<a href="../08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="../09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="../09_transfer_events/">
|
||||
|
||||
<a href="../09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="3.1.8" data-path="./">
|
||||
<li class="chapter active" data-level="3.1.9" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../../rx/">
|
||||
|
||||
<a href="../../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../../rx/01_simple_connect/">
|
||||
|
||||
<a href="../../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../../rx/05_read_storage/">
|
||||
|
||||
<a href="../../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../../rx/06_make_transfer/">
|
||||
|
||||
<a href="../../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../../rx/08_system_events/">
|
||||
|
||||
<a href="../../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../../rx/09_transfer_events/">
|
||||
|
||||
<a href="../../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1995,9 +2144,6 @@
|
||||
<span class="sunlight-comment">// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">testKeyring</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/keyring/testing'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-comment">// utility functions</span>
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">compactAddLength</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">hexToU8a</span> <span class="sunlight-punctuation">}</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'@polkadot/util'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
<span class="sunlight-reservedWord">const</span> <span class="sunlight-ident">fs</span> <span class="sunlight-operator">=</span> <span class="sunlight-ident">require</span><span class="sunlight-punctuation">(</span><span class="sunlight-string">'fs'</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">main</span> <span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">)</span> <span class="sunlight-punctuation">{</span>
|
||||
@@ -2028,14 +2174,13 @@
|
||||
  <span class="sunlight-comment">// preform the actual chain upgrade via the sudo module</span>
|
||||
  <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">sudo</span>
|
||||
    <span class="sunlight-operator">.</span><span class="sunlight-ident">sudo</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">proposal</span><span class="sunlight-punctuation">)</span>
|
||||
    <span class="sunlight-operator">.</span><span class="sunlight-ident">sign</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">adminPair</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">adminNonce</span><span class="sunlight-punctuation">)</span>
|
||||
    <span class="sunlight-operator">.</span><span class="sunlight-ident">send</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span> <span class="sunlight-ident">events</span> <span class="sunlight-operator">=</span> <span class="sunlight-punctuation">[</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">status</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span> <span class="sunlight-punctuation">}</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">'Transaction status:'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
    <span class="sunlight-operator">.</span><span class="sunlight-ident">signAndSend</span><span class="sunlight-punctuation">(</span><span class="sunlight-ident">adminPair</span><span class="sunlight-punctuation">,</span> <span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span> <span class="sunlight-ident">events</span> <span class="sunlight-operator">=</span> <span class="sunlight-punctuation">[</span><span class="sunlight-punctuation">]</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">status</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span> <span class="sunlight-punctuation">}</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">'Proposal status:'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">type</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
      <span class="sunlight-keyword">if</span> <span class="sunlight-punctuation">(</span><span class="sunlight-ident">type</span> <span class="sunlight-operator">===</span> <span class="sunlight-string">'Finalised'</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">'You have just upgraded your chain'</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">'Completed at block hash'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">status</span><span class="sunlight-operator">.</span><span class="sunlight-ident">value</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toHex</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">'Completed at block hash'</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">status</span><span class="sunlight-operator">.</span><span class="sunlight-ident">asFinalised</span><span class="sunlight-operator">.</span><span class="sunlight-ident">toHex</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">'Events:'</span><span class="sunlight-punctuation">)</span><span class="sunlight-punctuation">;</span>
|
||||
|
||||
        <span class="sunlight-ident">events</span><span class="sunlight-operator">.</span><span class="sunlight-ident">forEach</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">(</span><span class="sunlight-punctuation">{</span> <span class="sunlight-ident">phase</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">event</span><span class="sunlight-operator">:</span> <span class="sunlight-punctuation">{</span> <span class="sunlight-ident">data</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">method</span><span class="sunlight-punctuation">,</span> <span class="sunlight-ident">section</span> <span class="sunlight-punctuation">}</span> <span class="sunlight-punctuation">}</span><span class="sunlight-punctuation">)</span> <span class="sunlight-operator">=</span><span class="sunlight-operator">></span> <span class="sunlight-punctuation">{</span>
|
||||
@@ -2084,7 +2229,7 @@
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../../../types/classes/_accountid_.accountid.html" class="navigation navigation-next " aria-label="Next page: hidden">
|
||||
<a href="../../rx/" class="navigation navigation-next " aria-label="Next page: ApiRx">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
@@ -2095,7 +2240,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Upgrade via sudo","level":"3.1.8","depth":2,"next":{"title":"hidden","level":"4.1","depth":1,"path":"types/classes/_accountid_.accountid.md","ref":"types/classes/_accountid_.accountid.md","articles":[]},"previous":{"title":"Transaction with events","level":"3.1.7","depth":2,"path":"examples/promise/09_transfer_events/README.md","ref":"examples/promise/09_transfer_events/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":"examples/promise/10_upgrade_chain/README.md","mtime":"2019-01-17T16:15:44.325Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Upgrade via sudo","level":"3.1.9","depth":2,"next":{"title":"ApiRx","level":"3.2","depth":1,"path":"examples/rx/README.md","ref":"examples/rx/README.md","articles":[{"title":"Simple connect","level":"3.2.1","depth":2,"path":"examples/rx/01_simple_connect/README.md","ref":"examples/rx/01_simple_connect/README.md","articles":[]},{"title":"Listen to blocks","level":"3.2.2","depth":2,"path":"examples/rx/02_listen_to_blocks/README.md","ref":"examples/rx/02_listen_to_blocks/README.md","articles":[]},{"title":"Listen to balance change","level":"3.2.3","depth":2,"path":"examples/rx/03_listen_to_balance_change/README.md","ref":"examples/rx/03_listen_to_balance_change/README.md","articles":[]},{"title":"Unsubscribe from listening","level":"3.2.4","depth":2,"path":"examples/rx/04_unsubscribe/README.md","ref":"examples/rx/04_unsubscribe/README.md","articles":[]},{"title":"Read chain state","level":"3.2.5","depth":2,"path":"examples/rx/05_read_storage/README.md","ref":"examples/rx/05_read_storage/README.md","articles":[]},{"title":"Make a transfer","level":"3.2.6","depth":2,"path":"examples/rx/06_make_transfer/README.md","ref":"examples/rx/06_make_transfer/README.md","articles":[]},{"title":"Display system events","level":"3.2.7","depth":2,"path":"examples/rx/08_system_events/README.md","ref":"examples/rx/08_system_events/README.md","articles":[]},{"title":"Transaction with events","level":"3.2.8","depth":2,"path":"examples/rx/09_transfer_events/README.md","ref":"examples/rx/09_transfer_events/README.md","articles":[]},{"title":"Upgrade via sudo","level":"3.2.9","depth":2,"path":"examples/rx/10_upgrade_chain/README.md","ref":"examples/rx/10_upgrade_chain/README.md","articles":[]}]},"previous":{"title":"Transaction with events","level":"3.1.8","depth":2,"path":"examples/promise/09_transfer_events/README.md","ref":"examples/promise/09_transfer_events/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":"examples/promise/10_upgrade_chain/README.md","mtime":"2019-01-22T22:13:44.156Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -330,7 +330,20 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.4" data-path="05_read_storage/">
|
||||
<li class="chapter " data-level="3.1.4" data-path="04_unsubscribe/">
|
||||
|
||||
<a href="04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="05_read_storage/">
|
||||
|
||||
<a href="05_read_storage/">
|
||||
|
||||
@@ -343,9 +356,9 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.5" data-path="07_transfer_dots/">
|
||||
<li class="chapter " data-level="3.1.6" data-path="06_make_transfer/">
|
||||
|
||||
<a href="07_transfer_dots/">
|
||||
<a href="06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
@@ -356,7 +369,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.6" data-path="08_system_events/">
|
||||
<li class="chapter " data-level="3.1.7" data-path="08_system_events/">
|
||||
|
||||
<a href="08_system_events/">
|
||||
|
||||
@@ -369,7 +382,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.7" data-path="09_transfer_events/">
|
||||
<li class="chapter " data-level="3.1.8" data-path="09_transfer_events/">
|
||||
|
||||
<a href="09_transfer_events/">
|
||||
|
||||
@@ -382,7 +395,7 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.1.8" data-path="10_upgrade_chain/">
|
||||
<li class="chapter " data-level="3.1.9" data-path="10_upgrade_chain/">
|
||||
|
||||
<a href="10_upgrade_chain/">
|
||||
|
||||
@@ -393,6 +406,142 @@
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2" data-path="../rx/">
|
||||
|
||||
<a href="../rx/">
|
||||
|
||||
|
||||
ApiRx
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="3.2.1" data-path="../rx/01_simple_connect/">
|
||||
|
||||
<a href="../rx/01_simple_connect/">
|
||||
|
||||
|
||||
Simple connect
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.2" data-path="../rx/02_listen_to_blocks/">
|
||||
|
||||
<a href="../rx/02_listen_to_blocks/">
|
||||
|
||||
|
||||
Listen to blocks
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.3" data-path="../rx/03_listen_to_balance_change/">
|
||||
|
||||
<a href="../rx/03_listen_to_balance_change/">
|
||||
|
||||
|
||||
Listen to balance change
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.4" data-path="../rx/04_unsubscribe/">
|
||||
|
||||
<a href="../rx/04_unsubscribe/">
|
||||
|
||||
|
||||
Unsubscribe from listening
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.5" data-path="../rx/05_read_storage/">
|
||||
|
||||
<a href="../rx/05_read_storage/">
|
||||
|
||||
|
||||
Read chain state
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.6" data-path="../rx/06_make_transfer/">
|
||||
|
||||
<a href="../rx/06_make_transfer/">
|
||||
|
||||
|
||||
Make a transfer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.7" data-path="../rx/08_system_events/">
|
||||
|
||||
<a href="../rx/08_system_events/">
|
||||
|
||||
|
||||
Display system events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.8" data-path="../rx/09_transfer_events/">
|
||||
|
||||
<a href="../rx/09_transfer_events/">
|
||||
|
||||
|
||||
Transaction with events
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="3.2.9" data-path="../rx/10_upgrade_chain/">
|
||||
|
||||
<a href="../rx/10_upgrade_chain/">
|
||||
|
||||
|
||||
Upgrade via sudo
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
@@ -2044,7 +2193,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"ApiPromise","level":"3.1","depth":1,"next":{"title":"Simple connect","level":"3.1.1","depth":2,"path":"examples/promise/01_simple_connect/README.md","ref":"examples/promise/01_simple_connect/README.md","articles":[]},"previous":{"title":"Events (runtime)","level":"2.4","depth":1,"path":"METHODS_EVENTS.md","ref":"METHODS_EVENTS.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":"examples/promise/README.md","mtime":"2019-01-17T16:15:44.329Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-17T16:19:54.997Z"},"basePath":"../..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"ApiPromise","level":"3.1","depth":1,"next":{"title":"Simple connect","level":"3.1.1","depth":2,"path":"examples/promise/01_simple_connect/README.md","ref":"examples/promise/01_simple_connect/README.md","articles":[]},"previous":{"title":"Events (runtime)","level":"2.4","depth":1,"path":"METHODS_EVENTS.md","ref":"METHODS_EVENTS.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":"examples/promise/README.md","mtime":"2019-01-22T22:13:44.160Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-22T22:17:48.947Z"},"basePath":"../..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user