Documentation update.
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -42,7 +43,7 @@
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Classes</li>
|
||||
<li>AccountIndex</li>
|
||||
<li >AccountIndex</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@@ -63,22 +64,19 @@
|
||||
<code>src/app/_eth/accountIndex.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
<p class="comment">
|
||||
<h3>Description</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<p>Provides an instance of the accounts registry contract.
|
||||
Allows querying of accounts that have been registered as valid accounts in the network.</p>
|
||||
<p>This is our interface to the accounts registry contract.</p>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<p class="comment">
|
||||
<h3>Example</h3>
|
||||
</p>
|
||||
<div class="io-description">
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
@@ -93,13 +91,13 @@ Allows querying of accounts that have been registered as valid accounts in the n
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<a href="#contract">contract</a>
|
||||
<a href="#contract" >contract</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#contractAddress">contractAddress</a>
|
||||
<a href="#contractAddress" >contractAddress</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#signerAddress">signerAddress</a>
|
||||
<a href="#signerAddress" >signerAddress</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
@@ -116,22 +114,22 @@ Allows querying of accounts that have been registered as valid accounts in the n
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<a href="#addToAccountRegistry">addToAccountRegistry</a>
|
||||
<a href="#addToAccountRegistry" >addToAccountRegistry</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<a href="#haveAccount">haveAccount</a>
|
||||
<a href="#haveAccount" >haveAccount</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<a href="#last">last</a>
|
||||
<a href="#last" >last</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<a href="#totalAccounts">totalAccounts</a>
|
||||
<a href="#totalAccounts" >totalAccounts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
@@ -223,108 +221,105 @@ Allows querying of accounts that have been registered as valid accounts in the n
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="inputs">
|
||||
Properties
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<h3 id="inputs">
|
||||
Properties
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="contract"></a>
|
||||
<span class="name">
|
||||
<span ><b>contract</b></span>
|
||||
<a href="#contract"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="contract"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
contract</b>
|
||||
<a href="#contract"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
||||
|
||||
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/app/_eth/accountIndex.ts:22</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/app/_eth/accountIndex.ts:22</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>The instance of the account registry contract. </p>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>The instance of the account registry contract.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="contractAddress"></a>
|
||||
<span class="name">
|
||||
<span ><b>contractAddress</b></span>
|
||||
<a href="#contractAddress"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="contractAddress"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
contractAddress</b>
|
||||
<a href="#contractAddress"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
|
||||
<div class="io-line">Defined in <a href="" data-line="24" class="link-to-prism">src/app/_eth/accountIndex.ts:24</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="24" class="link-to-prism">src/app/_eth/accountIndex.ts:24</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>The deployed account registry contract's address. </p>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>The deployed account registry contract's address.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="signerAddress"></a>
|
||||
<span class="name">
|
||||
<span ><b>signerAddress</b></span>
|
||||
<a href="#signerAddress"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="signerAddress"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
signerAddress</b>
|
||||
<a href="#signerAddress"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
|
||||
<div class="io-line">Defined in <a href="" data-line="26" class="link-to-prism">src/app/_eth/accountIndex.ts:26</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="26" class="link-to-prism">src/app/_eth/accountIndex.ts:26</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>The account address of the account that deployed the account registry contract. </p>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>The account address of the account that deployed the account registry contract.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -338,11 +333,9 @@ Allows querying of accounts that have been registered as valid accounts in the n
|
||||
<td class="col-md-4">
|
||||
<a name="addToAccountRegistry"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
addToAccountRegistry
|
||||
</b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<span ><b>addToAccountRegistry</b></span>
|
||||
<a href="#addToAccountRegistry"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
@@ -357,8 +350,8 @@ Allows querying of accounts that have been registered as valid accounts in the n
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="58"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:58</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="61"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:61</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -367,7 +360,8 @@ Allows querying of accounts that have been registered as valid accounts in the n
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Registers an account to the accounts registry.
|
||||
Requires availability of the signer address.</p>
|
||||
</div>
|
||||
<p>Prints "true" for registration of '0xc0ffee254729296a45a3885639AC7E10F9d54979':</p>
|
||||
<div><pre class="line-numbers"><code class="language-typescript">console.log(await addToAccountRegistry('0xc0ffee254729296a45a3885639AC7E10F9d54979'));</code></pre></div></div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -406,11 +400,8 @@ Requires availability of the signer address.</p>
|
||||
<b>Example :</b>
|
||||
<div>
|
||||
<pre class="line-numbers"><code class="language-html">Prints &quot;true&quot; for registration of &#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;:</p>
|
||||
<p>```typescript</p>
|
||||
<ul>
|
||||
<li>console.log(await addToAccountRegistry(&#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;));</li>
|
||||
<li>```</li>
|
||||
</ul></code></pre>
|
||||
<pre><code class="language-typescript">console.log(await addToAccountRegistry(&#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;));
|
||||
</code></pre></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
@@ -431,11 +422,9 @@ Requires availability of the signer address.</p>
|
||||
<td class="col-md-4">
|
||||
<a name="haveAccount"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
haveAccount
|
||||
</b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<span ><b>haveAccount</b></span>
|
||||
<a href="#haveAccount"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
@@ -450,8 +439,8 @@ Requires availability of the signer address.</p>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="79"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:79</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="82"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:82</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -460,7 +449,8 @@ Requires availability of the signer address.</p>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Checks whether a specific account address has been registered in the accounts registry.
|
||||
Returns "true" for available and "false" otherwise.</p>
|
||||
</div>
|
||||
<p>Prints "true" or "false" depending on whether '0xc0ffee254729296a45a3885639AC7E10F9d54979' has been registered:</p>
|
||||
<div><pre class="line-numbers"><code class="language-typescript">console.log(await haveAccount('0xc0ffee254729296a45a3885639AC7E10F9d54979'));</code></pre></div></div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -499,11 +489,8 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
<b>Example :</b>
|
||||
<div>
|
||||
<pre class="line-numbers"><code class="language-html">Prints &quot;true&quot; or &quot;false&quot; depending on whether &#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39; has been registered:</p>
|
||||
<p>```typescript</p>
|
||||
<ul>
|
||||
<li>console.log(await haveAccount(&#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;));</li>
|
||||
<li>```</li>
|
||||
</ul></code></pre>
|
||||
<pre><code class="language-typescript">console.log(await haveAccount(&#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;));
|
||||
</code></pre></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
@@ -524,11 +511,9 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
<td class="col-md-4">
|
||||
<a name="last"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
last
|
||||
</b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<span ><b>last</b></span>
|
||||
<a href="#last"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
@@ -543,8 +528,8 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="96"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:96</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="99"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:99</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -552,7 +537,8 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Returns a specified number of the most recently registered accounts.</p>
|
||||
</div>
|
||||
<p>Prints an array of accounts:</p>
|
||||
<div><pre class="line-numbers"><code class="language-typescript">console.log(await last(5));</code></pre></div></div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -591,11 +577,8 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
<b>Example :</b>
|
||||
<div>
|
||||
<pre class="line-numbers"><code class="language-html">Prints an array of accounts:</p>
|
||||
<p>```typescript</p>
|
||||
<ul>
|
||||
<li>console.log(await last(5));</li>
|
||||
<li>```</li>
|
||||
</ul></code></pre>
|
||||
<pre><code class="language-typescript">console.log(await last(5));
|
||||
</code></pre></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
@@ -616,11 +599,9 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
<td class="col-md-4">
|
||||
<a name="totalAccounts"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
totalAccounts
|
||||
</b>
|
||||
<span class="modifier">Public</span>
|
||||
<span class="modifier">Async</span>
|
||||
<span ><b>totalAccounts</b></span>
|
||||
<a href="#totalAccounts"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
@@ -635,8 +616,8 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="122"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:122</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="125"
|
||||
class="link-to-prism">src/app/_eth/accountIndex.ts:125</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -644,17 +625,15 @@ Returns "true" for available and "false" otherwise.</p>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Returns the total number of accounts that have been registered in the network.</p>
|
||||
</div>
|
||||
<p>Prints the total number of registered accounts:</p>
|
||||
<div><pre class="line-numbers"><code class="language-typescript">console.log(await totalAccounts());</code></pre></div></div>
|
||||
|
||||
<div>
|
||||
<b>Example :</b>
|
||||
<div>
|
||||
<pre class="line-numbers"><code class="language-html">Prints the total number of registered accounts:</p>
|
||||
<p>```typescript</p>
|
||||
<ul>
|
||||
<li>console.log(await totalAccounts());</li>
|
||||
<li>```</li>
|
||||
</ul></code></pre>
|
||||
<pre><code class="language-typescript">console.log(await totalAccounts());
|
||||
</code></pre></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
@@ -714,6 +693,9 @@ export class AccountIndex {
|
||||
constructor(contractAddress: string, signerAddress?: string) {
|
||||
this.contractAddress = contractAddress;
|
||||
this.contract = new web3.eth.Contract(abi, this.contractAddress);
|
||||
// TODO this signer logic should be part of the web3service
|
||||
// if signer address is not passed (for example in user service) then
|
||||
// this fallsback to a web3 wallet that is not even connected???
|
||||
if (signerAddress) {
|
||||
this.signerAddress = signerAddress;
|
||||
} else {
|
||||
@@ -837,9 +819,9 @@ export class AccountIndex {
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
|
||||
<script src="../js/libs/custom-elements-es5-adapter.js" charset="utf-8" defer></script>
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user