ccxt 4.4.94__py2.py3-none-any.whl → 4.4.96__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 +3 -1
  2. ccxt/abstract/bingx.py +3 -0
  3. ccxt/abstract/foxbit.py +26 -0
  4. ccxt/abstract/hyperliquid.py +1 -1
  5. ccxt/abstract/woo.py +59 -4
  6. ccxt/apex.py +3 -3
  7. ccxt/ascendex.py +2 -2
  8. ccxt/async_support/__init__.py +3 -1
  9. ccxt/async_support/apex.py +3 -3
  10. ccxt/async_support/ascendex.py +2 -2
  11. ccxt/async_support/base/exchange.py +5 -3
  12. ccxt/async_support/base/ws/future.py +5 -1
  13. ccxt/async_support/bingx.py +129 -92
  14. ccxt/async_support/bitget.py +31 -144
  15. ccxt/async_support/bitmart.py +2 -2
  16. ccxt/async_support/bitrue.py +13 -8
  17. ccxt/async_support/bitstamp.py +2 -0
  18. ccxt/async_support/blofin.py +6 -1
  19. ccxt/async_support/bybit.py +15 -6
  20. ccxt/async_support/coinbase.py +36 -0
  21. ccxt/async_support/coinbaseexchange.py +4 -2
  22. ccxt/async_support/coinbaseinternational.py +2 -2
  23. ccxt/async_support/coinmate.py +34 -0
  24. ccxt/async_support/coinone.py +34 -0
  25. ccxt/async_support/coinsph.py +29 -0
  26. ccxt/async_support/coinspot.py +36 -1
  27. ccxt/async_support/cryptocom.py +2 -1
  28. ccxt/async_support/cryptomus.py +41 -1
  29. ccxt/async_support/defx.py +1 -1
  30. ccxt/async_support/derive.py +1 -1
  31. ccxt/async_support/ellipx.py +40 -0
  32. ccxt/async_support/foxbit.py +1935 -0
  33. ccxt/async_support/gate.py +1 -1
  34. ccxt/async_support/hyperliquid.py +3 -2
  35. ccxt/async_support/kucoin.py +1 -1
  36. ccxt/async_support/kucoinfutures.py +3 -2
  37. ccxt/async_support/mexc.py +28 -13
  38. ccxt/async_support/modetrade.py +3 -3
  39. ccxt/async_support/okcoin.py +1 -1
  40. ccxt/async_support/okx.py +10 -3
  41. ccxt/async_support/onetrading.py +1 -1
  42. ccxt/async_support/oxfun.py +2 -1
  43. ccxt/async_support/paradex.py +2 -2
  44. ccxt/async_support/vertex.py +3 -2
  45. ccxt/async_support/woo.py +1255 -875
  46. ccxt/async_support/woofipro.py +2 -2
  47. ccxt/base/exchange.py +8 -5
  48. ccxt/bingx.py +129 -92
  49. ccxt/bitget.py +31 -144
  50. ccxt/bitmart.py +2 -2
  51. ccxt/bitrue.py +13 -8
  52. ccxt/bitstamp.py +2 -0
  53. ccxt/blofin.py +6 -1
  54. ccxt/bybit.py +15 -6
  55. ccxt/coinbase.py +36 -0
  56. ccxt/coinbaseexchange.py +4 -2
  57. ccxt/coinbaseinternational.py +2 -2
  58. ccxt/coinmate.py +34 -0
  59. ccxt/coinone.py +34 -0
  60. ccxt/coinsph.py +29 -0
  61. ccxt/coinspot.py +36 -1
  62. ccxt/cryptocom.py +2 -1
  63. ccxt/cryptomus.py +41 -1
  64. ccxt/defx.py +1 -1
  65. ccxt/derive.py +1 -1
  66. ccxt/ellipx.py +40 -0
  67. ccxt/foxbit.py +1935 -0
  68. ccxt/gate.py +1 -1
  69. ccxt/hyperliquid.py +3 -2
  70. ccxt/kucoin.py +1 -1
  71. ccxt/kucoinfutures.py +3 -2
  72. ccxt/mexc.py +28 -13
  73. ccxt/modetrade.py +3 -3
  74. ccxt/okcoin.py +1 -1
  75. ccxt/okx.py +10 -3
  76. ccxt/onetrading.py +1 -1
  77. ccxt/oxfun.py +2 -1
  78. ccxt/paradex.py +2 -2
  79. ccxt/pro/__init__.py +1 -1
  80. ccxt/pro/hyperliquid.py +6 -6
  81. ccxt/pro/kraken.py +17 -16
  82. ccxt/pro/mexc.py +10 -10
  83. ccxt/test/tests_async.py +17 -2
  84. ccxt/test/tests_sync.py +17 -2
  85. ccxt/vertex.py +3 -2
  86. ccxt/woo.py +1255 -875
  87. ccxt/woofipro.py +2 -2
  88. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/METADATA +8 -8
  89. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/RECORD +92 -89
  90. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/LICENSE.txt +0 -0
  91. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/WHEEL +0 -0
  92. {ccxt-4.4.94.dist-info → ccxt-4.4.96.dist-info}/top_level.txt +0 -0
