ccxt 4.3.61__py2.py3-none-any.whl → 4.3.63__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.
Files changed (69) hide show
  1. ccxt/__init__.py +2 -1
  2. ccxt/abstract/binance.py +5 -5
  3. ccxt/abstract/binancecoinm.py +5 -5
  4. ccxt/abstract/binanceus.py +5 -5
  5. ccxt/abstract/binanceusdm.py +5 -5
  6. ccxt/abstract/cryptocom.py +11 -0
  7. ccxt/abstract/woo.py +3 -0
  8. ccxt/ace.py +33 -15
  9. ccxt/async_support/__init__.py +2 -1
  10. ccxt/async_support/ace.py +33 -15
  11. ccxt/async_support/base/exchange.py +1 -1
  12. ccxt/async_support/base/ws/fast_client.py +2 -2
  13. ccxt/async_support/binance.py +43 -38
  14. ccxt/async_support/bingx.py +492 -184
  15. ccxt/async_support/bybit.py +1 -1
  16. ccxt/async_support/coinbaseinternational.py +1 -1
  17. ccxt/async_support/cryptocom.py +17 -2
  18. ccxt/async_support/mercado.py +5 -1
  19. ccxt/async_support/tradeogre.py +1 -1
  20. ccxt/async_support/woo.py +296 -81
  21. ccxt/async_support/xt.py +4 -4
  22. ccxt/base/errors.py +8 -1
  23. ccxt/base/exchange.py +8 -2
  24. ccxt/binance.py +43 -38
  25. ccxt/bingx.py +492 -184
  26. ccxt/bybit.py +1 -1
  27. ccxt/coinbaseinternational.py +1 -1
  28. ccxt/cryptocom.py +17 -2
  29. ccxt/mercado.py +5 -1
  30. ccxt/pro/__init__.py +1 -1
  31. ccxt/pro/alpaca.py +3 -3
  32. ccxt/pro/binance.py +58 -39
  33. ccxt/pro/bingx.py +2 -2
  34. ccxt/pro/bitfinex2.py +8 -6
  35. ccxt/pro/bitget.py +6 -3
  36. ccxt/pro/bitmex.py +1 -1
  37. ccxt/pro/bitopro.py +1 -1
  38. ccxt/pro/bitvavo.py +1 -1
  39. ccxt/pro/bybit.py +46 -23
  40. ccxt/pro/coinbaseexchange.py +2 -2
  41. ccxt/pro/coincheck.py +1 -1
  42. ccxt/pro/coinone.py +1 -1
  43. ccxt/pro/cryptocom.py +8 -3
  44. ccxt/pro/deribit.py +1 -1
  45. ccxt/pro/gate.py +8 -5
  46. ccxt/pro/hollaex.py +1 -1
  47. ccxt/pro/htx.py +6 -2
  48. ccxt/pro/hyperliquid.py +3 -3
  49. ccxt/pro/independentreserve.py +6 -4
  50. ccxt/pro/kraken.py +80 -7
  51. ccxt/pro/kucoin.py +1 -1
  52. ccxt/pro/mexc.py +1 -1
  53. ccxt/pro/okx.py +5 -5
  54. ccxt/pro/oxfun.py +1 -1
  55. ccxt/pro/phemex.py +1 -1
  56. ccxt/pro/poloniexfutures.py +5 -2
  57. ccxt/pro/upbit.py +1 -1
  58. ccxt/pro/vertex.py +2 -2
  59. ccxt/pro/whitebit.py +1 -1
  60. ccxt/pro/woo.py +1 -1
  61. ccxt/pro/woofipro.py +1 -1
  62. ccxt/tradeogre.py +1 -1
  63. ccxt/woo.py +296 -81
  64. ccxt/xt.py +4 -4
  65. {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/METADATA +4 -4
  66. {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/RECORD +69 -69
  67. {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/LICENSE.txt +0 -0
  68. {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/WHEEL +0 -0
  69. {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/top_level.txt +0 -0
@@ -837,7 +837,7 @@ class binance(Exchange, ImplicitAPI):
837
837
  'forceOrders': {'cost': 20, 'noSymbol': 50},
838
838
  'allOrders': 5,
839
839
  'openOrder': 1,
840
- 'openOrders': 1,
840
+ 'openOrders': {'cost': 1, 'noSymbol': 40},
841
841
  'order': 1,
842
842
  'account': 5,
843
843
  'balance': 5,
@@ -1029,18 +1029,18 @@ class binance(Exchange, ImplicitAPI):
1029
1029
  'ping': 1,
1030
1030
  'um/order': 1, # 1
1031
1031
  'um/openOrder': 1, # 1
1032
- 'um/openOrders': 1, # 1
1032
+ 'um/openOrders': {'cost': 1, 'noSymbol': 40},
1033
1033
  'um/allOrders': 5, # 5
1034
1034
  'cm/order': 1, # 1
1035
1035
  'cm/openOrder': 1, # 1
1036
- 'cm/openOrders': 1, # 1
1036
+ 'cm/openOrders': {'cost': 1, 'noSymbol': 40},
1037
1037
  'cm/allOrders': 20, # 20
1038
1038
  'um/conditional/openOrder': 1,
1039
- 'um/conditional/openOrders': 40,
1039
+ 'um/conditional/openOrders': {'cost': 1, 'noSymbol': 40},
1040
1040
  'um/conditional/orderHistory': 1,
1041
1041
  'um/conditional/allOrders': 40,
1042
1042
  'cm/conditional/openOrder': 1,
1043
- 'cm/conditional/openOrders': 40,
1043
+ 'cm/conditional/openOrders': {'cost': 1, 'noSymbol': 40},
1044
1044
  'cm/conditional/orderHistory': 1,
1045
1045
  'cm/conditional/allOrders': 40,
1046
1046
  'margin/order': 5,
@@ -6202,10 +6202,7 @@ class binance(Exchange, ImplicitAPI):
6202
6202
  marketType = market['type'] if ('type' in market) else defaultType
6203
6203
  type = self.safe_string(params, 'type', marketType)
6204
6204
  elif self.options['warnOnFetchOpenOrdersWithoutSymbol']:
6205
- symbols = self.symbols
6206
- numSymbols = len(symbols)
6207
- fetchOpenOrdersRateLimit = self.parse_to_int(numSymbols / 2)
6208
- raise ExchangeError(self.id + ' fetchOpenOrders() WARNING: fetching open orders without specifying a symbol is rate-limited to one call per ' + str(fetchOpenOrdersRateLimit) + ' seconds. Do not call self method frequently to avoid ban. Set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.')
6205
+ raise ExchangeError(self.id + ' fetchOpenOrders() WARNING: fetching open orders without specifying a symbol has stricter rate limits(10 times more for spot, 40 times more for other markets) compared to requesting with symbol argument. To acknowledge self warning, set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.')
6209
6206
  else:
6210
6207
  defaultType = self.safe_string_2(self.options, 'fetchOpenOrders', 'defaultType', 'spot')
6211
6208
  type = self.safe_string(params, 'type', defaultType)
@@ -9104,34 +9101,38 @@ class binance(Exchange, ImplicitAPI):
9104
9101
  if marginMode == 'cross':
9105
9102
  # calculate collateral
9106
9103
  precision = self.safe_dict(market, 'precision', {})
9107
- if linear:
9108
- # walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
9109
- onePlusMaintenanceMarginPercentageString = None
9110
- entryPriceSignString = entryPriceString
9111
- if side == 'short':
9112
- onePlusMaintenanceMarginPercentageString = Precise.string_add('1', maintenanceMarginPercentageString)
9113
- entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
9114
- else:
9115
- onePlusMaintenanceMarginPercentageString = Precise.string_add('-1', maintenanceMarginPercentageString)
9116
- inner = Precise.string_mul(liquidationPriceString, onePlusMaintenanceMarginPercentageString)
9117
- leftSide = Precise.string_add(inner, entryPriceSignString)
9118
- quotePrecision = self.precision_from_string(self.safe_string_2(precision, 'quote', 'price'))
9119
- if quotePrecision is not None:
9120
- collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', quotePrecision)
9121
- else:
9122
- # walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
9123
- onePlusMaintenanceMarginPercentageString = None
9124
- entryPriceSignString = entryPriceString
9125
- if side == 'short':
9126
- onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
9104
+ basePrecisionValue = self.safe_string(precision, 'base')
9105
+ quotePrecisionValue = self.safe_string_2(precision, 'quote', 'price')
9106
+ precisionIsUndefined = (basePrecisionValue is None) and (quotePrecisionValue is None)
9107
+ if not precisionIsUndefined:
9108
+ if linear:
9109
+ # walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
9110
+ onePlusMaintenanceMarginPercentageString = None
9111
+ entryPriceSignString = entryPriceString
9112
+ if side == 'short':
9113
+ onePlusMaintenanceMarginPercentageString = Precise.string_add('1', maintenanceMarginPercentageString)
9114
+ entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
9115
+ else:
9116
+ onePlusMaintenanceMarginPercentageString = Precise.string_add('-1', maintenanceMarginPercentageString)
9117
+ inner = Precise.string_mul(liquidationPriceString, onePlusMaintenanceMarginPercentageString)
9118
+ leftSide = Precise.string_add(inner, entryPriceSignString)
9119
+ quotePrecision = self.precision_from_string(self.safe_string_2(precision, 'quote', 'price'))
9120
+ if quotePrecision is not None:
9121
+ collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', quotePrecision)
9127
9122
  else:
9128
- onePlusMaintenanceMarginPercentageString = Precise.string_sub('-1', maintenanceMarginPercentageString)
9129
- entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
9130
- leftSide = Precise.string_mul(contractsAbs, contractSizeString)
9131
- rightSide = Precise.string_sub(Precise.string_div('1', entryPriceSignString), Precise.string_div(onePlusMaintenanceMarginPercentageString, liquidationPriceString))
9132
- basePrecision = self.precision_from_string(self.safe_string(precision, 'base'))
9133
- if basePrecision is not None:
9134
- collateralString = Precise.string_div(Precise.string_mul(leftSide, rightSide), '1', basePrecision)
9123
+ # walletBalance = (contracts * contractSize) * (±1/entryPrice -1 - mmp) / liquidationPrice)
9124
+ onePlusMaintenanceMarginPercentageString = None
9125
+ entryPriceSignString = entryPriceString
9126
+ if side == 'short':
9127
+ onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
9128
+ else:
9129
+ onePlusMaintenanceMarginPercentageString = Precise.string_sub('-1', maintenanceMarginPercentageString)
9130
+ entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
9131
+ leftSide = Precise.string_mul(contractsAbs, contractSizeString)
9132
+ rightSide = Precise.string_sub(Precise.string_div('1', entryPriceSignString), Precise.string_div(onePlusMaintenanceMarginPercentageString, liquidationPriceString))
9133
+ basePrecision = self.precision_from_string(self.safe_string(precision, 'base'))
9134
+ if basePrecision is not None:
9135
+ collateralString = Precise.string_div(Precise.string_mul(leftSide, rightSide), '1', basePrecision)
9135
9136
  else:
9136
9137
  collateralString = self.safe_string(position, 'isolatedMargin')
9137
9138
  collateralString = '0' if (collateralString is None) else collateralString
@@ -9696,9 +9697,10 @@ class binance(Exchange, ImplicitAPI):
9696
9697
  #
9697
9698
  result = []
9698
9699
  for i in range(0, len(response)):
9699
- parsed = self.parse_position_risk(response[i])
9700
- entryPrice = self.safe_string(parsed, 'entryPrice')
9700
+ rawPosition = response[i]
9701
+ entryPrice = self.safe_string(rawPosition, 'entryPrice')
9701
9702
  if (entryPrice != '0') and (entryPrice != '0.0') and (entryPrice != '0.00000000'):
9703
+ parsed = self.parse_position_risk(response[i])
9702
9704
  result.append(parsed)
9703
9705
  symbols = self.market_symbols(symbols)
9704
9706
  return self.filter_by_array_positions(result, 'symbol', symbols, False)
@@ -11201,6 +11203,8 @@ class binance(Exchange, ImplicitAPI):
11201
11203
  request: dict = {}
11202
11204
  if market['option']:
11203
11205
  request['underlyingAsset'] = market['baseId']
11206
+ if market['expiry'] is None:
11207
+ raise NotSupported(self.id + ' fetchOpenInterest does not support ' + symbol)
11204
11208
  request['expiration'] = self.yymmdd(market['expiry'])
11205
11209
  else:
11206
11210
  request['symbol'] = market['id']
@@ -11242,6 +11246,7 @@ class binance(Exchange, ImplicitAPI):
11242
11246
  # ]
11243
11247
  #
11244
11248
  if market['option']:
11249
+ symbol = market['symbol']
11245
11250
  result = self.parse_open_interests(response, market)
11246
11251
  for i in range(0, len(result)):
11247
11252
  item = result[i]