@icgio/icg-exchanges-wrapper 1.10.32 → 1.10.33
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 +6 -1
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -70,6 +70,7 @@ module.exports = class Orders {
|
|
|
70
70
|
this.check_init_order_opened_timeout = 5 * 1000
|
|
71
71
|
this.cancel_previous_orders = settings.cancel_previous_orders || false
|
|
72
72
|
this.cancel_range_orders = settings.cancel_range_orders || false
|
|
73
|
+
this.delete_connection_error_order_timeout = 2 * 60 * 1000
|
|
73
74
|
this.delete_finished_orders_timeout = 30 * 1000 // CANCELED or F-FILLED
|
|
74
75
|
this.interval_dict = settings.interval_dict || {}
|
|
75
76
|
this.major_exchanges = settings.major_exchanges || []
|
|
@@ -313,8 +314,12 @@ module.exports = class Orders {
|
|
|
313
314
|
},
|
|
314
315
|
order_type + ' n-filled'
|
|
315
316
|
)
|
|
316
|
-
} else if (res.error === 'amount-too-small' || res.error === 'insufficient-funds'
|
|
317
|
+
} else if (res.error === 'amount-too-small' || res.error === 'insufficient-funds') {
|
|
317
318
|
this.delete_order_info(exchange, pair, method, id, order_type + ' limit-trade-' + res.error)
|
|
319
|
+
} else if (res.error === 'connection-error') {
|
|
320
|
+
setTimeout(() => {
|
|
321
|
+
this.delete_order_info(exchange, pair, method, id, order_type + ' limit-trade-' + res.error)
|
|
322
|
+
}, this.delete_connection_error_order_timeout)
|
|
318
323
|
} else {
|
|
319
324
|
if (order_type.startsWith('self') || order_type.startsWith('maker_2')) {
|
|
320
325
|
this.delete_order_info(exchange, pair, method, id, order_type + ' limit-trade-timeout')
|