ccxt 4.4.88__py2.py3-none-any.whl → 4.4.91__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 (101) hide show
  1. ccxt/__init__.py +1 -3
  2. ccxt/abstract/bitget.py +58 -0
  3. ccxt/abstract/bitrue.py +65 -65
  4. ccxt/abstract/cryptocom.py +2 -0
  5. ccxt/abstract/luno.py +1 -0
  6. ccxt/async_support/__init__.py +1 -3
  7. ccxt/async_support/base/exchange.py +6 -3
  8. ccxt/async_support/base/ws/client.py +173 -64
  9. ccxt/async_support/base/ws/future.py +23 -50
  10. ccxt/async_support/binance.py +2 -2
  11. ccxt/async_support/bingx.py +55 -29
  12. ccxt/async_support/bitget.py +469 -147
  13. ccxt/async_support/bitmex.py +2 -1
  14. ccxt/async_support/bitrue.py +72 -66
  15. ccxt/async_support/bitvavo.py +34 -0
  16. ccxt/async_support/btcalpha.py +35 -0
  17. ccxt/async_support/btcbox.py +35 -0
  18. ccxt/async_support/btcmarkets.py +35 -0
  19. ccxt/async_support/btcturk.py +35 -0
  20. ccxt/async_support/bybit.py +9 -3
  21. ccxt/async_support/cex.py +61 -0
  22. ccxt/async_support/coinbase.py +1 -3
  23. ccxt/async_support/cryptocom.py +66 -2
  24. ccxt/async_support/cryptomus.py +1 -1
  25. ccxt/async_support/delta.py +2 -2
  26. ccxt/async_support/digifinex.py +39 -99
  27. ccxt/async_support/exmo.py +14 -7
  28. ccxt/async_support/gate.py +14 -7
  29. ccxt/async_support/hashkey.py +15 -28
  30. ccxt/async_support/hollaex.py +27 -22
  31. ccxt/async_support/hyperliquid.py +104 -53
  32. ccxt/async_support/kraken.py +54 -50
  33. ccxt/async_support/luno.py +87 -1
  34. ccxt/async_support/mexc.py +1 -0
  35. ccxt/async_support/modetrade.py +2 -2
  36. ccxt/async_support/okx.py +2 -1
  37. ccxt/async_support/paradex.py +1 -1
  38. ccxt/async_support/phemex.py +16 -8
  39. ccxt/async_support/tradeogre.py +3 -3
  40. ccxt/async_support/xt.py +1 -1
  41. ccxt/base/exchange.py +20 -8
  42. ccxt/binance.py +2 -2
  43. ccxt/bingx.py +55 -29
  44. ccxt/bitget.py +469 -147
  45. ccxt/bitmex.py +2 -1
  46. ccxt/bitrue.py +72 -66
  47. ccxt/bitvavo.py +34 -0
  48. ccxt/btcalpha.py +35 -0
  49. ccxt/btcbox.py +35 -0
  50. ccxt/btcmarkets.py +35 -0
  51. ccxt/btcturk.py +35 -0
  52. ccxt/bybit.py +9 -3
  53. ccxt/cex.py +61 -0
  54. ccxt/coinbase.py +1 -3
  55. ccxt/cryptocom.py +66 -2
  56. ccxt/cryptomus.py +1 -1
  57. ccxt/delta.py +2 -2
  58. ccxt/digifinex.py +39 -99
  59. ccxt/exmo.py +13 -7
  60. ccxt/gate.py +14 -7
  61. ccxt/hashkey.py +15 -28
  62. ccxt/hollaex.py +27 -22
  63. ccxt/hyperliquid.py +104 -53
  64. ccxt/kraken.py +53 -50
  65. ccxt/luno.py +87 -1
  66. ccxt/mexc.py +1 -0
  67. ccxt/modetrade.py +2 -2
  68. ccxt/okx.py +2 -1
  69. ccxt/paradex.py +1 -1
  70. ccxt/phemex.py +16 -8
  71. ccxt/pro/__init__.py +1 -127
  72. ccxt/pro/bitstamp.py +1 -1
  73. ccxt/pro/bybit.py +6 -136
  74. ccxt/pro/coinbase.py +2 -0
  75. ccxt/pro/cryptocom.py +27 -0
  76. ccxt/pro/kraken.py +249 -267
  77. ccxt/pro/mexc.py +0 -1
  78. ccxt/tradeogre.py +3 -3
  79. ccxt/xt.py +1 -1
  80. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/METADATA +64 -23
  81. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/RECORD +84 -101
  82. ccxt/abstract/coinlist.py +0 -57
  83. ccxt/async_support/base/ws/aiohttp_client.py +0 -147
  84. ccxt/async_support/bitcoincom.py +0 -18
  85. ccxt/async_support/bitfinex1.py +0 -1711
  86. ccxt/async_support/bitpanda.py +0 -17
  87. ccxt/async_support/coinlist.py +0 -2542
  88. ccxt/async_support/poloniexfutures.py +0 -1875
  89. ccxt/bitcoincom.py +0 -18
  90. ccxt/bitfinex1.py +0 -1710
  91. ccxt/bitpanda.py +0 -17
  92. ccxt/coinlist.py +0 -2542
  93. ccxt/poloniexfutures.py +0 -1875
  94. ccxt/pro/bitcoincom.py +0 -35
  95. ccxt/pro/bitfinex1.py +0 -635
  96. ccxt/pro/bitpanda.py +0 -16
  97. ccxt/pro/poloniexfutures.py +0 -1004
  98. ccxt/pro/wazirx.py +0 -766
  99. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/LICENSE.txt +0 -0
  100. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/WHEEL +0 -0
  101. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/top_level.txt +0 -0
