# CICADA

### File

`src/app/_services/registry.service.ts`

### Index

###### Properties

- Static fileGetter
- Private Static registry

###### Methods

- Static Async getRegistry

### Constructor

`constructor()`
Defined in src/app/_services/registry.service.ts:12

### Methods

Static Async getRegistry
`getRegistry()`
Defined in src/app/_services/registry.service.ts:16
Returns : `Promise<CICRegistry>`

### Properties

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;
      }
    }

# result-matching ""

# No results matching ""