@@ -1761,9 +1761,9 @@ class woofipro(Exchange, ImplicitAPI):
1761
1761
  # }
1762
1762
  #
1763
1763
  return [
1764
- {
1764
+ self.safe_order({
1765
1765
  'info': response,
1766
- },
1766
+ }),
1767
1767
  ]
1768
1768
 
1769
1769
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.94'
7
+ __version__ = '4.4.96'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -229,6 +229,7 @@ class Exchange(object):
229
229
  'chrome100': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36',
230
230
  }
231
231
  headers = None
232
+ returnResponseHeaders = False
232
233
  origin = '*' # CORS origin
233
234
  MAX_VALUE = float('inf')
234
235
  #
@@ -579,6 +580,8 @@ class Exchange(object):
579
580
  if self.verbose:
580
581
  self.log("\nfetch Response:", self.id, method, url, http_status_code, "ResponseHeaders:", headers, "ResponseBody:", http_response)
581
582
  self.logger.debug("%s %s, Response: %s %s %s", method, url, http_status_code, headers, http_response)
583
+ if json_response and not isinstance(json_response, list) and self.returnResponseHeaders:
584
+ json_response['responseHeaders'] = headers
582
585
  response.raise_for_status()
583
586
 
584
587
  except Timeout as e:
@@ -2839,7 +2842,7 @@ class Exchange(object):
2839
2842
  # keep self in mind:
2840
2843
  # in JS: 1 == 1.0 is True; 1 == 1.0 is True
2841
2844
  # in Python: 1 == 1.0 is True
2842
- # in PHP 1 == 1.0 is True, but 1 == 1.0 is False
2845
+ # in PHP 1 == 1.0 is True, but 1 == 1.0 is False.
2843
2846
  if stringVersion.find('.') >= 0:
2844
2847
  return float(stringVersion)
2845
2848
  return int(stringVersion)
@@ -3780,7 +3783,7 @@ class Exchange(object):
3780
3783
  for i in range(0, len(fees)):
3781
3784
  fee = fees[i]
3782
3785
  code = self.safe_string(fee, 'currency')
3783
- feeCurrencyCode = code is not code if None else str(i)
3786
+ feeCurrencyCode = code if (code is not None) else str(i)
3784
3787
  if feeCurrencyCode is not None:
3785
3788
  rate = self.safe_string(fee, 'rate')
3786
3789
  cost = self.safe_string(fee, 'cost')
