@dhedge/backend-flatcoin-core 0.2.88 → 0.2.90
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.
package/dist/service/index.d.ts
CHANGED
package/dist/service/index.js
CHANGED
|
@@ -19,4 +19,4 @@ __exportStar(require("./graph-query.service"), exports);
|
|
|
19
19
|
__exportStar(require("./error.handler"), exports);
|
|
20
20
|
__exportStar(require("./notification.service"), exports);
|
|
21
21
|
__exportStar(require("./blockscan.service"), exports);
|
|
22
|
-
__exportStar(require("./config
|
|
22
|
+
__exportStar(require("./multichain-config.service"), exports);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Logger } from '@nestjs/common';
|
|
2
2
|
import { MultichainConfigRepository } from '../repository';
|
|
3
3
|
import { MultichainConfig } from '../entity';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class MultichainConfigService {
|
|
5
5
|
private configRepository;
|
|
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
|
}
|
|
@@ -9,36 +9,35 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.MultichainConfigService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const repository_1 = require("../repository");
|
|
15
|
-
let
|
|
15
|
+
let MultichainConfigService = class MultichainConfigService {
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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 from database`);
|
|
33
|
+
}
|
|
34
|
+
return this.baseConfig;
|
|
35
|
+
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
39
|
+
exports.MultichainConfigService = MultichainConfigService;
|
|
40
|
+
exports.MultichainConfigService = MultichainConfigService = __decorate([
|
|
42
41
|
(0, common_1.Injectable)(),
|
|
43
42
|
__metadata("design:paramtypes", [repository_1.MultichainConfigRepository, common_1.Logger])
|
|
44
|
-
],
|
|
43
|
+
], MultichainConfigService);
|