ccxt/kraken.py CHANGED
@@ -569,9 +569,12 @@ class kraken(Exchange, ImplicitAPI):
569
569
  :param dict [params]: extra parameters specific to the exchange API endpoint
570
570
  :returns dict[]: an array of objects representing market data
571
571
  """
572
+ promises = []
573
+ promises.append(self.publicGetAssetPairs(params))
572
574
  if self.options['adjustForTimeDifference']:
573
- self.load_time_difference()
574
- response = self.publicGetAssetPairs(params)
575
+ promises.append(self.load_time_difference())
576
+ responses = promises
577
+ assetsResponse = responses[0]
575
578
  #
576
579
  # {
577
580
  # "error": [],
@@ -619,7 +622,8 @@ class kraken(Exchange, ImplicitAPI):
619
622
  # }
620
623
  # }
621
624
  #
622
- markets = self.safe_value(response, 'result', {})
625
+ markets = self.safe_dict(assetsResponse, 'result', {})
626
+ cachedCurrencies = self.safe_dict(self.options, 'cachedCurrencies', {})
623
627
  keys = list(markets.keys())
624
628
  result = []
625
629
  for i in range(0, len(keys)):
@@ -629,39 +633,45 @@ class kraken(Exchange, ImplicitAPI):
629
633
  quoteId = self.safe_string(market, 'quote')
630
634
  base = self.safe_currency_code(baseId)
631
635
  quote = self.safe_currency_code(quoteId)
632
- darkpool = id.find('.d') >= 0
633
- altname = self.safe_string(market, 'altname')
634
- makerFees = self.safe_value(market, 'fees_maker', [])
635
- firstMakerFee = self.safe_value(makerFees, 0, [])
636
+ makerFees = self.safe_list(market, 'fees_maker', [])
637
+ firstMakerFee = self.safe_list(makerFees, 0, [])
636
638
  firstMakerFeeRate = self.safe_string(firstMakerFee, 1)
637
639
  maker = None
638
640
  if firstMakerFeeRate is not None:
639
641
  maker = self.parse_number(Precise.string_div(firstMakerFeeRate, '100'))
640
- takerFees = self.safe_value(market, 'fees', [])
641
- firstTakerFee = self.safe_value(takerFees, 0, [])
642
+ takerFees = self.safe_list(market, 'fees', [])
643
+ firstTakerFee = self.safe_list(takerFees, 0, [])
642
644
  firstTakerFeeRate = self.safe_string(firstTakerFee, 1)
643
645
  taker = None
644
646
  if firstTakerFeeRate is not None:
645
647
  taker = self.parse_number(Precise.string_div(firstTakerFeeRate, '100'))
646
- leverageBuy = self.safe_value(market, 'leverage_buy', [])
648
+ leverageBuy = self.safe_list(market, 'leverage_buy', [])
647
649
  leverageBuyLength = len(leverageBuy)
648
650
  precisionPrice = self.parse_number(self.parse_precision(self.safe_string(market, 'pair_decimals')))
651
+ precisionAmount = self.parse_number(self.parse_precision(self.safe_string(market, 'lot_decimals')))
652
+ spot = True
653
+ # fix https://github.com/freqtrade/freqtrade/issues/11765#issuecomment-2894224103
654
+ if spot and (base in cachedCurrencies):
655
+ currency = cachedCurrencies[base]
656
+ currencyPrecision = self.safe_number(currency, 'precision')
657
+ # if currency precision is greater(e.g. 0.01) than market precision(e.g. 0.001)
658
+ if currencyPrecision > precisionAmount:
659
+ precisionAmount = currencyPrecision
649
660
  status = self.safe_string(market, 'status')
650
661
  isActive = status == 'online'
651
662
  result.append({
652
663
  'id': id,
653
664
  'wsId': self.safe_string(market, 'wsname'),
654
- 'symbol': altname if darkpool else (base + '/' + quote),
665
+ 'symbol': base + '/' + quote,
655
666
  'base': base,
656
667
  'quote': quote,
657
668
  'settle': None,
658
669
  'baseId': baseId,
659
670
  'quoteId': quoteId,
660
671
  'settleId': None,
661
- 'darkpool': darkpool,
662
672
  'altname': market['altname'],
663
673
  'type': 'spot',
664
- 'spot': True,
674
+ 'spot': spot,
665
675
  'margin': (leverageBuyLength > 0),
666
676
  'swap': False,
667
677
  'future': False,
@@ -678,7 +688,7 @@ class kraken(Exchange, ImplicitAPI):
678
688
  'strike': None,
679
689
  'optionType': None,
680
690
  'precision': {
681
- 'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'lot_decimals'))),
691
+ 'amount': precisionAmount,
682
692
  'price': precisionPrice,
683
693
  },
684
694
  'limits': {
@@ -691,7 +701,7 @@ class kraken(Exchange, ImplicitAPI):
691
701
  'max': None,
692
702
  },
693
703
  'price': {
694
- 'min': precisionPrice,
704
+ 'min': None,
695
705
  'max': None,
696
706
  },
697
707
  'cost': {
@@ -702,7 +712,6 @@ class kraken(Exchange, ImplicitAPI):
702
712
  'created': None,
703
713
  'info': market,
704
714
  })
705
- result = self.append_inactive_markets(result)
706
715
  self.options['marketsByAltname'] = self.index_by(result, 'altname')
707
716
  return result
708
717
 
@@ -714,32 +723,6 @@ class kraken(Exchange, ImplicitAPI):
714
723
  currencyId = currencyId[1:]
715
724
  return super(kraken, self).safe_currency(currencyId, currency)
716
725
 
717
- def append_inactive_markets(self, result):
718
- # result should be an array to append to
719
- precision: dict = {
720
- 'amount': self.parse_number('1e-8'),
721
- 'price': self.parse_number('1e-8'),
722
- }
723
- costLimits: dict = {'min': None, 'max': None}
724
- priceLimits: dict = {'min': precision['price'], 'max': None}
725
- amountLimits: dict = {'min': precision['amount'], 'max': None}
726
- limits: dict = {'amount': amountLimits, 'price': priceLimits, 'cost': costLimits}
727
- defaults: dict = {
728
- 'darkpool': False,
729
- 'info': None,
730
- 'maker': None,
731
- 'taker': None,
732
- 'active': False,
733
- 'precision': precision,
734
- 'limits': limits,
735
- }
736
- markets = [
737
- # {'id': 'XXLMZEUR', 'symbol': 'XLM/EUR', 'base': 'XLM', 'quote': 'EUR', 'altname': 'XLMEUR'},
738
- ]
739
- for i in range(0, len(markets)):
740
- result.append(self.extend(defaults, markets[i]))
741
- return result
742
-
743
726
  def fetch_status(self, params={}):
744
727
  """
