ccxt 4.2.63__py2.py3-none-any.whl → 4.2.65__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (59) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/blofin.py +1 -0
  3. ccxt/abstract/krakenfutures.py +1 -0
  4. ccxt/abstract/kucoin.py +10 -0
  5. ccxt/abstract/kucoinfutures.py +10 -0
  6. ccxt/async_support/__init__.py +1 -1
  7. ccxt/async_support/base/exchange.py +2 -2
  8. ccxt/async_support/binance.py +32 -13
  9. ccxt/async_support/bingx.py +56 -49
  10. ccxt/async_support/bitget.py +66 -2
  11. ccxt/async_support/bitmex.py +2 -1
  12. ccxt/async_support/blofin.py +45 -12
  13. ccxt/async_support/btcmarkets.py +9 -0
  14. ccxt/async_support/bybit.py +90 -6
  15. ccxt/async_support/coinbase.py +9 -2
  16. ccxt/async_support/delta.py +92 -2
  17. ccxt/async_support/gate.py +1 -1
  18. ccxt/async_support/gemini.py +9 -5
  19. ccxt/async_support/hitbtc.py +1 -1
  20. ccxt/async_support/krakenfutures.py +1 -0
  21. ccxt/async_support/kucoin.py +85 -61
  22. ccxt/async_support/okx.py +1 -1
  23. ccxt/async_support/woo.py +1 -1
  24. ccxt/async_support/yobit.py +15 -15
  25. ccxt/base/exchange.py +14 -3
  26. ccxt/binance.py +32 -13
  27. ccxt/bingx.py +56 -49
  28. ccxt/bitget.py +66 -2
  29. ccxt/bitmex.py +2 -1
  30. ccxt/blofin.py +45 -12
  31. ccxt/btcmarkets.py +9 -0
  32. ccxt/bybit.py +90 -6
  33. ccxt/coinbase.py +9 -2
  34. ccxt/delta.py +92 -2
  35. ccxt/gate.py +1 -1
  36. ccxt/gemini.py +9 -5
  37. ccxt/hitbtc.py +1 -1
  38. ccxt/krakenfutures.py +1 -0
  39. ccxt/kucoin.py +85 -61
  40. ccxt/okx.py +1 -1
  41. ccxt/pro/__init__.py +1 -1
  42. ccxt/pro/bitget.py +4 -3
  43. ccxt/pro/coinex.py +4 -4
  44. ccxt/pro/currencycom.py +1 -1
  45. ccxt/pro/lbank.py +1 -1
  46. ccxt/static_dependencies/ethereum/utils/__init__.py +0 -6
  47. ccxt/static_dependencies/ethereum/utils/curried/__init__.py +0 -4
  48. ccxt/test/base/test_shared_methods.py +1 -1
  49. ccxt/test/test_async.py +13 -1
  50. ccxt/test/test_sync.py +13 -1
  51. ccxt/woo.py +1 -1
  52. ccxt/yobit.py +15 -15
  53. {ccxt-4.2.63.dist-info → ccxt-4.2.65.dist-info}/METADATA +4 -4
  54. {ccxt-4.2.63.dist-info → ccxt-4.2.65.dist-info}/RECORD +56 -59
  55. ccxt/static_dependencies/ethereum/utils/__json/eth_networks.json +0 -1
  56. ccxt/static_dependencies/ethereum/utils/network.py +0 -88
  57. ccxt-4.2.63.data/data/ccxt/eth_networks.json +0 -1
  58. {ccxt-4.2.63.dist-info → ccxt-4.2.65.dist-info}/WHEEL +0 -0
  59. {ccxt-4.2.63.dist-info → ccxt-4.2.65.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.2.63'
25
+ __version__ = '4.2.65'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/blofin.py CHANGED
@@ -19,6 +19,7 @@ class ImplicitAPI:
19
19
  private_get_account_balance = privateGetAccountBalance = Entry('account/balance', 'private', 'GET', {'cost': 1})
20
20
  private_get_account_positions = privateGetAccountPositions = Entry('account/positions', 'private', 'GET', {'cost': 1})
21
21
  private_get_account_leverage_info = privateGetAccountLeverageInfo = Entry('account/leverage-info', 'private', 'GET', {'cost': 1})
22
+ private_get_account_margin_mode = privateGetAccountMarginMode = Entry('account/margin-mode', 'private', 'GET', {'cost': 1})
22
23
  private_get_account_batch_leverage_info = privateGetAccountBatchLeverageInfo = Entry('account/batch-leverage-info', 'private', 'GET', {'cost': 1})
23
24
  private_get_trade_orders_tpsl_pending = privateGetTradeOrdersTpslPending = Entry('trade/orders-tpsl-pending', 'private', 'GET', {'cost': 1})
24
25
  private_get_trade_orders_history = privateGetTradeOrdersHistory = Entry('trade/orders-history', 'private', 'GET', {'cost': 1})
@@ -33,5 +33,6 @@ class ImplicitAPI:
33
33
  history_get_executions = historyGetExecutions = Entry('executions', 'history', 'GET', {})
34
34
  history_get_triggers = historyGetTriggers = Entry('triggers', 'history', 'GET', {})
35
35
  history_get_accountlogcsv = historyGetAccountlogcsv = Entry('accountlogcsv', 'history', 'GET', {})
36
+ history_get_account_log = historyGetAccountLog = Entry('account-log', 'history', 'GET', {})
36
37
  history_get_market_symbol_orders = historyGetMarketSymbolOrders = Entry('market/{symbol}/orders', 'history', 'GET', {})
37
38
  history_get_market_symbol_executions = historyGetMarketSymbolExecutions = Entry('market/{symbol}/executions', 'history', 'GET', {})
ccxt/abstract/kucoin.py CHANGED
@@ -83,6 +83,7 @@ class ImplicitAPI:
83
83
  private_get_project_marketinterestrate = privateGetProjectMarketInterestRate = Entry('project/marketInterestRate', 'private', 'GET', {'cost': 7.5})
84
84
  private_get_redeem_orders = privateGetRedeemOrders = Entry('redeem/orders', 'private', 'GET', {'cost': 10})
85
85
  private_get_purchase_orders = privateGetPurchaseOrders = Entry('purchase/orders', 'private', 'GET', {'cost': 10})
86
+ private_get_broker_api_rebase_download = privateGetBrokerApiRebaseDownload = Entry('broker/api/rebase/download', 'private', 'GET', {'cost': 3})
86
87
  private_post_sub_user_created = privatePostSubUserCreated = Entry('sub/user/created', 'private', 'POST', {'cost': 22.5})
87
88
  private_post_sub_api_key = privatePostSubApiKey = Entry('sub/api-key', 'private', 'POST', {'cost': 30})
88
89
  private_post_sub_api_key_update = privatePostSubApiKeyUpdate = Entry('sub/api-key/update', 'private', 'POST', {'cost': 45})
@@ -187,3 +188,12 @@ class ImplicitAPI:
187
188
  futuresprivate_delete_orders = futuresPrivateDeleteOrders = Entry('orders', 'futuresPrivate', 'DELETE', {'cost': 45})
188
189
  futuresprivate_delete_stoporders = futuresPrivateDeleteStopOrders = Entry('stopOrders', 'futuresPrivate', 'DELETE', {'cost': 22.5})
189
190
  webexchange_get_currency_currency_chain_info = webExchangeGetCurrencyCurrencyChainInfo = Entry('currency/currency/chain-info', 'webExchange', 'GET', {'cost': 1})
191
+ broker_get_broker_nd_info = brokerGetBrokerNdInfo = Entry('broker/nd/info', 'broker', 'GET', {'cost': 2})
192
+ broker_get_broker_nd_account = brokerGetBrokerNdAccount = Entry('broker/nd/account', 'broker', 'GET', {'cost': 2})
193
+ broker_get_broker_nd_account_apikey = brokerGetBrokerNdAccountApikey = Entry('broker/nd/account/apikey', 'broker', 'GET', {'cost': 2})
194
+ broker_get_broker_nd_rebase_download = brokerGetBrokerNdRebaseDownload = Entry('broker/nd/rebase/download', 'broker', 'GET', {'cost': 3})
195
+ broker_post_broker_nd_transfer = brokerPostBrokerNdTransfer = Entry('broker/nd/transfer', 'broker', 'POST', {'cost': 1})
196
+ broker_post_broker_nd_account = brokerPostBrokerNdAccount = Entry('broker/nd/account', 'broker', 'POST', {'cost': 3})
197
+ broker_post_broker_nd_account_apikey = brokerPostBrokerNdAccountApikey = Entry('broker/nd/account/apikey', 'broker', 'POST', {'cost': 3})
198
+ broker_post_broker_nd_account_update_apikey = brokerPostBrokerNdAccountUpdateApikey = Entry('broker/nd/account/update-apikey', 'broker', 'POST', {'cost': 3})
199
+ broker_delete_broker_nd_account_apikey = brokerDeleteBrokerNdAccountApikey = Entry('broker/nd/account/apikey', 'broker', 'DELETE', {'cost': 3})
@@ -83,6 +83,7 @@ class ImplicitAPI:
83
83
  private_get_project_marketinterestrate = privateGetProjectMarketInterestRate = Entry('project/marketInterestRate', 'private', 'GET', {'cost': 7.5})
84
84
  private_get_redeem_orders = privateGetRedeemOrders = Entry('redeem/orders', 'private', 'GET', {'cost': 10})
85
85
  private_get_purchase_orders = privateGetPurchaseOrders = Entry('purchase/orders', 'private', 'GET', {'cost': 10})
86
+ private_get_broker_api_rebase_download = privateGetBrokerApiRebaseDownload = Entry('broker/api/rebase/download', 'private', 'GET', {'cost': 3})
86
87
  private_post_sub_user_created = privatePostSubUserCreated = Entry('sub/user/created', 'private', 'POST', {'cost': 22.5})
87
88
  private_post_sub_api_key = privatePostSubApiKey = Entry('sub/api-key', 'private', 'POST', {'cost': 30})
88
89
  private_post_sub_api_key_update = privatePostSubApiKeyUpdate = Entry('sub/api-key/update', 'private', 'POST', {'cost': 45})
@@ -204,3 +205,12 @@ class ImplicitAPI:
204
205
  futuresprivate_delete_sub_api_key = futuresPrivateDeleteSubApiKey = Entry('sub/api-key', 'futuresPrivate', 'DELETE', {'cost': 1})
205
206
  webexchange_get_currency_currency_chain_info = webExchangeGetCurrencyCurrencyChainInfo = Entry('currency/currency/chain-info', 'webExchange', 'GET', {'cost': 1})
206
207
  webexchange_get_contract_symbol_funding_rates = webExchangeGetContractSymbolFundingRates = Entry('contract/{symbol}/funding-rates', 'webExchange', 'GET', {'cost': 1})
208
+ broker_get_broker_nd_info = brokerGetBrokerNdInfo = Entry('broker/nd/info', 'broker', 'GET', {'cost': 2})
209
+ broker_get_broker_nd_account = brokerGetBrokerNdAccount = Entry('broker/nd/account', 'broker', 'GET', {'cost': 2})
210
+ broker_get_broker_nd_account_apikey = brokerGetBrokerNdAccountApikey = Entry('broker/nd/account/apikey', 'broker', 'GET', {'cost': 2})
211
+ broker_get_broker_nd_rebase_download = brokerGetBrokerNdRebaseDownload = Entry('broker/nd/rebase/download', 'broker', 'GET', {'cost': 3})
212
+ broker_post_broker_nd_transfer = brokerPostBrokerNdTransfer = Entry('broker/nd/transfer', 'broker', 'POST', {'cost': 1})
213
+ broker_post_broker_nd_account = brokerPostBrokerNdAccount = Entry('broker/nd/account', 'broker', 'POST', {'cost': 3})
214
+ broker_post_broker_nd_account_apikey = brokerPostBrokerNdAccountApikey = Entry('broker/nd/account/apikey', 'broker', 'POST', {'cost': 3})
215
+ broker_post_broker_nd_account_update_apikey = brokerPostBrokerNdAccountUpdateApikey = Entry('broker/nd/account/update-apikey', 'broker', 'POST', {'cost': 3})
216
+ broker_delete_broker_nd_account_apikey = brokerDeleteBrokerNdAccountApikey = Entry('broker/nd/account/apikey', 'broker', 'DELETE', {'cost': 3})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.63'
7
+ __version__ = '4.2.65'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.2.63'
5
+ __version__ = '4.2.65'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -944,7 +944,7 @@ class Exchange(BaseExchange):
944
944
  await self.load_markets()
945
945
  if not self.has['fetchBorrowRates']:
946
946
  raise NotSupported(self.id + ' fetchIsolatedBorrowRate() is not supported yet')
947
- borrowRates = await self.fetchIsolatedBorrowRates(params)
947
+ borrowRates = await self.fetch_isolated_borrow_rates(params)
948
948
  rate = self.safe_dict(borrowRates, symbol)
949
949
  if rate is None:
950
950
  raise ExchangeError(self.id + ' fetchIsolatedBorrowRate() could not find the borrow rate for market symbol ' + symbol)
@@ -2375,7 +2375,7 @@ class binance(Exchange, ImplicitAPI):
2375
2375
  else:
2376
2376
  return subType == 'linear'
2377
2377
 
2378
- def set_sandbox_mode(self, enable):
2378
+ def set_sandbox_mode(self, enable: bool):
2379
2379
  super(binance, self).set_sandbox_mode(enable)
2380
2380
  self.options['sandboxMode'] = enable
2381
2381
 
@@ -2522,6 +2522,7 @@ class binance(Exchange, ImplicitAPI):
2522
2522
  :see: https://binance-docs.github.io/apidocs/futures/en/#check-server-time # swap
2523
2523
  :see: https://binance-docs.github.io/apidocs/delivery/en/#check-server-time # future
2524
2524
  :param dict [params]: extra parameters specific to the exchange API endpoint
2525
+ :param str [params.subType]: "linear" or "inverse"
2525
2526
  :returns int: the current integer timestamp in milliseconds from the exchange server
2526
2527
  """
2527
2528
  defaultType = self.safe_string_2(self.options, 'fetchTime', 'defaultType', 'spot')
@@ -2759,14 +2760,11 @@ class binance(Exchange, ImplicitAPI):
2759
2760
  else:
2760
2761
  raise ExchangeError(self.id + ' fetchMarkets() self.options fetchMarkets "' + marketType + '" is not a supported market type')
2761
2762
  promises = await asyncio.gather(*promisesRaw)
2762
- spotMarkets = self.safe_value(self.safe_value(promises, 0), 'symbols', [])
2763
- futureMarkets = self.safe_value(self.safe_value(promises, 1), 'symbols', [])
2764
- deliveryMarkets = self.safe_value(self.safe_value(promises, 2), 'symbols', [])
2765
- optionMarkets = self.safe_value(self.safe_value(promises, 3), 'optionSymbols', [])
2766
- markets = spotMarkets
2767
- markets = self.array_concat(markets, futureMarkets)
2768
- markets = self.array_concat(markets, deliveryMarkets)
2769
- markets = self.array_concat(markets, optionMarkets)
2763
+ markets = []
2764
+ for i in range(0, len(fetchMarkets)):
2765
+ promise = self.safe_dict(promises, i)
2766
+ promiseMarkets = self.safe_list_2(promise, 'symbols', 'optionSymbols', [])
2767
+ markets = self.array_concat(markets, promiseMarkets)
2770
2768
  #
2771
2769
  # spot / margin
2772
2770
  #
@@ -3255,6 +3253,7 @@ class binance(Exchange, ImplicitAPI):
3255
3253
  :param str [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
3256
3254
  :param str[]|None [params.symbols]: unified market symbols, only used in isolated margin mode
3257
3255
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch the balance for a portfolio margin account
3256
+ :param str [params.subType]: "linear" or "inverse"
3258
3257
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
3259
3258
  """
3260
3259
  await self.load_markets()
@@ -3795,6 +3794,7 @@ class binance(Exchange, ImplicitAPI):
3795
3794
  :see: https://binance-docs.github.io/apidocs/delivery/en/#symbol-order-book-ticker # future
3796
3795
  :param str[]|None symbols: unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
3797
3796
  :param dict [params]: extra parameters specific to the exchange API endpoint
3797
+ :param str [params.subType]: "linear" or "inverse"
3798
3798
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3799
3799
  """
3800
3800
  await self.load_markets()
@@ -3828,6 +3828,7 @@ class binance(Exchange, ImplicitAPI):
3828
3828
  :see: https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-ticker # future
3829
3829
  :param str[]|None symbols: unified symbols of the markets to fetch the last prices
3830
3830
  :param dict [params]: extra parameters specific to the exchange API endpoint
3831
+ :param str [params.subType]: "linear" or "inverse"
3831
3832
  :returns dict: a dictionary of lastprices structures
3832
3833
  """
3833
3834
  await self.load_markets()
@@ -3927,6 +3928,7 @@ class binance(Exchange, ImplicitAPI):
3927
3928
  :see: https://binance-docs.github.io/apidocs/voptions/en/#24hr-ticker-price-change-statistics # option
3928
3929
  :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
3929
3930
  :param dict [params]: extra parameters specific to the exchange API endpoint
3931
+ :param str [params.subType]: "linear" or "inverse"
3930
3932
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3931
3933
  """
3932
3934
  await self.load_markets()
@@ -6106,6 +6108,7 @@ class binance(Exchange, ImplicitAPI):
6106
6108
  :param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
6107
6109
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch open orders in the portfolio margin account
6108
6110
  :param boolean [params.stop]: set to True if you would like to fetch portfolio margin account conditional orders
6111
+ :param str [params.subType]: "linear" or "inverse"
6109
6112
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
6110
6113
  """
6111
6114
  await self.load_markets()
@@ -8022,6 +8025,7 @@ class binance(Exchange, ImplicitAPI):
8022
8025
  :param str symbol: unified market symbol
8023
8026
  :param dict [params]: extra parameters specific to the exchange API endpoint
8024
8027
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch trading fees in a portfolio margin account
8028
+ :param str [params.subType]: "linear" or "inverse"
8025
8029
  :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
8026
8030
  """
8027
8031
  await self.load_markets()
@@ -8080,6 +8084,7 @@ class binance(Exchange, ImplicitAPI):
8080
8084
  :see: https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
8081
8085
  :see: https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
8082
8086
  :param dict [params]: extra parameters specific to the exchange API endpoint
8087
+ :param str [params.subType]: "linear" or "inverse"
8083
8088
  :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
8084
8089
  """
8085
8090
  await self.load_markets()
@@ -8315,6 +8320,7 @@ class binance(Exchange, ImplicitAPI):
8315
8320
  :param dict [params]: extra parameters specific to the exchange API endpoint
8316
8321
  :param int [params.until]: timestamp in ms of the latest funding rate
8317
8322
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
8323
+ :param str [params.subType]: "linear" or "inverse"
8318
8324
  :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
8319
8325
  """
8320
8326
  await self.load_markets()
@@ -8377,6 +8383,7 @@ class binance(Exchange, ImplicitAPI):
8377
8383
  :see: https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
8378
8384
  :param str[]|None symbols: list of unified market symbols
8379
8385
  :param dict [params]: extra parameters specific to the exchange API endpoint
8386
+ :param str [params.subType]: "linear" or "inverse"
8380
8387
  :returns dict: a dictionary of `funding rates structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexe by market symbols
8381
8388
  """
8382
8389
  await self.load_markets()
@@ -8947,6 +8954,7 @@ class binance(Exchange, ImplicitAPI):
8947
8954
  :param str[]|None symbols: list of unified market symbols
8948
8955
  :param dict [params]: extra parameters specific to the exchange API endpoint
8949
8956
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch the leverage tiers for a portfolio margin account
8957
+ :param str [params.subType]: "linear" or "inverse"
8950
8958
  :returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
8951
8959
  """
8952
8960
  await self.load_markets()
@@ -9233,6 +9241,7 @@ class binance(Exchange, ImplicitAPI):
9233
9241
  :param str[]|None symbols: list of unified market symbols
9234
9242
  :param dict [params]: extra parameters specific to the exchange API endpoint
9235
9243
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch positions in a portfolio margin account
9244
+ :param str [params.subType]: "linear" or "inverse"
9236
9245
  :returns dict: data on account positions
9237
9246
  """
9238
9247
  if symbols is not None:
@@ -9275,6 +9284,7 @@ class binance(Exchange, ImplicitAPI):
9275
9284
  :param str[]|None symbols: list of unified market symbols
9276
9285
  :param dict [params]: extra parameters specific to the exchange API endpoint
9277
9286
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch positions for a portfolio margin account
9287
+ :param str [params.subType]: "linear" or "inverse"
9278
9288
  :returns dict: data on the positions risk
9279
9289
  """
9280
9290
  if symbols is not None:
@@ -9421,6 +9431,7 @@ class binance(Exchange, ImplicitAPI):
9421
9431
  :param dict [params]: extra parameters specific to the exchange API endpoint
9422
9432
  :param int [params.until]: timestamp in ms of the latest funding history entry
9423
9433
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch the funding history for a portfolio margin account
9434
+ :param str [params.subType]: "linear" or "inverse"
9424
9435
  :returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
9425
9436
  """
9426
9437
  await self.load_markets()
@@ -9567,6 +9578,7 @@ class binance(Exchange, ImplicitAPI):
9567
9578
  :param str symbol: not used by binance setPositionMode()
9568
9579
  :param dict [params]: extra parameters specific to the exchange API endpoint
9569
9580
  :param boolean [params.portfolioMargin]: set to True if you would like to set the position mode for a portfolio margin account
9581
+ :param str [params.subType]: "linear" or "inverse"
9570
9582
  :returns dict: response from the exchange
9571
9583
  """
9572
9584
  defaultType = self.safe_string(self.options, 'defaultType', 'future')
@@ -9590,11 +9602,13 @@ class binance(Exchange, ImplicitAPI):
9590
9602
  response = await self.papiPostCmPositionSideDual(self.extend(request, params))
9591
9603
  else:
9592
9604
  response = await self.dapiPrivatePostPositionSideDual(self.extend(request, params))
9593
- else:
9605
+ elif self.is_linear(type, subType):
9594
9606
  if isPortfolioMargin:
9595
9607
  response = await self.papiPostUmPositionSideDual(self.extend(request, params))
9596
9608
  else:
9597
9609
  response = await self.fapiPrivatePostPositionSideDual(self.extend(request, params))
9610
+ else:
9611
+ raise BadRequest(self.id + ' setPositionMode() supports linear and inverse contracts only')
9598
9612
  #
9599
9613
  # {
9600
9614
  # "code": 200,
@@ -9612,6 +9626,7 @@ class binance(Exchange, ImplicitAPI):
9612
9626
  :see: https://binance-docs.github.io/apidocs/pm/en/#get-cm-account-detail-user_data
9613
9627
  :param str[] [symbols]: a list of unified market symbols
9614
9628
  :param dict [params]: extra parameters specific to the exchange API endpoint
9629
+ :param str [params.subType]: "linear" or "inverse"
9615
9630
  :returns dict: a list of `leverage structures <https://docs.ccxt.com/#/?id=leverage-structure>`
9616
9631
  """
9617
9632
  await self.load_markets()
@@ -9859,6 +9874,7 @@ class binance(Exchange, ImplicitAPI):
9859
9874
  :param int [params.until]: timestamp in ms of the latest ledger entry
9860
9875
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
9861
9876
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch the ledger for a portfolio margin account
9877
+ :param str [params.subType]: "linear" or "inverse"
9862
9878
  :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
9863
9879
  """
9864
9880
  await self.load_markets()
@@ -10858,6 +10874,8 @@ class binance(Exchange, ImplicitAPI):
10858
10874
  :param int [params.until]: timestamp in ms of the latest liquidation
10859
10875
  :param boolean [params.paginate]: *spot only* default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
10860
10876
  :param boolean [params.portfolioMargin]: set to True if you would like to fetch liquidations in a portfolio margin account
10877
+ :param str [params.type]: "spot"
10878
+ :param str [params.subType]: "linear" or "inverse"
10861
10879
  :returns dict: an array of `liquidation structures <https://docs.ccxt.com/#/?id=liquidation-structure>`
10862
10880
  """
10863
10881
  await self.load_markets()
@@ -11158,8 +11176,8 @@ class binance(Exchange, ImplicitAPI):
11158
11176
  """
11159
11177
  fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
11160
11178
  :param str symbol: unified symbol of the market to fetch the order book for
11161
- :param dict params: extra parameters specific to the exchange API endpoint
11162
- :param str params['subType']: "linear" or "inverse"
11179
+ :param dict [params]: extra parameters specific to the exchange API endpoint
11180
+ :param str [params.subType]: "linear" or "inverse"
11163
11181
  :returns dict: an object detailing whether the market is in hedged or one-way mode
11164
11182
  """
11165
11183
  market = None
@@ -11191,7 +11209,8 @@ class binance(Exchange, ImplicitAPI):
11191
11209
  :see: https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
11192
11210
  :param str symbol: unified symbol of the market the order was made in
11193
11211
  :param dict [params]: extra parameters specific to the exchange API endpoint
11194
- :returns dict: struct of marginMode
11212
+ :param str [params.subType]: "linear" or "inverse"
11213
+ :returns dict: a list of `margin mode structures <https://docs.ccxt.com/#/?id=margin-mode-structure>`
11195
11214
  """
11196
11215
  await self.load_markets()
11197
11216
  market = None