@clonegod/ttd-sol-common 1.0.19 → 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,9 +40,16 @@ 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.ceil(gas_fee * constants_1.ONE_MILLION / cu_limit);
43
44
  this._context.set_priority_fee(gas_fee);
44
45
  this._context.set_cu_limit(cu_limit);
45
- this._context.set_cu_price(gas_fee / cu_limit);
46
+ this._context.set_cu_price(cu_price);
47
+ (0, dist_1.log_info)(`trade_strategy & gas`, {
48
+ trade_strategy,
49
+ gas_fee,
50
+ cu_limit,
51
+ cu_price
52
+ });
46
53
  if (broadcast_type === 'rpc') {
47
54
  let use_staked_endpint = speed === 'turbo' || speed === 'ultra';
48
55
  txid = yield this.send_smart_transaction(instructions, use_staked_endpint);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",