@clonegod/ttd-sol-common 1.0.57 → 1.0.59

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.
@@ -573,7 +573,10 @@ class RpcClient {
573
573
  let txid = (0, get_signature_1.getSignature)(transaction);
574
574
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
575
575
  const serializedTransaction = bs58_1.default.encode(transaction.serialize());
576
- const jitoApiUrl = `${types_1.JITO_API_URLS[region]}/api/v1/bundles`;
576
+ let jitoApiUrl = `${types_1.JITO_API_URLS[region]}/api/v1/bundles`;
577
+ if (solana_trade_runtime.jito_plugin_url) {
578
+ jitoApiUrl = solana_trade_runtime.jito_plugin_url;
579
+ }
577
580
  const bundleId = yield this.sendJitoBundle([serializedTransaction], jitoApiUrl);
578
581
  (0, dist_1.log_info)(`sendJitoBundle`, {
579
582
  txid,
@@ -5,22 +5,30 @@ const dist_1 = require("@clonegod/ttd-common/dist");
5
5
  const constants_1 = require("../common/constants");
6
6
  function create_solana_trade_runtime(connection, trade_runtime, pool_info) {
7
7
  let trade_strategy = trade_runtime.settings.strategy;
8
- let { cu_limit } = pool_info;
8
+ let { cu_limit, use_jito_plugin } = pool_info;
9
9
  if (isNaN(cu_limit) || cu_limit < 35000) {
10
10
  cu_limit = 35000;
11
11
  }
12
12
  let priority_fee = calculate_gas_fee(trade_strategy);
13
13
  let cu_price = Math.ceil(priority_fee * constants_1.ONE_MILLION / cu_limit);
14
+ let jito_plugin_url = '';
15
+ if (use_jito_plugin) {
16
+ jito_plugin_url = process.env.QUICKNODE_JITO_PLUGIN_URL;
17
+ }
14
18
  (0, dist_1.log_info)(`trade_strategy & gas`, {
15
19
  trade_strategy,
16
20
  priority_fee,
17
21
  cu_limit,
18
- cu_price
22
+ cu_price,
23
+ use_jito_plugin,
24
+ jito_plugin_url
19
25
  });
20
26
  let solana_trade_runtime = Object.assign(Object.assign({}, trade_runtime), { connection,
21
27
  priority_fee,
22
28
  cu_limit,
23
- cu_price });
29
+ cu_price,
30
+ use_jito_plugin,
31
+ jito_plugin_url });
24
32
  return solana_trade_runtime;
25
33
  }
26
34
  exports.create_solana_trade_runtime = create_solana_trade_runtime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
package/types/index.d.ts CHANGED
@@ -48,6 +48,8 @@ export interface SolanaTradeRuntimeType extends TradeRuntimeType {
48
48
 
49
49
  // Compute Budget: SetComputeUnitLimit
50
50
  cu_limit: number
51
+
52
+ jito_plugin_url: string
51
53
  }
52
54
 
53
55