From 33a446cfa453e14f9e70a3192380731ac588e306 Mon Sep 17 00:00:00 2001 From: Spencer Ofwiti Date: Thu, 2 Sep 2021 23:48:41 +0000 Subject: [PATCH] Documentation update. --- docs/compodoc/classes/AccountIndex.html | 258 +- docs/compodoc/classes/ActivatedRouteStub.html | 106 +- .../classes/CustomErrorStateMatcher.html | 18 +- docs/compodoc/classes/CustomValidator.html | 28 +- docs/compodoc/classes/HttpError.html | 70 +- docs/compodoc/classes/MutablePgpKeyStore.html | 184 +- docs/compodoc/classes/PGPSigner.html | 440 ++- docs/compodoc/classes/Settings.html | 218 +- docs/compodoc/classes/TokenRegistry.html | 219 +- docs/compodoc/classes/TokenServiceStub.html | 18 +- .../classes/TransactionServiceStub.html | 30 +- docs/compodoc/classes/UserServiceStub.html | 144 +- .../components/AccountDetailsComponent.html | 2762 +++++++++++------ .../components/AccountHistoryComponent.html | 619 ++++ .../components/AccountSearchComponent.html | 628 ++-- .../components/AccountsComponent.html | 652 ++-- docs/compodoc/components/AdminComponent.html | 401 +-- docs/compodoc/components/AppComponent.html | 574 +++- docs/compodoc/components/AuthComponent.html | 270 +- .../components/CreateAccountComponent.html | 387 +-- .../components/ErrorDialogComponent.html | 77 +- docs/compodoc/components/FooterComponent.html | 61 +- .../components/FooterStubComponent.html | 16 +- .../components/NetworkStatusComponent.html | 115 +- .../components/OrganizationComponent.html | 161 +- docs/compodoc/components/PagesComponent.html | 67 +- .../components/SettingsComponent.html | 380 +-- .../compodoc/components/SidebarComponent.html | 22 +- .../components/SidebarStubComponent.html | 16 +- .../components/TokenDetailsComponent.html | 32 +- docs/compodoc/components/TokensComponent.html | 469 +-- docs/compodoc/components/TopbarComponent.html | 22 +- .../components/TopbarStubComponent.html | 16 +- .../TransactionDetailsComponent.html | 317 +- .../components/TransactionsComponent.html | 590 ++-- docs/compodoc/coverage.html | 177 +- docs/compodoc/dependencies.html | 9 +- .../directives/MenuSelectionDirective.html | 22 +- .../directives/MenuToggleDirective.html | 22 +- .../directives/PasswordToggleDirective.html | 30 +- .../directives/RouterLinkDirectiveStub.html | 137 +- docs/compodoc/graph/dependencies.svg | 890 +++--- docs/compodoc/guards/AuthGuard.html | 21 +- docs/compodoc/guards/RoleGuard.html | 19 +- .../images/coverage-badge-documentation.svg | 6 +- docs/compodoc/index.html | 9 +- docs/compodoc/injectables/AuthService.html | 446 ++- .../injectables/BlockSyncService.html | 248 +- .../injectables/ErrorDialogService.html | 108 +- .../injectables/GlobalErrorHandler.html | 102 +- .../compodoc/injectables/KeystoreService.html | 67 +- .../compodoc/injectables/LocationService.html | 326 +- docs/compodoc/injectables/LoggingService.html | 164 +- .../compodoc/injectables/RegistryService.html | 355 ++- docs/compodoc/injectables/TokenService.html | 374 ++- .../injectables/TransactionService.html | 352 +-- docs/compodoc/injectables/UserService.html | 1878 ++++++----- docs/compodoc/injectables/Web3Service.html | 65 +- .../interceptors/ConnectionInterceptor.html | 28 +- .../interceptors/ErrorInterceptor.html | 33 +- .../interceptors/HttpConfigInterceptor.html | 50 +- .../interceptors/LoggingInterceptor.html | 28 +- .../interceptors/MockBackendInterceptor.html | 18 +- docs/compodoc/interfaces/AccountDetails.html | 146 +- docs/compodoc/interfaces/Action.html | 81 +- docs/compodoc/interfaces/Conversion.html | 107 +- docs/compodoc/interfaces/Meta.html | 55 +- docs/compodoc/interfaces/MetaResponse.html | 42 +- docs/compodoc/interfaces/MutableKeyStore.html | 245 +- docs/compodoc/interfaces/Signable.html | 27 +- docs/compodoc/interfaces/Signature-1.html | 68 +- docs/compodoc/interfaces/Signature.html | 68 +- docs/compodoc/interfaces/Signer.html | 80 +- docs/compodoc/interfaces/Staff.html | 81 +- docs/compodoc/interfaces/Token.html | 120 +- docs/compodoc/interfaces/Transaction.html | 120 +- docs/compodoc/interfaces/Tx.html | 81 +- docs/compodoc/interfaces/TxToken.html | 55 +- docs/compodoc/interfaces/W3.html | 42 +- docs/compodoc/js/libs/prism.js | 60 +- docs/compodoc/js/menu-wc.js | 309 +- docs/compodoc/js/menu-wc_es5.js | 60 + docs/compodoc/js/menu.js | 26 +- docs/compodoc/js/routes/routes_index.js | 2 +- docs/compodoc/js/search/lunr.min.js | 6 +- docs/compodoc/js/search/search_index.js | 4 +- docs/compodoc/license.html | 324 +- docs/compodoc/miscellaneous/functions.html | 295 +- docs/compodoc/miscellaneous/variables.html | 1121 ++++--- docs/compodoc/modules.html | 9 +- docs/compodoc/modules/AccountsModule.html | 185 +- .../modules/AccountsModule/dependencies.svg | 154 +- .../modules/AccountsRoutingModule.html | 12 +- docs/compodoc/modules/AdminModule.html | 16 +- docs/compodoc/modules/AdminRoutingModule.html | 12 +- docs/compodoc/modules/AppModule.html | 171 +- .../modules/AppModule/dependencies.svg | 146 +- docs/compodoc/modules/AppRoutingModule.html | 12 +- docs/compodoc/modules/AuthModule.html | 60 +- .../modules/AuthModule/dependencies.svg | 46 +- docs/compodoc/modules/AuthRoutingModule.html | 12 +- docs/compodoc/modules/PagesModule.html | 14 +- docs/compodoc/modules/PagesRoutingModule.html | 20 +- docs/compodoc/modules/SettingsModule.html | 62 +- .../modules/SettingsModule/dependencies.svg | 46 +- .../modules/SettingsRoutingModule.html | 12 +- docs/compodoc/modules/SharedModule.html | 269 +- .../modules/SharedModule/dependencies.svg | 246 +- docs/compodoc/modules/TokensModule.html | 16 +- .../compodoc/modules/TokensRoutingModule.html | 12 +- docs/compodoc/modules/TransactionsModule.html | 72 +- .../TransactionsModule/dependencies.svg | 56 +- .../modules/TransactionsRoutingModule.html | 12 +- docs/compodoc/overview.html | 909 +++--- docs/compodoc/pipes/SafePipe.html | 27 +- docs/compodoc/pipes/SignatureUserPipe.html | 257 ++ docs/compodoc/pipes/TokenRatioPipe.html | 16 +- docs/compodoc/pipes/UnixDatePipe.html | 20 +- docs/compodoc/routes.html | 9 +- docs/compodoc/styles/bootstrap.min.css | 7 +- docs/compodoc/styles/compodoc.css | 74 +- docs/compodoc/styles/dark.css | 113 + docs/compodoc/styles/laravel.css | 58 +- docs/compodoc/styles/material.css | 38 +- docs/compodoc/styles/original.css | 18 +- docs/compodoc/styles/postmark.css | 30 +- docs/compodoc/styles/prism.css | 300 +- docs/compodoc/styles/readthedocs.css | 33 +- docs/compodoc/styles/stripe.css | 53 +- docs/compodoc/styles/vagrant.css | 48 +- src/app/_helpers/online-status.ts | 14 +- .../_interceptors/http-config.interceptor.ts | 5 +- .../transaction-details.component.html | 17 +- 133 files changed, 13908 insertions(+), 9806 deletions(-) create mode 100644 docs/compodoc/components/AccountHistoryComponent.html create mode 100644 docs/compodoc/js/menu-wc_es5.js create mode 100644 docs/compodoc/pipes/SignatureUserPipe.html create mode 100644 docs/compodoc/styles/dark.css diff --git a/docs/compodoc/classes/AccountIndex.html b/docs/compodoc/classes/AccountIndex.html index 9808103..f0cae83 100644 --- a/docs/compodoc/classes/AccountIndex.html +++ b/docs/compodoc/classes/AccountIndex.html @@ -8,7 +8,8 @@ - + + @@ -42,7 +43,7 @@ @@ -223,108 +221,105 @@ Allows querying of accounts that have been registered as valid accounts in the n
-

