@clonegod/ttd-sol-common 1.0.189 → 1.0.190

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.
@@ -51,6 +51,12 @@ export declare class RpcClient {
51
51
  sendSmartTransactionWithTipMixed(solana_trade_runtime: SolanaTradeRuntimeType, instructions: TransactionInstruction[], signers: Signer[], lookupTables?: AddressLookupTableAccount[], tipAmount?: number, region?: JitoRegion, feePayer?: Signer, lastValidBlockHeightOffset?: number): Promise<string>;
52
52
  sendJitoTransaction(serializedTransaction: string, jitoApiUrl: string, encoding?: string): Promise<string>;
53
53
  get_last_blockhash_slot(connections: Connection[]): Promise<RpcResponseAndContext<BlockhashWithExpiryBlockHeight>>;
54
+ getOldBlockhash(targetSlotOffset?: number): Promise<{
55
+ context: {
56
+ slot: number;
57
+ };
58
+ value: string;
59
+ }>;
54
60
  try_get_bundle_failed_result(txid: string, bundle_id: string, timeoutMs?: number): Promise<void>;
55
61
  send_tx_to_all_jito_region(serializedTransaction: string, encoding: string): Promise<string>;
56
62
  }
@@ -791,6 +791,22 @@ class RpcClient {
791
791
  return last_blockhash_slot;
792
792
  });
793
793
  }
794
+ getOldBlockhash() {
795
+ return __awaiter(this, arguments, void 0, function* (targetSlotOffset = 145) {
796
+ const latestBlockHeight = yield this.connection.getBlockHeight("finalized");
797
+ const targetBlockHeight = latestBlockHeight - targetSlotOffset;
798
+ const block = yield this.connection.getBlock(targetBlockHeight, {
799
+ commitment: "finalized",
800
+ maxSupportedTransactionVersion: 0,
801
+ });
802
+ if (!block)
803
+ throw new Error("Failed to fetch block");
804
+ return {
805
+ context: { slot: block.parentSlot },
806
+ value: block.blockhash
807
+ };
808
+ });
809
+ }
794
810
  try_get_bundle_failed_result(txid_1, bundle_id_1) {
795
811
  return __awaiter(this, arguments, void 0, function* (txid, bundle_id, timeoutMs = 90000) {
796
812
  let url = `https://bundles.jito.wtf/api/v1/bundles/get_bundle_error/${bundle_id}`;
@@ -87,7 +87,7 @@ class TransactionResultChecker {
87
87
  check_tx_result_interval() {
88
88
  return __awaiter(this, void 0, void 0, function* () {
89
89
  const check_start_time = Date.now();
90
- const check_interval = parseInt(process.env.CHECK_TX_RESULT_INTERVAL_MILLS || '2000');
90
+ const check_interval = parseInt(process.env.CHECK_TX_RESULT_INTERVAL_MILLS || '3000');
91
91
  const check_timeout = parseInt(process.env.CHECK_TX_RESULT_TIMEOUT_MILLS || '10000');
92
92
  (0, dist_1.log_info)(`check transaction start: check_interval=${check_interval}, check_timeout=${check_timeout}`);
93
93
  if (check_interval >= check_timeout) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.189",
3
+ "version": "1.0.190",
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.1.46",
16
+ "@clonegod/ttd-common": "1.1.47",
17
17
  "@metaplex-foundation/mpl-token-metadata": "^2.5.2",
18
18
  "@solana/web3.js": "1.91.6",
19
19
  "rpc-websockets": "7.10.0",