745
728
  the latest known information on the availability of the exchange API
@@ -980,8 +963,6 @@ class kraken(Exchange, ImplicitAPI):
980
963
  """
981
964
  self.load_markets()
982
965
  market = self.market(symbol)
983
- if market['darkpool']:
984
- raise ExchangeError(self.id + ' fetchOrderBook() does not provide an order book for darkpool symbol ' + symbol)
985
966
  request: dict = {
986
967
  'pair': market['id'],
987
968
  }
@@ -1084,7 +1065,7 @@ class kraken(Exchange, ImplicitAPI):
1084
1065
  for i in range(0, len(symbols)):
1085
1066
  symbol = symbols[i]
1086
1067
  market = self.markets[symbol]
1087
- if market['active'] and not market['darkpool']:
1068
+ if market['active']:
1088
1069
  marketIds.append(market['id'])
1089
1070
  request['pair'] = ','.join(marketIds)
1090
1071
  response = self.publicGetTicker(self.extend(request, params))
@@ -1110,9 +1091,6 @@ class kraken(Exchange, ImplicitAPI):
1110
1091
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
1111
1092
  """
1112
1093
  self.load_markets()
1113
- darkpool = symbol.find('.d') >= 0
1114
- if darkpool:
1115
- raise ExchangeError(self.id + ' fetchTicker() does not provide a ticker for darkpool symbol ' + symbol)
1116
1094
  market = self.market(symbol)