- Properties -

- - +

+ Properties +

+
+ + + + - - - - - + - + + - -
+ + + contract + + +
- - - - contract - - + Type : any +
- Type : any - +
- -
-

The instance of the account registry contract.

+
+

The instance of the account registry contract.

-
- - + +
+ + + + + - - - - - + - + + - -
+ + + contractAddress + + +
- - - - contractAddress - - + Type : string +
- Type : string - +
- -
-

The deployed account registry contract's address.

+
+

The deployed account registry contract's address.

-
- - + +
+ + + + + - - - - - + - + + - -
+ + + signerAddress + + +
- - - - signerAddress - - + Type : string +
- Type : string - +
- -
-

The account address of the account that deployed the account registry contract.

+
+

The account address of the account that deployed the account registry contract.

-
+ +
@@ -338,11 +333,9 @@ Allows querying of accounts that have been registered as valid accounts in the n - - Public - Async - addToAccountRegistry - + Public + Async + addToAccountRegistry @@ -357,8 +350,8 @@ Allows querying of accounts that have been registered as valid accounts in the n - + @@ -367,7 +360,8 @@ Allows querying of accounts that have been registered as valid accounts in the n

Registers an account to the accounts registry. Requires availability of the signer address.

-
+

Prints "true" for registration of '0xc0ffee254729296a45a3885639AC7E10F9d54979':

