@clonegod/ttd-core 3.1.32 → 3.1.33

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.
@@ -1,3 +1,5 @@
1
1
  import type { EnvArgs } from './EnvArgs';
2
- export declare function setCoreEnv(env: EnvArgs): void;
2
+ export declare function setCoreEnv(env: EnvArgs, opts?: {
3
+ force?: boolean;
4
+ }): void;
3
5
  export declare function getCoreEnv(): EnvArgs;
@@ -3,7 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setCoreEnv = setCoreEnv;
4
4
  exports.getCoreEnv = getCoreEnv;
5
5
  let _core_env;
6
- function setCoreEnv(env) {
6
+ function setCoreEnv(env, opts) {
7
+ var _a, _b;
8
+ if (_core_env && !(opts === null || opts === void 0 ? void 0 : opts.force)) {
9
+ const cur = ((_a = _core_env === null || _core_env === void 0 ? void 0 : _core_env.constructor) === null || _a === void 0 ? void 0 : _a.name) || 'unknown';
10
+ const next = ((_b = env === null || env === void 0 ? void 0 : env.constructor) === null || _b === void 0 ? void 0 : _b.name) || 'unknown';
11
+ console.warn(`[setCoreEnv] ignored second call: current=${cur}, attempted=${next}. ` +
12
+ `Library packages must NOT setCoreEnv at module load (only the top-level entry should). ` +
13
+ `If you really want to reset, pass { force: true }.`);
14
+ return;
15
+ }
7
16
  _core_env = env;
8
17
  }
9
18
  function getCoreEnv() {
@@ -49,7 +49,7 @@ function get_bsc_token_price_info(addresses, opts) {
49
49
  for (const channel of PRICE_CHANNELS) {
50
50
  if (addresses.length === 0)
51
51
  break;
52
- (0, index_1.log_info)(`[get_token_price_info] Processing ${addresses.length} tokens using ${channel.name}`);
52
+ (0, index_1.log_debug)(`[get_token_price_info] Processing ${addresses.length} tokens using ${channel.name}`);
53
53
  const batches = (0, index_1.chunkArray)(addresses, channel.batchSize);
54
54
  (0, index_1.log_debug)(`[get_token_price_info] Split into ${batches.length} batches of size ${channel.batchSize}`);
55
55
  let remainingAddresses = [...addresses];
@@ -49,7 +49,7 @@ function get_sui_token_price_info(addresses, opts) {
49
49
  for (const channel of PRICE_CHANNELS) {
50
50
  if (addresses.length === 0)
51
51
  break;
52
- (0, index_1.log_info)(`[get_token_price_info] Processing ${addresses.length} tokens using ${channel.name}`);
52
+ (0, index_1.log_debug)(`[get_token_price_info] Processing ${addresses.length} tokens using ${channel.name}`);
53
53
  const batches = (0, index_1.chunkArray)(addresses, channel.batchSize);
54
54
  (0, index_1.log_debug)(`[get_token_price_info] Split into ${batches.length} batches of size ${channel.batchSize}`);
55
55
  let remainingAddresses = [...addresses];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "3.1.32",
3
+ "version": "3.1.33",
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",