@@ -5495,10 +5498,10 @@ class Exchange(object):
5495
5498
  """
5496
5499
  raise NotSupported(self.id + ' fetchDepositsWithdrawals() is not supported yet')
5497
5500
 
5498
- def fetch_deposits(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5501
+ def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
5499
5502
  raise NotSupported(self.id + ' fetchDeposits() is not supported yet')
5500
5503
 
5501
- def fetch_withdrawals(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5504
+ def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
5502
5505
  raise NotSupported(self.id + ' fetchWithdrawals() is not supported yet')
5503
5506
 
5504
5507
  def fetch_deposits_ws(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
ccxt/bingx.py CHANGED
@@ -127,6 +127,7 @@ class bingx(Exchange, ImplicitAPI):
127
127
  'account': 'https://open-api.{hostname}/openApi',
128
128
  'copyTrading': 'https://open-api.{hostname}/openApi',
129
129
  'cswap': 'https://open-api.{hostname}/openApi',
130
+ 'api': 'https://open-api.{hostname}/openApi',
130
131
  },
131
132
  'test': {
132
133
  'swap': 'https://open-api-vst.{hostname}/openApi', # only swap is really "test" but since the API keys are the same, we want to keep all the functionalities when the user enables the sandboxmode
@@ -456,6 +457,7 @@ class bingx(Exchange, ImplicitAPI):
456
457
  'private': {
457
458
  'get': {
458
459
  'asset/transfer': 1,
460
+ 'asset/transferRecord': 5,
459
461
  'capital/deposit/hisrec': 1,
460
462
  'capital/withdraw/history': 1,
461
463
  },
@@ -464,6 +466,20 @@ class bingx(Exchange, ImplicitAPI):
464
466
  },
465
467
  },
466
468
  },
469
+ 'asset': {
470
+ 'v1': {
471
+ 'private': {
472
+ 'post': {
473
+ 'transfer': 5,
474
+ },
475
+ },
476
+ 'public': {
477
+ 'get': {
478
+ 'transfer/supportCoins': 5,
479
+ },
480
+ },
481
+ },
482
+ },
467
483
  },
468
484
  },
469
485
  'timeframes': {
@@ -528,16 +544,19 @@ class bingx(Exchange, ImplicitAPI):
528
544
  'options': {
529
545
  'defaultType': 'spot',
530
546
  'accountsByType': {
531
- 'funding': 'FUND',
532
- 'spot': 'SPOT',
533
- 'swap': 'PFUTURES',
534
- 'future': 'SFUTURES',
547
+ 'funding': 'fund',
548
+ 'spot': 'spot',
549
+ 'future': 'stdFutures',
550
+ 'swap': 'USDTMPerp',
551
+ 'linear': 'USDTMPerp',
552
+ 'inverse': 'coinMPerp',
535
553
  },
536
554
  'accountsById': {
537
- 'FUND': 'funding',
538
- 'SPOT': 'spot',
539
- 'PFUTURES': 'swap',
540
- 'SFUTURES': 'future',
555
+ 'fund': 'funding',
556
+ 'spot': 'spot',
557
+ 'stdFutures': 'future',
558
+ 'USDTMPerp': 'linear',
559
+ 'coinMPerp': 'inverse',
541
560
  },
542
561
  'recvWindow': 5 * 1000, # 5 sec
543
562
  'broker': 'CCXT',
@@ -779,6 +798,10 @@ class bingx(Exchange, ImplicitAPI):
779
798
  'min': self.safe_number(rawNetwork, 'withdrawMin'),
780
799
  'max': self.safe_number(rawNetwork, 'withdrawMax'),
781
800
  },
801
+ 'deposit': {
802
+ 'min': self.safe_number(rawNetwork, 'depositMin'),
803
+ 'max': None,
804
+ },
782
805
  }
783
806
  precision = self.parse_number(self.parse_precision(self.safe_string(rawNetwork, 'withdrawPrecision')))
784
807
  networks[networkCode] = {
@@ -792,20 +815,35 @@ class bingx(Exchange, ImplicitAPI):
792
815
  'precision': precision,
793
816
  'limits': limits,
794
817
  }
795
- result[code] = self.safe_currency_structure({
796
- 'info': entry,
797
- 'code': code,
798
- 'id': currencyId,
799
- 'precision': None,
800
- 'name': name,
801
- 'active': None,
802
- 'deposit': None,
803
- 'withdraw': None,
804
- 'networks': networks,
805
- 'fee': None,
806
- 'limits': None,
807
- 'type': 'crypto', # only cryptos now
808
- })
818
+ if not (code in result): # the exchange could return the same currency with different networks
819
+ result[code] = {
820
+ 'info': entry,
821
+ 'code': code,
822
+ 'id': currencyId,
823
+ 'precision': None,
824
+ 'name': name,
825
+ 'active': None,
826
+ 'deposit': None,
827
+ 'withdraw': None,
828
+ 'networks': networks,
829
+ 'fee': None,
830
+ 'limits': None,
831
+ 'type': 'crypto', # only cryptos now
832
+ }
833
+ else:
834
+ existing = result[code]
835
+ existingNetworks = self.safe_dict(existing, 'networks', {})
836
+ newNetworkCodes = list(networks.keys())
837
+ for j in range(0, len(newNetworkCodes)):
838
+ newNetworkCode = newNetworkCodes[j]
839
+ if not (newNetworkCode in existingNetworks):
840
+ existingNetworks[newNetworkCode] = networks[newNetworkCode]
841
+ result[code]['networks'] = existingNetworks
842
+ codes = list(result.keys())
843
+ for i in range(0, len(codes)):
844
+ code = codes[i]
845
+ currency = result[code]
846
+ result[code] = self.safe_currency_structure(currency)
809
847
  return result
810
848
 
811
849
  def fetch_spot_markets(self, params) -> List[Market]:
@@ -4641,26 +4679,39 @@ class bingx(Exchange, ImplicitAPI):
4641
4679
  """
