src/app/_services/registry.service.ts
Properties |
|
Methods |
|
constructor()
|
Defined in src/app/_services/registry.service.ts:12
|
Static Async getRegistry |
getRegistry()
|
Defined in src/app/_services/registry.service.ts:16
|
Returns :
Promise<CICRegistry>
|
Static fileGetter |
Type : FileGetter
|
Default value : new HttpGetter()
|
Defined in src/app/_services/registry.service.ts:11
|
Private Static registry |
Type : CICRegistry
|
Defined in src/app/_services/registry.service.ts:12
|
import { Injectable } from '@angular/core';
import { environment } from '@src/environments/environment';
import { CICRegistry, FileGetter } from '@cicnet/cic-client';
import { HttpGetter } from '@app/_helpers';
import { Web3Service } from '@app/_services/web3.service';
@Injectable({
providedIn: 'root',
})
export class RegistryService {
static fileGetter: FileGetter = new HttpGetter();
private static registry: CICRegistry;
constructor() {}
public static async getRegistry(): Promise<CICRegistry> {
if (!RegistryService.registry) {
RegistryService.registry = new CICRegistry(
Web3Service.getInstance(),
environment.registryAddress,
'Registry',
RegistryService.fileGetter,
['../../assets/js/block-sync/data']
);
RegistryService.registry.declaratorHelper.addTrust(environment.trustedDeclaratorAddress);
await RegistryService.registry.load();
}
return RegistryService.registry;
}
}