Skip to content

Commit

Permalink
docs: enhance the documentation and add inline code examples (#286)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominique <[email protected]>
  • Loading branch information
TarikGul and Imod7 authored Sep 18, 2023
1 parent 780dfdf commit 5a69541
Show file tree
Hide file tree
Showing 23 changed files with 908 additions and 406 deletions.
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

205 changes: 205 additions & 0 deletions docs/enums/errors_BaseError.BaseErrorsEnum.html

Large diffs are not rendered by default.

65 changes: 35 additions & 30 deletions docs/enums/Direction.html → docs/enums/types.Direction.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
<div class="col-content">
<div class="tsd-page-title">
<ul class="tsd-breadcrumb">
<li><a href="../modules.html">@substrate/asset-transfer-api</a></li>
<li><a href="constructApiPromise.html">constructApiPromise</a></li></ul>
<li><a href="../index.html">@substrate/asset-transfer-api</a></li>
<li><a href="../modules/constructApiPromise.html">constructApiPromise</a></li>
<li><a href="constructApiPromise.constructApiPromise.html">constructApiPromise</a></li></ul>
<h1>Function constructApiPromise</h1></div>
<section class="tsd-panel">
<ul class="tsd-signatures">
<li class="tsd-signature tsd-anchor-link" id="constructApiPromise"><span class="tsd-kind-call-signature">construct<wbr/>Api<wbr/>Promise</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">wsUrl</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/ApiInfo.html" class="tsd-signature-type tsd-kind-interface">ApiInfo</a><span class="tsd-signature-symbol">&gt;</span><a href="#constructApiPromise" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></li>
<li class="tsd-signature tsd-anchor-link" id="constructApiPromise"><span class="tsd-kind-call-signature">construct<wbr/>Api<wbr/>Promise</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">wsUrl</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/constructApiPromise.ApiInfo.html" class="tsd-signature-type tsd-kind-interface">ApiInfo</a><span class="tsd-signature-symbol">&gt;</span><a href="#constructApiPromise" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Construct an Polkadot-js ApiPromise, and and retrieve the specName of the chain</p>
<div class="tsd-comment tsd-typography"><p>Construct an Polkadot-js ApiPromise, and and retrieve the specName of the chain.</p>
<pre><code class="language-ts"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">constructApiPromise</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">&#39;@substrate/asset-transfer-api&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> { </span><span class="hl-6">api</span><span class="hl-1">, </span><span class="hl-6">specName</span><span class="hl-1">, </span><span class="hl-6">safeXcmVersion</span><span class="hl-1"> } = </span><span class="hl-7">constructApiPromise</span><span class="hl-1">(</span><span class="hl-3">&#39;wss://some_ws_url&#39;</span><span class="hl-1">);</span>
</code><button>Copy</button></pre>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -34,10 +37,10 @@ <h5><span class="tsd-kind-parameter">opts</span>: <span class="tsd-signature-typ
<div class="tsd-comment tsd-typography"><p>ApiOptions</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/ApiInfo.html" class="tsd-signature-type tsd-kind-interface">ApiInfo</a><span class="tsd-signature-symbol">&gt;</span></h4>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/constructApiPromise.ApiInfo.html" class="tsd-signature-type tsd-kind-interface">ApiInfo</a><span class="tsd-signature-symbol">&gt;</span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/0081da9/src/constructApiPromise.ts#L24">constructApiPromise.ts:24</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/b031f56/src/constructApiPromise.ts#L39">constructApiPromise.ts:39</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand All @@ -52,16 +55,15 @@ <h4 class="uppercase">Member Visibility</h4><form>
<div class="tsd-theme-toggle">
<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
<div class="site-menu">
<nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@substrate/asset-<wbr/>transfer-<wbr/>api -<wbr/> v0.1.0-<wbr/>beta.5</span></a>
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@substrate/asset-<wbr/>transfer-<wbr/>api -<wbr/> v0.1.0-<wbr/>beta.5</span></a>
<ul class="tsd-small-nested-navigation">
<li><a href="../enums/Direction.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>Direction</span></a></li>
<li><a href="../classes/AssetsTransferApi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Assets<wbr/>Transfer<wbr/>Api</span></a></li>
<li><a href="../interfaces/ApiInfo.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Api<wbr/>Info</span></a></li>
<li><a href="../interfaces/TransferArgsOpts.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Transfer<wbr/>Args<wbr/>Opts</span></a></li>
<li><a href="../interfaces/TxResult.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Tx<wbr/>Result</span></a></li>
<li><a href="../types/ConstructedFormat.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>Constructed<wbr/>Format</span></a></li>
<li><a href="../types/Format.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Format</span></a></li>
<li><a href="../types/LocalTransferTypes.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Local<wbr/>Transfer<wbr/>Types</span></a></li>
<li><a href="../types/Methods.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Methods</span></a></li>
<li><a href="constructApiPromise.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>construct<wbr/>Api<wbr/>Promise</span></a></li></ul></nav></div></div></div>
<li><a href="../modules/AssetsTransferApi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Assets<wbr/>Transfer<wbr/>Api</span></a></li>
<li>
<details class="tsd-index-accordion" open data-key="constructApiPromise"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><a href="../modules/constructApiPromise.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>construct<wbr/>Api<wbr/>Promise</span></a></summary>
<div class="tsd-accordion-details">
<ul class="tsd-nested-navigation">
<li><a href="../interfaces/constructApiPromise.ApiInfo.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Api<wbr/>Info</span></a></li>
<li><a href="constructApiPromise.constructApiPromise.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>construct<wbr/>Api<wbr/>Promise</span></a></li></ul></div></details></li>
<li><a href="../modules/errors_BaseError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>errors/<wbr/>Base<wbr/>Error</span></a></li>
<li><a href="../modules/types.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>types</span></a></li></ul></nav></div></div></div>
<div class="overlay"></div><script src="../assets/custom.js"></script></body></html>
16 changes: 5 additions & 11 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,10 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon
<li><a href="#md:running-zombienet"><span>Running <wbr/>Zombienet</span></a></li>
<li><a href="#md:create-an-asset"><span>Create an asset</span></a></li></ul></li></ul></li></ul></li></ul></div></details></div>
<div class="site-menu">
<nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@substrate/asset-<wbr/>transfer-<wbr/>api -<wbr/> v0.1.0-<wbr/>beta.5</span></a>
<nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@substrate/asset-<wbr/>transfer-<wbr/>api -<wbr/> v0.1.0-<wbr/>beta.5</span></a>
<ul class="tsd-small-nested-navigation">
<li><a href="enums/Direction.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>Direction</span></a></li>
<li><a href="classes/AssetsTransferApi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Assets<wbr/>Transfer<wbr/>Api</span></a></li>
<li><a href="interfaces/ApiInfo.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Api<wbr/>Info</span></a></li>
<li><a href="interfaces/TransferArgsOpts.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Transfer<wbr/>Args<wbr/>Opts</span></a></li>
<li><a href="interfaces/TxResult.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Tx<wbr/>Result</span></a></li>
<li><a href="types/ConstructedFormat.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>Constructed<wbr/>Format</span></a></li>
<li><a href="types/Format.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Format</span></a></li>
<li><a href="types/LocalTransferTypes.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Local<wbr/>Transfer<wbr/>Types</span></a></li>
<li><a href="types/Methods.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Methods</span></a></li>
<li><a href="functions/constructApiPromise.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>construct<wbr/>Api<wbr/>Promise</span></a></li></ul></nav></div></div></div>
<li><a href="modules/AssetsTransferApi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Assets<wbr/>Transfer<wbr/>Api</span></a></li>
<li><a href="modules/constructApiPromise.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>construct<wbr/>Api<wbr/>Promise</span></a></li>
<li><a href="modules/errors_BaseError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>errors/<wbr/>Base<wbr/>Error</span></a></li>
<li><a href="modules/types.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>types</span></a></li></ul></nav></div></div></div>
<div class="overlay"></div><script src="assets/custom.js"></script></body></html>
Loading

0 comments on commit 5a69541

Please sign in to comment.