ccxt 4.1.84__py2.py3-none-any.whl → 4.1.86__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 (65) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/alpaca.py +1 -1
  3. ccxt/ascendex.py +1 -1
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/alpaca.py +1 -1
  6. ccxt/async_support/ascendex.py +1 -1
  7. ccxt/async_support/base/exchange.py +7 -2
  8. ccxt/async_support/binance.py +1 -1
  9. ccxt/async_support/bingx.py +9 -8
  10. ccxt/async_support/bitget.py +1 -2
  11. ccxt/async_support/bithumb.py +2 -2
  12. ccxt/async_support/bitmart.py +90 -73
  13. ccxt/async_support/bitmex.py +1 -1
  14. ccxt/async_support/bitopro.py +2 -2
  15. ccxt/async_support/bybit.py +2 -4
  16. ccxt/async_support/coinex.py +2 -1
  17. ccxt/async_support/cryptocom.py +2 -2
  18. ccxt/async_support/digifinex.py +119 -103
  19. ccxt/async_support/hitbtc.py +1 -1
  20. ccxt/async_support/htx.py +1 -1
  21. ccxt/async_support/kraken.py +1 -1
  22. ccxt/async_support/krakenfutures.py +2 -2
  23. ccxt/async_support/kucoin.py +1 -5
  24. ccxt/async_support/kucoinfutures.py +0 -3
  25. ccxt/async_support/latoken.py +1 -1
  26. ccxt/async_support/mexc.py +76 -49
  27. ccxt/async_support/okx.py +3 -3
  28. ccxt/async_support/p2b.py +0 -2
  29. ccxt/async_support/poloniex.py +42 -42
  30. ccxt/async_support/probit.py +25 -17
  31. ccxt/async_support/tokocrypto.py +6 -3
  32. ccxt/base/exchange.py +21 -8
  33. ccxt/binance.py +1 -1
  34. ccxt/bingx.py +9 -8
  35. ccxt/bitget.py +1 -2
  36. ccxt/bitmart.py +90 -73
  37. ccxt/bitmex.py +1 -1
  38. ccxt/bybit.py +2 -4
  39. ccxt/coinex.py +2 -1
  40. ccxt/cryptocom.py +2 -2
  41. ccxt/digifinex.py +119 -103
  42. ccxt/hitbtc.py +1 -1
  43. ccxt/htx.py +1 -1
  44. ccxt/kraken.py +1 -1
  45. ccxt/krakenfutures.py +2 -2
  46. ccxt/kucoin.py +1 -5
  47. ccxt/kucoinfutures.py +0 -3
  48. ccxt/latoken.py +1 -1
  49. ccxt/mexc.py +76 -49
  50. ccxt/okx.py +3 -3
  51. ccxt/p2b.py +0 -2
  52. ccxt/poloniex.py +42 -42
  53. ccxt/pro/__init__.py +1 -1
  54. ccxt/pro/bitmart.py +965 -247
  55. ccxt/pro/bitmex.py +200 -2
  56. ccxt/pro/krakenfutures.py +4 -4
  57. ccxt/pro/mexc.py +1 -1
  58. ccxt/pro/poloniex.py +1 -1
  59. ccxt/pro/poloniexfutures.py +3 -3
  60. ccxt/probit.py +25 -17
  61. ccxt/tokocrypto.py +6 -3
  62. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/METADATA +6 -5
  63. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/RECORD +65 -65
  64. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/WHEEL +0 -0
  65. {ccxt-4.1.84.dist-info → ccxt-4.1.86.dist-info}/top_level.txt +0 -0
ccxt/bingx.py CHANGED
@@ -1721,7 +1721,7 @@ class bingx(Exchange, ImplicitAPI):
1721
1721
  create a list of trade orders
1722
1722
  :see: https://bingx-api.github.io/docs/#/spot/trade-api.html#Batch%20Placing%20Orders
1723
1723
  :see: https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
1724
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1724
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1725
1725
  :param dict [params]: extra parameters specific to the exchange API endpoint
