@icgio/icg-exchanges-wrapper 1.21.1 → 1.21.3
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/middleware/orders.js +8 -3
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -479,6 +479,10 @@ module.exports = class Orders {
|
|
|
479
479
|
})
|
|
480
480
|
}
|
|
481
481
|
cancel_order(exchange, pair, order, decision_context = null) {
|
|
482
|
+
if (!order.order_id) {
|
|
483
|
+
console.error('cancel_order: order_id missing %s %s %s %j', exchange, pair, order.type, order)
|
|
484
|
+
return
|
|
485
|
+
}
|
|
482
486
|
let original_status = order.status
|
|
483
487
|
const cancel_decision_context = public_decision_context(decision_context) || _.cloneDeep(order.decision_context) || null
|
|
484
488
|
this.update_order_info(
|
|
@@ -1035,17 +1039,18 @@ module.exports = class Orders {
|
|
|
1035
1039
|
}
|
|
1036
1040
|
console.log('DELETE %s: %s %s %s %s', note, exchange, pair, type, order_id)
|
|
1037
1041
|
|
|
1038
|
-
if (ws_client
|
|
1042
|
+
if (ws_client) {
|
|
1043
|
+
const internal_id = order_data.internal_id || order_data.id || order_id
|
|
1039
1044
|
ws_client.send_order({
|
|
1040
1045
|
action: 'delete',
|
|
1041
1046
|
exchange,
|
|
1042
1047
|
pair,
|
|
1043
1048
|
side: type,
|
|
1044
1049
|
order_id,
|
|
1045
|
-
internal_id
|
|
1050
|
+
internal_id,
|
|
1046
1051
|
lifecycle_seq: (order_data.lifecycle_seq || 0) + 1,
|
|
1047
1052
|
event_hrtime: process.hrtime(),
|
|
1048
|
-
data: order_data,
|
|
1053
|
+
data: { ...order_data, internal_id },
|
|
1049
1054
|
note,
|
|
1050
1055
|
})
|
|
1051
1056
|
}
|