ccxt 4.3.58__py2.py3-none-any.whl → 4.3.59__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 (72) hide show
  1. ccxt/__init__.py +5 -5
  2. ccxt/abstract/bitmart.py +1 -0
  3. ccxt/abstract/btcbox.py +1 -0
  4. ccxt/abstract/upbit.py +3 -0
  5. ccxt/abstract/xt.py +1 -0
  6. ccxt/async_support/__init__.py +5 -5
  7. ccxt/async_support/base/exchange.py +1 -1
  8. ccxt/async_support/binance.py +1 -1
  9. ccxt/async_support/bingx.py +47 -7
  10. ccxt/async_support/bitget.py +1 -1
  11. ccxt/async_support/bitmart.py +1 -0
  12. ccxt/async_support/btcbox.py +145 -8
  13. ccxt/async_support/bybit.py +2 -2
  14. ccxt/async_support/cex.py +1 -1
  15. ccxt/async_support/coinsph.py +1 -1
  16. ccxt/async_support/deribit.py +15 -1
  17. ccxt/async_support/digifinex.py +30 -7
  18. ccxt/async_support/gate.py +16 -16
  19. ccxt/async_support/htx.py +7 -7
  20. ccxt/async_support/hyperliquid.py +106 -2
  21. ccxt/async_support/kraken.py +1 -1
  22. ccxt/async_support/mexc.py +11 -11
  23. ccxt/async_support/novadax.py +1 -1
  24. ccxt/async_support/okcoin.py +1 -1
  25. ccxt/async_support/okx.py +1 -1
  26. ccxt/async_support/phemex.py +1 -1
  27. ccxt/async_support/probit.py +1 -1
  28. ccxt/async_support/tokocrypto.py +1 -1
  29. ccxt/async_support/upbit.py +139 -45
  30. ccxt/async_support/xt.py +70 -7
  31. ccxt/base/errors.py +23 -23
  32. ccxt/base/exchange.py +9 -9
  33. ccxt/binance.py +1 -1
  34. ccxt/bingx.py +47 -7
  35. ccxt/bitget.py +1 -1
  36. ccxt/bitmart.py +1 -0
  37. ccxt/btcbox.py +145 -8
  38. ccxt/bybit.py +2 -2
  39. ccxt/cex.py +1 -1
  40. ccxt/coinsph.py +1 -1
  41. ccxt/deribit.py +15 -1
  42. ccxt/digifinex.py +30 -7
  43. ccxt/gate.py +16 -16
  44. ccxt/htx.py +7 -7
  45. ccxt/hyperliquid.py +106 -2
  46. ccxt/kraken.py +1 -1
  47. ccxt/mexc.py +11 -11
  48. ccxt/novadax.py +1 -1
  49. ccxt/okcoin.py +1 -1
  50. ccxt/okx.py +1 -1
  51. ccxt/phemex.py +1 -1
  52. ccxt/pro/__init__.py +3 -1
  53. ccxt/pro/binance.py +11 -13
  54. ccxt/pro/bingx.py +11 -8
  55. ccxt/pro/bitmart.py +2 -2
  56. ccxt/pro/bitopro.py +1 -1
  57. ccxt/pro/coincheck.py +1 -1
  58. ccxt/pro/coinone.py +1 -1
  59. ccxt/pro/hyperliquid.py +1 -1
  60. ccxt/pro/xt.py +1043 -0
  61. ccxt/probit.py +1 -1
  62. ccxt/test/tests_async.py +2 -2
  63. ccxt/test/tests_helpers.py +1 -1
  64. ccxt/test/tests_sync.py +2 -2
  65. ccxt/tokocrypto.py +1 -1
  66. ccxt/upbit.py +139 -45
  67. ccxt/xt.py +70 -7
  68. {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/METADATA +5 -5
  69. {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/RECORD +72 -71
  70. {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/LICENSE.txt +0 -0
  71. {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/WHEEL +0 -0
  72. {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/top_level.txt +0 -0
ccxt/btcbox.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.btcbox import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade
10
+ from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -73,7 +73,7 @@ class btcbox(Exchange, ImplicitAPI):
73
73
  'fetchPositionsRisk': False,
74
74
  'fetchPremiumIndexOHLCV': False,
75
75
  'fetchTicker': True,
76
- 'fetchTickers': False,
76
+ 'fetchTickers': True,
77
77
  'fetchTrades': True,
78
78
  'fetchTransfer': False,
79
79
  'fetchTransfers': False,
@@ -102,6 +102,7 @@ class btcbox(Exchange, ImplicitAPI):
102
102
  'depth',
103
103
  'orders',
104
104
  'ticker',
105
+ 'tickers',
105
106
  ],
106
107
  },
107
108
  'private': {
@@ -115,12 +116,6 @@ class btcbox(Exchange, ImplicitAPI):
115
116
  ],
116
117
  },
117
118
  },
118
- 'markets': {
119
- 'BTC/JPY': self.safe_market_structure({'id': 'btc', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'taker': self.parse_number('0.0005'), 'maker': self.parse_number('0.0005'), 'type': 'spot', 'spot': True}),
120
- 'ETH/JPY': self.safe_market_structure({'id': 'eth', 'symbol': 'ETH/JPY', 'base': 'ETH', 'quote': 'JPY', 'baseId': 'eth', 'quoteId': 'jpy', 'taker': self.parse_number('0.0010'), 'maker': self.parse_number('0.0010'), 'type': 'spot', 'spot': True}),
121
- 'LTC/JPY': self.safe_market_structure({'id': 'ltc', 'symbol': 'LTC/JPY', 'base': 'LTC', 'quote': 'JPY', 'baseId': 'ltc', 'quoteId': 'jpy', 'taker': self.parse_number('0.0010'), 'maker': self.parse_number('0.0010'), 'type': 'spot', 'spot': True}),
122
- 'BCH/JPY': self.safe_market_structure({'id': 'bch', 'symbol': 'BCH/JPY', 'base': 'BCH', 'quote': 'JPY', 'baseId': 'bch', 'quoteId': 'jpy', 'taker': self.parse_number('0.0010'), 'maker': self.parse_number('0.0010'), 'type': 'spot', 'spot': True}),
123
- },
124
119
  'precisionMode': TICK_SIZE,
125
120
  'exceptions': {
126
121
  '104': AuthenticationError,
@@ -136,6 +131,137 @@ class btcbox(Exchange, ImplicitAPI):
136
131
  },
137
132
  })