1726
1726
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1727
1727
  """
@@ -1912,6 +1912,8 @@ class bingx(Exchange, ImplicitAPI):
1912
1912
  positionSide = self.safe_string_2(order, 'positionSide', 'ps')
1913
1913
  marketType = 'spot' if (positionSide is None) else 'swap'
1914
1914
  marketId = self.safe_string_2(order, 'symbol', 's')
1915
+ if market is None:
1916
+ market = self.safe_market(marketId, None, None, marketType)
1915
1917
  symbol = self.safe_symbol(marketId, market, '-', marketType)
1916
1918
  orderId = self.safe_string_2(order, 'orderId', 'i')
1917
1919
  side = self.safe_string_lower_2(order, 'side', 'S')
@@ -2250,15 +2252,14 @@ class bingx(Exchange, ImplicitAPI):
2250
2252
  :param dict [params]: extra parameters specific to the exchange API endpoint
2251
2253
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2252
2254
  """
2253
- if symbol is None:
2254
- raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')
2255
2255
  self.load_markets()
2256
- market = self.market(symbol)
2257
- request = {
2258
- 'symbol': market['id'],
2259
- }
2256
+ market = None
2257
+ request = {}
2258
+ if symbol is not None:
2259
+ market = self.market(symbol)
2260
+ request['symbol'] = market['id']
2260
2261
  response = None
2261
- marketType, query = self.handle_market_type_and_params('fetchOrder', market, params)
2262
+ marketType, query = self.handle_market_type_and_params('fetchOpenOrders', market, params)
2262
2263
  if marketType == 'spot':
2263
2264
  response = self.spotV1PrivateGetTradeOpenOrders(self.extend(request, query))
2264
2265
  else:
ccxt/bitget.py CHANGED
@@ -3553,7 +3553,7 @@ class bitget(Exchange, ImplicitAPI):
3553
3553
  :see: https://bitgetlimited.github.io/apidoc/en/mix/#batch-order
3554
3554
  :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-order
3555
3555
  :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-order
3556
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3556
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3557
3557
  :param dict [params]: extra parameters specific to the api endpoint
3558
3558
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
3559
3559
  """
@@ -5571,7 +5571,6 @@ class bitget(Exchange, ImplicitAPI):
5571
5571
  :param str symbol: not used by bitget setPositionMode()
5572
5572
  :param dict [params]: extra parameters specific to the exchange API endpoint
5573
5573
  :returns dict: response from the exchange
5574
- *
5575
5574
  """
5576
5575
  self.load_markets()
5577
5576
  sandboxMode = self.safe_value(self.options, 'sandboxMode', False)
ccxt/bitmart.py CHANGED
@@ -1308,48 +1308,58 @@ class bitmart(Exchange, ImplicitAPI):
1308
1308
  #
1309
1309
  # public fetchTrades spot( amount = count * price )
1310
1310
  #
1311
- # {
1312
- # "amount": "818.94",
1313
- # "order_time": "1637601839035", # ETH/USDT
1314
- # "price": "4221.99",
1315
- # "count": "0.19397",
1316
- # "type": "buy"
1317
- # }
1311
+ # {
1312
+ # "amount": "818.94",
1313
+ # "order_time": "1637601839035", # ETH/USDT
1314
+ # "price": "4221.99",
1315
+ # "count": "0.19397",
1316
+ # "type": "buy"
1317
+ # }
1318
1318
  #
1319
1319
  # spot: fetchMyTrades
1320
1320
  #
