ccxt 4.2.95__py2.py3-none-any.whl → 4.2.97__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/abstract/coinbase.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +9 -9
- ccxt/async_support/coinbase.py +590 -102
- ccxt/async_support/deribit.py +7 -3
- ccxt/async_support/gemini.py +26 -11
- ccxt/async_support/okx.py +3 -2
- ccxt/async_support/poloniexfutures.py +4 -1
- ccxt/base/exchange.py +17 -5
- ccxt/binance.py +9 -9
- ccxt/coinbase.py +590 -102
- ccxt/deribit.py +7 -3
- ccxt/gemini.py +26 -11
- ccxt/okx.py +3 -2
- ccxt/poloniexfutures.py +4 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +9 -5
- ccxt/pro/coinbase.py +19 -4
- ccxt/pro/poloniexfutures.py +5 -2
- ccxt/test/base/test_order_book.py +21 -15
- ccxt/test/test_async.py +32 -6
- ccxt/test/test_sync.py +32 -6
- {ccxt-4.2.95.dist-info → ccxt-4.2.97.dist-info}/METADATA +4 -4
- {ccxt-4.2.95.dist-info → ccxt-4.2.97.dist-info}/RECORD +28 -28
- {ccxt-4.2.95.dist-info → ccxt-4.2.97.dist-info}/WHEEL +0 -0
- {ccxt-4.2.95.dist-info → ccxt-4.2.97.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/coinbase.py
CHANGED
@@ -83,6 +83,7 @@ class ImplicitAPI:
|
|
83
83
|
v3_private_post_brokerage_convert_trade_trade_id = v3PrivatePostBrokerageConvertTradeTradeId = Entry('brokerage/convert/trade/{trade_id}', ['v3', 'private'], 'POST', {'cost': 1})
|
84
84
|
v3_private_post_brokerage_cfm_sweeps_schedule = v3PrivatePostBrokerageCfmSweepsSchedule = Entry('brokerage/cfm/sweeps/schedule', ['v3', 'private'], 'POST', {'cost': 1})
|
85
85
|
v3_private_post_brokerage_intx_allocate = v3PrivatePostBrokerageIntxAllocate = Entry('brokerage/intx/allocate', ['v3', 'private'], 'POST', {'cost': 1})
|
86
|
+
v3_private_post_brokerage_orders_close_position = v3PrivatePostBrokerageOrdersClosePosition = Entry('brokerage/orders/close_position', ['v3', 'private'], 'POST', {'cost': 1})
|
86
87
|
v3_private_put_brokerage_portfolios_portfolio_uuid = v3PrivatePutBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'PUT', {'cost': 1})
|
87
88
|
v3_private_delete_brokerage_portfolios_portfolio_uuid = v3PrivateDeleteBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'DELETE', {'cost': 1})
|
88
89
|
v3_private_delete_brokerage_cfm_sweeps = v3PrivateDeleteBrokerageCfmSweeps = Entry('brokerage/cfm/sweeps', ['v3', 'private'], 'DELETE', {'cost': 1})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -5549,7 +5549,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5549
5549
|
response = await self.papiPostCmOrder(request)
|
5550
5550
|
else:
|
5551
5551
|
response = await self.dapiPrivatePostOrder(request)
|
5552
|
-
elif marketType == 'margin' or marginMode is not None:
|
5552
|
+
elif marketType == 'margin' or marginMode is not None or isPortfolioMargin:
|
5553
5553
|
if isPortfolioMargin:
|
5554
5554
|
response = await self.papiPostMarginOrder(request)
|
5555
5555
|
else:
|
@@ -5631,12 +5631,6 @@ class binance(Exchange, ImplicitAPI):
|
|
5631
5631
|
uppercaseType = 'TAKE_PROFIT_MARKET' if market['contract'] else 'TAKE_PROFIT'
|
5632
5632
|
elif isLimitOrder:
|
5633
5633
|
uppercaseType = 'TAKE_PROFIT' if market['contract'] else 'TAKE_PROFIT_LIMIT'
|
5634
|
-
if (marketType == 'spot') or (marketType == 'margin'):
|
5635
|
-
request['newOrderRespType'] = self.safe_string(self.options['newOrderRespType'], type, 'RESULT') # 'ACK' for order id, 'RESULT' for full order or 'FULL' for order with fills
|
5636
|
-
else:
|
5637
|
-
# swap, futures and options
|
5638
|
-
if not isPortfolioMargin:
|
5639
|
-
request['newOrderRespType'] = 'RESULT' # "ACK", "RESULT", default "ACK"
|
5640
5634
|
if market['option']:
|
5641
5635
|
if type == 'market':
|
5642
5636
|
raise InvalidOrder(self.id + ' ' + type + ' is not a valid order type for the ' + symbol + ' market')
|
@@ -5664,6 +5658,12 @@ class binance(Exchange, ImplicitAPI):
|
|
5664
5658
|
uppercaseType = 'LIMIT_MAKER'
|
5665
5659
|
if marginMode == 'isolated':
|
5666
5660
|
request['isIsolated'] = True
|
5661
|
+
# handle newOrderRespType response type
|
5662
|
+
if ((marketType == 'spot') or (marketType == 'margin')) and not isPortfolioMargin:
|
5663
|
+
request['newOrderRespType'] = self.safe_string(self.options['newOrderRespType'], type, 'FULL') # 'ACK' for order id, 'RESULT' for full order or 'FULL' for order with fills
|
5664
|
+
else:
|
5665
|
+
# swap, futures and options
|
5666
|
+
request['newOrderRespType'] = 'RESULT' # "ACK", "RESULT", default "ACK"
|
5667
5667
|
typeRequest = 'strategyType' if isPortfolioMarginConditional else 'type'
|
5668
5668
|
request[typeRequest] = uppercaseType
|
5669
5669
|
# additional required fields depending on the order type
|
@@ -6217,7 +6217,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6217
6217
|
response = await self.papiGetCmOpenOrders(self.extend(request, params))
|
6218
6218
|
else:
|
6219
6219
|
response = await self.dapiPrivateGetOpenOrders(self.extend(request, params))
|
6220
|
-
elif type == 'margin' or marginMode is not None:
|
6220
|
+
elif type == 'margin' or marginMode is not None or isPortfolioMargin:
|
6221
6221
|
if isPortfolioMargin:
|
6222
6222
|
response = await self.papiGetMarginOpenOrders(self.extend(request, params))
|
6223
6223
|
else:
|
@@ -6646,7 +6646,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6646
6646
|
response = await self.papiDeleteCmAllOpenOrders(self.extend(request, params))
|
6647
6647
|
else:
|
6648
6648
|
response = await self.dapiPrivateDeleteAllOpenOrders(self.extend(request, params))
|
6649
|
-
elif (type == 'margin') or (marginMode is not None):
|
6649
|
+
elif (type == 'margin') or (marginMode is not None) or isPortfolioMargin:
|
6650
6650
|
if isPortfolioMargin:
|
6651
6651
|
response = await self.papiDeleteMarginAllOpenOrders(self.extend(request, params))
|
6652
6652
|
else:
|