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.
- ccxt/__init__.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +290 -329
- ccxt/async_support/binancecoinm.py +1 -0
- ccxt/async_support/binanceusdm.py +2 -0
- ccxt/async_support/bitget.py +1 -0
- ccxt/async_support/bybit.py +32 -0
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/htx.py +10 -10
- ccxt/async_support/kucoin.py +4 -4
- ccxt/async_support/kucoinfutures.py +1 -1
- ccxt/base/exchange.py +1 -1
- ccxt/bigone.py +1 -1
- ccxt/binance.py +290 -329
- ccxt/binancecoinm.py +1 -0
- ccxt/binanceusdm.py +2 -0
- ccxt/bitget.py +1 -0
- ccxt/bybit.py +32 -0
- ccxt/exmo.py +1 -1
- ccxt/htx.py +10 -10
- ccxt/kucoin.py +4 -4
- ccxt/kucoinfutures.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +36 -36
- ccxt/pro/binancecoinm.py +1 -0
- ccxt/pro/binanceusdm.py +2 -0
- ccxt/pro/gate.py +2 -2
- {ccxt-4.3.49.dist-info → ccxt-4.3.51.dist-info}/METADATA +6 -6
- {ccxt-4.3.49.dist-info → ccxt-4.3.51.dist-info}/RECORD +33 -33
- {ccxt-4.3.49.dist-info → ccxt-4.3.51.dist-info}/WHEEL +0 -0
- {ccxt-4.3.49.dist-info → ccxt-4.3.51.dist-info}/top_level.txt +0 -0
@@ -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."}
|
ccxt/async_support/bitget.py
CHANGED
@@ -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()
|
ccxt/async_support/bybit.py
CHANGED
@@ -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
|
ccxt/async_support/exmo.py
CHANGED
@@ -30,7 +30,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
30
30
|
'id': 'exmo',
|
31
31
|
'name': 'EXMO',
|
32
32
|
'countries': ['LT'], # Lithuania
|
33
|
-
'rateLimit':
|
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.
|
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.
|
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.
|
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.
|
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.
|
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)
|
ccxt/async_support/kucoin.py
CHANGED
@@ -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.
|
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.
|
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.
|
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
ccxt/bigone.py
CHANGED