@clonegod/ttd-sol-common 1.0.115 → 1.0.116

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.
@@ -588,10 +588,9 @@ class RpcClient {
588
588
  const currentBlockHeight = yield solana_trade_runtime.connection.getBlockHeight();
589
589
  const lastValidBlockHeight = Math.min(blockhash.lastValidBlockHeight, currentBlockHeight + lastValidBlockHeightOffset);
590
590
  const timeout = 10000;
591
- const interval = 5000;
591
+ const interval = 2000;
592
592
  const startTime = Date.now();
593
- while (Date.now() - startTime < timeout ||
594
- (yield this.connection.getBlockHeight()) <= lastValidBlockHeight) {
593
+ while (Date.now() - startTime < timeout) {
595
594
  const bundleStatuses = yield this.getBundleStatuses([bundleId], jitoApiUrl);
596
595
  (0, dist_1.log_info)(`getBundleStatuses`, {
597
596
  txid,
@@ -799,8 +798,7 @@ class RpcClient {
799
798
  });
800
799
  }
801
800
  check_bundle_result(bundle_id_1) {
802
- return __awaiter(this, arguments, void 0, function* (bundle_id, timeoutMs = 3000) {
803
- this.jitoClient.confirmInflightBundle(bundle_id, timeoutMs);
801
+ return __awaiter(this, arguments, void 0, function* (bundle_id, timeoutMs = 10000) {
804
802
  let start = Date.now();
805
803
  while (Date.now() - start < timeoutMs) {
806
804
  try {
@@ -811,7 +809,7 @@ class RpcClient {
811
809
  catch (err) {
812
810
  console.error('get_bundle_error, error!', err);
813
811
  }
814
- yield new Promise(resolve => setTimeout(resolve, 500));
812
+ yield new Promise(resolve => setTimeout(resolve, 1000));
815
813
  }
816
814
  });
817
815
  }
@@ -73,12 +73,14 @@ const handle_order_message = (appConfig, trade, message) => __awaiter(void 0, vo
73
73
  let { price_msg, id_parts } = yield check_parse_order_msg(appConfig, order_msg);
74
74
  let { order_trace_id } = order_msg;
75
75
  let { chain_id, dex_id, pool_id, fee_rate } = id_parts;
76
- let lock_order = yield (0, exports.try_lock_order_msg)(appConfig, order_msg);
77
- if (!lock_order) {
78
- (0, dist_1.log_warn)(`try lock order failed!`, {
79
- chain_id, group_id, order_trace_id
80
- });
81
- return;
76
+ if (process.env.ENABLE_MULTIPLE_PROCESS === 'true') {
77
+ let lock_order = yield (0, exports.try_lock_order_msg)(appConfig, order_msg);
78
+ if (!lock_order) {
79
+ (0, dist_1.log_warn)(`try lock order failed!`, {
80
+ chain_id, group_id, order_trace_id
81
+ });
82
+ return;
83
+ }
82
84
  }
83
85
  let context;
84
86
  let txid = '';
@@ -87,7 +87,7 @@ class TransactionResultChecker {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  const check_start_time = Date.now();
89
89
  const check_interval = parseInt(process.env.CHECK_TX_RESULT_INTERVAL_MILLS || '1000');
90
- const check_timeout = parseInt(process.env.CHECK_TX_RESULT_TIMEOUT_MILLS || '30000');
90
+ const check_timeout = parseInt(process.env.CHECK_TX_RESULT_TIMEOUT_MILLS || '6000');
91
91
  const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
92
92
  this.check_count += 1;
93
93
  (0, dist_1.log_info)(`check transaction start: seq=[${this.check_count}], txhash= ${this.txid}, trace_id=${this.trace_id}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",