@clonegod/ttd-sol-common 1.0.100 → 1.0.102
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.
|
@@ -12,6 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.notify_new_txid = void 0;
|
|
13
13
|
const common_1 = require("../common");
|
|
14
14
|
const notify_new_txid = (txid) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
if (!global.event_emitter) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
15
18
|
global.event_emitter.emit(common_1.LOCAL_EVENT_NAME.EVENT_WALLET_TRANSACTION_NEW_TXID, txid);
|
|
16
19
|
});
|
|
17
20
|
exports.notify_new_txid = notify_new_txid;
|
|
@@ -94,6 +94,7 @@ const handle_order_message = (appConfig, trade, message) => __awaiter(void 0, vo
|
|
|
94
94
|
msg: 'SUCCESS',
|
|
95
95
|
txid
|
|
96
96
|
};
|
|
97
|
+
global.event_emitter = appConfig;
|
|
97
98
|
new tx_result_check_1.TransactionResultChecker(env_args, appConfig, context, txid).init_tx_status().check();
|
|
98
99
|
}
|
|
99
100
|
catch (err) {
|
|
@@ -86,8 +86,8 @@ class TransactionResultChecker {
|
|
|
86
86
|
check_tx_result_interval() {
|
|
87
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
88
|
const check_start_time = Date.now();
|
|
89
|
-
const check_interval = 1000;
|
|
90
|
-
const check_timeout =
|
|
89
|
+
const check_interval = parseInt(process.env.CHECK_TX_RESULT_INTERVAL_MILLS || '1000');
|
|
90
|
+
const check_timeout = parseInt(process.env.CHECK_TX_RESULT_TIMEOUT_MILLS || '30000');
|
|
91
91
|
const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
92
92
|
this.check_count += 1;
|
|
93
93
|
(0, dist_1.log_info)(`check transaction start: seq=[${this.check_count}], txhash= ${this.txid}, trace_id=${this.trace_id}`);
|