1117
1095
  request: dict = {
1118
1096
  'pair': market['id'],
@@ -1387,7 +1365,20 @@ class kraken(Exchange, ImplicitAPI):
1387
1365
  # "maker": False
1388
1366
  # }
1389
1367
  #
1368
+ # watchTrades
1369
+ #
1370
+ # {
1371
+ # "symbol": "BTC/USD",
1372
+ # "side": "buy",
1373
+ # "price": 109601.2,
1374
+ # "qty": 0.04561994,
1375
+ # "ord_type": "market",
1376
+ # "trade_id": 83449369,
1377
+ # "timestamp": "2025-05-27T11:24:03.847761Z"
1378
+ # }
1379
+ #
1390
1380
  timestamp = None
1381
+ datetime = None
1391
1382
  side = None
1392
1383
  type = None
1393
1384
  price = None
@@ -1430,6 +1421,14 @@ class kraken(Exchange, ImplicitAPI):
1430
1421
  'cost': self.safe_string(trade, 'fee'),
1431
1422
  'currency': currency,
1432
1423
  }
1424
+ else:
1425
+ symbol = self.safe_string(trade, 'symbol')
1426
+ datetime = self.safe_string(trade, 'timestamp')
1427
+ id = self.safe_string(trade, 'trade_id')
1428
+ side = self.safe_string(trade, 'side')
1429
+ type = self.safe_string(trade, 'ord_type')
1430
+ price = self.safe_string(trade, 'price')
1431
+ amount = self.safe_string(trade, 'qty')
1433
1432
  if market is not None:
1434
1433
  symbol = market['symbol']
1435
1434
  cost = self.safe_string(trade, 'cost')
@@ -1437,12 +1436,16 @@ class kraken(Exchange, ImplicitAPI):
1437
1436
  takerOrMaker = None
1438
1437
  if maker is not None:
1439
1438
  takerOrMaker = 'maker' if maker else 'taker'