4642
4680
  transfer currency internally between wallets on the same account
4643
4681
 
4644
- https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20Transfer
4682
+ https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20Transfer%20New
4645
4683
 
4646
4684
  :param str code: unified currency code
4647
4685
  :param float amount: amount to transfer
4648
4686
  :param str fromAccount: account to transfer from(spot, swap, futures, or funding)
4649
- :param str toAccount: account to transfer to(spot, swap, futures, or funding)
4687
+ :param str toAccount: account to transfer to(spot, swap(linear or inverse), future, or funding)
4650
4688
  :param dict [params]: extra parameters specific to the exchange API endpoint
4651
4689
  :returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
4652
4690
  """
4653
4691
  self.load_markets()
4654
4692
  currency = self.currency(code)
4655
4693
  accountsByType = self.safe_dict(self.options, 'accountsByType', {})
4694
+ subType = None
4695
+ subType, params = self.handle_sub_type_and_params('transfer', None, params)
4656
4696
  fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
4657
4697
  toId = self.safe_string(accountsByType, toAccount, toAccount)
4698
+ if fromId == 'swap':
4699
+ if subType == 'inverse':
4700
+ fromId = 'coinMPerp'
4701
+ else:
4702
+ fromId = 'USDTMPerp'
4703
+ if toId == 'swap':
4704
+ if subType == 'inverse':
4705
+ toId = 'coinMPerp'
4706
+ else:
4707
+ toId = 'USDTMPerp'
4658
4708
  request: dict = {
4709
+ 'fromAccount': fromId,
4710
+ 'toAccount': toId,
4659
4711
  'asset': currency['id'],
4660
4712
  'amount': self.currency_to_precision(code, amount),
4661
- 'type': fromId + '_' + toId,
4662
4713
  }
4663
- response = self.spotV3PrivateGetGetAssetTransfer(self.extend(request, params))
4714
+ response = self.apiAssetV1PrivatePostTransfer(self.extend(request, params))
4664
4715
  #
4665
4716
  # {
4666
4717
  # "tranId": 1933130865269936128,
@@ -4669,7 +4720,7 @@ class bingx(Exchange, ImplicitAPI):
4669
4720
  #
4670
4721
  return {
4671
4722
  'info': response,
4672
- 'id': self.safe_string(response, 'tranId'),
4723
+ 'id': self.safe_string(response, 'transferId'),
4673
4724
  'timestamp': None,
4674
4725
  'datetime': None,
4675
4726
  'currency': code,
@@ -4683,18 +4734,19 @@ class bingx(Exchange, ImplicitAPI):
4683
4734
  """
4684
4735
  fetch a history of internal transfers made on an account
4685
4736
 
4686
- https://bingx-api.github.io/docs/#/spot/account-api.html#Query%20User%20Universal%20Transfer%20History%20(USER_DATA)
4737
+ https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20transfer%20records%20new
4687
4738
 
4688
4739
  :param str [code]: unified currency code of the currency transferred
4689
4740
  :param int [since]: the earliest time in ms to fetch transfers for
4690
4741
  :param int [limit]: the maximum number of transfers structures to retrieve(default 10, max 100)
4691
4742
  :param dict [params]: extra parameters specific to the exchange API endpoint
4692
- :param str params.fromAccount:(mandatory) transfer from(spot, swap, futures, or funding)
4693
- :param str params.toAccount:(mandatory) transfer to(spot, swap, futures, or funding)
4743
+ :param str params.fromAccount:(mandatory) transfer from(spot, swap(linear or inverse), future, or funding)
4744
+ :param str params.toAccount:(mandatory) transfer to(spot, swap(linear or inverse), future, or funding)
4694
4745
  :param boolean [params.paginate]: whether to paginate the results(default False)
4695
4746
  :returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
