@clonegod/ttd-sol-common 1.0.96 → 1.0.99

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 = {}));
@@ -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.96",
3
+ "version": "1.0.99",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",