1439
+ if datetime is None:
1440
+ datetime = self.iso8601(timestamp)
1441
+ else:
1442
+ timestamp = self.parse8601(datetime)
1440
1443
  return self.safe_trade({
1441
1444
  'id': id,
1442
1445
  'order': orderId,
1443
1446
  'info': trade,
1444
1447
  'timestamp': timestamp,
1445
- 'datetime': self.iso8601(timestamp),
1448
+ 'datetime': datetime,
1446
1449
  'symbol': symbol,
1447
1450
  'type': type,
1448
1451
  'side': side,
@@ -3329,6 +3332,6 @@ class kraken(Exchange, ImplicitAPI):
3329
3332
  for i in range(0, len(response['error'])):
3330
3333
  error = response['error'][i]
3331
3334
  self.throw_exactly_matched_exception(self.exceptions['exact'], error, message)
3332
- self.throw_exactly_matched_exception(self.exceptions['broad'], error, message)
3335
+ self.throw_broadly_matched_exception(self.exceptions['broad'], error, message)
3333
3336
  raise ExchangeError(message)
3334
3337
  return None
ccxt/luno.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.luno import ImplicitAPI
8
- from ccxt.base.types import Account, Any, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface
8
+ from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import ArgumentsRequired
@@ -44,6 +44,7 @@ class luno(Exchange, ImplicitAPI):
44
44
  'fetchClosedOrders': True,
45
45
  'fetchCrossBorrowRate': False,
46
46
  'fetchCrossBorrowRates': False,
47
+ 'fetchCurrencies': True,
47
48
  'fetchDepositAddress': True,
48
49
  'fetchFundingHistory': False,
49
50
  'fetchFundingRate': False,
@@ -125,6 +126,7 @@ class luno(Exchange, ImplicitAPI):
125
126
  'accounts/{id}/transactions': 1,
126
127
  'balance': 1,
127
128
  'beneficiaries': 1,
129
+ 'send/networks': 1,
128
130
  'fee_info': 1,
129
131
  'funding_address': 1,
130
132
  'listorders': 1,
@@ -265,6 +267,90 @@ class luno(Exchange, ImplicitAPI):
265
267
  },
266
268
  })
267
269
 
270
+ def fetch_currencies(self, params={}) -> Currencies:
271
+ """
272
+ fetches all available currencies on an exchange
273
+ :param dict [params]: extra parameters specific to the exchange API endpoint
274
+ :returns dict: an associative dictionary of currencies
275
+ """
276
+ if not self.check_required_credentials(False):
277
+ return None
278
+ response = self.privateGetSendNetworks(params)
279
+ #
280
+ # {
281
+ # "networks": [
282
+ # {
283
+ # "id": 0,
284
+ # "name": "Ethereum",
285
+ # "native_currency": "ETH"
286
+ # },
287
+ # ...
288
+ # ]
289
+ # }
290
+ #
291
+ currenciesData = self.safe_list(response, 'data', [])
292
+ result: dict = {}
293
+ for i in range(0, len(currenciesData)):
294
+ networkEntry = currenciesData[i]
295
+ id = self.safe_string(networkEntry, 'native_currency')
296
+ code = self.safe_currency_code(id)
297
+ if not (code in result):
298
+ result[code] = {
299
+ 'id': id,
300
+ 'code': code,
301
+ 'precision': None,
302
+ 'type': None,
303
+ 'name': None,
304
+ 'active': None,
305
+ 'deposit': None,
306
+ 'withdraw': None,
307
+ 'fee': None,
308
+ 'limits': {
309
+ 'withdraw': {
310
+ 'min': None,
311
+ 'max': None,
312
+ },
313
+ 'deposit': {
314
+ 'min': None,
315
+ 'max': None,
316
+ },
317
+ },
318
+ 'networks': {},
319
+ 'info': {},
320
+ }
321
+ networkId = self.safe_string(networkEntry, 'name')
322
+ networkCode = self.network_id_to_code(networkId)
323
+ result[code]['networks'][networkCode] = {
324
+ 'id': networkId,
325
+ 'network': networkCode,
326
+ 'limits': {
327
+ 'withdraw': {
328
+ 'min': None,
329
+ 'max': None,
330
+ },
331
+ 'deposit': {
332
+ 'min': None,
333
+ 'max': None,
334
+ },
335
+ },
336
+ 'active': None,
337
+ 'deposit': None,
338
+ 'withdraw': None,
339
+ 'fee': None,
340
+ 'precision': None,
341
+ 'info': networkEntry,
342
+ }
343
+ # add entry in info
344
+ info = self.safe_list(result[code], 'info', [])
345
+ info.append(networkEntry)
346
+ result[code]['info'] = info
347
+ # only after all entries are formed in currencies, restructure each entry
348
+ allKeys = list(result.keys())
349
+ for i in range(0, len(allKeys)):
350
+ code = allKeys[i]
351
+ result[code] = self.safe_currency_structure(result[code]) # self is needed after adding network entry
352
+ return result
353
+
268
354
  def fetch_markets(self, params={}) -> List[Market]:
