Format docs using linter and prettier.
This commit is contained in:
@@ -208,8 +208,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="38"
|
||||
class="link-to-prism">src/app/_services/token.service.ts:38</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="37"
|
||||
class="link-to-prism">src/app/_services/token.service.ts:37</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -278,8 +278,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="34"
|
||||
class="link-to-prism">src/app/_services/token.service.ts:34</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="33"
|
||||
class="link-to-prism">src/app/_services/token.service.ts:33</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -350,8 +350,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="29"
|
||||
class="link-to-prism">src/app/_services/token.service.ts:29</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="28"
|
||||
class="link-to-prism">src/app/_services/token.service.ts:28</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -466,36 +466,35 @@
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { EventEmitter, Injectable } from '@angular/core';
|
||||
import {environment} from '@src/environments/environment';
|
||||
import {BehaviorSubject, Observable} from 'rxjs';
|
||||
import {CICRegistry} from 'cic-client';
|
||||
import {TokenRegistry} from '@app/_eth';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {RegistryService} from '@app/_services/registry.service';
|
||||
import { environment } from '@src/environments/environment';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { CICRegistry } from 'cic-client';
|
||||
import { TokenRegistry } from '@app/_eth';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { RegistryService } from '@app/_services/registry.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TokenService {
|
||||
registry: CICRegistry;
|
||||
tokenRegistry: TokenRegistry;
|
||||
LoadEvent: EventEmitter<number> = new EventEmitter<number>();
|
||||
|
||||
constructor(
|
||||
private httpClient: HttpClient,
|
||||
private registryService: RegistryService,
|
||||
) {
|
||||
constructor(private httpClient: HttpClient, private registryService: RegistryService) {
|
||||
this.registry = registryService.getRegistry();
|
||||
this.registry.load();
|
||||
this.registry.onload = async (address: string): Promise<void> => {
|
||||
this.tokenRegistry = new TokenRegistry(await this.registry.getContractAddressByName('TokenRegistry'));
|
||||
this.tokenRegistry = new TokenRegistry(
|
||||
await this.registry.getContractAddressByName('TokenRegistry')
|
||||
);
|
||||
this.LoadEvent.next(Date.now());
|
||||
};
|
||||
}
|
||||
|
||||
async getTokens(): Promise<Array<Promise<string>>> {
|
||||
const count: number = await this.tokenRegistry.totalTokens();
|
||||
return Array.from({length: count}, async (v, i) => await this.tokenRegistry.entry(i));
|
||||
return Array.from({ length: count }, async (v, i) => await this.tokenRegistry.entry(i));
|
||||
}
|
||||
|
||||
getTokenBySymbol(symbol: string): Observable<any> {
|
||||
|
||||
Reference in New Issue
Block a user