[CI Skip] 0.29.4

This commit is contained in:
Travis CI
2018-09-17 12:37:37 +00:00
parent f5b0e23e4b
commit ef78f2a024
69 changed files with 16231 additions and 280 deletions
+2 -2
View File
@@ -97,7 +97,7 @@ api.chain
**Ƭ ApiInterface**: *`object`*
*Defined in [types.d.ts:18](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/types.d.ts#L18)*
*Defined in [types.d.ts:18](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L18)*
#### Type declaration
@@ -108,7 +108,7 @@ ___
**Ƭ ApiInterface$Section**: *`object`*
*Defined in [types.d.ts:14](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/types.d.ts#L14)*
*Defined in [types.d.ts:14](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L14)*
#### Type declaration
+5 -5
View File
@@ -41,7 +41,7 @@ const api = new Api(provider);
⊕ **new Api**(provider: *`ProviderInterface`*): [Api](api.md)
*Defined in [index.ts:37](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/index.ts#L37)*
*Defined in [index.ts:37](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/index.ts#L37)*
*__constructor__*: Default constructor for the Api Object
@@ -63,7 +63,7 @@ ___
**● author**: *[ApiInterface$Section](../#apiinterface_section)*
*Defined in [index.ts:34](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/index.ts#L34)*
*Defined in [index.ts:34](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/index.ts#L34)*
___
<a id="chain"></a>
@@ -72,7 +72,7 @@ ___
**● chain**: *[ApiInterface$Section](../#apiinterface_section)*
*Defined in [index.ts:35](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/index.ts#L35)*
*Defined in [index.ts:35](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/index.ts#L35)*
___
<a id="state"></a>
@@ -81,7 +81,7 @@ ___
**● state**: *[ApiInterface$Section](../#apiinterface_section)*
*Defined in [index.ts:36](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/index.ts#L36)*
*Defined in [index.ts:36](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/index.ts#L36)*
___
<a id="system"></a>
@@ -90,7 +90,7 @@ ___
**● system**: *[ApiInterface$Section](../#apiinterface_section)*
*Defined in [index.ts:37](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/index.ts#L37)*
*Defined in [index.ts:37](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/index.ts#L37)*
___
+564
View File
@@ -0,0 +1,564 @@
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>api · Polkadot API Book</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../api-format/" />
<link rel="prev" href="../" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="header">Intro</li>
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
Introduction
</a>
</li>
<li class="header">API</li>
<li class="chapter active" data-level="2.1" data-path="./">
<a href="./">
api
</a>
</li>
<li class="chapter " data-level="2.2" data-path="../api-format/">
<a href="../api-format/">
api-format
</a>
</li>
<li class="chapter " data-level="2.3" data-path="../api-provider/">
<a href="../api-provider/">
api-provider
</a>
</li>
<li class="chapter " data-level="2.4" data-path="../api-rx/">
<a href="../api-rx/">
api-rx
</a>
</li>
<li class="chapter " data-level="2.5" data-path="../type-extrinsics/">
<a href="../type-extrinsics/">
type-extrinsics
</a>
</li>
<li class="chapter " data-level="2.6" data-path="../type-jsonrpc/">
<a href="../type-jsonrpc/">
type-jsonrpc
</a>
</li>
<li class="chapter " data-level="2.7" data-path="../type-params/">
<a href="../type-params/">
type-params
</a>
</li>
<li class="chapter " data-level="2.8" data-path="../type-primitives/">
<a href="../type-primitives/">
type-primitives
</a>
</li>
<li class="chapter " data-level="2.9" data-path="../type-storage/">
<a href="../type-storage/">
type-storage
</a>
</li>
<li class="header">Examples</li>
<li class="chapter " data-level="3.1" data-path="../examples/">
<a href="../examples/">
Overview
</a>
</li>
<li class="chapter " data-level="3.2" data-path="../examples/01_simple_connect/">
<a href="../examples/01_simple_connect/">
Simple connect
</a>
</li>
<li class="chapter " data-level="3.3" data-path="../examples/02_listen_to_blocks/">
<a href="../examples/02_listen_to_blocks/">
Listen to blocks
</a>
</li>
<li class="chapter " data-level="3.4" data-path="../examples/03_listen_to_balance_change/">
<a href="../examples/03_listen_to_balance_change/">
Listen to balance change
</a>
</li>
<li class="chapter " data-level="3.5" data-path="../examples/04_generate_account/">
<a href="../examples/04_generate_account/">
Generate Accounts
</a>
</li>
<li class="chapter " data-level="3.6" data-path="../examples/05_read_storage/">
<a href="../examples/05_read_storage/">
Read Storage
</a>
</li>
<li class="chapter " data-level="3.7" data-path="../examples/06_craft_extrinsic/">
<a href="../examples/06_craft_extrinsic/">
Craft Extrinsic
</a>
</li>
<li class="chapter " data-level="3.8" data-path="../examples/07_transfer_dots/">
<a href="../examples/07_transfer_dots/">
Transfer DOTs
</a>
</li>
<li class="header">Contributing</li>
<li class="chapter " data-level="4.1" data-path="../CONTRIBUTING.html">
<a href="../CONTRIBUTING.html">
Contributing guide
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >api</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<p><a href="https://polkadot.js.org" target="_blank"><img src="https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square" alt="polkadotjs"></a> <img src="https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square" alt="isc"> <a href="https://github.com/Flet/semistandard" target="_blank"><img src="https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square" alt="style"></a> <a href="https://www.npmjs.com/package/@polkadot/api" target="_blank"><img src="https://img.shields.io/npm/v/@polkadot/api.svg?style=flat-square" alt="npm"></a> <a href="https://travis-ci.org/polkadot-js/api" target="_blank"><img src="https://img.shields.io/travis/polkadot-js/api.svg?style=flat-square" alt="travis"></a> <a href="https://codeclimate.com/github/polkadot-js/api/maintainability" target="_blank"><img src="https://img.shields.io/codeclimate/maintainability/polkadot-js/api.svg?style=flat-square" alt="maintainability"></a> <a href="https://coveralls.io/github/polkadot-js/api?branch=master" target="_blank"><img src="https://img.shields.io/coveralls/polkadot-js/api.svg?style=flat-square" alt="coverage"></a> <a href="https://david-dm.org/polkadot-js/api?path=packages/api" target="_blank"><img src="https://david-dm.org/polkadot-js/api.svg?style=flat-square&amp;path=packages/api" alt="dependency"></a> <a href="https://david-dm.org/polkadot-js/api?path=packages/api#info=devDependencies" target="_blank"><img src="https://david-dm.org/polkadot-js/api/dev-status.svg?style=flat-square&amp;path=packages/api" alt="devDependency"></a></p>
<h1 id="polkadotapi">@polkadot/api</h1>
<p>Warning - currently this does not actually do all that much, it is an attempt to put into code some thoughts about how to maintain the endpoints. This library provides a clean wrapper around all the methods exposed by a Polkadot network client.</p>
<p>Methods are auto-generated for the <a href="https://github.com/polkadot-js/api/packages/type-jsonrpc" target="_blank">JsonRPC interface definitions</a>, containing a full list of all sections and the methods contained within.</p>
<h2 id="usage">Usage</h2>
<p>Installation -</p>
<pre><code>npm install --save @polkadot/api
</code></pre><p>Initialisation -</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> Api <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@polkadot/api&apos;</span>;
<span class="hljs-keyword">import</span> WsProvider <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@polkadot/api-provider/ws&apos;</span>;
<span class="hljs-keyword">const</span> provider = <span class="hljs-keyword">new</span> WsProvider(<span class="hljs-string">&apos;http://127.0.0.1:9944&apos;</span>);
<span class="hljs-keyword">const</span> api = <span class="hljs-keyword">new</span> Api(provider);
</code></pre>
<p>Making calls -</p>
<pre><code class="lang-js">api.chain
.getHeader(<span class="hljs-string">&apos;0x1234567890&apos;</span>)
.then((header) =&gt; <span class="hljs-built_in">console</span>.log(header))
.catch((error) =&gt; <span class="hljs-built_in">console</span>.error(error));
</code></pre>
<p>Retrieving the best block (once-off) -</p>
<pre><code class="lang-js">api.chain
.getHead()
.then((headerHash) =&gt; {
<span class="hljs-keyword">return</span> api.chain.getHeader(headerHash);
})
.then((header) =&gt; {
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">`best #<span class="hljs-subst">${header.number.toString()}</span>`</span>);
})
.catch((error) =&gt; {
<span class="hljs-built_in">console</span>.error(<span class="hljs-string">&apos;error:&apos;</span>, error);
});
</code></pre>
<p>Retrieving best header via subscription -</p>
<pre><code class="lang-js">api.chain
.newHead((error, header) =&gt; {
<span class="hljs-keyword">if</span> (error) {
<span class="hljs-built_in">console</span>.error(<span class="hljs-string">&apos;error:&apos;</span>, error);
}
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">`best #<span class="hljs-subst">${header.number.toString()}</span>`</span>);
})
.then((subscriptionId) =&gt; {
<span class="hljs-comment">// id for the subscription, can unsubscribe via</span>
<span class="hljs-comment">// api.chain.newHead.unsubscribe(subscriptionId)</span>
})
.catch((error) =&gt; {
<span class="hljs-built_in">console</span>.error(<span class="hljs-string">&apos;error subscribing:&apos;</span>, error);
});
</code></pre>
<h2 id="index">Index</h2>
<h3 id="classes">Classes</h3>
<ul>
<li><a href="classes/api.md">Api</a></li>
</ul>
<h3 id="interfaces">Interfaces</h3>
<ul>
<li><a href="interfaces/apiinterface_section_method.md">ApiInterface$Section$Method</a></li>
</ul>
<h3 id="type-aliases">Type aliases</h3>
<ul>
<li><a href="#apiinterface">ApiInterface</a></li>
<li><a href="#apiinterface_section">ApiInterface$Section</a></li>
</ul>
<hr>
<h2 id="type-aliases">Type aliases</h2>
<p><a id="apiinterface"></a></p>
<h3 id="apiinterface">ApiInterface</h3>
<p><strong>&#x1AC; ApiInterface</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L18" target="_blank">types.d.ts:18</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
<p><a id="apiinterface_section"></a></p>
<h3 id="apiinterfacesection">ApiInterface$Section</h3>
<p><strong>&#x1AC; ApiInterface$Section</strong>: <em><code>object</code></em></p>
<p><em>Defined in <a href="https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L14" target="_blank">types.d.ts:14</a></em></p>
<h4 id="type-declaration">Type declaration</h4>
<hr>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../" class="navigation navigation-prev " aria-label="Previous page: Introduction">
<i class="fa fa-angle-left"></i>
</a>
<a href="../api-format/" class="navigation navigation-next " aria-label="Next page: api-format">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"api","level":"2.1","depth":1,"next":{"title":"api-format","level":"2.2","depth":1,"path":"api-format/README.md","ref":"api-format/README.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.adoc","ref":"README.adoc","articles":[]},"dir":"ltr"},"config":{"plugins":["asciidoc-include"],"root":"docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"asciidoc-include":{"syntax":"asciidoc"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot API Book","gitbook":">=2.4.0"},"file":{"path":"api/README.md","mtime":"2018-09-17T12:34:28.968Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-17T12:37:27.221Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>
@@ -9,7 +9,7 @@
## Callable
▸ **__call**(...params: *`Array`<`any`>*): `Promise`<`any`>
*Defined in [types.d.ts:7](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/types.d.ts#L7)*
*Defined in [types.d.ts:7](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L7)*
**Parameters:**
@@ -36,7 +36,7 @@
**● subscription**: *`string`*
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/types.d.ts#L10)*
*Defined in [types.d.ts:10](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L10)*
___
<a id="unsubscribe"></a>
@@ -45,7 +45,7 @@ ___
**● unsubscribe**: *`function`*
*Defined in [types.d.ts:11](https://github.com/polkadot-js/api/blob/5f8c52d/packages/api/src/types.d.ts#L11)*
*Defined in [types.d.ts:11](https://github.com/polkadot-js/api/blob/f5b0e23/packages/api/src/types.d.ts#L11)*
#### Type declaration
▸(id: *`number`*): `Promise`<`any`>