ccxt 4.4.44__py2.py3-none-any.whl → 4.4.46__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 (74) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/blofin.py +22 -0
  3. ccxt/ascendex.py +15 -1
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/ascendex.py +15 -1
  6. ccxt/async_support/base/exchange.py +1 -1
  7. ccxt/async_support/binance.py +178 -62
  8. ccxt/async_support/bingx.py +15 -9
  9. ccxt/async_support/bitfinex.py +1 -1
  10. ccxt/async_support/bitget.py +105 -41
  11. ccxt/async_support/bitmart.py +3 -3
  12. ccxt/async_support/bitmex.py +1 -1
  13. ccxt/async_support/blofin.py +22 -0
  14. ccxt/async_support/bybit.py +84 -40
  15. ccxt/async_support/coinbase.py +1 -1
  16. ccxt/async_support/coinex.py +1 -1
  17. ccxt/async_support/cryptocom.py +1 -1
  18. ccxt/async_support/delta.py +9 -4
  19. ccxt/async_support/exmo.py +16 -8
  20. ccxt/async_support/gate.py +1 -2
  21. ccxt/async_support/hashkey.py +6 -1
  22. ccxt/async_support/htx.py +2 -2
  23. ccxt/async_support/hyperliquid.py +3 -4
  24. ccxt/async_support/kraken.py +1 -1
  25. ccxt/async_support/krakenfutures.py +1 -1
  26. ccxt/async_support/kucoin.py +1 -1
  27. ccxt/async_support/kucoinfutures.py +2 -3
  28. ccxt/async_support/lykke.py +1 -1
  29. ccxt/async_support/mexc.py +3 -2
  30. ccxt/async_support/myokx.py +8 -0
  31. ccxt/async_support/okx.py +4 -4
  32. ccxt/async_support/onetrading.py +20 -4
  33. ccxt/async_support/whitebit.py +31 -8
  34. ccxt/async_support/woo.py +1 -1
  35. ccxt/async_support/woofipro.py +2 -2
  36. ccxt/base/exchange.py +1 -1
  37. ccxt/binance.py +178 -62
  38. ccxt/bingx.py +15 -9
  39. ccxt/bitfinex.py +1 -1
  40. ccxt/bitget.py +105 -41
  41. ccxt/bitmart.py +3 -3
  42. ccxt/bitmex.py +1 -1
  43. ccxt/blofin.py +22 -0
  44. ccxt/bybit.py +84 -40
  45. ccxt/coinbase.py +1 -1
  46. ccxt/coinex.py +1 -1
  47. ccxt/cryptocom.py +1 -1
  48. ccxt/delta.py +9 -4
  49. ccxt/exmo.py +16 -8
  50. ccxt/gate.py +1 -2
  51. ccxt/hashkey.py +6 -1
  52. ccxt/htx.py +2 -2
  53. ccxt/hyperliquid.py +3 -4
  54. ccxt/kraken.py +1 -1
  55. ccxt/krakenfutures.py +1 -1
  56. ccxt/kucoin.py +1 -1
  57. ccxt/kucoinfutures.py +2 -3
  58. ccxt/lykke.py +1 -1
  59. ccxt/mexc.py +3 -2
  60. ccxt/myokx.py +8 -0
  61. ccxt/okx.py +4 -4
  62. ccxt/onetrading.py +20 -4
  63. ccxt/pro/__init__.py +1 -1
  64. ccxt/pro/binance.py +2 -1
  65. ccxt/pro/coinex.py +1 -1
  66. ccxt/pro/myokx.py +5 -0
  67. ccxt/whitebit.py +31 -8
  68. ccxt/woo.py +1 -1
  69. ccxt/woofipro.py +2 -2
  70. {ccxt-4.4.44.dist-info → ccxt-4.4.46.dist-info}/METADATA +4 -4
  71. {ccxt-4.4.44.dist-info → ccxt-4.4.46.dist-info}/RECORD +74 -74
  72. {ccxt-4.4.44.dist-info → ccxt-4.4.46.dist-info}/LICENSE.txt +0 -0
  73. {ccxt-4.4.44.dist-info → ccxt-4.4.46.dist-info}/WHEEL +0 -0
  74. {ccxt-4.4.44.dist-info → ccxt-4.4.46.dist-info}/top_level.txt +0 -0
