@clonegod/ttd-sol-common 1.0.181 → 1.0.182

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.
@@ -434,9 +434,7 @@ class RpcClient {
434
434
  }
435
435
  }), 0);
436
436
  const customersCU = Math.ceil(solana_trade_runtime.cu_limit);
437
- const computeUnitsIx = web3_js_1.ComputeBudgetProgram.setComputeUnitLimit({
438
- units: customersCU,
439
- });
437
+ const computeUnitsIx = (0, jitodontfront_1.createCustomComputeBudgetInstructionWithJitoDontFront)(new web3_js_1.PublicKey('jitodontfront111111111111111111111111111111'), customersCU);
440
438
  instructions.unshift(computeUnitsIx);
441
439
  if (isVersioned) {
442
440
  const v0Message = new web3_js_1.TransactionMessage({
@@ -586,8 +584,6 @@ class RpcClient {
586
584
  const serializedMainTx = transaction.serialize({ verifySignatures: false }).toString(encoding);
587
585
  let jito_region = process.env.JITO_REGION || region;
588
586
  let jitoApiUrl = `${types_1.JITO_API_URLS[jito_region]}/api/v1/bundles`;
589
- let jitoDontFrontTransaction = (0, jitodontfront_1.createJitoDontFrontTransaction)(blockhash.blockhash, signers[0]);
590
- let jitoDontFrontTransaction_serialized = jitoDontFrontTransaction.serialize({ verifySignatures: false }).toString(encoding);
591
587
  const send_tx_jito_url = process.env.SEND_TX_JITO_URL || '';
592
588
  const send_tx_jito_stratgy = process.env.SEND_TX_JITO_STRATEGY || '';
593
589
  if (!(0, dist_1.isEmpty)(send_tx_jito_url) && send_tx_jito_stratgy === 'mul_ips') {
@@ -598,7 +594,6 @@ class RpcClient {
598
594
  if (jito_use_separate_tx) {
599
595
  let serializedTipTx = (yield axios_1.default.get(`${process.env.JITO_CREATE_TIP_TX_URL}?group_id=${group_id}&blockhash=${recent_blockhash}&encoding=${encoding}&tip_amount=${tipAmount}`)).data.data;
600
596
  encoded_tx = [
601
- jitoDontFrontTransaction_serialized,
602
597
  serializedMainTx,
603
598
  serializedTipTx
604
599
  ].join(',');
@@ -617,7 +612,7 @@ class RpcClient {
617
612
  });
618
613
  return;
619
614
  }
620
- let bundleId = yield this.sendJitoBundle([jitoDontFrontTransaction_serialized, serializedMainTx], encoding, jitoApiUrl);
615
+ let bundleId = yield this.sendJitoBundle([serializedMainTx], encoding, jitoApiUrl);
621
616
  (0, dist_1.log_info)(`sendJitoBundle`, {
622
617
  txid,
623
618
  jitoApiUrl,
@@ -1,3 +1,6 @@
1
1
  import { Keypair } from "@solana/web3.js";
2
- import { Transaction } from "@solana/web3.js";
2
+ import { Transaction, TransactionInstruction } from "@solana/web3.js";
3
+ import { PublicKey } from "@solana/web3.js";
3
4
  export declare function createJitoDontFrontTransaction(recentBlockhash: string, tipPayer: Keypair): Transaction;
5
+ export declare function createCustomComputeBudgetInstruction(payerPubkey: any, jitodontfrontPubkey: any, units: any): TransactionInstruction;
6
+ export declare function createCustomComputeBudgetInstructionWithJitoDontFront(jitodontfrontPubkey: PublicKey, units: number): TransactionInstruction;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createJitoDontFrontTransaction = createJitoDontFrontTransaction;
4
+ exports.createCustomComputeBudgetInstruction = createCustomComputeBudgetInstruction;
5
+ exports.createCustomComputeBudgetInstructionWithJitoDontFront = createCustomComputeBudgetInstructionWithJitoDontFront;
4
6
  const web3_js_1 = require("@solana/web3.js");
5
7
  const web3_js_2 = require("@solana/web3.js");
6
8
  const web3_js_3 = require("@solana/web3.js");
@@ -25,3 +27,15 @@ function createCustomComputeBudgetInstruction(payerPubkey, jitodontfrontPubkey,
25
27
  data: data,
26
28
  });
27
29
  }
30
+ function createCustomComputeBudgetInstructionWithJitoDontFront(jitodontfrontPubkey, units) {
31
+ const data = Buffer.alloc(5);
32
+ data.writeUInt8(2, 0);
33
+ data.writeUInt32LE(units, 1);
34
+ return new web3_js_2.TransactionInstruction({
35
+ keys: [
36
+ { pubkey: jitodontfrontPubkey, isSigner: false, isWritable: false },
37
+ ],
38
+ programId: web3_js_1.ComputeBudgetProgram.programId,
39
+ data: data,
40
+ });
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.181",
3
+ "version": "1.0.182",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",