@icgio/icg-exchanges-wrapper 1.8.18 → 1.8.19
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 -8
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -516,7 +516,7 @@ module.exports = class Orders {
|
|
|
516
516
|
this.init_account(this.balances)
|
|
517
517
|
}
|
|
518
518
|
} else if (_.get(this.balances, [exchange, 'update_time']) < new Date() - this.interval_dict[exchange].balances) {
|
|
519
|
-
this.
|
|
519
|
+
this.info_log('%s balances expired: %j', exchange, res)
|
|
520
520
|
this.balances = _.omit(this.balances, [exchange])
|
|
521
521
|
this.buy_sell_limits = _.omit(this.buy_sell_limits, [exchange])
|
|
522
522
|
}
|
|
@@ -554,7 +554,7 @@ module.exports = class Orders {
|
|
|
554
554
|
})
|
|
555
555
|
}
|
|
556
556
|
} else if (_.get(this.positions, [exchange, 'update_time']) < new Date() - this.interval_dict[exchange].positions) {
|
|
557
|
-
this.
|
|
557
|
+
this.info_log('%s positions expired: %j', exchange, res)
|
|
558
558
|
this.positions = _.omit(this.positions, [exchange])
|
|
559
559
|
this.buy_sell_limits = _.omit(this.buy_sell_limits, [exchange])
|
|
560
560
|
}
|
|
@@ -637,7 +637,7 @@ module.exports = class Orders {
|
|
|
637
637
|
_.set(this.open_orders, [exchange, pair], { open_orders: res.body, update_time: new Date() })
|
|
638
638
|
previous_orders_processer(exchange, pair, res.body)
|
|
639
639
|
} else if (_.get(this.open_orders, [exchange, pair, 'update_time']) < new Date() - this.interval_dict[exchange].open_orders) {
|
|
640
|
-
this.
|
|
640
|
+
this.info_log('%s %s open orders expired: %j', exchange, pair, res)
|
|
641
641
|
this.open_orders[exchange] = _.omit(this.open_orders[exchange], [pair])
|
|
642
642
|
} else if (res.error !== 'opening') {
|
|
643
643
|
this.error_log('%s %s open orders: %j', exchange, pair, res)
|
|
@@ -655,7 +655,7 @@ module.exports = class Orders {
|
|
|
655
655
|
for (let pair of this.exchange_pairs[exchange]) {
|
|
656
656
|
if (_.get(this.open_orders, [exchange, pair, 'update_time']) < new Date() - this.interval_dict[exchange].open_orders) {
|
|
657
657
|
if (!error_logged) {
|
|
658
|
-
this.
|
|
658
|
+
this.info_log('%s all open orders expired: %j', exchange, res)
|
|
659
659
|
error_logged = true
|
|
660
660
|
}
|
|
661
661
|
this.open_orders[exchange] = _.omit(this.open_orders[exchange], [pair])
|
|
@@ -730,7 +730,7 @@ module.exports = class Orders {
|
|
|
730
730
|
_.set(this.trades, [exchange, pair], { trades: res.body, update_time: new Date() })
|
|
731
731
|
_.set(this.trades_amount_past_hour, [exchange, pair], _.sumBy(res.body.filter(t => t.close_time > new Date() - 60 * 60 * 1000 || t.open_time > new Date() - 60 * 60 * 1000), t => t.amount) || 0)
|
|
732
732
|
} else if (_.get(this.trades, [exchange, pair, 'update_time']) < new Date() - this.interval_dict[exchange].trades) {
|
|
733
|
-
this.
|
|
733
|
+
this.info_log('%s %s trades expired: %j', exchange, pair, res)
|
|
734
734
|
this.trades[exchange] = _.omit(this.trades[exchange], [pair])
|
|
735
735
|
} else if (res.error !== 'opening') {
|
|
736
736
|
this.error_log('%s %s trades: %j', exchange, pair, res)
|
|
@@ -748,7 +748,7 @@ module.exports = class Orders {
|
|
|
748
748
|
for (let pair of this.exchange_pairs[exchange]) {
|
|
749
749
|
if (_.get(this.trades, [exchange, pair, 'update_time']) < new Date() - this.interval_dict[exchange].trades) {
|
|
750
750
|
if (!error_logged) {
|
|
751
|
-
this.
|
|
751
|
+
this.info_log('%s all trades expired: %j', exchange, res)
|
|
752
752
|
error_logged = true
|
|
753
753
|
}
|
|
754
754
|
this.trades[exchange] = _.omit(this.trades[exchange], [pair])
|
|
@@ -929,7 +929,7 @@ module.exports = class Orders {
|
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
931
|
} else if (_.get(this.rates, [exchange, pair, 'update_time']) < new Date() - this.interval_dict[exchange].rates) {
|
|
932
|
-
this.
|
|
932
|
+
this.info_log('%s %s rates expired: %j', exchange, pair, res)
|
|
933
933
|
this.rates[exchange] = _.omit(this.rates[exchange], [pair])
|
|
934
934
|
}
|
|
935
935
|
}
|
|
@@ -962,7 +962,7 @@ module.exports = class Orders {
|
|
|
962
962
|
if (res.success) {
|
|
963
963
|
_.set(this.market_history, [exchange, pair], Object.assign(res.body, { update_time: new Date() }))
|
|
964
964
|
} else if (_.get(this.market_history, [exchange, pair, 'update_time']) < new Date() - this.interval_dict[exchange].market_history) {
|
|
965
|
-
this.
|
|
965
|
+
this.info_log('%s %s market_history expired: %j', exchange, pair, res)
|
|
966
966
|
this.market_history[exchange] = _.omit(this.market_history[exchange], [pair])
|
|
967
967
|
}
|
|
968
968
|
}
|