138
133
 
134
+ def fetch_markets(self, params={}) -> List[Market]:
135
+ """
136
+ retrieves data on all markets for ace
137
+ :param dict [params]: extra parameters specific to the exchange API endpoint
138
+ :returns dict[]: an array of objects representing market data
139
+ """
140
+ response = self.publicGetTickers()
141
+ #
142
+ marketIds = list(response.keys())
143
+ markets = []
144
+ for i in range(0, len(marketIds)):
145
+ marketId = marketIds[i]
146
+ symbolParts = marketId.split('_')
147
+ baseCurr = self.safe_string(symbolParts, 0)
148
+ quote = self.safe_string(symbolParts, 1)
149
+ quoteId = quote.lower()
150
+ id = baseCurr.lower()
151
+ res = response[marketId]
152
+ symbol = baseCurr + '/' + quote
153
+ fee = self.parse_number('0.0005') if (id == 'BTC') else self.parse_number('0.0010')
154
+ markets.append(self.safe_market_structure({
155
+ 'id': id,
156
+ 'uppercaseId': None,
157
+ 'symbol': symbol,
158
+ 'base': baseCurr,
159
+ 'baseId': id,
160
+ 'quote': quote,
161
+ 'quoteId': quoteId,
162
+ 'settle': None,
163
+ 'settleId': None,
164
+ 'type': 'spot',
165
+ 'spot': True,
166
+ 'margin': False,
167
+ 'swap': False,
168
+ 'future': False,
169
+ 'option': False,
170
+ 'taker': fee,
171
+ 'maker': fee,
172
+ 'contract': False,
173
+ 'linear': None,
174
+ 'inverse': None,
175
+ 'contractSize': None,
176
+ 'expiry': None,
177
+ 'expiryDatetime': None,
178
+ 'strike': None,
179
+ 'optionType': None,
180
+ 'limits': {
181
+ 'amount': {
182
+ 'min': None,
183
+ 'max': None,
184
+ },
185
+ 'price': {
186
+ 'min': None,
187
+ 'max': None,
188
+ },
189
+ 'cost': {
190
+ 'min': None,
191
+ 'max': None,
192
+ },
193
+ 'leverage': {
194
+ 'min': None,
195
+ 'max': None,
196
+ },
197
+ },
198
+ 'precision': {
199
+ 'price': None,
200
+ 'amount': None,
201
+ },
202
+ 'active': None,
203
+ 'created': None,
204
+ 'info': res,
205
+ }))
206
+ return markets
207
+
208
+ def parse_market(self, market: dict) -> Market:
209
+ baseId = self.safe_string(market, 'base')
210
+ base = self.safe_currency_code(baseId)
211
+ quoteId = self.safe_string(market, 'quote')
212
+ quote = self.safe_currency_code(quoteId)
213
+ symbol = base + '/' + quote
214
+ return {
215
+ 'id': self.safe_string(market, 'symbol'),
216
+ 'uppercaseId': None,
217
+ 'symbol': symbol,
218
+ 'base': base,
219
+ 'baseId': baseId,
220
+ 'quote': quote,
221
+ 'quoteId': quoteId,
222
+ 'settle': None,
223
+ 'settleId': None,
224
+ 'type': 'spot',
225
+ 'spot': True,
226
+ 'margin': False,
227
+ 'swap': False,
228
+ 'future': False,
229
+ 'option': False,
230
+ 'contract': False,
231
+ 'linear': None,
232
+ 'inverse': None,
233
+ 'contractSize': None,
234
+ 'expiry': None,
235
+ 'expiryDatetime': None,
236
+ 'strike': None,
237
+ 'optionType': None,
238
+ 'limits': {
239
+ 'amount': {
240
+ 'min': self.safe_number(market, 'minLimitBaseAmount'),
241
+ 'max': self.safe_number(market, 'maxLimitBaseAmount'),
242
+ },
243
+ 'price': {
244
+ 'min': None,
245
+ 'max': None,
246
+ },
247
+ 'cost': {
248
+ 'min': None,
249
+ 'max': None,
250
+ },
251
+ 'leverage': {
252
+ 'min': None,
253
+ 'max': None,
254
+ },
255
+ },
256
+ 'precision': {
257
+ 'price': self.parse_number(self.parse_precision(self.safe_string(market, 'quotePrecision'))),
258
+ 'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'basePrecision'))),
259
+ },
260
+ 'active': None,
261
+ 'created': None,
262
+ 'info': market,
263
+ }
264
+
139
265
  def parse_balance(self, response) -> Balances:
140
266
  result: dict = {'info': response}
141
267
  codes = list(self.currencies.keys())
@@ -224,6 +350,17 @@ class btcbox(Exchange, ImplicitAPI):
224
350
  response = self.publicGetTicker(self.extend(request, params))
225
351
  return self.parse_ticker(response, market)
226
352
 
353
+ def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
354
+ """
355
+ fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
356
+ :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
357
+ :param dict [params]: extra parameters specific to the exchange API endpoint
358
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
359
+ """
360
+ self.load_markets()
361
+ response = self.publicGetTickers(params)
362
+ return self.parse_tickers(response, symbols)
363
+
227
364
  def parse_trade(self, trade: dict, market: Market = None) -> Trade:
228
365
  #
229
366
  # fetchTrades(public)
ccxt/bybit.py CHANGED
@@ -3187,13 +3187,13 @@ class bybit(Exchange, ImplicitAPI):
3187
3187
  if code is not None:
3188
3188
  if code != '0':
3189
3189
  category = self.safe_string(order, 'category')
3190
- inferedMarketType = 'spot' if (category == 'spot') else 'contract'
3190
+ inferredMarketType = 'spot' if (category == 'spot') else 'contract'
3191
3191
  return self.safe_order({
3192
3192
  'info': order,
3193
3193
  'status': 'rejected',
3194
3194
  'id': self.safe_string(order, 'orderId'),
3195
3195
  'clientOrderId': self.safe_string(order, 'orderLinkId'),
3196
- 'symbol': self.safe_symbol(self.safe_string(order, 'symbol'), None, None, inferedMarketType),
3196
+ 'symbol': self.safe_symbol(self.safe_string(order, 'symbol'), None, None, inferredMarketType),
3197
3197
  })
3198
3198
  marketId = self.safe_string(order, 'symbol')
3199
3199
  isContract = ('tpslMode' in order)
ccxt/cex.py CHANGED
@@ -13,13 +13,13 @@ from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
14
14
  from ccxt.base.errors import ArgumentsRequired
15
15
  from ccxt.base.errors import BadSymbol
