@dhedge/backend-flatcoin-core 0.2.88 → 0.2.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,5 @@ export declare class ConfigService {
6
6
  private readonly logger;
7
7
  private baseConfig;
8
8
  constructor(configRepository: MultichainConfigRepository, logger: Logger);
9
- baseConfigs(): MultichainConfig;
10
- refreshConfigs(): Promise<void>;
9
+ baseConfigs(): Promise<MultichainConfig>;
11
10
  }
@@ -16,24 +16,23 @@ let ConfigService = class ConfigService {
16
16
  constructor(configRepository, logger) {
17
17
  this.configRepository = configRepository;
18
18
  this.logger = logger;
19
- this.refreshConfigs().catch();
20
19
  }
21
- baseConfigs() {
20
+ async baseConfigs() {
22
21
  if (this.baseConfig) {
23
22
  return this.baseConfig;
24
23
  }
25
24
  else {
26
- throw Error('multichain configs not loaded');
27
- }
28
- }
29
- async refreshConfigs() {
30
- const result = await this.configRepository.getById(1);
31
- if (!result) {
32
- throw new Error('failed to load multichain config from db');
33
- }
34
- else {
35
- this.baseConfig = result;
36
- this.logger.log(`multichain config loaded ${result}`);
25
+ const result = await this.configRepository.getById(1);
26
+ if (!result) {
27
+ throw new Error('failed to load multichain config from db');
28
+ }
29
+ else {
30
+ if (!this.baseConfig) {
31
+ this.baseConfig = result;
32
+ this.logger.log(`multichain config loaded ${result}`);
33
+ }
34
+ return this.baseConfig;
35
+ }
37
36
  }
38
37
  }
39
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.2.88",
3
+ "version": "0.2.89",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",