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 CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.2.95'
25
+ __version__ = '4.2.97'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
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})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.95'
7
+ __version__ = '4.2.97'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.2.95'
5
+ __version__ = '4.2.97'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -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: