@clonegod/ttd-sol-common 1.0.96 → 1.0.98

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.
@@ -7,5 +7,6 @@ export declare enum COMMITMENT_LEVEL {
7
7
  }
8
8
  export declare enum LOCAL_EVENT_NAME {
9
9
  EVENT_POOL_ACCOUNT_CHANGE = "EVENT_POOL_ACCOUNT_CHANGE",
10
- EVENT_WALLET_TRANSACTION = "EVENT_WALLET_TRANSACTION"
10
+ EVENT_WALLET_TRANSACTION = "EVENT_WALLET_TRANSACTION",
11
+ EVENT_WALLET_TRANSACTION_NEW_TXID = "EVENT_WALLET_TRANSACTION_NEW_TXID"
11
12
  }
@@ -14,4 +14,5 @@ var LOCAL_EVENT_NAME;
14
14
  (function (LOCAL_EVENT_NAME) {
15
15
  LOCAL_EVENT_NAME["EVENT_POOL_ACCOUNT_CHANGE"] = "EVENT_POOL_ACCOUNT_CHANGE";
16
16
  LOCAL_EVENT_NAME["EVENT_WALLET_TRANSACTION"] = "EVENT_WALLET_TRANSACTION";
17
+ LOCAL_EVENT_NAME["EVENT_WALLET_TRANSACTION_NEW_TXID"] = "EVENT_WALLET_TRANSACTION_NEW_TXID";
17
18
  })(LOCAL_EVENT_NAME || (exports.LOCAL_EVENT_NAME = LOCAL_EVENT_NAME = {}));
@@ -19,6 +19,7 @@ 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");
22
23
  class RpcClient {
23
24
  constructor(connection, id) {
24
25
  this.connection = connection;
@@ -696,6 +697,9 @@ class RpcClient {
696
697
  }
697
698
  const { transaction, blockhash } = yield this.createSmartTransactionWithTip(solana_trade_runtime, instructions, signers, lookupTables, tipAmount, feePayer);
698
699
  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
+ }
699
703
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
700
704
  const serializedTransaction = bs58_1.default.encode(transaction.serialize());
701
705
  let jitoApiUrl = `${types_1.JITO_API_URLS[region]}/api/v1/transactions?bundleOnly=true`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "1.0.96",
3
+ "version": "1.0.98",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",