4696
4747
  """
4697
4748
  self.load_markets()
4749
+ request: dict = {}
4698
4750
  currency = None
4699
4751
  if code is not None:
4700
4752
  currency = self.currency(code)
@@ -4704,34 +4756,36 @@ class bingx(Exchange, ImplicitAPI):
4704
4756
  fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
4705
4757
  toId = self.safe_string(accountsByType, toAccount, toAccount)
4706
4758
  if fromId is None or toId is None:
4707
- raise ExchangeError(self.id + ' fromAccount & toAccount parameter are required')
4759
+ raise ExchangeError(self.id + ' fromAccount & toAccount parameters are required')
4760
+ if fromAccount is not None:
4761
+ request['fromAccount'] = fromId
4762
+ if toAccount is not None:
4763
+ request['toAccount'] = toId
4708
4764
  params = self.omit(params, ['fromAccount', 'toAccount'])
4709
4765
  maxLimit = 100
4710
4766
  paginate = False
4711
4767
  paginate, params = self.handle_option_and_params(params, 'fetchTransfers', 'paginate', False)
4712
4768
  if paginate:
4713
4769
  return self.fetch_paginated_call_dynamic('fetchTransfers', None, since, limit, params, maxLimit)
4714
- request: dict = {
4715
- 'type': fromId + '_' + toId,
4716
- }
4717
4770
  if since is not None:
4718
4771
  request['startTime'] = since
4719
4772
  if limit is not None:
4720
- request['size'] = limit
4773
+ request['pageSize'] = limit
4721
4774
  request, params = self.handle_until_option('endTime', request, params)
4722
- response = self.spotV3PrivateGetAssetTransfer(self.extend(request, params))
4775
+ response = self.apiV3PrivateGetAssetTransferRecord(self.extend(request, params))
4723
4776
  #
4724
4777
  # {
4725
- # "total": 3,
4778
+ # "total": 2,
4726
4779
  # "rows": [
4727
4780
  # {
4728
- # "asset": "USDT",
4729
- # "amount": "100.00000000000000000000",
4730
- # "type": "FUND_SFUTURES",
4781
+ # "asset": "LTC",
4782
+ # "amount": "0.05000000000000000000",
4731
4783
  # "status": "CONFIRMED",
4732
- # "tranId": 1067594500957016069,
4733
- # "timestamp": 1658388859000
4734
- # },
4784
+ # "transferId": "1051461075661819338791",
4785
+ # "timestamp": 1752202092000,
4786
+ # "fromAccount": "spot",
4787
+ # "toAccount": "USDTMPerp"
4788
+ # }
4735
4789
  # ]
4736
4790
  # }
4737
4791
  #
@@ -4739,15 +4793,14 @@ class bingx(Exchange, ImplicitAPI):
4739
4793
  return self.parse_transfers(rows, currency, since, limit)
4740
4794
 
4741
4795
  def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
4742
- tranId = self.safe_string(transfer, 'tranId')
4796
+ tranId = self.safe_string(transfer, 'transferId')
4743
4797
  timestamp = self.safe_integer(transfer, 'timestamp')
4744
- currencyCode = self.safe_currency_code(None, currency)
4798
+ currencyId = self.safe_string(transfer, 'asset')
4799
+ currencyCode = self.safe_currency_code(currencyId, currency)
4745
4800
  status = self.safe_string(transfer, 'status')
4746
4801
  accountsById = self.safe_dict(self.options, 'accountsById', {})
4747
- typeId = self.safe_string(transfer, 'type')
4748
- typeIdSplit = typeId.split('_')
4749
- fromId = self.safe_string(typeIdSplit, 0)
4750
- toId = self.safe_string(typeIdSplit, 1)
4802
+ fromId = self.safe_string(transfer, 'fromAccount')
4803
+ toId = self.safe_string(transfer, 'toAccount')
4751
4804
  fromAccount = self.safe_string(accountsById, fromId, fromId)
4752
4805
  toAccount = self.safe_string(accountsById, toId, toId)
4753
4806
  return {
@@ -5458,37 +5511,13 @@ class bingx(Exchange, ImplicitAPI):
5458
5511
 
5459
5512
  def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
5460
5513
  #
5461
- # {
5462
- # "coin": "BTC",
5463
- # "name": "BTC",
5464
- # "networkList": [
5465
- # {
5466
- # "name": "BTC",
5467
- # "network": "BTC",
5468
- # "isDefault": True,
5469
- # "minConfirm": "2",
5470
- # "withdrawEnable": True,
5471
- # "withdrawFee": "0.00035",
5472
- # "withdrawMax": "1.62842",
5473
- # "withdrawMin": "0.0005"
5474
- # },
5475
- # {
5476
- # "name": "BTC",
5477
- # "network": "BEP20",
5478
- # "isDefault": False,
5479
- # "minConfirm": "15",
5480
- # "withdrawEnable": True,
5481
- # "withdrawFee": "0.00001",
5482
- # "withdrawMax": "1.62734",
5483
- # "withdrawMin": "0.0001"
5484
- # }
5485
- # ]
5486
- # }
5514
+ # currencie structure
5487
5515
  #
5488
- networkList = self.safe_list(fee, 'networkList', [])
5489
- networkListLength = len(networkList)
5516
+ networks = self.safe_dict(fee, 'networks', {})
5517
+ networkCodes = list(networks.keys())
5518
+ networksLength = len(networkCodes)
5490
5519
  result: dict = {
5491
- 'info': fee,
5520
+ 'info': networks,
5492
5521
  'withdraw': {
5493
5522
  'fee': None,
5494
5523
  'percentage': None,
@@ -5499,18 +5528,15 @@ class bingx(Exchange, ImplicitAPI):
5499
5528
  },
5500
5529
  'networks': {},
5501
5530
  }
5502
- if networkListLength != 0:
5503
- for i in range(0, networkListLength):
5504
- network = networkList[i]
5505
- networkId = self.safe_string(network, 'network')
5506
- isDefault = self.safe_bool(network, 'isDefault')
5507
- currencyCode = self.safe_string(currency, 'code')
5508
- networkCode = self.network_id_to_code(networkId, currencyCode)
5531
+ if networksLength != 0:
5532
+ for i in range(0, networksLength):
5533
+ networkCode = networkCodes[i]
5534
+ network = networks[networkCode]
5509
5535
  result['networks'][networkCode] = {
5510
5536
  'deposit': {'fee': None, 'percentage': None},
5511
- 'withdraw': {'fee': self.safe_number(network, 'withdrawFee'), 'percentage': False},
5537
+ 'withdraw': {'fee': self.safe_number(network, 'fee'), 'percentage': False},
5512
5538
  }
5513
- if isDefault:
5539
+ if networksLength == 1:
5514
5540
  result['withdraw']['fee'] = self.safe_number(network, 'withdrawFee')
5515
5541
  result['withdraw']['percentage'] = False
5516
5542
  return result
@@ -5526,9 +5552,15 @@ class bingx(Exchange, ImplicitAPI):
5526
5552
  :returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
5527
5553
  """