1321
- # {
1322
- # "tradeId":"182342999769370687",
1323
- # "orderId":"183270218784142990",
1324
- # "clientOrderId":"183270218784142990",
1325
- # "symbol":"ADA_USDT",
1326
- # "side":"buy",
1327
- # "orderMode":"spot",
1328
- # "type":"market",
1329
- # "price":"0.245948",
1330
- # "size":"20.71",
1331
- # "notional":"5.09358308",
1332
- # "fee":"0.00509358",
1333
- # "feeCoinName":"USDT",
1334
- # "tradeRole":"taker",
1335
- # "createTime":1695658457836,
1336
- # }
1321
+ # {
1322
+ # "tradeId":"182342999769370687",
1323
+ # "orderId":"183270218784142990",
1324
+ # "clientOrderId":"183270218784142990",
1325
+ # "symbol":"ADA_USDT",
1326
+ # "side":"buy",
1327
+ # "orderMode":"spot",
1328
+ # "type":"market",
1329
+ # "price":"0.245948",
1330
+ # "size":"20.71",
1331
+ # "notional":"5.09358308",
1332
+ # "fee":"0.00509358",
1333
+ # "feeCoinName":"USDT",
1334
+ # "tradeRole":"taker",
1335
+ # "createTime":1695658457836,
1336
+ # }
1337
1337
  #
1338
1338
  # swap: fetchMyTrades
1339
1339
  #
1340
- # {
1341
- # "order_id": "230930336848609",
1342
- # "trade_id": "6212604014",
1343
- # "symbol": "BTCUSDT",
1344
- # "side": 3,
1345
- # "price": "26910.4",
1346
- # "vol": "1",
1347
- # "exec_type": "Taker",
1348
- # "profit": False,
1349
- # "create_time": 1695961596692,
1350
- # "realised_profit": "-0.0003",
1351
- # "paid_fees": "0.01614624"
1352
- # }
1340
+ # {
1341
+ # "order_id": "230930336848609",
1342
+ # "trade_id": "6212604014",
1343
+ # "symbol": "BTCUSDT",
1344
+ # "side": 3,
1345
+ # "price": "26910.4",
1346
+ # "vol": "1",
1347
+ # "exec_type": "Taker",
1348
+ # "profit": False,
1349
+ # "create_time": 1695961596692,
1350
+ # "realised_profit": "-0.0003",
1351
+ # "paid_fees": "0.01614624"
1352
+ # }
1353
+ #
1354
+ # ws swap
1355
+ #
1356
+ # {
1357
+ # 'fee': '-0.000044502',
1358
+ # 'feeCcy': 'USDT',
1359
+ # 'fillPrice': '74.17',
1360
+ # 'fillQty': '1',
1361
+ # 'lastTradeID': 6802340762
1362
+ # }
1353
1363
  #
1354
1364
  timestamp = self.safe_integer_n(trade, ['order_time', 'createTime', 'create_time'])
1355
1365
  isPublicTrade = ('order_time' in trade)
@@ -1362,7 +1372,7 @@ class bitmart(Exchange, ImplicitAPI):
1362
1372
  cost = self.safe_string(trade, 'amount')
1363
1373
  side = self.safe_string(trade, 'type')
1364
1374
  else:
1365
- amount = self.safe_string_2(trade, 'size', 'vol')
1375
+ amount = self.safe_string_n(trade, ['size', 'vol', 'fillQty'])
1366
1376
  cost = self.safe_string(trade, 'notional')
1367
1377
  type = self.safe_string(trade, 'type')
1368
1378
  side = self.parse_order_side(self.safe_string(trade, 'side'))
@@ -1381,14 +1391,14 @@ class bitmart(Exchange, ImplicitAPI):
1381
1391
  }
1382
1392
  return self.safe_trade({
1383
1393
  'info': trade,
1384
- 'id': self.safe_string_2(trade, 'tradeId', 'trade_id'),
1394
+ 'id': self.safe_string_n(trade, ['tradeId', 'trade_id', 'lastTradeID']),
1385
1395
  'order': self.safe_string_2(trade, 'orderId', 'order_id'),
1386
1396
  'timestamp': timestamp,
1387
1397
  'datetime': self.iso8601(timestamp),
1388
1398
  'symbol': market['symbol'],
1389
1399
  'type': type,
1390
1400
  'side': side,
1391
- 'price': self.safe_string(trade, 'price'),
1401
+ 'price': self.safe_string_2(trade, 'price', 'fillPrice'),
1392
1402
  'amount': amount,
1393
1403
  'cost': cost,
1394
1404
  'takerOrMaker': self.safe_string_lower_2(trade, 'tradeRole', 'exec_type'),
@@ -1439,38 +1449,45 @@ class bitmart(Exchange, ImplicitAPI):
1439
1449
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
1440
1450
  #
1441
1451
  # spot
1442
- #
1443
- # [
1444
- # "1699512060", # timestamp
1445
- # "36746.49", # open
1446
- # "36758.71", # high
1447
- # "36736.13", # low
1448
- # "36755.99", # close
1449
- # "2.83965", # base volume
1450
- # "104353.57" # quote volume
1451
- # ]
1452
+ # [
1453
+ # "1699512060", # timestamp
1454
+ # "36746.49", # open
1455
+ # "36758.71", # high
1456
+ # "36736.13", # low
1457
+ # "36755.99", # close
1458
+ # "2.83965", # base volume
1459
+ # "104353.57" # quote volume
1460
+ # ]
1452
1461
  #
1453
1462
  # swap
1454
- #
1455
- # {
1456
- # "low_price": "20090.3",
1457
- # "high_price": "20095.5",
1458
- # "open_price": "20092.6",
1459
- # "close_price": "20091.4",
1460
- # "volume": "8748",
1461
- # "timestamp": 1665002281
1462
- # }
1463
+ # {
1464
+ # "low_price": "20090.3",
1465
+ # "high_price": "20095.5",
1466
+ # "open_price": "20092.6",
1467
+ # "close_price": "20091.4",
1468
+ # "volume": "8748",
1469
+ # "timestamp": 1665002281
1470
+ # }
1463
1471
  #
1464
1472
  # ws
1465
- #
1466
- # [
1467
- # 1631056350, # timestamp
1468
- # "46532.83", # open
1469
- # "46555.71", # high
1470
- # "46511.41", # low
1471
- # "46555.71", # close
1472
- # "0.25", # volume
1473
- # ]
1473
+ # [
1474
+ # 1631056350, # timestamp
1475
+ # "46532.83", # open
1476
+ # "46555.71", # high
1477
+ # "46511.41", # low
1478
+ # "46555.71", # close
1479
+ # "0.25", # volume
1480
+ # ]
1481
+ #
1482
+ # ws swap
1483
+ # {
1484
+ # "symbol":"BTCUSDT",
1485
+ # "o":"146.24",
1486
+ # "h":"146.24",
1487
+ # "l":"146.24",
1488
+ # "c":"146.24",
1489
+ # "v":"146"
1490
+ # }
1474
1491
  #
1475
1492
  if isinstance(ohlcv, list):
1476
1493
  return [
@@ -1483,12 +1500,12 @@ class bitmart(Exchange, ImplicitAPI):
1483
1500
  ]
1484
1501
  else:
1485
1502
  return [
1486
- self.safe_timestamp(ohlcv, 'timestamp'),
1487
- self.safe_number(ohlcv, 'open_price'),
1488
- self.safe_number(ohlcv, 'high_price'),
1489
- self.safe_number(ohlcv, 'low_price'),
1490
- self.safe_number(ohlcv, 'close_price'),
1491
- self.safe_number(ohlcv, 'volume'),
1503
+ self.safe_timestamp_2(ohlcv, 'timestamp', 'ts'),
1504
+ self.safe_number_2(ohlcv, 'open_price', 'o'),
1505
+ self.safe_number_2(ohlcv, 'high_price', 'h'),
1506
+ self.safe_number_2(ohlcv, 'low_price', 'l'),
1507
+ self.safe_number_2(ohlcv, 'close_price', 'c'),
1508
+ self.safe_number_2(ohlcv, 'volume', 'v'),
1492
1509
  ]
1493
1510
 
1494
1511
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
ccxt/bitmex.py CHANGED
@@ -2118,7 +2118,7 @@ class bitmex(Exchange, ImplicitAPI):
2118
2118
  datetime = self.safe_string(position, 'timestamp')
2119
2119
  crossMargin = self.safe_value(position, 'crossMargin')
2120
2120
  marginMode = 'cross' if (crossMargin is True) else 'isolated'
2121
- notionalString = Precise.string_abs(self.safe_string(position, 'foreignNotional', 'homeNotional'))
2121
+ notionalString = Precise.string_abs(self.safe_string_2(position, 'foreignNotional', 'homeNotional'))
2122
2122
  settleCurrencyCode = self.safe_string(market, 'settle')
2123
2123
  maintenanceMargin = self.convert_to_real_amount(settleCurrencyCode, self.safe_string(position, 'maintMargin'))
2124
2124
  unrealisedPnl = self.convert_to_real_amount(settleCurrencyCode, self.safe_string(position, 'unrealisedPnl'))
ccxt/bybit.py CHANGED
@@ -3485,7 +3485,7 @@ class bybit(Exchange, ImplicitAPI):
3485
3485
  """
3486
3486
  create a list of trade orders
3487
3487
  :see: https://bybit-exchange.github.io/docs/v5/order/batch-place
3488
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3488
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3489
3489
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
3490
3490
  """
3491
3491
  self.load_markets()
@@ -4415,7 +4415,6 @@ class bybit(Exchange, ImplicitAPI):
4415
4415
  :param int [limit]: the maximum number of trades to retrieve
4416
4416
  :param dict [params]: extra parameters specific to the exchange API endpoint
4417
4417
  :returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
4418
- *
4419
4418
  """
4420
4419
  request = {}
4421
4420
  clientOrderId = self.safe_string_2(params, 'clientOrderId', 'orderLinkId')
@@ -4679,12 +4678,11 @@ class bybit(Exchange, ImplicitAPI):
4679
4678
  :param int [limit]: the maximum number of deposits structures to retrieve, default = 50, max = 50
4680
4679
  :param dict [params]: extra parameters specific to the exchange API endpoint
4681
4680
  :param int [params.until]: the latest time in ms to fetch deposits for, default = 30 days after since
4682
- *
4683
4681
  * EXCHANGE SPECIFIC PARAMETERS
4684
4682
  :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)
4685
4683
  :param str [params.cursor]: used for pagination
4686
4684
  :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
4687
- """
4685
+ """
4688
4686
  self.load_markets()
4689
4687
  paginate = False
4690
4688
  paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
ccxt/coinex.py CHANGED
@@ -42,6 +42,7 @@ class coinex(Exchange, ImplicitAPI):
42
42
  # 20 per 2 seconds => 10 per second => weight = 40
43
43
  'rateLimit': 2.5,
44
44
  'pro': True,
45
+ 'certified': True,
45
46
  'has': {
46
47
  'CORS': None,
47
48
  'spot': True,
@@ -2141,7 +2142,7 @@ class coinex(Exchange, ImplicitAPI):
2141
2142
  """
2142
2143
  create a list of trade orders(all orders should be of the same symbol)
2143
2144
  :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade002_batch_limit_orders
2144
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
2145
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
2145
2146
  :param dict [params]: extra parameters specific to the api endpoint
2146
2147
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2147
2148
  """
ccxt/cryptocom.py CHANGED
@@ -1103,7 +1103,7 @@ class cryptocom(Exchange, ImplicitAPI):
1103
1103
  create a list of trade orders
1104
1104
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-order-list-list
1105
1105
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-order-list-oco
1106
- :param array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1106
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1107
1107
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1108
1108
  """
1109
1109
  self.load_markets()
@@ -2074,7 +2074,7 @@ class cryptocom(Exchange, ImplicitAPI):
2074
2074
  * @ignore
2075
2075
  marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin'
2076
2076
  :param dict [params]: extra parameters specific to the exchange API endpoint
2077
- :returns array: the marginMode in lowercase
2077
+ :returns Array: the marginMode in lowercase
2078
2078
  """
2079
2079
  defaultType = self.safe_string(self.options, 'defaultType')
2080
2080
  isMargin = self.safe_value(params, 'margin', False)