@clonegod/ttd-bsc-common 3.0.16 → 3.0.18

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.
@@ -22,9 +22,10 @@ const redis_1 = require("../redis");
22
22
  const trade_direction_1 = require("../utils/trade_direction");
23
23
  const decimal_js_1 = __importDefault(require("decimal.js"));
24
24
  function buildTradeConfig() {
25
- const vaultGroupId = process.env.VAULT_GROUP_ID;
25
+ var _a, _b;
26
+ const vaultGroupId = process.env.TRADE_GROUP_ID || process.env.VAULT_GROUP_ID;
26
27
  if (!vaultGroupId) {
27
- throw new Error('环境变量 VAULT_GROUP_ID 未配置');
28
+ throw new Error('环境变量 TRADE_GROUP_ID 未配置');
28
29
  }
29
30
  const vaultWallet = (0, ttd_core_1.load_wallet)(vaultGroupId, true);
30
31
  if (!vaultWallet.public_key) {
@@ -35,8 +36,8 @@ function buildTradeConfig() {
35
36
  return {
36
37
  vaultAddress: vaultWallet.public_key,
37
38
  executorIds: {
38
- pancake: ethers_1.ethers.utils.id(pancakeIdName),
39
- uniswap: ethers_1.ethers.utils.id(uniswapIdName),
39
+ pancake: (((_a = ethers_1.ethers.utils) === null || _a === void 0 ? void 0 : _a.id) || ethers_1.ethers.id)(pancakeIdName),
40
+ uniswap: (((_b = ethers_1.ethers.utils) === null || _b === void 0 ? void 0 : _b.id) || ethers_1.ethers.id)(uniswapIdName),
40
41
  },
41
42
  };
42
43
  }
@@ -44,7 +44,7 @@ class TradeResultSubscriber {
44
44
  this.ws = new ttd_core_1.WebSocketClient(wsUrl);
45
45
  this.ws.onOpen(() => {
46
46
  this.connected = true;
47
- const groupIds = (process.env.VAULT_GROUP_ID || '').split(',').map(s => s.trim()).filter(Boolean);
47
+ const groupIds = (process.env.TRADE_GROUP_ID || process.env.VAULT_GROUP_ID || '').split(',').map(s => s.trim()).filter(Boolean);
48
48
  for (const gid of groupIds) {
49
49
  const w = (0, ttd_core_1.load_wallet)(gid, true);
50
50
  if (w.public_key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-bsc-common",
3
- "version": "3.0.16",
3
+ "version": "3.0.18",
4
4
  "description": "BSC common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",