@clonegod/ttd-sol-common 1.0.20 → 1.0.21

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,4 +1,5 @@
1
1
  export declare const MAX_GAS_FEE: number;
2
+ export declare const ONE_MILLION = 1000000;
2
3
  export declare enum COMMITMENT_LEVEL {
3
4
  PROCESSED = "processed",
4
5
  CONFIRMED = "confirmed",
package/dist/constants.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOCAL_EVENT_NAME = exports.COMMITMENT_LEVEL = exports.MAX_GAS_FEE = void 0;
3
+ exports.LOCAL_EVENT_NAME = exports.COMMITMENT_LEVEL = exports.ONE_MILLION = exports.MAX_GAS_FEE = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.MAX_GAS_FEE = web3_js_1.LAMPORTS_PER_SOL / 1000;
6
+ exports.ONE_MILLION = 1000000;
6
7
  var COMMITMENT_LEVEL;
7
8
  (function (COMMITMENT_LEVEL) {
8
9
  COMMITMENT_LEVEL["PROCESSED"] = "processed";
@@ -40,7 +40,7 @@ class HeliusClient {
40
40
  let { broadcast_type, speed } = trade_strategy;
41
41
  let gas_fee = this.get_gas_fee(trade_strategy);
42
42
  let cu_limit = 70000;
43
- let cu_price = Math.floor(gas_fee / cu_limit);
43
+ let cu_price = Math.ceil(gas_fee * constants_1.ONE_MILLION / cu_limit);
44
44
  this._context.set_priority_fee(gas_fee);
45
45
  this._context.set_cu_limit(cu_limit);
46
46
  this._context.set_cu_price(cu_price);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",