@clonegod/ttd-core 2.0.11 → 2.0.12
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.
package/dist/app_config/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.getGlobalAppConfig = void 0;
|
|
18
18
|
__exportStar(require("./env_args"), exports);
|
|
19
19
|
__exportStar(require("./app_config"), exports);
|
|
20
|
+
__exportStar(require("./app_trade_config"), exports);
|
|
20
21
|
const getGlobalAppConfig = () => {
|
|
21
22
|
let app_config = global.app_config;
|
|
22
23
|
if (!app_config) {
|
|
@@ -16,7 +16,9 @@ export declare abstract class AbstractTransactionResultCheck {
|
|
|
16
16
|
intervalId: any;
|
|
17
17
|
check_count: number;
|
|
18
18
|
trade_result_already_processed: boolean;
|
|
19
|
-
constructor(env_args: EnvArgs, event_emitter: EventEmitter
|
|
19
|
+
constructor(env_args: EnvArgs, event_emitter: EventEmitter);
|
|
20
|
+
set_context(context: TradeContext): this;
|
|
21
|
+
set_txid(txid: string): this;
|
|
20
22
|
init_tx_status(): this;
|
|
21
23
|
check(): Promise<void>;
|
|
22
24
|
abstract check_tx_result_interval(): void;
|
|
@@ -12,19 +12,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AbstractTransactionResultCheck = void 0;
|
|
13
13
|
const __1 = require("..");
|
|
14
14
|
class AbstractTransactionResultCheck {
|
|
15
|
-
constructor(env_args, event_emitter
|
|
15
|
+
constructor(env_args, event_emitter) {
|
|
16
16
|
this.env_args = env_args;
|
|
17
17
|
this.event_emitter = event_emitter;
|
|
18
|
+
this.check_count = 0;
|
|
19
|
+
this.trade_result_already_processed = false;
|
|
20
|
+
}
|
|
21
|
+
set_context(context) {
|
|
18
22
|
this.context = context;
|
|
19
23
|
this.group_id = context.group_id;
|
|
20
24
|
this.wallet = context.trade_runtime.wallet.public_key;
|
|
21
|
-
this.txid = txid;
|
|
22
25
|
this.price_msg = context.price_msg;
|
|
23
26
|
this.order_msg = context.order_msg;
|
|
24
27
|
this.pool_info = context.pool_info;
|
|
25
28
|
this.trace_id = context.order_msg.order_trace_id;
|
|
26
|
-
this
|
|
27
|
-
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
set_txid(txid) {
|
|
32
|
+
this.txid = txid;
|
|
33
|
+
return this;
|
|
28
34
|
}
|
|
29
35
|
init_tx_status() {
|
|
30
36
|
let empty_trade_result = JSON.parse(JSON.stringify({
|
|
@@ -94,7 +94,7 @@ const handle_order_message = (trade_appconfig, trade_instance, tx_result_checker
|
|
|
94
94
|
txid
|
|
95
95
|
};
|
|
96
96
|
global.event_emitter = trade_appconfig;
|
|
97
|
-
tx_result_checker.init_tx_status().check();
|
|
97
|
+
tx_result_checker.set_context(context).set_txid(txid).init_tx_status().check();
|
|
98
98
|
trade_appconfig.subscribe_wallet_raw_txn_event();
|
|
99
99
|
}
|
|
100
100
|
catch (err) {
|