@icgio/icg-exchanges-wrapper 1.9.124 → 1.9.126

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.
@@ -87,7 +87,7 @@ module.exports = class Orders {
87
87
  LIMITS = MEDIUM_LIMITS
88
88
  } else if (_.includes(['bitfinex', 'kucoin', 'lbank', 'okex', 'phemex', 'xt'], exchange)) {
89
89
  LIMITS = SMALL_LIMITS
90
- } else if (_.includes(['bitforex', 'bitkub', 'bkex', 'coinbene', 'poloniex'], exchange)) {
90
+ } else if (_.includes(['bitforex', 'bitkub', 'bkex', 'coinbene', 'coinsbit', 'poloniex'], exchange)) {
91
91
  LIMITS = MINIMUM_LIMITS
92
92
  } else {
93
93
  LIMITS = STANDARD_LIMITS
@@ -766,6 +766,22 @@ module.exports = class Orders {
766
766
  const open_orders_timeframe = 12 * 60 * 60 * 1000
767
767
  let previous_orders_processer = (exchange, pair, orders) => {
768
768
  if (_.includes(this.no_cancel_previous_exchanges, exchange)) {
769
+ let buy_orders = orders.filter((o) => o.type === 'buy')
770
+ let sell_orders = orders.filter((o) => o.type === 'sell')
771
+ if (buy_orders.length > 0) {
772
+ buy_orders = _.sortBy(buy_orders, 'price').reverse().slice(0, 1)
773
+ buy_orders.map((order) => {
774
+ this.info_log('cancel original order: %s %s %j', exchange, pair, order)
775
+ this.Exchanges[exchange].cancel_order_by_order(order, (res) => {})
776
+ })
777
+ }
778
+ if (sell_orders.length > 0) {
779
+ sell_orders = _.sortBy(sell_orders, 'price').slice(0, 1)
780
+ sell_orders.map((order) => {
781
+ this.info_log('cancel original order: %s %s %j', exchange, pair, order)
782
+ this.Exchanges[exchange].cancel_order_by_order(order, (res) => {})
783
+ })
784
+ }
769
785
  _.set(this.previous_orders_canceled_exchange_pair, [exchange, pair], true)
770
786
  } else if (this.cancel_previous_orders && !this.previous_orders_canceled) {
771
787
  orders.map((order) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.9.124",
3
+ "version": "1.9.126",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {