@clonegod/ttd-core 3.1.22 → 3.1.23
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/app_config/EnvArgs.js +2 -47
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ const __1 = require("..");
|
|
|
5
5
|
const env_loader_1 = require("./env_loader");
|
|
6
6
|
class EnvArgs {
|
|
7
7
|
constructor(chain_id, dex_id) {
|
|
8
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
9
8
|
const overrides = {};
|
|
10
9
|
if (chain_id)
|
|
11
10
|
overrides.chain_id = chain_id;
|
|
@@ -13,54 +12,10 @@ class EnvArgs {
|
|
|
13
12
|
overrides.dex_id = dex_id;
|
|
14
13
|
const cfg = (0, env_loader_1.loadEnvConfig)(overrides);
|
|
15
14
|
this._cfg = cfg;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.chain_id = (cfg.chain_id || '').toUpperCase();
|
|
19
|
-
this.dex_id = (cfg.dex_id || '').toUpperCase();
|
|
20
|
-
if ((0, __1.isEmpty)(this.chain_id)) {
|
|
15
|
+
const cid = (cfg.chain_id || '').toUpperCase();
|
|
16
|
+
if ((0, __1.isEmpty)(cid)) {
|
|
21
17
|
throw new Error(`environment: CHAIN_ID is empty!!!`);
|
|
22
18
|
}
|
|
23
|
-
this.log_level = (_a = cfg.log_level) !== null && _a !== void 0 ? _a : '';
|
|
24
|
-
this.log_depth = cfg.log_depth;
|
|
25
|
-
this.server_id = (_b = cfg.server_id) !== null && _b !== void 0 ? _b : '';
|
|
26
|
-
this.redis_host = cfg.redis_host;
|
|
27
|
-
this.redis_port = String(cfg.redis_port);
|
|
28
|
-
this.config_center_host = cfg.config_center_host;
|
|
29
|
-
this.enable_init_cache = (_c = cfg.enable_init_cache) !== null && _c !== void 0 ? _c : '';
|
|
30
|
-
this.trade_analyze_url = cfg.trade_analyze_url;
|
|
31
|
-
this.trade_analyze_host = (_d = cfg.trade_analyze_host) !== null && _d !== void 0 ? _d : '';
|
|
32
|
-
this.rpc_endpoint = cfg.rpc_endpoint;
|
|
33
|
-
this.ws_endpoint = cfg.ws_endpoint;
|
|
34
|
-
this.grpc_endpoint = cfg.grpc_endpoint;
|
|
35
|
-
this.grpc_token = cfg.grpc_token;
|
|
36
|
-
this.auto_quote_enable = cfg.auto_quote_enable;
|
|
37
|
-
this.auto_quote_interval_mills = cfg.auto_quote_interval_mills;
|
|
38
|
-
this.quote_pair = cfg.quote_pair;
|
|
39
|
-
this.quote_amount_usd = cfg.quote_amount_usd;
|
|
40
|
-
this.quote_pool_address = cfg.quote_pool_address;
|
|
41
|
-
this.quote_pool_name = cfg.quote_pool_name;
|
|
42
|
-
this.quote_pool_fee_rate = cfg.quote_pool_fee_rate;
|
|
43
|
-
this.tick_cache_force_full_refresh_interval = cfg.tick_cache_force_full_refresh_interval;
|
|
44
|
-
this.depth_cex_bps = cfg.depth_cex_bps;
|
|
45
|
-
this.group_id = (_e = cfg.group_id) !== null && _e !== void 0 ? _e : '';
|
|
46
|
-
this.trade_group_id = cfg.trade_group_id;
|
|
47
|
-
this.trade_pair = cfg.trade_pair;
|
|
48
|
-
this.trade_log_report_cex_url = (_f = cfg.trade_log_report_cex_url) !== null && _f !== void 0 ? _f : '';
|
|
49
|
-
this.trade_log_report_cex_data_type = (_g = cfg.trade_log_report_cex_data_type) !== null && _g !== void 0 ? _g : '';
|
|
50
|
-
this.token_price_cache_seconds = cfg.token_price_cache_seconds;
|
|
51
|
-
this.token_market_price_url = (_h = cfg.token_market_price_url) !== null && _h !== void 0 ? _h : '';
|
|
52
|
-
this.wallet_dir = cfg.wallet_dir;
|
|
53
|
-
this.encryption_key = (_j = cfg.encryption_key) !== null && _j !== void 0 ? _j : '';
|
|
54
|
-
this.providers_file_path = cfg.providers_file_path;
|
|
55
|
-
this.fixed_symbol_address_file = (_k = cfg.fixed_symbol_address_file) !== null && _k !== void 0 ? _k : '';
|
|
56
|
-
this.zh_pinyin_map_file = (_l = cfg.zh_pinyin_map_file) !== null && _l !== void 0 ? _l : '';
|
|
57
|
-
this.alert_analyze_host = (_m = cfg.alert_analyze_host) !== null && _m !== void 0 ? _m : '';
|
|
58
|
-
this.alert_flush_size = cfg.alert_flush_size;
|
|
59
|
-
this.alert_flush_ms = cfg.alert_flush_ms;
|
|
60
|
-
this.alert_dedup_window_ms = cfg.alert_dedup_window_ms;
|
|
61
|
-
this.namespace = (_o = cfg.namespace) !== null && _o !== void 0 ? _o : '';
|
|
62
|
-
this.server_ip_list = (_p = cfg.server_ip_list) !== null && _p !== void 0 ? _p : '';
|
|
63
|
-
this.ip_exclude_prefix = (_q = cfg.ip_exclude_prefix) !== null && _q !== void 0 ? _q : '';
|
|
64
19
|
}
|
|
65
20
|
print(moduleName) {
|
|
66
21
|
(0, env_loader_1.printEnvConfig)(moduleName || this.app_name || 'EnvArgs', this);
|