@@ -239,7 +239,6 @@ class hyperliquid(Exchange, ImplicitAPI):
239
239
  'takeProfitPrice': False,
240
240
  'attachedStopLossTakeProfit': None,
241
241
  'timeInForce': {
242
- 'GTC': True,
243
242
  'IOC': True,
244
243
  'FOK': False,
245
244
  'PO': True,
@@ -284,7 +283,7 @@ class hyperliquid(Exchange, ImplicitAPI):
284
283
  'fetchClosedOrders': {
285
284
  'marginMode': False,
286
285
  'limit': 2000,
287
- 'daysBackClosed': None,
286
+ 'daysBack': None,
288
287
  'daysBackCanceled': None,
289
288
  'untilDays': None,
290
289
  'trigger': False,
@@ -2182,7 +2181,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2182
2181
  else:
2183
2182
  market = self.safe_market(marketId, market)
2184
2183
  symbol = market['symbol']
2185
- timestamp = self.safe_integer_2(order, 'timestamp', 'statusTimestamp')
2184
+ timestamp = self.safe_integer(entry, 'timestamp')
2186
2185
  status = self.safe_string_2(order, 'status', 'ccxtStatus')
2187
2186
  order = self.omit(order, ['ccxtStatus'])
2188
2187
  side = self.safe_string(entry, 'side')
@@ -2197,7 +2196,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2197
2196
  'timestamp': timestamp,
2198
2197
  'datetime': self.iso8601(timestamp),
2199
2198
  'lastTradeTimestamp': None,
2200
- 'lastUpdateTimestamp': None,
2199
+ 'lastUpdateTimestamp': self.safe_integer(order, 'statusTimestamp'),
2201
2200
  'symbol': symbol,
2202
2201
  'type': self.parse_order_type(self.safe_string_lower(entry, 'orderType')),
2203
2202
  'timeInForce': self.safe_string_upper(entry, 'tif'),
@@ -492,7 +492,7 @@ class kraken(Exchange, ImplicitAPI):
492
492
  'fetchClosedOrders': {
493
493
  'marginMode': False,
494
494
  'limit': None,
495
- 'daysBackClosed': None,
495
+ 'daysBack': None,
496
496
  'daysBackCanceled': None,
497
497
  'untilDays': 100000,
498
498
  'trigger': False,
@@ -325,7 +325,7 @@ class krakenfutures(Exchange, ImplicitAPI):
325
325
  'fetchClosedOrders': {
326
326
  'marginMode': False,
327
327
  'limit': None,
328
- 'daysBackClosed': None,
328
+ 'daysBack': None,
329
329
  'daysBackCanceled': None,
330
330
  'untilDays': None,
331
331
  'trigger': False,
@@ -1056,7 +1056,7 @@ class kucoin(Exchange, ImplicitAPI):
1056
1056
  'fetchClosedOrders': {
1057
1057
  'marginMode': True,
1058
1058
  'limit': 500,
1059
- 'daysBackClosed': None,
1059
+ 'daysBack': None,
1060
1060
  'daysBackCanceled': None,
1061
1061
  'untilDays': 7,
1062
1062
  'trigger': True,
@@ -386,9 +386,8 @@ class kucoinfutures(kucoin, ImplicitAPI):
386
386
  'stopLossPrice': True,
387
387
  'takeProfitPrice': True,
388
388
  'attachedStopLossTakeProfit': {
389
- 'triggerPrice': None,
390
389
  'triggerPriceType': None,
391
- 'limitPrice': True,
390
+ 'price': True,
392
391
  },
393
392
  'timeInForce': {
394
393
  'IOC': True,
@@ -428,7 +427,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
428
427
  'fetchClosedOrders': {
429
428
  'marginMode': False,
430
429
  'limit': 1000,
431
- 'daysBackClosed': None,
430
+ 'daysBack': None,
432
431
  'daysBackCanceled': None,
433
432
  'untilDays': None,
434
433
  'trigger': True,
@@ -209,7 +209,7 @@ class lykke(Exchange, ImplicitAPI):
209
209
  # {
210
210
  # "payload":[
211
211
  # {
212
- # "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9074",
212
+ # "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9075",
213
213
  # "name":"Monaco Token",
214
214
  # "symbol":"MCO",
215
215
  # "accuracy":6,
@@ -458,6 +458,7 @@ class mexc(Exchange, ImplicitAPI):
458
458
  '1h': '60m',
459
459
  '4h': '4h',
460
460
  '1d': '1d',
461
+ '1w': '1W',
461
462
  '1M': '1M',
462
463
  },
463
464
  'swap': {
@@ -749,7 +750,7 @@ class mexc(Exchange, ImplicitAPI):
749
750
  'fetchClosedOrders': {
750
751
  'marginMode': True,
751
752
  'limit': 1000,
752
- 'daysBackClosed': 7,
753
+ 'daysBack': 7,
753
754
  'daysBackCanceled': 7,
754
755
  'untilDays': 7,
755
756
  'trigger': False,
@@ -805,7 +806,7 @@ class mexc(Exchange, ImplicitAPI):
805
806
  'fetchClosedOrders': {
806
807
  'marginMode': False,
807
808
  'limit': 100,
808
- 'daysBackClosed': 90,
809
+ 'daysBack': 90,
809
810
  'daysBackCanceled': None,
810
811
  'untilDays': 90,
811
812
  'trigger': True,
@@ -32,4 +32,12 @@ class myokx(okx, ImplicitAPI):
32
32
  'rest': 'https://{hostname}',
33
33
  },
34
34
  },
35
+ 'has': {
36
+ 'CORS': None,
37
+ 'spot': True,
38
+ 'margin': None,
39
+ 'swap': False,
40
+ 'future': False,
41
+ 'option': False,
42
+ },
35
43
  })
ccxt/async_support/okx.py CHANGED
@@ -1226,7 +1226,7 @@ class okx(Exchange, ImplicitAPI):
1226
1226
  'mark': True,
1227
1227
  'index': True,
1228
1228
  },
1229
- 'limitPrice': True,
1229
+ 'price': True,
1230
1230
  },
1231
1231
  'timeInForce': {
1232
1232
  'IOC': True,
@@ -1266,7 +1266,7 @@ class okx(Exchange, ImplicitAPI):
1266
1266
  'fetchClosedOrders': {
1267
1267
  'marginMode': False,
1268
1268
  'limit': 100,
1269
- 'daysBackClosed': 90, # 3 months
1269
+ 'daysBack': 90, # 3 months
1270
1270
  'daysBackCanceled': 1 / 12, # 2 hour
1271
1271
  'untilDays': None,
1272
1272
  'trigger': True,
@@ -1636,7 +1636,7 @@ class okx(Exchange, ImplicitAPI):
1636
1636
  'contractSize': self.safe_number(market, 'ctVal') if contract else None,
1637
1637
  'expiry': expiry,
1638
1638
  'expiryDatetime': self.iso8601(expiry),
1639
- 'strike': strikePrice,
1639
+ 'strike': self.parse_number(strikePrice),
1640
1640
  'optionType': optionType,
1641
1641
  'created': self.safe_integer(market, 'listTime'),
1642
1642
  'precision': {
@@ -1835,7 +1835,7 @@ class okx(Exchange, ImplicitAPI):
1835
1835
  }
1836
1836
  firstChain = self.safe_dict(chains, 0, {})
1837
1837
  result[code] = {
1838
- 'info': None,
1838
+ 'info': chains,
1839
1839
  'code': code,
1840
1840
  'id': currencyId,
1841
1841
  'name': self.safe_string(firstChain, 'name'),
@@ -289,6 +289,7 @@ class onetrading(Exchange, ImplicitAPI):
289
289
  'INTERNAL_SERVER_ERROR': ExchangeError,
290
290
  },
291
291
  'broad': {
292
+ 'Order not found.': OrderNotFound,
292
293
  },
293
294
  },
294
295
  'commonCurrencies': {
@@ -865,7 +866,8 @@ class onetrading(Exchange, ImplicitAPI):
865
866
  # {"instrument_code":"BTC_EUR","granularity":{"unit":"HOURS","period":1},"high":"9135.7","low":"9002.59","open":"9055.45","close":"9133.98","total_amount":"26.21919","volume":"238278.8724959","time":"2020-05-09T00:59:59.999Z","last_sequence":461521},
866
867
  # ]
867
868
  #
868
- return self.parse_ohlcvs(response, market, timeframe, since, limit)
869
+ ohlcv = self.safe_list(response, 'candlesticks')
870
+ return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
869
871
 
870
872
  def parse_trade(self, trade: dict, market: Market = None) -> Trade:
871
873
  #
@@ -999,6 +1001,7 @@ class onetrading(Exchange, ImplicitAPI):
999
1001
  'CLOSED': 'canceled',
1000
1002
  'FAILED': 'failed',
1001
1003
  'STOP_TRIGGERED': 'triggered',
1004
+ 'DONE': 'closed',
1002
1005
  }
1003
1006
  return self.safe_string(statuses, status, status)
1004
1007
 
@@ -1093,7 +1096,7 @@ class onetrading(Exchange, ImplicitAPI):
1093
1096
  'datetime': self.iso8601(timestamp),
1094
1097
  'lastTradeTimestamp': None,
1095
1098
  'symbol': symbol,
1096
- 'type': type,
1099
+ 'type': self.parse_order_type(type),
1097
1100
  'timeInForce': timeInForce,
1098
1101
  'postOnly': postOnly,
1099
1102
  'side': side,
@@ -1109,6 +1112,12 @@ class onetrading(Exchange, ImplicitAPI):
1109
1112
  'trades': rawTrades,
1110
1113
  }, market)
1111
1114
 
1115
+ def parse_order_type(self, type: Str):
1116
+ types: dict = {
1117
+ 'booked': 'limit',
1118
+ }
1119
+ return self.safe_string(types, type, type)
1120
+
1112
1121
  def parse_time_in_force(self, timeInForce: Str):
1113
1122
  timeInForces: dict = {
1114
1123
  'GOOD_TILL_CANCELLED': 'GTC',
@@ -1166,6 +1175,9 @@ class onetrading(Exchange, ImplicitAPI):
1166
1175
  if clientOrderId is not None:
1167
1176
  request['client_id'] = clientOrderId
1168
1177
  params = self.omit(params, ['clientOrderId', 'client_id'])
1178
+ timeInForce = self.safe_string_2(params, 'timeInForce', 'time_in_force', 'GOOD_TILL_CANCELLED')
1179
+ params = self.omit(params, 'timeInForce')
1180
+ request['time_in_force'] = timeInForce
1169
1181
  response = await self.privatePostAccountOrders(self.extend(request, params))
1170
1182
  #
1171
1183
  # {
@@ -1205,11 +1217,15 @@ class onetrading(Exchange, ImplicitAPI):
1205
1217
  request['client_id'] = clientOrderId
1206
1218
  else:
1207
1219
  request['order_id'] = id
1208
- response = await getattr(self, method)(self.extend(request, params))
1220
+ response = None
1221
+ if method == 'privateDeleteAccountOrdersOrderId':
1222
+ response = await self.privateDeleteAccountOrdersOrderId(self.extend(request, params))
1223
+ else:
1224
+ response = await self.privateDeleteAccountOrdersClientClientId(self.extend(request, params))
1209
1225
  #
1210
1226
  # responds with an empty body
1211
1227
  #
1212
- return response
1228
+ return self.parse_order(response)
1213
1229
 
1214
1230
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1215
1231
  """
@@ -820,9 +820,22 @@ class whitebit(Exchange, ImplicitAPI):
820
820
  # "last": "55913.88",
821
821
  # "period": 86400
822
822
  # }
823
- market = self.safe_market(None, market)
823
+ # v2
824
+ # {
825
+ # lastUpdateTimestamp: '2025-01-02T09:16:36.000Z',
826
+ # tradingPairs: 'ARB_USDC',
827
+ # lastPrice: '0.7727',
828
+ # lowestAsk: '0.7735',
829
+ # highestBid: '0.7732',
830
+ # baseVolume24h: '1555793.74',
831
+ # quoteVolume24h: '1157602.622406',
832
+ # tradesEnabled: True
833
+ # }
834
+ #
835
+ marketId = self.safe_string(ticker, 'tradingPairs')
836
+ market = self.safe_market(marketId, market)
824
837
  # last price is provided as "last" or "last_price"
825
- last = self.safe_string_2(ticker, 'last', 'last_price')
838
+ last = self.safe_string_n(ticker, ['last', 'last_price', 'lastPrice'])
826
839
  # if "close" is provided, use it, otherwise use <last>
827
840
  close = self.safe_string(ticker, 'close', last)
828
841
  return self.safe_ticker({
@@ -831,9 +844,9 @@ class whitebit(Exchange, ImplicitAPI):
831
844
  'datetime': None,
832
845
  'high': self.safe_string(ticker, 'high'),
833
846
  'low': self.safe_string(ticker, 'low'),
834
- 'bid': self.safe_string(ticker, 'bid'),
847
+ 'bid': self.safe_string_2(ticker, 'bid', 'highestBid'),
835
848
  'bidVolume': None,
836
- 'ask': self.safe_string(ticker, 'ask'),
849
+ 'ask': self.safe_string_2(ticker, 'ask', 'lowestAsk'),
837
850
  'askVolume': None,
838
851
  'vwap': None,
839
852
  'open': self.safe_string(ticker, 'open'),
@@ -843,8 +856,8 @@ class whitebit(Exchange, ImplicitAPI):
843
856
  'change': None,
844
857
  'percentage': self.safe_string(ticker, 'change'),
845
858
  'average': None,
846
- 'baseVolume': self.safe_string_2(ticker, 'base_volume', 'volume'),
847
- 'quoteVolume': self.safe_string_2(ticker, 'quote_volume', 'deal'),
859
+ 'baseVolume': self.safe_string_n(ticker, ['base_volume', 'volume', 'baseVolume24h']),
860
+ 'quoteVolume': self.safe_string_n(ticker, ['quote_volume', 'deal', 'quoteVolume24h']),
848
861
  'info': ticker,
849
862
  }, market)
850
863
 
@@ -854,13 +867,20 @@ class whitebit(Exchange, ImplicitAPI):
854
867
 
855
868
  https://docs.whitebit.com/public/http-v4/#market-activity
856
869
 
857
- :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
870
+ :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
858
871
  :param dict [params]: extra parameters specific to the exchange API endpoint
872
+ :param str [params.method]: either v2PublicGetTicker or v4PublicGetTicker default is v4PublicGetTicker
859
873
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
860
874
  """
861
875
  await self.load_markets()
862
876
  symbols = self.market_symbols(symbols)
863
- response = await self.v4PublicGetTicker(params)
877
+ method = 'v4PublicGetTicker'
878
+ method, params = self.handle_option_and_params(params, 'fetchTickers', 'method', method)
879
+ response = None
880
+ if method == 'v4PublicGetTicker':
881
+ response = await self.v4PublicGetTicker(params)
882
+ else:
883
+ response = await self.v2PublicGetTicker(params)
864
884
  #
865
885
  # "BCH_RUB": {
866
886
  # "base_id":1831,
@@ -872,6 +892,9 @@ class whitebit(Exchange, ImplicitAPI):
872
892
  # "change":"2.12"
873
893
  # },
874
894
  #
895
+ resultList = self.safe_list(response, 'result')
896
+ if resultList is not None:
897
+ return self.parse_tickers(resultList, symbols)
875
898
  marketIds = list(response.keys())
876
899
  result: dict = {}
877
900
  for i in range(0, len(marketIds)):
ccxt/async_support/woo.py CHANGED
@@ -379,7 +379,7 @@ class woo(Exchange, ImplicitAPI):
379
379
  'fetchClosedOrders': {
380
380
  'marginMode': False,
381
381
  'limit': 500,
382
- 'daysBackClosed': None,
382
+ 'daysBack': None,
383
383
  'daysBackCanceled': None,
384
384
  'untilDays': 100000,
385
385
  'trigger': True,
@@ -357,7 +357,7 @@ class woofipro(Exchange, ImplicitAPI):
357
357
  'fetchClosedOrders': {
358
358
  'marginMode': False,
359
359
  'limit': 500,
360
- 'daysBackClosed': None,
360
+ 'daysBack': None,
361
361
  'daysBackCanceled': None,
362
362
  'untilDays': 100000,
363
363
  'trigger': True,
@@ -378,7 +378,7 @@ class woofipro(Exchange, ImplicitAPI):
378
378
  'attachedStopLossTakeProfit': {
379
379
  # todo: implementation needs unification
380
380
  'triggerPriceType': None,
381
- 'limitPrice': False,
381
+ 'price': False,
382
382
  },
383
383
  },
384
384
  },
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.44'
7
+ __version__ = '4.4.46'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10