ccxt 4.4.85__py2.py3-none-any.whl → 4.4.87__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 (92) hide show
  1. ccxt/__init__.py +7 -5
  2. ccxt/abstract/modetrade.py +119 -0
  3. ccxt/abstract/myokx.py +2 -0
  4. ccxt/abstract/okx.py +2 -0
  5. ccxt/abstract/okxus.py +349 -0
  6. ccxt/ascendex.py +187 -151
  7. ccxt/async_support/__init__.py +7 -5
  8. ccxt/async_support/ascendex.py +187 -151
  9. ccxt/async_support/base/exchange.py +30 -26
  10. ccxt/async_support/bequant.py +1 -1
  11. ccxt/async_support/binance.py +1 -1
  12. ccxt/async_support/bitget.py +4 -4
  13. ccxt/async_support/bitmart.py +1 -1
  14. ccxt/async_support/bitteam.py +31 -0
  15. ccxt/async_support/{huobijp.py → bittrade.py} +11 -11
  16. ccxt/async_support/coinbase.py +2 -5
  17. ccxt/async_support/coinmetro.py +3 -0
  18. ccxt/async_support/deribit.py +4 -5
  19. ccxt/async_support/gate.py +91 -73
  20. ccxt/async_support/hollaex.py +106 -49
  21. ccxt/async_support/htx.py +30 -51
  22. ccxt/async_support/hyperliquid.py +36 -20
  23. ccxt/async_support/kraken.py +5 -8
  24. ccxt/async_support/mexc.py +2 -2
  25. ccxt/async_support/modetrade.py +2727 -0
  26. ccxt/async_support/ndax.py +25 -24
  27. ccxt/async_support/okcoin.py +12 -29
  28. ccxt/async_support/okx.py +99 -3
  29. ccxt/async_support/okxus.py +54 -0
  30. ccxt/async_support/onetrading.py +10 -7
  31. ccxt/async_support/oxfun.py +40 -110
  32. ccxt/async_support/paradex.py +6 -0
  33. ccxt/async_support/phemex.py +4 -6
  34. ccxt/async_support/poloniex.py +172 -159
  35. ccxt/async_support/probit.py +18 -47
  36. ccxt/async_support/timex.py +5 -10
  37. ccxt/async_support/vertex.py +3 -4
  38. ccxt/async_support/whitebit.py +41 -11
  39. ccxt/async_support/woo.py +101 -75
  40. ccxt/async_support/woofipro.py +25 -20
  41. ccxt/async_support/xt.py +31 -41
  42. ccxt/base/exchange.py +12 -9
  43. ccxt/bequant.py +1 -1
  44. ccxt/binance.py +1 -1
  45. ccxt/bitget.py +4 -4
  46. ccxt/bitmart.py +1 -1
  47. ccxt/bitteam.py +31 -0
  48. ccxt/{huobijp.py → bittrade.py} +11 -11
  49. ccxt/coinbase.py +2 -5
  50. ccxt/coinmetro.py +3 -0
  51. ccxt/deribit.py +4 -5
  52. ccxt/gate.py +91 -73
  53. ccxt/hollaex.py +106 -49
  54. ccxt/htx.py +30 -51
  55. ccxt/hyperliquid.py +36 -20
  56. ccxt/kraken.py +5 -8
  57. ccxt/mexc.py +2 -2
  58. ccxt/modetrade.py +2727 -0
  59. ccxt/ndax.py +25 -24
  60. ccxt/okcoin.py +12 -29
  61. ccxt/okx.py +99 -3
  62. ccxt/okxus.py +54 -0
  63. ccxt/onetrading.py +10 -7
  64. ccxt/oxfun.py +40 -110
  65. ccxt/paradex.py +6 -0
  66. ccxt/phemex.py +4 -6
  67. ccxt/poloniex.py +172 -159
  68. ccxt/pro/__init__.py +101 -3
  69. ccxt/pro/binance.py +1 -0
  70. ccxt/pro/{huobijp.py → bittrade.py} +3 -3
  71. ccxt/pro/luno.py +6 -5
  72. ccxt/pro/mexc.py +2 -0
  73. ccxt/pro/modetrade.py +1271 -0
  74. ccxt/pro/okxus.py +38 -0
  75. ccxt/probit.py +18 -47
  76. ccxt/test/tests_async.py +17 -1
  77. ccxt/test/tests_sync.py +17 -1
  78. ccxt/timex.py +5 -10
  79. ccxt/vertex.py +3 -4
  80. ccxt/whitebit.py +41 -11
  81. ccxt/woo.py +100 -75
  82. ccxt/woofipro.py +24 -20
  83. ccxt/xt.py +31 -41
  84. {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/METADATA +19 -8
  85. {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/RECORD +89 -84
  86. ccxt/abstract/kuna.py +0 -182
  87. ccxt/async_support/kuna.py +0 -1935
  88. ccxt/kuna.py +0 -1935
  89. /ccxt/abstract/{huobijp.py → bittrade.py} +0 -0
  90. {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/LICENSE.txt +0 -0
  91. {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/WHEEL +0 -0
  92. {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/top_level.txt +0 -0
ccxt/phemex.py CHANGED
@@ -1130,9 +1130,7 @@ class phemex(Exchange, ImplicitAPI):
1130
1130
  for i in range(0, len(currencies)):
1131
1131
  currency = currencies[i]
1132
1132
  id = self.safe_string(currency, 'currency')
1133
- name = self.safe_string(currency, 'name')
1134
1133
  code = self.safe_currency_code(id)
1135
- status = self.safe_string(currency, 'status')
1136
1134
  valueScaleString = self.safe_string(currency, 'valueScale')
1137
1135
  valueScale = int(valueScaleString)
1138
1136
  minValueEv = self.safe_string(currency, 'minValueEv')
@@ -1145,12 +1143,12 @@ class phemex(Exchange, ImplicitAPI):
1145
1143
  precision = self.parse_number(precisionString)
1146
1144
  minAmount = self.parse_number(Precise.string_mul(minValueEv, precisionString))
1147
1145
  maxAmount = self.parse_number(Precise.string_mul(maxValueEv, precisionString))
1148
- result[code] = {
1146
+ result[code] = self.safe_currency_structure({
1149
1147
  'id': id,
1150
1148
  'info': currency,
1151
1149
  'code': code,
1152
- 'name': name,
1153
- 'active': status == 'Listed',
1150
+ 'name': self.safe_string(currency, 'name'),
1151
+ 'active': self.safe_string(currency, 'status') == 'Listed',
1154
1152
  'deposit': None,
1155
1153
  'withdraw': None,
1156
1154
  'fee': None,
@@ -1168,7 +1166,7 @@ class phemex(Exchange, ImplicitAPI):
1168
1166
  'valueScale': valueScale,
1169
1167
  'networks': None,
1170
1168
  'type': 'crypto',
1171
- }
1169
+ })
1172
1170
  return result
1173
1171
 
1174
1172
  def custom_parse_bid_ask(self, bidask, priceKey=0, amountKey=1, market: Market = None):
ccxt/poloniex.py CHANGED
@@ -321,6 +321,11 @@ class poloniex(Exchange, ImplicitAPI):
321
321
  'BEP20': 'BSC',
322
322
  'ERC20': 'ETH',
323
323
  'TRC20': 'TRON',
324
+ 'TRX': 'TRON',
325
+ },
326
+ 'networksById': {
327
+ 'TRX': 'TRC20',
328
+ 'TRON': 'TRC20',
324
329
  },
325
330
  'limits': {
326
331
  'cost': {
@@ -1148,102 +1153,103 @@ class poloniex(Exchange, ImplicitAPI):
1148
1153
  response = self.publicGetCurrencies(self.extend(params, {'includeMultiChainCurrencies': True}))
1149
1154
  #
1150
1155
  # [
1151
- # {
1152
- # "1CR": {
1153
- # "id": 1,
1154
- # "name": "1CRedit",
1155
- # "description": "BTC Clone",
1156
- # "type": "address",
1157
- # "withdrawalFee": "0.01000000",
1158
- # "minConf": 10000,
1159
- # "depositAddress": null,
1160
- # "blockchain": "1CR",
1161
- # "delisted": False,
1162
- # "tradingState": "NORMAL",
1163
- # "walletState": "DISABLED",
1164
- # "walletDepositState": "DISABLED",
1165
- # "walletWithdrawalState": "DISABLED",
1166
- # "parentChain": null,
1167
- # "isMultiChain": False,
1168
- # "isChildChain": False,
1169
- # "childChains": []
1170
- # }
1171
- # }
1156
+ # {
1157
+ # "USDT": {
1158
+ # "id": 214,
1159
+ # "name": "Tether USD",
1160
+ # "description": "Sweep to Main Account",
1161
+ # "type": "address",
1162
+ # "withdrawalFee": "0.00000000",
1163
+ # "minConf": 2,
1164
+ # "depositAddress": null,
1165
+ # "blockchain": "OMNI",
1166
+ # "delisted": False,
1167
+ # "tradingState": "NORMAL",
1168
+ # "walletState": "DISABLED",
1169
+ # "walletDepositState": "DISABLED",
1170
+ # "walletWithdrawalState": "DISABLED",
1171
+ # "supportCollateral": True,
1172
+ # "supportBorrow": True,
1173
+ # "parentChain": null,
1174
+ # "isMultiChain": True,
1175
+ # "isChildChain": False,
1176
+ # "childChains": [
1177
+ # "USDTBSC",
1178
+ # "USDTETH",
1179
+ # "USDTSOL",
1180
+ # "USDTTRON"
1181
+ # ]
1182
+ # }
1183
+ # },
1184
+ # ...
1185
+ # {
1186
+ # "USDTBSC": {
1187
+ # "id": 582,
1188
+ # "name": "Binance-Peg BSC-USD",
1189
+ # "description": "Sweep to Main Account",
1190
+ # "type": "address",
1191
+ # "withdrawalFee": "0.00000000",
1192
+ # "minConf": 15,
1193
+ # "depositAddress": null,
1194
+ # "blockchain": "BSC",
1195
+ # "delisted": False,
1196
+ # "tradingState": "OFFLINE",
1197
+ # "walletState": "ENABLED",
1198
+ # "walletDepositState": "ENABLED",
1199
+ # "walletWithdrawalState": "DISABLED",
1200
+ # "supportCollateral": False,
1201
+ # "supportBorrow": False,
1202
+ # "parentChain": "USDT",
1203
+ # "isMultiChain": True,
1204
+ # "isChildChain": True,
1205
+ # "childChains": []
1206
+ # }
1207
+ # },
1208
+ # ...
1172
1209
  # ]
1173
1210
  #
1174
1211
  result: dict = {}
1212
+ # poloniex has a complicated structure of currencies, so we handle them differently
1213
+ # at first, turn the response into a normal dictionary
1214
+ currenciesDict = {}
1175
1215
  for i in range(0, len(response)):
1176
- item = self.safe_value(response, i)
1216
+ item = self.safe_dict(response, i)
1177
1217
  ids = list(item.keys())
1178
- id = self.safe_value(ids, 0)
1179
- currency = self.safe_value(item, id)
1218
+ id = self.safe_string(ids, 0)
1219
+ currenciesDict[id] = item[id]
1220
+ keys = list(currenciesDict.keys())
1221
+ for i in range(0, len(keys)):
1222
+ id = keys[i]
1223
+ entry = currenciesDict[id]
1180
1224
  code = self.safe_currency_code(id)
1181
- name = self.safe_string(currency, 'name')
1182
- networkId = self.safe_string(currency, 'blockchain')
1183
- networkCode = None
1184
- if networkId is not None:
1185
- networkCode = self.network_id_to_code(networkId, code)
1186
- delisted = self.safe_value(currency, 'delisted')
1187
- walletEnabled = self.safe_string(currency, 'walletState') == 'ENABLED'
1188
- depositEnabled = self.safe_string(currency, 'walletDepositState') == 'ENABLED'
1189
- withdrawEnabled = self.safe_string(currency, 'walletWithdrawalState') == 'ENABLED'
1190
- active = not delisted and walletEnabled and depositEnabled and withdrawEnabled
1191
- numericId = self.safe_integer(currency, 'id')
1192
- feeString = self.safe_string(currency, 'withdrawalFee')
1193
- parentChain = self.safe_value(currency, 'parentChain')
1194
- noParentChain = parentChain is None
1195
- if self.safe_value(result, code) is None:
1196
- result[code] = {
1197
- 'id': id,
1198
- 'code': code,
1199
- 'info': None,
1200
- 'name': name,
1201
- 'active': active,
1202
- 'deposit': depositEnabled,
1203
- 'withdraw': withdrawEnabled,
1204
- 'fee': self.parse_number(feeString),
1205
- 'precision': None,
1206
- 'type': 'crypto',
1207
- 'limits': {
1208
- 'amount': {
1209
- 'min': None,
1210
- 'max': None,
1211
- },
1212
- 'deposit': {
1213
- 'min': None,
1214
- 'max': None,
1215
- },
1216
- 'withdraw': {
1217
- 'min': None,
1218
- 'max': None,
1219
- },
1220
- },
1221
- }
1222
- minFeeString = self.safe_string(result[code], 'fee')
1223
- if feeString is not None:
1224
- minFeeString = feeString if (minFeeString is None) else Precise.string_min(feeString, minFeeString)
1225
- depositAvailable = self.safe_value(result[code], 'deposit')
1226
- depositAvailable = depositEnabled if (depositEnabled) else depositAvailable
1227
- withdrawAvailable = self.safe_value(result[code], 'withdraw')
1228
- withdrawAvailable = withdrawEnabled if (withdrawEnabled) else withdrawAvailable
1229
- networks = self.safe_value(result[code], 'networks', {})
1230
- if networkCode is not None:
1225
+ # skip childChains, are collected in parentChain loop
1226
+ if self.safe_bool(entry, 'isChildChain'):
1227
+ continue
1228
+ allChainEntries = []
1229
+ childChains = self.safe_list(entry, 'childChains', [])
1230
+ if childChains is not None:
1231
+ for j in range(0, len(childChains)):
1232
+ childChainId = childChains[j]
1233
+ childNetworkEntry = self.safe_dict(currenciesDict, childChainId)
1234
+ allChainEntries.append(childNetworkEntry)
1235
+ allChainEntries.append(entry)
1236
+ networks: dict = {}
1237
+ for j in range(0, len(allChainEntries)):
1238
+ chainEntry = allChainEntries[j]
1239
+ networkName = self.safe_string(chainEntry, 'blockchain')
1240
+ networkCode = self.network_id_to_code(networkName, code)
1241
+ specialNetworkId = self.safe_string(childChains, j, id) # in case it's primary chain, defeault to ID
1231
1242
  networks[networkCode] = {
1232
- 'info': currency,
1233
- 'id': networkId,
1243
+ 'info': chainEntry,
1244
+ 'id': specialNetworkId, # we need self for deposit/withdrawal, instead of friendly name
1245
+ 'numericId': self.safe_integer(chainEntry, 'id'),
1234
1246
  'network': networkCode,
1235
- 'currencyId': id,
1236
- 'numericId': numericId,
1237
- 'deposit': depositEnabled,
1238
- 'withdraw': withdrawEnabled,
1239
- 'active': active,
1240
- 'fee': self.parse_number(feeString),
1247
+ 'active': self.safe_bool(chainEntry, 'walletState'),
1248
+ 'deposit': self.safe_string(chainEntry, 'walletDepositState') == 'ENABLED',
1249
+ 'withdraw': self.safe_string(chainEntry, 'walletWithdrawalState') == 'ENABLED',
1250
+ 'fee': self.safe_number(chainEntry, 'withdrawalFee'),
1241
1251
  'precision': None,
1242
1252
  'limits': {
1243
- 'amount': {
1244
- 'min': None,
1245
- 'max': None,
1246
- },
1247
1253
  'withdraw': {
1248
1254
  'min': None,
1249
1255
  'max': None,
@@ -1254,19 +1260,34 @@ class poloniex(Exchange, ImplicitAPI):
1254
1260
  },
1255
1261
  },
1256
1262
  }
1257
- result[code]['networks'] = networks
1258
- info = self.safe_value(result[code], 'info', [])
1259
- rawInfo: dict = {}
1260
- rawInfo[id] = currency
1261
- info.append(rawInfo)
1262
- result[code]['info'] = info
1263
- if noParentChain:
1264
- result[code]['id'] = id
1265
- result[code]['name'] = name
1266
- result[code]['active'] = depositAvailable and withdrawAvailable
1267
- result[code]['deposit'] = depositAvailable
1268
- result[code]['withdraw'] = withdrawAvailable
1269
- result[code]['fee'] = self.parse_number(minFeeString)
1263
+ result[code] = self.safe_currency_structure({
1264
+ 'info': entry,
1265
+ 'code': code,
1266
+ 'id': id,
1267
+ 'numericId': self.safe_integer(entry, 'id'),
1268
+ 'type': 'crypto',
1269
+ 'name': self.safe_string(entry, 'name'),
1270
+ 'active': None,
1271
+ 'deposit': None,
1272
+ 'withdraw': None,
1273
+ 'fee': None,
1274
+ 'precision': None,
1275
+ 'limits': {
1276
+ 'amount': {
1277
+ 'min': None,
1278
+ 'max': None,
1279
+ },
1280
+ 'withdraw': {
1281
+ 'min': None,
1282
+ 'max': None,
1283
+ },
1284
+ 'deposit': {
1285
+ 'min': None,
1286
+ 'max': None,
1287
+ },
1288
+ },
1289
+ 'networks': networks,
1290
+ })
1270
1291
  return result
1271
1292
 
1272
1293
  def fetch_ticker(self, symbol: str, params={}) -> Ticker:
@@ -2584,40 +2605,15 @@ class poloniex(Exchange, ImplicitAPI):
2584
2605
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
2585
2606
  """
2586
2607
  self.load_markets()
2587
- currency = self.currency(code)
2588
- request: dict = {
2589
- 'currency': currency['id'],
2590
- }
2591
- networks = self.safe_value(self.options, 'networks', {})
2592
- network = self.safe_string_upper(params, 'network') # self line allows the user to specify either ERC20 or ETH
2593
- network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
2594
- if network is not None:
2595
- request['currency'] = request['currency'] + network # when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
2596
- params = self.omit(params, 'network')
2597
- else:
2598
- if currency['id'] == 'USDT':
2599
- raise ArgumentsRequired(self.id + ' createDepositAddress requires a network parameter for ' + code + '.')
2608
+ request, extraParams, currency, networkEntry = self.prepare_request_for_deposit_address(code, params)
2609
+ params = extraParams
2600
2610
  response = self.privatePostWalletsAddress(self.extend(request, params))
2601
2611
  #
2602
2612
  # {
2603
2613
  # "address" : "0xfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf"
2604
2614
  # }
2605
2615
  #
2606
- address = self.safe_string(response, 'address')
2607
- tag: Str = None
2608
- self.check_address(address)
2609
- if currency is not None:
2610
- depositAddress = self.safe_string(currency['info'], 'depositAddress')
2611
- if depositAddress is not None:
2612
- tag = address
2613
- address = depositAddress
2614
- return {
2615
- 'currency': code,
2616
- 'address': address,
2617
- 'tag': tag,
2618
- 'network': network,
2619
- 'info': response,
2620
- }
2616
+ return self.parse_deposit_address_special(response, currency, networkEntry)
2621
2617
 
2622
2618
  def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2623
2619
  """
@@ -2630,37 +2626,56 @@ class poloniex(Exchange, ImplicitAPI):
2630
2626
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
2631
2627
  """
2632
2628
  self.load_markets()
2633
- currency = self.currency(code)
2634
- request: dict = {
2635
- 'currency': currency['id'],
2636
- }
2637
- networks = self.safe_value(self.options, 'networks', {})
2638
- network = self.safe_string_upper(params, 'network') # self line allows the user to specify either ERC20 or ETH
2639
- network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
2640
- if network is not None:
2641
- request['currency'] = request['currency'] + network # when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
2642
- params = self.omit(params, 'network')
2643
- else:
2644
- if currency['id'] == 'USDT':
2645
- raise ArgumentsRequired(self.id + ' fetchDepositAddress requires a network parameter for ' + code + '.')
2629
+ request, extraParams, currency, networkEntry = self.prepare_request_for_deposit_address(code, params)
2630
+ params = extraParams
2646
2631
  response = self.privateGetWalletsAddresses(self.extend(request, params))
2647
2632
  #
2648
2633
  # {
2649
2634
  # "USDTTRON" : "Txxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxp"
2650
2635
  # }
2651
2636
  #
2652
- address = self.safe_string(response, request['currency'])
2637
+ keys = list(response.keys())
2638
+ length = len(keys)
2639
+ if length < 1:
2640
+ raise ExchangeError(self.id + ' fetchDepositAddress() returned an empty response, you might need to try "createDepositAddress" at first and then use "fetchDepositAddress"')
2641
+ return self.parse_deposit_address_special(response, currency, networkEntry)
2642
+
2643
+ def prepare_request_for_deposit_address(self, code: str, params: dict = {}) -> Any:
2644
+ if not (code in self.currencies):
2645
+ raise BadSymbol(self.id + ' fetchDepositAddress(): can not recognize ' + code + ' currency, you might try using unified currency-code and add provide specific "network" parameter, like: fetchDepositAddress("USDT", {"network": "TRC20"})')
2646
+ currency = self.currency(code)
2647
+ networkCode = None
2648
+ networkCode, params = self.handle_network_code_and_params(params)
2649
+ if networkCode is None:
2650
+ # we need to know the network to find out the currency-junction
2651
+ raise ArgumentsRequired(self.id + ' fetchDepositAddress requires a network parameter for ' + code + '.')
2652
+ exchangeNetworkId = None
2653
+ networkCode = self.network_id_to_code(networkCode, code)
2654
+ networkEntry = self.safe_dict(currency['networks'], networkCode)
2655
+ if networkEntry is not None:
2656
+ exchangeNetworkId = networkEntry['id']
2657
+ else:
2658
+ exchangeNetworkId = networkCode
2659
+ request = {
2660
+ 'currency': exchangeNetworkId,
2661
+ }
2662
+ return [request, params, currency, networkEntry]
2663
+
2664
+ def parse_deposit_address_special(self, response, currency, networkEntry) -> DepositAddress:
2665
+ address = self.safe_string(response, 'address')
2666
+ if address is None:
2667
+ address = self.safe_string(response, networkEntry['id'])
2653
2668
  tag: Str = None
2654
2669
  self.check_address(address)
2655
- if currency is not None:
2656
- depositAddress = self.safe_string(currency['info'], 'depositAddress')
2670
+ if networkEntry is not None:
2671
+ depositAddress = self.safe_string(networkEntry['info'], 'depositAddress')
2657
2672
  if depositAddress is not None:
2658
2673
  tag = address
2659
2674
  address = depositAddress
2660
2675
  return {
2661
2676
  'info': response,
2662
- 'currency': code,
2663
- 'network': network,
2677
+ 'currency': currency['code'],
2678
+ 'network': self.safe_string(networkEntry, 'network'),
2664
2679
  'address': address,
2665
2680
  'tag': tag,
2666
2681
  }
@@ -2730,21 +2745,12 @@ class poloniex(Exchange, ImplicitAPI):
2730
2745
  """
2731
2746
  tag, params = self.handle_withdraw_tag_and_params(tag, params)
2732
2747
  self.check_address(address)
2733
- self.load_markets()
2734
- currency = self.currency(code)
2735
- request: dict = {
2736
- 'currency': currency['id'],
2737
- 'amount': amount,
2738
- 'address': address,
2739
- }
2748
+ request, extraParams, currency, networkEntry = self.prepare_request_for_deposit_address(code, params)
2749
+ params = extraParams
2750
+ request['amount'] = self.currency_to_precision(code, amount)
2751
+ request['address'] = address
2740
2752
  if tag is not None:
2741
2753
  request['paymentId'] = tag
2742
- networks = self.safe_value(self.options, 'networks', {})
2743
- network = self.safe_string_upper(params, 'network') # self line allows the user to specify either ERC20 or ETH
2744
- network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
2745
- if network is not None:
2746
- request['currency'] = request['currency'] + network # when network the currency need to be changed to currency+network https://docs.poloniex.com/#withdraw on MultiChain Currencies section
2747
- params = self.omit(params, 'network')
2748
2754
  response = self.privatePostWalletsWithdraw(self.extend(request, params))
2749
2755
  #
2750
2756
  # {
@@ -2753,7 +2759,11 @@ class poloniex(Exchange, ImplicitAPI):
2753
2759
  # "withdrawalNumber": 13449869
2754
2760
  # }
2755
2761
  #
2756
- return self.parse_transaction(response, currency)
2762
+ withdrawResponse = {
2763
+ 'response': response,
2764
+ 'withdrawNetworkEntry': networkEntry,
2765
+ }
2766
+ return self.parse_transaction(withdrawResponse, currency)
2757
2767
 
2758
2768
  def fetch_transactions_helper(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2759
2769
  self.load_markets()
@@ -3071,6 +3081,9 @@ class poloniex(Exchange, ImplicitAPI):
3071
3081
  # "withdrawalRequestsId": 33485231
3072
3082
  # }
3073
3083
  #
3084
+ # if it's being parsed from "withdraw()" method, get the original response
3085
+ if 'withdrawNetworkEntry' in transaction:
3086
+ transaction = transaction['response']
3074
3087
  timestamp = self.safe_timestamp(transaction, 'timestamp')
3075
3088
  currencyId = self.safe_string(transaction, 'currency')
3076
3089
  code = self.safe_currency_code(currencyId)
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.85'
7
+ __version__ = '4.4.87'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
@@ -75,6 +75,100 @@ from ccxt.base.errors import error_hierarchy # noqa: F4
75
75
 
76
76
 
77
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
+
78
172
 
79
173
 
80
174
 
@@ -97,6 +191,7 @@ from ccxt.pro.bitmex import bitmex # noqa
97
191
  from ccxt.pro.bitopro import bitopro # noqa: F401
98
192
  from ccxt.pro.bitrue import bitrue # noqa: F401
99
193
  from ccxt.pro.bitstamp import bitstamp # noqa: F401
194
+ from ccxt.pro.bittrade import bittrade # noqa: F401
100
195
  from ccxt.pro.bitvavo import bitvavo # noqa: F401
101
196
  from ccxt.pro.blockchaincom import blockchaincom # noqa: F401
102
197
  from ccxt.pro.blofin import blofin # noqa: F401
@@ -123,7 +218,6 @@ from ccxt.pro.hitbtc import hitbtc # noqa
123
218
  from ccxt.pro.hollaex import hollaex # noqa: F401
124
219
  from ccxt.pro.htx import htx # noqa: F401
125
220
  from ccxt.pro.huobi import huobi # noqa: F401
126
- from ccxt.pro.huobijp import huobijp # noqa: F401
127
221
  from ccxt.pro.hyperliquid import hyperliquid # noqa: F401
128
222
  from ccxt.pro.independentreserve import independentreserve # noqa: F401
129
223
  from ccxt.pro.kraken import kraken # noqa: F401
@@ -133,10 +227,12 @@ from ccxt.pro.kucoinfutures import kucoinfutures # noqa
133
227
  from ccxt.pro.lbank import lbank # noqa: F401
134
228
  from ccxt.pro.luno import luno # noqa: F401
135
229
  from ccxt.pro.mexc import mexc # noqa: F401
230
+ from ccxt.pro.modetrade import modetrade # noqa: F401
136
231
  from ccxt.pro.myokx import myokx # noqa: F401
137
232
  from ccxt.pro.ndax import ndax # noqa: F401
138
233
  from ccxt.pro.okcoin import okcoin # noqa: F401
139
234
  from ccxt.pro.okx import okx # noqa: F401
235
+ from ccxt.pro.okxus import okxus # noqa: F401
140
236
  from ccxt.pro.onetrading import onetrading # noqa: F401
141
237
  from ccxt.pro.oxfun import oxfun # noqa: F401
142
238
  from ccxt.pro.p2b import p2b # noqa: F401
@@ -170,6 +266,7 @@ exchanges = [
170
266
  'bitopro',
171
267
  'bitrue',
172
268
  'bitstamp',
269
+ 'bittrade',
173
270
  'bitvavo',
174
271
  'blockchaincom',
175
272
  'blofin',
@@ -196,7 +293,6 @@ exchanges = [
196
293
  'hollaex',
197
294
  'htx',
198
295
  'huobi',
199
- 'huobijp',
200
296
  'hyperliquid',
201
297
  'independentreserve',
202
298
  'kraken',
@@ -206,10 +302,12 @@ exchanges = [
206
302
  'lbank',
207
303
  'luno',
208
304
  'mexc',
305
+ 'modetrade',
209
306
  'myokx',
210
307
  'ndax',
211
308
  'okcoin',
212
309
  'okx',
310
+ 'okxus',
213
311
  'onetrading',
214
312
  'oxfun',
215
313
  'p2b',
ccxt/pro/binance.py CHANGED
@@ -805,6 +805,7 @@ class binance(ccxt.async_support.binance):
805
805
  orderbook.reset(snapshot)
806
806
  # unroll the accumulated deltas
807
807
  messages = orderbook.cache
808
+ orderbook.cache = []
808
809
  for i in range(0, len(messages)):
809
810
  messageItem = messages[i]
810
811
  U = self.safe_integer(messageItem, 'U')
@@ -11,10 +11,10 @@ from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
 
13
13
 
14
- class huobijp(ccxt.async_support.huobijp):
14
+ class bittrade(ccxt.async_support.bittrade):
15
15
 
16
16
  def describe(self) -> Any:
17
- return self.deep_extend(super(huobijp, self).describe(), {
17
+ return self.deep_extend(super(bittrade, self).describe(), {
18
18
  'has': {
19
19
  'ws': True,
20
20
  'watchOrderBook': True,
@@ -556,7 +556,7 @@ class huobijp(ccxt.async_support.huobijp):
556
556
  #
557
557
  # ________________________
558
558
  #
559
- # sometimes huobijp responds with half of a JSON response like
559
+ # sometimes bittrade responds with half of a JSON response like
560
560
  #
561
561
  # " {"ch":"market.ethbtc.m "
562
562
  #