16
- from ccxt.base.errors import NullResponse
17
16
  from ccxt.base.errors import InsufficientFunds
18
17
  from ccxt.base.errors import InvalidOrder
19
18
  from ccxt.base.errors import OrderNotFound
20
19
  from ccxt.base.errors import DDoSProtection
21
20
  from ccxt.base.errors import RateLimitExceeded
22
21
  from ccxt.base.errors import InvalidNonce
22
+ from ccxt.base.errors import NullResponse
23
23
  from ccxt.base.decimal_to_precision import TICK_SIZE
24
24
  from ccxt.base.precise import Precise
25
25
 
ccxt/coinsph.py CHANGED
@@ -14,7 +14,6 @@ from ccxt.base.errors import PermissionDenied
14
14
  from ccxt.base.errors import ArgumentsRequired
15
15
  from ccxt.base.errors import BadRequest
16
16
  from ccxt.base.errors import BadSymbol
17
- from ccxt.base.errors import BadResponse
18
17
  from ccxt.base.errors import InsufficientFunds
19
18
  from ccxt.base.errors import InvalidAddress
20
19
  from ccxt.base.errors import InvalidOrder
@@ -24,6 +23,7 @@ from ccxt.base.errors import DuplicateOrderId
24
23
  from ccxt.base.errors import NotSupported
25
24
  from ccxt.base.errors import RateLimitExceeded
26
25
  from ccxt.base.errors import ExchangeNotAvailable
26
+ from ccxt.base.errors import BadResponse
27
27
  from ccxt.base.decimal_to_precision import TICK_SIZE
28
28
  from ccxt.base.precise import Precise
29
29
 
ccxt/deribit.py CHANGED
@@ -2022,7 +2022,21 @@ class deribit(Exchange, ImplicitAPI):
2022
2022
  market = self.market(symbol)
2023
2023
  request['instrument_name'] = market['id']
2024
2024
  response = self.privateGetCancelAllByInstrument(self.extend(request, params))
2025
- return response
2025
+ #
2026
+ # {
2027
+ # jsonrpc: '2.0',
2028
+ # result: '1',
2029
+ # usIn: '1720508354127369',
2030
+ # usOut: '1720508354133603',
2031
+ # usDiff: '6234',
2032
+ # testnet: True
2033
+ # }
2034
+ #
2035
+ return [
2036
+ self.safe_order({
2037
+ 'info': response,
2038
+ }),
2039
+ ]
2026
2040
 
2027
2041
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2028
2042
  """
ccxt/digifinex.py CHANGED
@@ -16,7 +16,6 @@ from ccxt.base.errors import AccountSuspended
16
16
  from ccxt.base.errors import ArgumentsRequired
17
17
  from ccxt.base.errors import BadRequest
18
18
  from ccxt.base.errors import BadSymbol
19
- from ccxt.base.errors import BadResponse
20
19
  from ccxt.base.errors import InsufficientFunds
21
20
  from ccxt.base.errors import InvalidAddress
22
21
  from ccxt.base.errors import InvalidOrder
@@ -26,6 +25,7 @@ from ccxt.base.errors import NetworkError
26
25
  from ccxt.base.errors import DDoSProtection
27
26
  from ccxt.base.errors import RateLimitExceeded
28
27
  from ccxt.base.errors import InvalidNonce
28
+ from ccxt.base.errors import BadResponse
29
29
  from ccxt.base.decimal_to_precision import TICK_SIZE
30
30
  from ccxt.base.precise import Precise
31
31
 
@@ -1808,7 +1808,34 @@ class digifinex(Exchange, ImplicitAPI):
1808
1808
  numCanceledOrders = len(canceledOrders)
1809
1809
  if numCanceledOrders != 1:
1810
1810
  raise OrderNotFound(self.id + ' cancelOrder() ' + id + ' not found')
1811
- return response
1811
+ orders = self.parse_cancel_orders(response)
1812
+ return self.safe_dict(orders, 0)
1813
+ else:
1814
+ return self.safe_order({
1815
+ 'info': response,
1816
+ 'orderId': self.safe_string(response, 'data'),
1817
+ })
1818
+
1819
+ def parse_cancel_orders(self, response):
1820
+ success = self.safe_list(response, 'success')
1821
+ error = self.safe_list(response, 'error')
1822
+ result = []
1823
+ for i in range(0, len(success)):
1824
+ order = success[i]
1825
+ result.append(self.safe_order({
1826
+ 'info': order,
1827
+ 'id': order,
1828
+ 'status': 'canceled',
1829
+ }))
1830
+ for i in range(0, len(error)):
1831
+ order = error[i]
1832
+ result.append(self.safe_order({
1833
+ 'info': order,
1834
+ 'id': self.safe_string_2(order, 'order-id', 'order_id'),
1835
+ 'status': 'failed',
1836
+ 'clientOrderId': self.safe_string(order, 'client-order-id'),
1837
+ }))
1838
+ return result
1812
1839
 
1813
1840
  def cancel_orders(self, ids, symbol: Str = None, params={}):
1814
1841
  """