269
355
  """
270
356
  retrieves data on all markets for luno
ccxt/mexc.py CHANGED
@@ -854,6 +854,7 @@ class mexc(Exchange, ImplicitAPI):
854
854
  'PROS': 'PROSFINANCE', # conflict with Prosper
855
855
  'SIN': 'SINCITYTOKEN',
856
856
  'SOUL': 'SOULSWAP',
857
+ 'XBT': 'XBT', # restore original mapping
857
858
  },
858
859
  'exceptions': {
859
860
  'exact': {
ccxt/modetrade.py CHANGED
@@ -1651,7 +1651,7 @@ class modetrade(Exchange, ImplicitAPI):
1651
1651
  #
1652
1652
  # {
1653
1653
  # "success": True,
1654
- # "timestamp": 1702989203989,
1654
+ # "timestamp": 1702989203988,
1655
1655
  # "data": {
1656
1656
  # "status": "CANCEL_SENT"
1657
1657
  # }
@@ -1659,7 +1659,7 @@ class modetrade(Exchange, ImplicitAPI):
1659
1659
  #
1660
1660
  # {
1661
1661
  # "success": True,
1662
- # "timestamp": 1702989203989,
1662
+ # "timestamp": 1702989203988,
1663
1663
  # "status": "CANCEL_SENT"
1664
1664
  # }
1665
1665
  #
ccxt/okx.py CHANGED
@@ -1606,6 +1606,7 @@ class okx(Exchange, ImplicitAPI):
1606
1606
  # "instType": "OPTION",
1607
1607
  # "lever": "",
1608
1608
  # "listTime": "1631262612280",
1609
+ # "contTdSwTime": "1631262812280",
1609
1610
  # "lotSz": "1",
1610
1611
  # "minSz": "1",
1611
1612
  # "optType": "P",
@@ -1685,7 +1686,7 @@ class okx(Exchange, ImplicitAPI):
1685
1686
  'expiryDatetime': self.iso8601(expiry),
1686
1687
  'strike': self.parse_number(strikePrice),
1687
1688
  'optionType': optionType,
1688
- 'created': self.safe_integer(market, 'listTime'),
1689
+ 'created': self.safe_integer_2(market, 'contTdSwTime', 'listTime'), # contTdSwTime is public trading start time, while listTime considers pre-trading too
1689
1690
  'precision': {
1690
1691
  'amount': self.safe_number(market, 'lotSz'),
1691
1692
  'price': self.safe_number(market, 'tickSz'),
ccxt/paradex.py CHANGED
@@ -785,7 +785,7 @@ class paradex(Exchange, ImplicitAPI):
785
785
  # "ask": "69578.2",
786
786
  # "volume_24h": "5815541.397939004",
787
787
  # "total_volume": "584031465.525259686",
788
- # "created_at": 1718170156580,
788
+ # "created_at": 1718170156581,
789
789
  # "underlying_price": "67367.37268422",
790
790
  # "open_interest": "162.272",
791
791
  # "funding_rate": "0.01629574927887",
ccxt/phemex.py CHANGED
@@ -597,6 +597,7 @@ class phemex(Exchange, ImplicitAPI):
597
597
  },
598
598
  'defaultNetworks': {
599
599
  'USDT': 'ETH',
600
+ 'MKR': 'ETH',
600
601
  },
601
602
  'defaultSubType': 'linear',
602
603
  'accountsByType': {
@@ -3321,6 +3322,7 @@ class phemex(Exchange, ImplicitAPI):
3321
3322
  fetch the deposit address for a currency associated with self account
3322
3323
  :param str code: unified currency code
3323
3324
  :param dict [params]: extra parameters specific to the exchange API endpoint
3325
+ :param str [params.network]: the chain name to fetch the deposit address e.g. ETH, TRX, EOS, SOL, etc.
3324
3326
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
3325
3327
  """
