@clonegod/ttd-sui-common 1.0.85 → 1.0.87

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.
@@ -317,7 +317,7 @@ class AbstractSuiDexTradePlus extends dist_1.AbastrcatTrade {
317
317
  (0, dist_1.log_info)(`✅ ${tokenSymbol} 进行对象合并,涉及 ${other_objects.length} 个对象`);
318
318
  }
319
319
  try_refresh_wallet_objects(wallet_1, txid_1, context_1) {
320
- return __awaiter(this, arguments, void 0, function* (wallet, txid, context, initial_delay_ms = 0, try_times = 5, try_delay_ms = 400) {
320
+ return __awaiter(this, arguments, void 0, function* (wallet, txid, context, initial_delay_ms = 0, try_times = 5, try_delay_ms = 300) {
321
321
  for (let i = 0; i < try_times; i++) {
322
322
  let delay_ms = initial_delay_ms + i * try_delay_ms;
323
323
  setTimeout(() => {
@@ -99,12 +99,14 @@ class SuiTransactionParser {
99
99
  const storageCost = new decimal_js_1.default(gasUsed.storage_cost || 0);
100
100
  const storageRebate = new decimal_js_1.default(gasUsed.storage_rebate || 0);
101
101
  const nonRefundableStorageFee = new decimal_js_1.default(gasUsed.non_refundable_storage_fee || 0);
102
- const totalCost = computationCost.plus(storageCost).minus(storageRebate).plus(nonRefundableStorageFee);
103
- const totalCostInSui = totalCost.div(Math.pow(10, 9));
102
+ const actualStorageCost = storageCost.minus(storageRebate).plus(nonRefundableStorageFee);
103
+ const base_fee = actualStorageCost.div(Math.pow(10, 9)).toNumber();
104
+ const priority_fee = computationCost.div(Math.pow(10, 9)).toNumber();
105
+ const total_fee = base_fee + priority_fee;
104
106
  return {
105
- base_fee: computationCost.div(Math.pow(10, 9)).toNumber(),
106
- priority_fee: storageCost.div(Math.pow(10, 9)).toNumber(),
107
- total_fee: totalCostInSui.toNumber()
107
+ base_fee,
108
+ priority_fee,
109
+ total_fee
108
110
  };
109
111
  }
110
112
  calc_tx_price(tokenAChange, tokenBChange, pool_info) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sui-common",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "Sui common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",