@@ -1839,11 +1866,7 @@ class digifinex(Exchange, ImplicitAPI):
1839
1866
  # ]
1840
1867
  # }
1841
1868
  #
1842
- canceledOrders = self.safe_value(response, 'success', [])
1843
- numCanceledOrders = len(canceledOrders)
1844
- if numCanceledOrders < 1:
1845
- raise OrderNotFound(self.id + ' cancelOrders() error')
1846
- return response
1869
+ return self.parse_cancel_orders(response)
1847
1870
 
1848
1871
  def parse_order_status(self, status: Str):
1849
1872
  statuses: dict = {
ccxt/gate.py CHANGED
@@ -16,7 +16,6 @@ from ccxt.base.errors import AccountSuspended
16
16
  from ccxt.base.errors import ArgumentsRequired
17
17
  from ccxt.base.errors import BadRequest
18
18
  from ccxt.base.errors import BadSymbol
19
- from ccxt.base.errors import BadResponse
20
19
  from ccxt.base.errors import InsufficientFunds
21
20
  from ccxt.base.errors import InvalidOrder
22
21
  from ccxt.base.errors import OrderNotFound
@@ -24,6 +23,7 @@ from ccxt.base.errors import OrderImmediatelyFillable
24
23
  from ccxt.base.errors import NotSupported
25
24
  from ccxt.base.errors import RateLimitExceeded
26
25
  from ccxt.base.errors import ExchangeNotAvailable
26
+ from ccxt.base.errors import BadResponse
27
27
  from ccxt.base.decimal_to_precision import TICK_SIZE
28
28
  from ccxt.base.precise import Precise
29
29
 
@@ -612,21 +612,21 @@ class gate(Exchange, ImplicitAPI):
612
612
  # copied from gatev2
613
613
  'commonCurrencies': {
614
614
  '88MPH': 'MPH',
615
- 'AXIS': 'Axis DeFi',
616
- 'BIFI': 'Bitcoin File',
617
- 'BOX': 'DefiBox',
618
- 'BYN': 'BeyondFi',
619
- 'EGG': 'Goose Finance',
620
- 'GTC': 'Game.com', # conflict with Gitcoin and Gastrocoin
621
- 'GTC_HT': 'Game.com HT',
622
- 'GTC_BSC': 'Game.com BSC',
623
- 'HIT': 'HitChain',
624
- 'MM': 'Million', # conflict with MilliMeter
625
- 'MPH': 'Morpher', # conflict with 88MPH
626
- 'POINT': 'GatePoint',
627
- 'RAI': 'Rai Reflex Index', # conflict with RAI Finance
628
- 'SBTC': 'Super Bitcoin',
629
- 'TNC': 'Trinity Network Credit',
615
+ 'AXIS': 'AXISDEFI',
616
+ 'BIFI': 'BITCOINFILE',
617
+ 'BOX': 'DEFIBOX',
618
+ 'BYN': 'BEYONDFI',
619
+ 'EGG': 'GOOSEFINANCE',
620
+ 'GTC': 'GAMECOM', # conflict with Gitcoin and Gastrocoin
621
+ 'GTC_HT': 'GAMECOM_HT',
622
+ 'GTC_BSC': 'GAMECOM_BSC',
623
+ 'HIT': 'HITCHAIN',
624
+ 'MM': 'MILLION', # conflict with MilliMeter
625
+ 'MPH': 'MORPHER', # conflict with 88MPH
626
+ 'POINT': 'GATEPOINT',
627
+ 'RAI': 'RAIREFLEXINDEX', # conflict with RAI Finance
628
+ 'SBTC': 'SUPERBITCOIN',
629
+ 'TNC': 'TRINITYNETWORKCREDIT',
630
630
  'VAI': 'VAIOT',
631
631
  'TRAC': 'TRACO', # conflict with OriginTrail(TRAC)
632
632
  },
ccxt/htx.py CHANGED
@@ -1236,17 +1236,17 @@ class htx(Exchange, ImplicitAPI):
1236
1236
  # https://github.com/ccxt/ccxt/issues/6081
1237
1237
  # https://github.com/ccxt/ccxt/issues/3365
1238
1238
  # https://github.com/ccxt/ccxt/issues/2873
1239
- 'GET': 'Themis', # conflict with GET(Guaranteed Entrance Token, GET Protocol)
1240
- 'GTC': 'Game.com', # conflict with Gitcoin and Gastrocoin
1241
- 'HIT': 'HitChain',
1239
+ 'GET': 'THEMIS', # conflict with GET(Guaranteed Entrance Token, GET Protocol)
1240
+ 'GTC': 'GAMECOM', # conflict with Gitcoin and Gastrocoin
1241
+ 'HIT': 'HITCHAIN',
1242
1242
  # https://github.com/ccxt/ccxt/issues/7399
1243
1243
  # https://coinmarketcap.com/currencies/pnetwork/
1244
1244
  # https://coinmarketcap.com/currencies/penta/markets/
1245
1245
  # https://en.cryptonomist.ch/blog/eidoo/the-edo-to-pnt-upgrade-what-you-need-to-know-updated/
1246
- 'PNT': 'Penta',
1247
- 'SBTC': 'Super Bitcoin',
1248
- 'SOUL': 'Soulsaver',
1249
- 'BIFI': 'Bitcoin File', # conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
1246
+ 'PNT': 'PENTA',
1247
+ 'SBTC': 'SUPERBITCOIN',
1248
+ 'SOUL': 'SOULSAVER',
1249
+ 'BIFI': 'BITCOINFILE', # conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
1250
1250
  },
1251
1251
  })
1252
1252
 
ccxt/hyperliquid.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.hyperliquid import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, Transaction, TransferEntry
8
+ from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TradingFeeInterface, Transaction, TransferEntry
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import ArgumentsRequired
@@ -105,7 +105,7 @@ class hyperliquid(Exchange, ImplicitAPI):
105
105
  'fetchTickers': False,
106
106
  'fetchTime': False,
107
107
  'fetchTrades': True,
108
- 'fetchTradingFee': False,
108
+ 'fetchTradingFee': True,
109
109
  'fetchTradingFees': False,
110
110
  'fetchTransfer': False,
111
111
  'fetchTransfers': False,
@@ -2381,6 +2381,110 @@ class hyperliquid(Exchange, ImplicitAPI):
2381
2381
  'fee': None,
2382
2382
  }
2383
2383
 
2384
+ def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
2385
+ """
2386
+ fetch the trading fees for a market
2387
+ :param str symbol: unified market symbol
2388
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2389
+ :param str [params.user]: user address, will default to self.walletAddress if not provided
2390
+ :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
2391
+ """
2392
+ self.load_markets()
2393
+ userAddress = None
2394
+ userAddress, params = self.handle_public_address('fetchTradingFee', params)
2395
+ market = self.market(symbol)
2396
+ request: dict = {
2397
+ 'type': 'userFees',
2398
+ 'user': userAddress,
2399
+ }
2400
+ response = self.publicPostInfo(self.extend(request, params))
2401
+ #
2402
+ # {
2403
+ # "dailyUserVlm": [
2404
+ # {
2405
+ # "date": "2024-07-08",
2406
+ # "userCross": "0.0",
2407
+ # "userAdd": "0.0",
2408
+ # "exchange": "90597185.23639999"
2409
+ # }
2410
+ # ],
2411
+ # "feeSchedule": {
2412
+ # "cross": "0.00035",
2413
+ # "add": "0.0001",
2414
+ # "tiers": {
2415
+ # "vip": [
2416
+ # {
2417
+ # "ntlCutoff": "5000000.0",
2418
+ # "cross": "0.0003",
2419
+ # "add": "0.00005"
2420
+ # }
2421
+ # ],
2422
+ # "mm": [
2423
+ # {
2424
+ # "makerFractionCutoff": "0.005",
2425
+ # "add": "-0.00001"
2426
+ # }
2427
+ # ]
2428
+ # },
2429
+ # "referralDiscount": "0.04"
2430
+ # },
2431
+ # "userCrossRate": "0.00035",
2432
+ # "userAddRate": "0.0001",
2433
+ # "activeReferralDiscount": "0.0"
2434
+ # }
2435
+ #
2436
+ data: dict = {
2437
+ 'userCrossRate': self.safe_string(response, 'userCrossRate'),
2438
+ 'userAddRate': self.safe_string(response, 'userAddRate'),
2439
+ }
2440
+ return self.parse_trading_fee(data, market)
2441
+
2442
+ def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
2443
+ #
2444
+ # {
2445
+ # "dailyUserVlm": [
2446
+ # {
2447
+ # "date": "2024-07-08",
2448
+ # "userCross": "0.0",
2449
+ # "userAdd": "0.0",
2450
+ # "exchange": "90597185.23639999"
2451
+ # }
2452
+ # ],
2453
+ # "feeSchedule": {
2454
+ # "cross": "0.00035",
2455
+ # "add": "0.0001",
2456
+ # "tiers": {
2457
+ # "vip": [
2458
+ # {
2459
+ # "ntlCutoff": "5000000.0",
2460
+ # "cross": "0.0003",
2461
+ # "add": "0.00005"
2462
+ # }
2463
+ # ],
2464
+ # "mm": [
2465
+ # {
2466
+ # "makerFractionCutoff": "0.005",
2467
+ # "add": "-0.00001"
2468
+ # }
2469
+ # ]
2470
+ # },
2471
+ # "referralDiscount": "0.04"
2472
+ # },
2473
+ # "userCrossRate": "0.00035",
2474
+ # "userAddRate": "0.0001",
2475
+ # "activeReferralDiscount": "0.0"
2476
+ # }
2477
+ #
2478
+ symbol = self.safe_symbol(None, market)
2479
+ return {
2480
+ 'info': fee,
2481
+ 'symbol': symbol,
2482
+ 'maker': self.safe_number(fee, 'userAddRate'),
2483
+ 'taker': self.safe_number(fee, 'userCrossRate'),
2484
+ 'percentage': None,
2485
+ 'tierBased': None,
2486
+ }
2487
+
2384
2488
  def format_vault_address(self, address: Str = None):