+
console.log(await addToAccountRegistry('0xc0ffee254729296a45a3885639AC7E10F9d54979'));
Parameters : @@ -406,11 +400,8 @@ Requires availability of the signer address.

Example :
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>
+<pre><code class="language-typescript">console.log(await addToAccountRegistry(&#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;)); +</code></pre>
@@ -431,11 +422,9 @@ Requires availability of the signer address.

- - Public - Async - haveAccount - + Public + Async + haveAccount @@ -450,8 +439,8 @@ Requires availability of the signer address.

- + @@ -460,7 +449,8 @@ Requires availability of the signer address.

Checks whether a specific account address has been registered in the accounts registry. Returns "true" for available and "false" otherwise.

-
+

Prints "true" or "false" depending on whether '0xc0ffee254729296a45a3885639AC7E10F9d54979' has been registered:

+
console.log(await haveAccount('0xc0ffee254729296a45a3885639AC7E10F9d54979'));
Parameters : @@ -499,11 +489,8 @@ Returns "true" for available and "false" otherwise.

Example :
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>
+<pre><code class="language-typescript">console.log(await haveAccount(&#39;0xc0ffee254729296a45a3885639AC7E10F9d54979&#39;)); +</code></pre>
@@ -524,11 +511,9 @@ Returns "true" for available and "false" otherwise.

- - Public - Async - last - + Public + Async + last @@ -543,8 +528,8 @@ Returns "true" for available and "false" otherwise.

- + @@ -552,7 +537,8 @@ Returns "true" for available and "false" otherwise.

Returns a specified number of the most recently registered accounts.

-
+

Prints an array of accounts:

+
console.log(await last(5));
Parameters : @@ -591,11 +577,8 @@ Returns "true" for available and "false" otherwise.

Example :
Prints an array of accounts:</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await last(5));</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await last(5)); +</code></pre>
@@ -616,11 +599,9 @@ Returns "true" for available and "false" otherwise.

- - Public - Async - totalAccounts - + Public + Async + totalAccounts @@ -635,8 +616,8 @@ Returns "true" for available and "false" otherwise.

- + @@ -644,17 +625,15 @@ Returns "true" for available and "false" otherwise.

Returns the total number of accounts that have been registered in the network.

-
+

Prints the total number of registered accounts:

+
console.log(await totalAccounts());
Example :
Prints the total number of registered accounts:</p>
-<p>```typescript</p>
-<ul>
-<li>console.log(await totalAccounts());</li>
-<li>```</li>
-</ul>
+<pre><code class="language-typescript">console.log(await totalAccounts()); +</code></pre>
@@ -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 { - - - + + + diff --git a/docs/compodoc/classes/ActivatedRouteStub.html b/docs/compodoc/classes/ActivatedRouteStub.html index bca779e..83cb688 100644 --- a/docs/compodoc/classes/ActivatedRouteStub.html +++ b/docs/compodoc/classes/ActivatedRouteStub.html @@ -8,7 +8,8 @@ - + + @@ -42,7 +43,7 @@
@@ -620,12 +860,16 @@
import { ChangeDetectionStrategy, Component, HostListener, OnInit } from '@angular/core';
 import {
   AuthService,
+  BlockSyncService,
   ErrorDialogService,
   LoggingService,
+  TokenService,
   TransactionService,
+  UserService,
 } from '@app/_services';
-import { catchError } from 'rxjs/operators';
 import { SwUpdate } from '@angular/service-worker';
+import { NavigationEnd, Router } from '@angular/router';
+import { filter } from 'rxjs/operators';
 
 @Component({
   selector: 'app-root',
@@ -635,16 +879,20 @@ import { SwUpdate } from '@angular/service-worker';
 })
 export class AppComponent implements OnInit {
   title = 'CICADA';
-  readyStateTarget: number = 3;
-  readyState: number = 0;
   mediaQuery: MediaQueryList = window.matchMedia('(max-width: 768px)');
+  url: string;
+  accountDetailsRegex = '/accounts/[a-z,A-Z,0-9]{40}';
 
   constructor(
     private authService: AuthService,
-    private transactionService: TransactionService,
-    private loggingService: LoggingService,
+    private blockSyncService: BlockSyncService,
     private errorDialogService: ErrorDialogService,
-    private swUpdate: SwUpdate
+    private loggingService: LoggingService,
+    private tokenService: TokenService,
+    private transactionService: TransactionService,
+    private userService: UserService,
+    private swUpdate: SwUpdate,
+    private router: Router
   ) {
     this.mediaQuery.addEventListener('change', this.onResize);
     this.onResize(this.mediaQuery);
@@ -652,6 +900,8 @@ export class AppComponent implements OnInit {
 
   async ngOnInit(): Promise<void> {
     await this.authService.init();
+    await this.tokenService.init();
+    await this.userService.init();
     await this.transactionService.init();
     try {
       const publicKeys = await this.authService.getPublicKeys();
@@ -670,6 +920,7 @@ export class AppComponent implements OnInit {
         }
       });
     }
+    await this.routeManagement();
   }
 
   // Load resize
@@ -708,6 +959,33 @@ export class AppComponent implements OnInit {
     const conversion: any = event.detail.tx;
     await this.transactionService.setConversion(conversion, 100);
   }
+
+  async routeManagement(): Promise<void> {
+    await this.router.events
+      .pipe(filter((e) => e instanceof NavigationEnd))
+      .forEach(async (routeInfo) => {
+        if (routeInfo instanceof NavigationEnd) {
+          this.url = routeInfo.url;
+          if (!this.url.match(this.accountDetailsRegex) || !this.url.includes('tx')) {
+            await this.blockSyncService.blockSync();
+          }
+          if (!this.url.includes('accounts')) {
+            try {
+              await this.userService.loadAccounts(100);
+            } catch (error) {
+              this.loggingService.sendErrorLevelMessage('Failed to load accounts', this, { error });
+            }
+          }
+          if (!this.url.includes('tokens')) {
+            this.tokenService.load.subscribe(async (status: boolean) => {
+              if (status) {
+                await this.tokenService.getTokens();
+              }
+            });
+          }
+        }
+      });
+  }
 }
 
@@ -750,7 +1028,7 @@ export class AppComponent implements OnInit { @@ -793,9 +1071,9 @@ export class AppComponent implements OnInit { - - - + + + diff --git a/docs/compodoc/components/AuthComponent.html b/docs/compodoc/components/AuthComponent.html index bce0b2b..7682596 100644 --- a/docs/compodoc/components/AuthComponent.html +++ b/docs/compodoc/components/AuthComponent.html @@ -8,7 +8,8 @@ - + + @@ -35,7 +36,9 @@
-

- Properties -

- - +

+ Properties +

+
+ + + + - - - - -
+ + + keyForm + + +
- - - - keyForm - - + Type : FormGroup +
- Type : FormGroup - +
- -
- - + +
+ + + + + + + + - - - - - - - -
+ + + loading + + +
- - - - loading - - + Type : boolean + +
+ Default value : false
- Type : boolean - +
- Default value : false -
- -
- - + +
+ + + + + + + + - - - - - - - -
+ + + matcher + + +
- - - - matcher - - + Type : CustomErrorStateMatcher + +
+ Default value : new CustomErrorStateMatcher()
- Type : CustomErrorStateMatcher - +
- Default value : new CustomErrorStateMatcher() -
- -
- - + +
+ + + + + + + + - - - - - - - -
+ + + submitted + + +
- - - - submitted - - + Type : boolean + +
+ Default value : false
- Type : boolean - +
- Default value : false -
- -
+ +
@@ -678,7 +665,7 @@ - + @@ -694,7 +681,6 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { CustomErrorStateMatcher } from '@app/_helpers'; import { AuthService } from '@app/_services'; import { ErrorDialogService } from '@app/_services/error-dialog.service'; -import { LoggingService } from '@app/_services/logging.service'; import { Router } from '@angular/router'; @Component({ @@ -716,7 +702,7 @@ export class AuthComponent implements OnInit { private errorDialogService: ErrorDialogService ) {} - async ngOnInit(): Promise<void> { + ngOnInit(): void { this.keyForm = this.formBuilder.group({ key: ['', Validators.required], }); @@ -749,7 +735,7 @@ export class AuthComponent implements OnInit { } } catch (HttpError) { this.errorDialogService.openDialog({ - message: HttpError.message, + message: 'Failed to login please try again.', }); } } @@ -871,7 +857,7 @@ export class AuthComponent implements OnInit { @@ -914,9 +900,9 @@ export class AuthComponent implements OnInit { - - - + + + diff --git a/docs/compodoc/components/CreateAccountComponent.html b/docs/compodoc/components/CreateAccountComponent.html index 21cfc33..bcda900 100644 --- a/docs/compodoc/components/CreateAccountComponent.html +++ b/docs/compodoc/components/CreateAccountComponent.html @@ -8,7 +8,8 @@ - + + @@ -35,7 +36,9 @@
@@ -588,7 +618,7 @@ - + @@ -626,8 +656,7 @@ export class CreateAccountComponent implements OnInit { private userService: UserService ) {} - async ngOnInit(): Promise<void> { - await this.userService.init(); + ngOnInit(): void { this.createForm = this.formBuilder.group({ accountType: ['', Validators.required], idNumber: ['', Validators.required], @@ -640,6 +669,22 @@ export class CreateAccountComponent implements OnInit { referrer: ['', Validators.required], businessCategory: ['', Validators.required], }); + this.loadSearchData(); + } + + get createFormStub(): any { + return this.createForm.controls; + } + + onSubmit(): void { + this.submitted = true; + if (this.createForm.invalid || !confirm('Create account?')) { + return; + } + this.submitted = false; + } + + loadSearchData(): void { this.userService.getCategories(); this.userService.categoriesSubject.subscribe((res) => { this.categories = Object.keys(res); @@ -657,18 +702,6 @@ export class CreateAccountComponent implements OnInit { .pipe(first()) .subscribe((res) => (this.genders = res)); } - - get createFormStub(): any { - return this.createForm.controls; - } - - onSubmit(): void { - this.submitted = true; - if (this.createForm.invalid || !confirm('Create account?')) { - return; - } - this.submitted = false; - } } @@ -918,7 +951,7 @@ export class CreateAccountComponent implements OnInit { @@ -961,9 +994,9 @@ export class CreateAccountComponent implements OnInit { - - - + + + diff --git a/docs/compodoc/components/ErrorDialogComponent.html b/docs/compodoc/components/ErrorDialogComponent.html index 711b0b8..b3b0b19 100644 --- a/docs/compodoc/components/ErrorDialogComponent.html +++ b/docs/compodoc/components/ErrorDialogComponent.html @@ -8,7 +8,8 @@ - + + @@ -35,7 +36,9 @@
-

- Properties -

- - +

+ Properties +

+
+ + + + - - - - -
+ + + currentYear + + +
- - - - currentYear - - + Default value : new Date().getFullYear()
- Default value : new Date().getFullYear() +
- -
+ +
@@ -332,7 +333,7 @@ export class FooterComponent implements OnInit { @@ -375,9 +376,9 @@ export class FooterComponent implements OnInit { - - - + + + diff --git a/docs/compodoc/components/FooterStubComponent.html b/docs/compodoc/components/FooterStubComponent.html index 82df003..f27c7a2 100644 --- a/docs/compodoc/components/FooterStubComponent.html +++ b/docs/compodoc/components/FooterStubComponent.html @@ -8,7 +8,8 @@ - + + @@ -35,7 +36,9 @@