@clonegod/ttd-sol-common 1.0.98 → 1.0.100

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.
@@ -19,7 +19,6 @@ const axios_1 = __importDefault(require("axios"));
19
19
  const types_1 = require("./types");
20
20
  const get_signature_1 = require("../send_tx/get_signature");
21
21
  const dist_1 = require("@clonegod/ttd-common/dist");
22
- const common_1 = require("../common");
23
22
  class RpcClient {
24
23
  constructor(connection, id) {
25
24
  this.connection = connection;
@@ -558,6 +557,10 @@ class RpcClient {
558
557
  headers: { 'Content-Type': 'application/json' },
559
558
  });
560
559
  if (response.data.error) {
560
+ (0, dist_1.log_warn)(`getBundleStatuses error!`, {
561
+ jitoApiUrl,
562
+ bundleIds,
563
+ });
561
564
  throw new Error(`Error getting bundle statuses: ${JSON.stringify(response.data.error, null, 2)}`);
562
565
  }
563
566
  return response.data.result;
@@ -697,9 +700,6 @@ class RpcClient {
697
700
  }
698
701
  const { transaction, blockhash } = yield this.createSmartTransactionWithTip(solana_trade_runtime, instructions, signers, lookupTables, tipAmount, feePayer);
699
702
  let txid = (0, get_signature_1.getSignature)(transaction);
700
- if (global.event_emitter) {
701
- global.event_emitter.emit(common_1.LOCAL_EVENT_NAME.EVENT_WALLET_TRANSACTION_NEW_TXID, txid);
702
- }
703
703
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
704
704
  const serializedTransaction = bs58_1.default.encode(transaction.serialize());
705
705
  let jitoApiUrl = `${types_1.JITO_API_URLS[region]}/api/v1/transactions?bundleOnly=true`;
@@ -745,6 +745,9 @@ class RpcClient {
745
745
  }
746
746
  sendJitoTransaction(serializedTransaction, jitoApiUrl) {
747
747
  return __awaiter(this, void 0, void 0, function* () {
748
+ (0, dist_1.log_info)('sendJitoTransaction start', {
749
+ jitoApiUrl
750
+ });
748
751
  const response = yield axios_1.default.post(jitoApiUrl, {
749
752
  jsonrpc: '2.0',
750
753
  id: 1,
@@ -5,10 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getSignature = getSignature;
7
7
  const bs58_1 = __importDefault(require("bs58"));
8
+ const notify_new_txid_1 = require("./notify_new_txid");
8
9
  function getSignature(transaction) {
9
10
  const signature = 'signature' in transaction ? transaction.signature : transaction.signatures[0];
10
11
  if (!signature) {
11
12
  throw new Error('Missing transaction signature, the transaction was not signed by the fee payer');
12
13
  }
13
- return bs58_1.default.encode(signature);
14
+ let txid = bs58_1.default.encode(signature);
15
+ (0, notify_new_txid_1.notify_new_txid)(txid);
16
+ return txid;
14
17
  }
@@ -0,0 +1 @@
1
+ export declare const notify_new_txid: (txid: string) => Promise<void>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.notify_new_txid = void 0;
13
+ const common_1 = require("../common");
14
+ const notify_new_txid = (txid) => __awaiter(void 0, void 0, void 0, function* () {
15
+ global.event_emitter.emit(common_1.LOCAL_EVENT_NAME.EVENT_WALLET_TRANSACTION_NEW_TXID, txid);
16
+ });
17
+ exports.notify_new_txid = notify_new_txid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.98",
3
+ "version": "1.0.100",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",