2385
2489
  if address is None:
2386
2490
  return None
ccxt/kraken.py CHANGED
@@ -19,13 +19,13 @@ from ccxt.base.errors import InsufficientFunds
19
19
  from ccxt.base.errors import InvalidAddress
20
20
  from ccxt.base.errors import InvalidOrder
21
21
  from ccxt.base.errors import OrderNotFound
22
- from ccxt.base.errors import CancelPending
23
22
  from ccxt.base.errors import NotSupported
24
23
  from ccxt.base.errors import DDoSProtection
25
24
  from ccxt.base.errors import RateLimitExceeded
26
25
  from ccxt.base.errors import ExchangeNotAvailable
27
26
  from ccxt.base.errors import OnMaintenance
28
27
  from ccxt.base.errors import InvalidNonce
28
+ from ccxt.base.errors import CancelPending
29
29
  from ccxt.base.decimal_to_precision import TRUNCATE
30
30
  from ccxt.base.decimal_to_precision import TICK_SIZE
31
31
  from ccxt.base.precise import Precise
ccxt/mexc.py CHANGED
@@ -810,24 +810,24 @@ class mexc(Exchange, ImplicitAPI):
810
810
  'commonCurrencies': {
811
811
  'BEYONDPROTOCOL': 'BEYOND',
812
812
  'BIFI': 'BIFIF',
813
- 'BYN': 'BeyondFi',
813
+ 'BYN': 'BEYONDFI',
814
814
  'COFI': 'COFIX', # conflict with CoinFi
815
- 'DFI': 'DfiStarter',
816
- 'DFT': 'dFuture',
815
+ 'DFI': 'DFISTARTER',
816
+ 'DFT': 'DFUTURE',
817
817
  'DRK': 'DRK',
818
- 'EGC': 'Egoras Credit',
818
+ 'EGC': 'EGORASCREDIT',
819
819
  'FLUX1': 'FLUX', # switched places
820
820
  'FLUX': 'FLUX1', # switched places
821
- 'FREE': 'FreeRossDAO', # conflict with FREE Coin
821
+ 'FREE': 'FREEROSSDAO', # conflict with FREE Coin
822
822
  'GAS': 'GASDAO',
823
823
  'GASNEO': 'GAS',
824
- 'GMT': 'GMT Token', # Conflict with GMT(STEPN)
824
+ 'GMT': 'GMTTOKEN', # Conflict with GMT(STEPN)
825
825
  'STEPN': 'GMT', # Conflict with GMT Token
826
- 'HERO': 'Step Hero', # conflict with Metahero
827
- 'MIMO': 'Mimosa',
828
- 'PROS': 'Pros.Finance', # conflict with Prosper
829
- 'SIN': 'Sin City Token',
830
- 'SOUL': 'Soul Swap',
826
+ 'HERO': 'STEPHERO', # conflict with Metahero
827
+ 'MIMO': 'MIMOSA',
828
+ 'PROS': 'PROSFINANCE', # conflict with Prosper
829
+ 'SIN': 'SINCITYTOKEN',
830
+ 'SOUL': 'SOULSWAP',
831
831
  },
