@icgio/icg-exchanges-wrapper 1.14.173 → 1.14.175

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.
@@ -181,7 +181,7 @@ module.exports = class Orders {
181
181
  positions_check: false,
182
182
  open_orders_check: true,
183
183
  trades_check: true,
184
- query_order_check_old_orders: true,
184
+ query_order_check_arb_maker_1: true,
185
185
  query_order_check_exchange: {},
186
186
  rates_check: true,
187
187
  market_history_check: true,
@@ -201,7 +201,7 @@ module.exports = class Orders {
201
201
  this.trades_amount_past_hour = {}
202
202
  this.check_trades()
203
203
  }
204
- if (this.function_enabled.query_order_check_old_orders) {
204
+ if (this.function_enabled.query_order_check_arb_maker_1) {
205
205
  for (let exchange in this.Exchanges) {
206
206
  if (this.function_enabled.query_order_check_exchange[exchange]) {
207
207
  this.check_query_order(exchange)
@@ -226,7 +226,7 @@ module.exports = class Orders {
226
226
  this.process_open_orders(this.open_orders)
227
227
  }, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
228
228
  }
229
- if (this.function_enabled.query_order_check_old_orders) {
229
+ if (this.function_enabled.query_order_check_arb_maker_1) {
230
230
  setInterval(() => {
231
231
  this.process_query_order(this.query_order)
232
232
  }, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
@@ -450,7 +450,8 @@ module.exports = class Orders {
450
450
  for (let pair in this.order_info[exchange]) {
451
451
  for (let type in this.order_info[exchange][pair]) {
452
452
  for (let order_id in this.order_info[exchange][pair][type]) {
453
- if (_.get(this.order_info, [exchange, pair, type, order_id, 'order_type']) === order_type) {
453
+ const order_type_temp = _.get(this.order_info, [exchange, pair, type, order_id, 'order_type'])
454
+ if ((Array.isArray(order_type) && order_type.includes(order_type_temp)) || order_type_temp === order_type) {
454
455
  _.setWith(order_info_temp, `${exchange}.${pair}.${type}.${order_id}`, _.get(this.order_info, `${exchange}.${pair}.${type}.${order_id}`), Object)
455
456
  }
456
457
  }
@@ -1145,8 +1146,8 @@ module.exports = class Orders {
1145
1146
  get_trades_all(this.Exchanges, this.exchange_pairs, this.interval_dict)
1146
1147
  }
1147
1148
  check_query_order(exchange) {
1148
- const QUERY_ORDER_TIME_IN_MS = 30 * 60 * 1000
1149
- // const QUERY_ORDER_TIME_IN_MS = 0
1149
+ // const QUERY_ORDER_TIME_IN_MS = 30 * 60 * 1000
1150
+ const QUERY_ORDER_TIME_IN_MS = 0
1150
1151
  let query_order_handler = (exchange, pair, res) => {
1151
1152
  if (res.success) {
1152
1153
  _.set(this.query_order, [exchange, pair], { query_order: res.body, update_time: new Date() })
@@ -1159,7 +1160,7 @@ module.exports = class Orders {
1159
1160
  }
1160
1161
  let get_query_order_all = (Exchanges, exchange_pairs, interval_dict) => {
1161
1162
  let query_order = (exchange, pair) => {
1162
- let order_info = _.get(this.order_info, [exchange, pair], {})
1163
+ let order_info = _.get(this.get_order_info_by_order_type(['arb', 'maker_1']), [exchange, pair], {})
1163
1164
  let timeout = setTimeout(() => {
1164
1165
  query_order(exchange, pair)
1165
1166
  }, interval_dict[exchange].query_order)
@@ -1171,7 +1172,7 @@ module.exports = class Orders {
1171
1172
  let { open_time } = order_info[type][order_id]
1172
1173
  // console.log(order_id, open_time, open_time < new Date() - 30 * 60 * 1000)
1173
1174
  if (open_time < new Date() - QUERY_ORDER_TIME_IN_MS) {
1174
- console.log('query_order_old_orders: %s %s %s', exchange, pair, order_id)
1175
+ // console.log('query_order_arb_maker_1: %s %s %s', exchange, pair, order_id)
1175
1176
  Exchanges[exchange].query_order(pair, order_id, (res) => {
1176
1177
  count++
1177
1178
  if (res.success) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.14.173",
3
+ "version": "1.14.175",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {