@clonegod/ttd-core 3.1.16 → 3.1.17

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.
@@ -16,13 +16,12 @@ const get_fixed_symbol_address = () => {
16
16
  }
17
17
  const filepath = process.env.BSC_FIXED_SYMBOL_ADDRESS_FILE ||
18
18
  path_1.default.join(os_1.default.homedir(), 'data', 'onchain_data', chain_id.toLowerCase(), 'fixed_symbol_address.json');
19
- const print_log = process.env.PRINT_FIXED_SYMBOL_ADDRESS === 'true';
20
19
  let list = [];
21
20
  try {
22
- list = (0, index_1.readFile)(filepath, true, true);
23
- if (print_log && !_first_load_logged) {
24
- (0, index_1.log_info)(`[fixed_symbol_address] loaded ${list.length} entries from ${filepath}`);
21
+ list = (0, index_1.readFile)(filepath, true, false);
22
+ if (!_first_load_logged) {
25
23
  _first_load_logged = true;
24
+ (0, index_1.log_info)(`[fixed_symbol_address] loaded ${list.length} entries from ${filepath}`);
26
25
  }
27
26
  }
28
27
  catch (error) {
@@ -17,13 +17,12 @@ const get_zh_pinyin_map = () => {
17
17
  }
18
18
  const filepath = process.env.ZH_PINYIN_MAP_FILE ||
19
19
  path_1.default.join(os_1.default.homedir(), 'data', 'onchain_data', chain_id.toLowerCase(), 'zh_pinyin_map.json');
20
- const print_log = process.env.PRINT_ZH_PINYIN_MAP === 'true';
21
20
  let list = [];
22
21
  try {
23
- list = (0, index_1.readFile)(filepath, true, true);
24
- if (print_log && !_first_load_logged) {
25
- (0, index_1.log_info)(`[zh_pinyin_map] loaded ${list.length} entries from ${filepath}`);
22
+ list = (0, index_1.readFile)(filepath, true, false);
23
+ if (!_first_load_logged) {
26
24
  _first_load_logged = true;
25
+ (0, index_1.log_info)(`[zh_pinyin_map] loaded ${list.length} entries from ${filepath}`);
27
26
  }
28
27
  }
29
28
  catch (error) {
@@ -0,0 +1 @@
1
+ export declare function getConfigCenterHttpOrigin(): string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfigCenterHttpOrigin = getConfigCenterHttpOrigin;
4
+ const service_ports_1 = require("../constants/service_ports");
5
+ function getConfigCenterHttpOrigin() {
6
+ const raw = (process.env.CONFIG_CENTER_HOST || '127.0.0.1').trim();
7
+ if (!raw) {
8
+ return `http://127.0.0.1:${service_ports_1.SERVICE_PORT.CONFIG_CENTER_HTTP}`;
9
+ }
10
+ if (/:\d+$/.test(raw) || /\]:\d+$/.test(raw)) {
11
+ return `http://${raw}`;
12
+ }
13
+ return `http://${raw}:${service_ports_1.SERVICE_PORT.CONFIG_CENTER_HTTP}`;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "3.1.16",
3
+ "version": "3.1.17",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",