@clonegod/ttd-sui-common 1.0.86 → 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.
@@ -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.86",
3
+ "version": "1.0.87",
4
4
  "description": "Sui common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",