3326
3328
  self.load_markets()
@@ -3331,20 +3333,26 @@ class phemex(Exchange, ImplicitAPI):
3331
3333
  defaultNetworks = self.safe_dict(self.options, 'defaultNetworks')
3332
3334
  defaultNetwork = self.safe_string_upper(defaultNetworks, code)
3333
3335
  networks = self.safe_dict(self.options, 'networks', {})
3334
- network = self.safe_string_upper(params, 'network', defaultNetwork)
3336
+ network = self.safe_string_upper_2(params, 'network', 'chainName', defaultNetwork)
3335
3337
  network = self.safe_string(networks, network, network)
3336
3338
  if network is None:
3337
- request['chainName'] = currency['id']
3339
+ raise ArgumentsRequired(self.id + ' fetchDepositAddress() requires a network parameter')
3338
3340
  else:
3339
3341
  request['chainName'] = network
3340
3342
  params = self.omit(params, 'network')
3341
- response = self.privateGetPhemexUserWalletsV2DepositAddress(self.extend(request, params))
3343
+ response = self.privateGetExchangeWalletsV2DepositAddress(self.extend(request, params))
3344
+ #
3342
3345
  # {
3343
- # "code":0,
3344
- # "msg":"OK",
3345
- # "data":{
3346
- # "address":"0x5bfbf60e0fa7f63598e6cfd8a7fd3ffac4ccc6ad",
3347
- # "tag":null
3346
+ # "code": 0,
3347
+ # "msg": "OK",
3348
+ # "data": {
3349
+ # "address": "tb1qxel5wq5gumt",
3350
+ # "tag": "",
3351
+ # "notice": False,
3352
+ # "accountType": 1,
3353
+ # "contractName": null,
3354
+ # "chainTokenUrl": null,
3355
+ # "sign": null
3348
3356
  # }
3349
3357
  # }
3350
3358
  #
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.88'
7
+ __version__ = '4.4.91'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
@@ -56,132 +56,6 @@ from ccxt.base.errors import UnsubscribeError # noqa: F4
56
56
  from ccxt.base.errors import error_hierarchy # noqa: F401
57
57
  # DO_NOT_REMOVE__ERROR_IMPORTS_END
58
58
 
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
59
  from ccxt.pro.alpaca import alpaca # noqa: F401
186
60
  from ccxt.pro.apex import apex # noqa: F401
187
61
  from ccxt.pro.ascendex import ascendex # noqa: F401
ccxt/pro/bitstamp.py CHANGED
@@ -502,7 +502,7 @@ class bitstamp(ccxt.async_support.bitstamp):
502
502
  #
503
503
  sessionToken = self.safe_string(response, 'token')
504
504
  if sessionToken is not None:
505
- userId = self.safe_number(response, 'user_id')
505
+ userId = self.safe_string(response, 'user_id')
506
506
  validity = self.safe_integer_product(response, 'valid_sec', 1000)
507
507
  self.options['expiresIn'] = self.sum(time, validity)
508
508
  self.options['userId'] = userId