5528
5554
  self.load_markets()
5529
- response = self.walletsV1PrivateGetCapitalConfigGetall(params)
5530
- coins = self.safe_list(response, 'data')
5531
- return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
5555
+ response = self.fetch_currencies(params)
5556
+ depositWithdrawFees: dict = {}
5557
+ responseCodes = list(response.keys())
5558
+ for i in range(0, len(responseCodes)):
5559
+ code = responseCodes[i]
5560
+ if (codes is None) or (self.in_array(code, codes)):
5561
+ entry = response[code]
5562
+ depositWithdrawFees[code] = self.parse_deposit_withdraw_fee(entry)
5563
+ return depositWithdrawFees
5532
5564
 
5533
5565
  def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
5534
5566
  """
@@ -6228,8 +6260,13 @@ class bingx(Exchange, ImplicitAPI):
6228
6260
  raise NotSupported(self.id + ' does not have a testnet/sandbox URL for ' + type + ' endpoints')
6229
6261
  url = self.implode_hostname(self.urls['api'][type])
6230
6262
  path = self.implode_params(path, params)
6231
- if version == 'transfer':
6232
- type = 'account/transfer'
6263
+ versionIsTransfer = (version == 'transfer')
6264
+ versionIsAsset = (version == 'asset')
6265
+ if versionIsTransfer or versionIsAsset:
6266
+ if versionIsTransfer:
6267
+ type = 'account/transfer'
6268
+ else:
6269
+ type = 'api/asset'
6233
6270
  version = section[2]
6234
6271
  access = section[3]
6235
6272
  if path != 'account/apiPermissions':