@clonegod/ttd-sol-common 1.0.58 → 1.0.60

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.
@@ -574,8 +574,8 @@ class RpcClient {
574
574
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
575
575
  const serializedTransaction = bs58_1.default.encode(transaction.serialize());
576
576
  let jitoApiUrl = `${types_1.JITO_API_URLS[region]}/api/v1/bundles`;
577
- if (process.env.QUICKNODE_JITO_PLUGIN_URL) {
578
- jitoApiUrl = process.env.QUICKNODE_JITO_PLUGIN_URL;
577
+ if (solana_trade_runtime.jito_plugin_url) {
578
+ jitoApiUrl = solana_trade_runtime.jito_plugin_url;
579
579
  }
580
580
  const bundleId = yield this.sendJitoBundle([serializedTransaction], jitoApiUrl);
581
581
  (0, dist_1.log_info)(`sendJitoBundle`, {
@@ -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.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.58",
3
+ "version": "1.0.60",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "push": "npm run build && npm publish"
14
14
  },
15
15
  "dependencies": {
16
- "@clonegod/ttd-common": "^1.0.150",
16
+ "@clonegod/ttd-common": "^1.0.151",
17
17
  "@irys/sdk": "^0.2.10",
18
18
  "@metaplex-foundation/mpl-token-metadata": "^2.5.2",
19
19
  "@solana/web3.js": "1.91.6",
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