ccxt 4.3.49__py2.py3-none-any.whl → 4.3.51__py2.py3-none-any.whl

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.
@@ -18,6 +18,7 @@ class binancecoinm(binance, ImplicitAPI):
18
18
  'doc': [
19
19
  'https://binance-docs.github.io/apidocs/delivery/en/',
20
20
  'https://binance-docs.github.io/apidocs/spot/en',
21
+ 'https://developers.binance.com/en',
21
22
  ],
22
23
  },
23
24
  'has': {
@@ -19,6 +19,7 @@ class binanceusdm(binance, ImplicitAPI):
19
19
  'doc': [
20
20
  'https://binance-docs.github.io/apidocs/futures/en/',
21
21
  'https://binance-docs.github.io/apidocs/spot/en',
22
+ 'https://developers.binance.com/en',
22
23
  ],
23
24
  },
24
25
  'has': {
@@ -40,6 +41,7 @@ class binanceusdm(binance, ImplicitAPI):
40
41
  'marginModes': {},
41
42
  },
42
43
  # https://binance-docs.github.io/apidocs/futures/en/#error-codes
44
+ # https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code
43
45
  'exceptions': {
44
46
  'exact': {
45
47
  '-5021': InvalidOrder, # {"code":-5021,"msg":"Due to the order could not be filled immediately, the FOK order has been rejected."}
@@ -3981,6 +3981,7 @@ class bitget(Exchange, ImplicitAPI):
3981
3981
  :param str [params.trailingTriggerPrice]: *swap and future only* the price to trigger a trailing stop order, default uses the price argument
3982
3982
  :param str [params.triggerType]: *swap and future only* 'fill_price', 'mark_price' or 'index_price'
3983
3983
  :param boolean [params.oneWayMode]: *swap and future only* required to set self to True in one_way_mode and you can leave self in hedge_mode, can adjust the mode using the setPositionMode() method
3984
+ :param bool [params.reduceOnly]: True or False whether the order is reduce-only
3984
3985
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
3985
3986
  """
3986
3987
  await self.load_markets()
@@ -49,6 +49,7 @@ class bybit(Exchange, ImplicitAPI):
49
49
  'option': True,
50
50
  'borrowCrossMargin': True,
51
51
  'cancelAllOrders': True,
52
+ 'cancelAllOrdersAfter': True,
52
53
  'cancelOrder': True,
53
54
  'cancelOrders': True,
54
55
  'cancelOrdersForSymbols': True,
@@ -4109,6 +4110,37 @@ class bybit(Exchange, ImplicitAPI):
4109
4110
  row = self.safe_list(result, 'list', [])
4110
4111
  return self.parse_orders(row, market)
4111
4112
 
4113
+ async def cancel_all_orders_after(self, timeout: Int, params={}):
4114
+ """
4115
+ dead man's switch, cancel all orders after the given timeout
4116
+ :see: https://bybit-exchange.github.io/docs/v5/order/dcp
4117
+ :param number timeout: time in milliseconds
4118
+ :param dict [params]: extra parameters specific to the exchange API endpoint
4119
+ :param str [params.product]: OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
4120
+ :returns dict: the api result
4121
+ """
4122
+ await self.load_markets()
4123
+ request: dict = {
4124
+ 'timeWindow': self.parse_to_int(timeout / 1000),
4125
+ }
4126
+ type: Str = None
4127
+ type, params = self.handle_market_type_and_params('cancelAllOrdersAfter', None, params, 'swap')
4128
+ productMap = {
4129
+ 'spot': 'SPOT',
4130
+ 'swap': 'DERIVATIVES',
4131
+ 'option': 'OPTIONS',
4132
+ }
4133
+ product = self.safe_string(productMap, type, type)
4134
+ request['product'] = product
4135
+ response = await self.privatePostV5OrderDisconnectedCancelAll(self.extend(request, params))
4136
+ #
4137
+ # {
4138
+ # "retCode": 0,
4139
+ # "retMsg": "success"
4140
+ # }
4141
+ #
4142
+ return response
4143
+
4112
4144
  async def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
4113
4145
  """
4114
4146
  cancel multiple orders for multiple symbols
@@ -30,7 +30,7 @@ class exmo(Exchange, ImplicitAPI):
30
30
  'id': 'exmo',
31
31
  'name': 'EXMO',
32
32
  'countries': ['LT'], # Lithuania
33
- 'rateLimit': 350, # once every 350 ms ≈ 180 requests per minute ≈ 3 requests per second
33
+ 'rateLimit': 100, # 10 requests per 1 second
34
34
  'version': 'v1.1',
35
35
  'has': {
36
36
  'CORS': None,
ccxt/async_support/htx.py CHANGED
@@ -3747,10 +3747,10 @@ class htx(Exchange, ImplicitAPI):
3747
3747
  'status': '0', # support multiple query seperated by ',',such as '3,4,5', 0: all. 3. Have sumbmitted the orders; 4. Orders partially matched; 5. Orders cancelled with partially matched; 6. Orders fully matched; 7. Orders cancelled
3748
3748
  }
3749
3749
  response = None
3750
- stop = self.safe_value(params, 'stop')
3750
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
3751
3751
  stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
3752
3752
  trailing = self.safe_bool(params, 'trailing', False)
3753
- params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing'])
3753
+ params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger'])
3754
3754
  if stop or stopLossTakeProfit or trailing:
3755
3755
  if limit is not None:
3756
3756
  request['page_size'] = limit
@@ -4071,10 +4071,10 @@ class htx(Exchange, ImplicitAPI):
4071
4071
  if limit is not None:
4072
4072
  request['page_size'] = limit
4073
4073
  request['contract_code'] = market['id']
4074
- stop = self.safe_value(params, 'stop')
4074
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
4075
4075
  stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
4076
4076
  trailing = self.safe_bool(params, 'trailing', False)
4077
- params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing'])
4077
+ params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger'])
4078
4078
  if market['linear']:
4079
4079
  marginMode = None
4080
4080
  marginMode, params = self.handle_margin_mode_and_params('fetchOpenOrders', params)
@@ -5306,10 +5306,10 @@ class htx(Exchange, ImplicitAPI):
5306
5306
  request['symbol'] = market['settleId']
5307
5307
  else:
5308
5308
  request['contract_code'] = market['id']
5309
- stop = self.safe_value(params, 'stop')
5309
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
5310
5310
  stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
5311
5311
  trailing = self.safe_bool(params, 'trailing', False)
5312
- params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing'])
5312
+ params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger'])
5313
5313
  if market['linear']:
5314
5314
  marginMode = None
5315
5315
  marginMode, params = self.handle_margin_mode_and_params('cancelOrder', params)
@@ -5433,9 +5433,9 @@ class htx(Exchange, ImplicitAPI):
5433
5433
  request['symbol'] = market['settleId']
5434
5434
  else:
5435
5435
  request['contract_code'] = market['id']
5436
- stop = self.safe_value(params, 'stop')
5436
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
5437
5437
  stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
5438
- params = self.omit(params, ['stop', 'stopLossTakeProfit'])
5438
+ params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trigger'])
5439
5439
  if market['linear']:
5440
5440
  marginMode = None
5441
5441
  marginMode, params = self.handle_margin_mode_and_params('cancelOrders', params)
@@ -5565,10 +5565,10 @@ class htx(Exchange, ImplicitAPI):
5565
5565
  if market['future']:
5566
5566
  request['symbol'] = market['settleId']
5567
5567
  request['contract_code'] = market['id']
5568
- stop = self.safe_value(params, 'stop')
5568
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
5569
5569
  stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
5570
5570
  trailing = self.safe_bool(params, 'trailing', False)
5571
- params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing'])
5571
+ params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger'])
5572
5572
  if market['linear']:
5573
5573
  marginMode = None
5574
5574
  marginMode, params = self.handle_margin_mode_and_params('cancelAllOrders', params)
@@ -2397,9 +2397,9 @@ class kucoin(Exchange, ImplicitAPI):
2397
2397
  await self.load_markets()
2398
2398
  lowercaseStatus = status.lower()
2399
2399
  until = self.safe_integer(params, 'until')
2400
- stop = self.safe_bool(params, 'stop', False)
2400
+ stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2401
2401
  hf = self.safe_bool(params, 'hf', False)
2402
- params = self.omit(params, ['stop', 'hf', 'until'])
2402
+ params = self.omit(params, ['stop', 'hf', 'until', 'trigger'])
2403
2403
  marginMode, query = self.handle_margin_mode_and_params('fetchOrdersByStatus', params)
2404
2404
  if lowercaseStatus == 'open':
2405
2405
  lowercaseStatus = 'active'
@@ -2556,7 +2556,7 @@ class kucoin(Exchange, ImplicitAPI):
2556
2556
  await self.load_markets()
2557
2557
  request: dict = {}
2558
2558
  clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
2559
- stop = self.safe_bool(params, 'stop', False)
2559
+ stop = self.safe_bool_2(params, 'stop', 'trigger', False)
2560
2560
  hf = self.safe_bool(params, 'hf', False)
2561
2561
  market = None
2562
2562
  if symbol is not None:
@@ -2565,7 +2565,7 @@ class kucoin(Exchange, ImplicitAPI):
2565
2565
  if symbol is None:
2566
2566
  raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol parameter for hf orders')
2567
2567
  request['symbol'] = market['id']
2568
- params = self.omit(params, ['stop', 'hf', 'clientOid', 'clientOrderId'])
2568
+ params = self.omit(params, ['stop', 'hf', 'clientOid', 'clientOrderId', 'trigger'])
2569
2569
  response = None
2570
2570
  if clientOrderId is not None:
2571
2571
  request['clientOid'] = clientOrderId
@@ -1688,7 +1688,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1688
1688
  paginate, params = self.handle_option_and_params(params, 'fetchOrdersByStatus', 'paginate')
1689
1689
  if paginate:
1690
1690
  return await self.fetch_paginated_call_dynamic('fetchOrdersByStatus', symbol, since, limit, params)
1691
- stop = self.safe_value_2(params, 'stop', 'trigger')
1691
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
1692
1692
  until = self.safe_integer(params, 'until')
1693
1693
  params = self.omit(params, ['stop', 'until', 'trigger'])
1694
1694
  if status == 'closed':
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.49'
7
+ __version__ = '4.3.51'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/bigone.py CHANGED
@@ -29,7 +29,7 @@ class bigone(Exchange, ImplicitAPI):
29
29
  'name': 'BigONE',
30
30
  'countries': ['CN'],
31
31
  'version': 'v3',
32
- 'rateLimit': 1200, # 500 request per 10 minutes
32
+ 'rateLimit': 20, # 500 requests per 10 seconds
33
33
  'has': {
34
34
  'CORS': None,
35
35
  'spot': True,