832
832
  'exceptions': {
833
833
  'exact': {
ccxt/novadax.py CHANGED
@@ -19,9 +19,9 @@ from ccxt.base.errors import BadSymbol
19
19
  from ccxt.base.errors import InsufficientFunds
20
20
  from ccxt.base.errors import InvalidOrder
21
21
  from ccxt.base.errors import OrderNotFound
22
- from ccxt.base.errors import CancelPending
23
22
  from ccxt.base.errors import RateLimitExceeded
24
23
  from ccxt.base.errors import OnMaintenance
24
+ from ccxt.base.errors import CancelPending
25
25
  from ccxt.base.decimal_to_precision import TICK_SIZE
26
26
  from ccxt.base.precise import Precise
27
27
 
ccxt/okcoin.py CHANGED
@@ -20,7 +20,6 @@ from ccxt.base.errors import InsufficientFunds
20
20
  from ccxt.base.errors import InvalidAddress
21
21
  from ccxt.base.errors import InvalidOrder
22
22
  from ccxt.base.errors import OrderNotFound
23
- from ccxt.base.errors import CancelPending
24
23
  from ccxt.base.errors import NotSupported
25
24
  from ccxt.base.errors import NetworkError
26
25
  from ccxt.base.errors import RateLimitExceeded
@@ -28,6 +27,7 @@ from ccxt.base.errors import ExchangeNotAvailable
28
27
  from ccxt.base.errors import OnMaintenance
29
28
  from ccxt.base.errors import InvalidNonce
30
29
  from ccxt.base.errors import RequestTimeout
30
+ from ccxt.base.errors import CancelPending
31
31
  from ccxt.base.decimal_to_precision import TICK_SIZE
32
32
  from ccxt.base.precise import Precise
33
33
 
ccxt/okx.py CHANGED
@@ -21,7 +21,6 @@ from ccxt.base.errors import InsufficientFunds
21
21
  from ccxt.base.errors import InvalidAddress
22
22
  from ccxt.base.errors import InvalidOrder
23
23
  from ccxt.base.errors import OrderNotFound
24
- from ccxt.base.errors import CancelPending
25
24
  from ccxt.base.errors import ContractUnavailable
26
25
  from ccxt.base.errors import NotSupported
27
26
  from ccxt.base.errors import NetworkError
@@ -31,6 +30,7 @@ from ccxt.base.errors import ExchangeNotAvailable
31
30
  from ccxt.base.errors import OnMaintenance
32
31
  from ccxt.base.errors import InvalidNonce
33
32
  from ccxt.base.errors import RequestTimeout
33
+ from ccxt.base.errors import CancelPending
34
34
  from ccxt.base.decimal_to_precision import TICK_SIZE
35
35
  from ccxt.base.precise import Precise
36
36
 
ccxt/phemex.py CHANGED
@@ -19,10 +19,10 @@ from ccxt.base.errors import BadSymbol
19
19
  from ccxt.base.errors import InsufficientFunds
20
20
  from ccxt.base.errors import InvalidOrder
21
21
  from ccxt.base.errors import OrderNotFound
22
- from ccxt.base.errors import CancelPending
23
22
  from ccxt.base.errors import DuplicateOrderId
24
23
  from ccxt.base.errors import DDoSProtection
25
24
  from ccxt.base.errors import RateLimitExceeded
25
+ from ccxt.base.errors import CancelPending
26
26
  from ccxt.base.decimal_to_precision import TICK_SIZE
27
27
  from ccxt.base.precise import Precise
28
28