@clonegod/ttd-core 2.0.16 → 2.0.17
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.
|
@@ -9,7 +9,7 @@ export declare abstract class AbstractTradeAppConfig extends AppConfig {
|
|
|
9
9
|
constructor();
|
|
10
10
|
init(): Promise<void>;
|
|
11
11
|
init_trade_runtime(): Promise<void>;
|
|
12
|
-
subscribe_order_event(trade_instance: AbastrcatTrade,
|
|
13
|
-
abstract subscribe_wallet_raw_txn_event(): void;
|
|
12
|
+
subscribe_order_event(trade_instance: AbastrcatTrade, new_tx_result_checker_factory: () => AbstractTransactionResultCheck): Promise<void>;
|
|
14
13
|
cache_trade_result(trade_response: TradeResponseType): Promise<void>;
|
|
14
|
+
abstract subscribe_wallet_raw_txn_event(): void;
|
|
15
15
|
}
|
|
@@ -41,9 +41,9 @@ class AbstractTradeAppConfig extends AppConfig_1.AppConfig {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
subscribe_order_event(trade_instance,
|
|
44
|
+
subscribe_order_event(trade_instance, new_tx_result_checker_factory) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
let handler = (message) => (0, handle_order_message_1.handle_order_message)(this, trade_instance,
|
|
46
|
+
let handler = (message) => (0, handle_order_message_1.handle_order_message)(this, trade_instance, new_tx_result_checker_factory, message);
|
|
47
47
|
let group_id = this.trade_runtime.group.id;
|
|
48
48
|
let pair_name = this.trade_runtime.pair_name;
|
|
49
49
|
let dex_id = this.trade_runtime.dex_id;
|
|
@@ -2,4 +2,4 @@ import { AbstractTradeAppConfig, AppConfig } from "../app_config";
|
|
|
2
2
|
import { AbastrcatTrade } from "./abstract_trade";
|
|
3
3
|
import { AbstractTransactionResultCheck } from "./abstract_tx_check";
|
|
4
4
|
export declare const try_lock_order_msg: (appConfig: AppConfig, order_msg: any) => Promise<boolean>;
|
|
5
|
-
export declare const handle_order_message: (trade_appconfig: AbstractTradeAppConfig, trade_instance: AbastrcatTrade,
|
|
5
|
+
export declare const handle_order_message: (trade_appconfig: AbstractTradeAppConfig, trade_instance: AbastrcatTrade, tx_result_checker_factory: () => AbstractTransactionResultCheck, recv_order_msg: string) => Promise<void>;
|
|
@@ -56,7 +56,7 @@ const try_lock_order_msg = (appConfig, order_msg) => __awaiter(void 0, void 0, v
|
|
|
56
56
|
return is_lock_success;
|
|
57
57
|
});
|
|
58
58
|
exports.try_lock_order_msg = try_lock_order_msg;
|
|
59
|
-
const handle_order_message = (trade_appconfig, trade_instance,
|
|
59
|
+
const handle_order_message = (trade_appconfig, trade_instance, tx_result_checker_factory, recv_order_msg) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
60
|
(0, __1.new_line)(3);
|
|
61
61
|
console.log(`=================================================================================`);
|
|
62
62
|
console.log(`| NEW ORDER MESSAGE |`);
|
|
@@ -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
|
-
|
|
97
|
+
tx_result_checker_factory().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) {
|