ccxt 4.3.57__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 (91) 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/kucoin.py +1 -0
  5. ccxt/abstract/kucoinfutures.py +1 -0
  6. ccxt/abstract/upbit.py +3 -0
  7. ccxt/abstract/xt.py +1 -0
  8. ccxt/alpaca.py +5 -1
  9. ccxt/async_support/__init__.py +5 -5
  10. ccxt/async_support/alpaca.py +5 -1
  11. ccxt/async_support/base/exchange.py +1 -1
  12. ccxt/async_support/base/ws/client.py +1 -0
  13. ccxt/async_support/bigone.py +19 -1
  14. ccxt/async_support/binance.py +1 -1
  15. ccxt/async_support/bingx.py +116 -26
  16. ccxt/async_support/bitget.py +1 -1
  17. ccxt/async_support/bitmart.py +1 -0
  18. ccxt/async_support/btcbox.py +145 -8
  19. ccxt/async_support/bybit.py +2 -2
  20. ccxt/async_support/cex.py +1 -1
  21. ccxt/async_support/coinmate.py +28 -32
  22. ccxt/async_support/coinone.py +1 -1
  23. ccxt/async_support/coinsph.py +1 -1
  24. ccxt/async_support/deribit.py +15 -1
  25. ccxt/async_support/digifinex.py +30 -7
  26. ccxt/async_support/gate.py +22 -18
  27. ccxt/async_support/htx.py +10 -8
  28. ccxt/async_support/hyperliquid.py +106 -2
  29. ccxt/async_support/kraken.py +1 -1
  30. ccxt/async_support/kucoin.py +3 -0
  31. ccxt/async_support/latoken.py +5 -1
  32. ccxt/async_support/mexc.py +11 -11
  33. ccxt/async_support/novadax.py +1 -1
  34. ccxt/async_support/okcoin.py +1 -1
  35. ccxt/async_support/okx.py +3 -1
  36. ccxt/async_support/phemex.py +1 -1
  37. ccxt/async_support/probit.py +1 -1
  38. ccxt/async_support/tokocrypto.py +1 -1
  39. ccxt/async_support/upbit.py +139 -45
  40. ccxt/async_support/woo.py +2 -1
  41. ccxt/async_support/xt.py +70 -7
  42. ccxt/base/errors.py +23 -23
  43. ccxt/base/exchange.py +9 -9
  44. ccxt/bigone.py +19 -1
  45. ccxt/binance.py +1 -1
  46. ccxt/bingx.py +116 -26
  47. ccxt/bitget.py +1 -1
  48. ccxt/bitmart.py +1 -0
  49. ccxt/btcbox.py +145 -8
  50. ccxt/bybit.py +2 -2
  51. ccxt/cex.py +1 -1
  52. ccxt/coinmate.py +28 -32
  53. ccxt/coinone.py +1 -1
  54. ccxt/coinsph.py +1 -1
  55. ccxt/deribit.py +15 -1
  56. ccxt/digifinex.py +30 -7
  57. ccxt/gate.py +22 -18
  58. ccxt/htx.py +10 -8
  59. ccxt/hyperliquid.py +106 -2
  60. ccxt/kraken.py +1 -1
  61. ccxt/kucoin.py +3 -0
  62. ccxt/latoken.py +5 -1
  63. ccxt/mexc.py +11 -11
  64. ccxt/novadax.py +1 -1
  65. ccxt/okcoin.py +1 -1
  66. ccxt/okx.py +3 -1
  67. ccxt/phemex.py +1 -1
  68. ccxt/pro/__init__.py +3 -1
  69. ccxt/pro/binance.py +11 -13
  70. ccxt/pro/bingx.py +11 -8
  71. ccxt/pro/bitmart.py +2 -2
  72. ccxt/pro/bitopro.py +1 -1
  73. ccxt/pro/coincheck.py +1 -1
  74. ccxt/pro/coinone.py +1 -1
  75. ccxt/pro/htx.py +1 -1
  76. ccxt/pro/hyperliquid.py +1 -1
  77. ccxt/pro/okx.py +3 -3
  78. ccxt/pro/xt.py +1043 -0
  79. ccxt/probit.py +1 -1
  80. ccxt/test/tests_async.py +2 -2
  81. ccxt/test/tests_helpers.py +1 -1
  82. ccxt/test/tests_sync.py +2 -2
  83. ccxt/tokocrypto.py +1 -1
  84. ccxt/upbit.py +139 -45
  85. ccxt/woo.py +2 -1
  86. ccxt/xt.py +70 -7
  87. {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/METADATA +5 -5
  88. {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/RECORD +91 -90
  89. {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/LICENSE.txt +0 -0
  90. {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/WHEEL +0 -0
  91. {ccxt-4.3.57.dist-info → ccxt-4.3.59.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from ccxt.async_support.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
+ async 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 = await 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 = await self.publicGetTicker(self.extend(request, params))
225
351
  return self.parse_ticker(response, market)
226
352
 
353
+ async 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
+ await self.load_markets()
361
+ response = await 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)
@@ -3188,13 +3188,13 @@ class bybit(Exchange, ImplicitAPI):
3188
3188
  if code is not None:
3189
3189
  if code != '0':
3190
3190
  category = self.safe_string(order, 'category')
3191
- inferedMarketType = 'spot' if (category == 'spot') else 'contract'
3191
+ inferredMarketType = 'spot' if (category == 'spot') else 'contract'
3192
3192
  return self.safe_order({
3193
3193
  'info': order,
3194
3194
  'status': 'rejected',
3195
3195
  'id': self.safe_string(order, 'orderId'),
3196
3196
  'clientOrderId': self.safe_string(order, 'orderLinkId'),
3197
- 'symbol': self.safe_symbol(self.safe_string(order, 'symbol'), None, None, inferedMarketType),
3197
+ 'symbol': self.safe_symbol(self.safe_string(order, 'symbol'), None, None, inferredMarketType),
3198
3198
  })
3199
3199
  marketId = self.safe_string(order, 'symbol')
3200
3200
  isContract = ('tpslMode' in order)
ccxt/async_support/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
 
@@ -26,7 +26,7 @@ class coinmate(Exchange, ImplicitAPI):
26
26
  'id': 'coinmate',
27
27
  'name': 'CoinMate',
28
28
  'countries': ['GB', 'CZ', 'EU'], # UK, Czech Republic
29
- 'rateLimit': 1000,
29
+ 'rateLimit': 600,
30
30
  'has': {
31
31
  'CORS': True,
32
32
  'spot': True,
@@ -175,28 +175,28 @@ class coinmate(Exchange, ImplicitAPI):
175
175
  'trading': {
176
176
  'tierBased': True,
177
177
  'percentage': True,
178
- 'maker': self.parse_number('0.0012'),
179
- 'taker': self.parse_number('0.0025'),
178
+ 'taker': self.parse_number('0.006'),
179
+ 'maker': self.parse_number('0.004'),
180
180
  'tiers': {
181
181
  'taker': [
182
- [self.parse_number('0'), self.parse_number('0.0035')],
183
- [self.parse_number('10000'), self.parse_number('0.0023')],
184
- [self.parse_number('100000'), self.parse_number('0.0021')],
185
- [self.parse_number('250000'), self.parse_number('0.0020')],
186
- [self.parse_number('500000'), self.parse_number('0.0015')],
187
- [self.parse_number('1000000'), self.parse_number('0.0013')],
188
- [self.parse_number('3000000'), self.parse_number('0.0010')],
189
- [self.parse_number('15000000'), self.parse_number('0.0005')],
182
+ [self.parse_number('0'), self.parse_number('0.006')],
183
+ [self.parse_number('10000'), self.parse_number('0.003')],
184
+ [self.parse_number('100000'), self.parse_number('0.0023')],
185
+ [self.parse_number('250000'), self.parse_number('0.0021')],
186
+ [self.parse_number('500000'), self.parse_number('0.0018')],
187
+ [self.parse_number('1000000'), self.parse_number('0.0015')],
188
+ [self.parse_number('3000000'), self.parse_number('0.0012')],
189
+ [self.parse_number('15000000'), self.parse_number('0.001')],
190
190
  ],
191
191
  'maker': [
192
- [self.parse_number('0'), self.parse_number('0.003')],
193
- [self.parse_number('10000'), self.parse_number('0.0011')],
194
- [self.parse_number('100000'), self.parse_number('0.0010')],
195
- [self.parse_number('250000'), self.parse_number('0.0008')],
192
+ [self.parse_number('0'), self.parse_number('0.004')],
193
+ [self.parse_number('10000'), self.parse_number('0.002')],
194
+ [self.parse_number('100000'), self.parse_number('0.0012')],
195
+ [self.parse_number('250000'), self.parse_number('0.0009')],
196
196
  [self.parse_number('500000'), self.parse_number('0.0005')],
197
197
  [self.parse_number('1000000'), self.parse_number('0.0003')],
198
198
  [self.parse_number('3000000'), self.parse_number('0.0002')],
199
- [self.parse_number('15000000'), self.parse_number('0')],
199
+ [self.parse_number('15000000'), self.parse_number('-0.0004')],
200
200
  ],
201
201
  },
202
202
  },
@@ -1048,20 +1048,16 @@ class coinmate(Exchange, ImplicitAPI):
1048
1048
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1049
1049
 
1050
1050
  def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1051
- if response is not None:
1052
- if 'error' in response:
1053
- # {"error":true,"errorMessage":"Minimum Order Size 0.01 ETH","data":null}
1054
- if response['error']:
1055
- message = self.safe_string(response, 'errorMessage')
1056
- feedback = self.id + ' ' + message
1057
- self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
1058
- self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
1059
- raise ExchangeError(self.id + ' ' + self.json(response))
1060
- if code > 400:
1061
- if body:
1062
- feedback = self.id + ' ' + body
1063
- self.throw_exactly_matched_exception(self.exceptions['exact'], body, feedback)
1064
- self.throw_broadly_matched_exception(self.exceptions['broad'], body, feedback)
1065
- raise ExchangeError(feedback) # unknown message
1066
- raise ExchangeError(self.id + ' ' + body)
1051
+ if response is None:
1052
+ return None # fallback to default error handler
1053
+ #
1054
+ # {"error":true,"errorMessage":"Api internal error","data":null}
1055
+ # {"error":true,"errorMessage":"Access denied.","data":null}
1056
+ #
1057
+ errorMessage = self.safe_string(response, 'errorMessage')
1058
+ if errorMessage is not None:
1059
+ feedback = self.id + ' ' + body
1060
+ self.throw_exactly_matched_exception(self.exceptions['exact'], errorMessage, feedback)
1061
+ self.throw_broadly_matched_exception(self.exceptions['broad'], errorMessage, feedback)
1062
+ raise ExchangeError(feedback) # unknown message
1067
1063
  return None
@@ -1116,7 +1116,7 @@ class coinone(Exchange, ImplicitAPI):
1116
1116
  # {"result":"error","error_code":"108","error_msg":"Unknown CryptoCurrency"}
1117
1117
  #
1118
1118
  errorCode = self.safe_string(response, 'error_code')
1119
- if errorCode != '0':
1119
+ if errorCode is not None and errorCode != '0':
1120
1120
  feedback = self.id + ' ' + body
1121
1121
  self.throw_exactly_matched_exception(self.exceptions, errorCode, feedback)
1122
1122
  raise ExchangeError(feedback) # unknown message
@@ -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
 
@@ -2022,7 +2022,21 @@ class deribit(Exchange, ImplicitAPI):
2022
2022
  market = self.market(symbol)
2023
2023
  request['instrument_name'] = market['id']
2024
2024
  response = await 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
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2028
2042
  """
@@ -17,7 +17,6 @@ from ccxt.base.errors import AccountSuspended
17
17
  from ccxt.base.errors import ArgumentsRequired
18
18
  from ccxt.base.errors import BadRequest
19
19
  from ccxt.base.errors import BadSymbol
20
- from ccxt.base.errors import BadResponse
21
20
  from ccxt.base.errors import InsufficientFunds
22
21
  from ccxt.base.errors import InvalidAddress
23
22
  from ccxt.base.errors import InvalidOrder
@@ -27,6 +26,7 @@ from ccxt.base.errors import NetworkError
27
26
  from ccxt.base.errors import DDoSProtection
28
27
  from ccxt.base.errors import RateLimitExceeded
29
28
  from ccxt.base.errors import InvalidNonce
29
+ from ccxt.base.errors import BadResponse
30
30
  from ccxt.base.decimal_to_precision import TICK_SIZE
31
31
  from ccxt.base.precise import Precise
32
32
 
@@ -1809,7 +1809,34 @@ class digifinex(Exchange, ImplicitAPI):
1809
1809
  numCanceledOrders = len(canceledOrders)
1810
1810
  if numCanceledOrders != 1:
1811
1811
  raise OrderNotFound(self.id + ' cancelOrder() ' + id + ' not found')
1812
- return response
1812
+ orders = self.parse_cancel_orders(response)
1813
+ return self.safe_dict(orders, 0)
1814
+ else:
1815
+ return self.safe_order({
1816
+ 'info': response,
1817
+ 'orderId': self.safe_string(response, 'data'),
1818
+ })
1819
+
1820
+ def parse_cancel_orders(self, response):
1821
+ success = self.safe_list(response, 'success')
1822
+ error = self.safe_list(response, 'error')
1823
+ result = []
1824
+ for i in range(0, len(success)):
1825
+ order = success[i]
1826
+ result.append(self.safe_order({
1827
+ 'info': order,
1828
+ 'id': order,
1829
+ 'status': 'canceled',
1830
+ }))
1831
+ for i in range(0, len(error)):
1832
+ order = error[i]
1833
+ result.append(self.safe_order({
1834
+ 'info': order,
1835
+ 'id': self.safe_string_2(order, 'order-id', 'order_id'),
1836
+ 'status': 'failed',
1837
+ 'clientOrderId': self.safe_string(order, 'client-order-id'),
1838
+ }))
1839
+ return result
1813
1840
 
1814
1841
  async def cancel_orders(self, ids, symbol: Str = None, params={}):
1815
1842
  """
@@ -1840,11 +1867,7 @@ class digifinex(Exchange, ImplicitAPI):
1840
1867
  # ]
1841
1868
  # }
1842
1869
  #
1843
- canceledOrders = self.safe_value(response, 'success', [])
1844
- numCanceledOrders = len(canceledOrders)
1845
- if numCanceledOrders < 1:
1846
- raise OrderNotFound(self.id + ' cancelOrders() error')
1847
- return response
1870
+ return self.parse_cancel_orders(response)
1848
1871
 
1849
1872
  def parse_order_status(self, status: Str):
1850
1873
  statuses: dict = {
@@ -17,7 +17,6 @@ from ccxt.base.errors import AccountSuspended
17
17
  from ccxt.base.errors import ArgumentsRequired
18
18
  from ccxt.base.errors import BadRequest
19
19
  from ccxt.base.errors import BadSymbol
20
- from ccxt.base.errors import BadResponse
21
20
  from ccxt.base.errors import InsufficientFunds
22
21
  from ccxt.base.errors import InvalidOrder
23
22
  from ccxt.base.errors import OrderNotFound
@@ -25,6 +24,7 @@ from ccxt.base.errors import OrderImmediatelyFillable
25
24
  from ccxt.base.errors import NotSupported
26
25
  from ccxt.base.errors import RateLimitExceeded
27
26
  from ccxt.base.errors import ExchangeNotAvailable
27
+ from ccxt.base.errors import BadResponse
28
28
  from ccxt.base.decimal_to_precision import TICK_SIZE
29
29
  from ccxt.base.precise import Precise
30
30
 
@@ -613,21 +613,21 @@ class gate(Exchange, ImplicitAPI):
613
613
  # copied from gatev2
614
614
  'commonCurrencies': {
615
615
  '88MPH': 'MPH',
616
- 'AXIS': 'Axis DeFi',
617
- 'BIFI': 'Bitcoin File',
618
- 'BOX': 'DefiBox',
619
- 'BYN': 'BeyondFi',
620
- 'EGG': 'Goose Finance',
621
- 'GTC': 'Game.com', # conflict with Gitcoin and Gastrocoin
622
- 'GTC_HT': 'Game.com HT',
623
- 'GTC_BSC': 'Game.com BSC',
624
- 'HIT': 'HitChain',
625
- 'MM': 'Million', # conflict with MilliMeter
626
- 'MPH': 'Morpher', # conflict with 88MPH
627
- 'POINT': 'GatePoint',
628
- 'RAI': 'Rai Reflex Index', # conflict with RAI Finance
629
- 'SBTC': 'Super Bitcoin',
630
- 'TNC': 'Trinity Network Credit',
616
+ 'AXIS': 'AXISDEFI',
617
+ 'BIFI': 'BITCOINFILE',
618
+ 'BOX': 'DEFIBOX',
619
+ 'BYN': 'BEYONDFI',
620
+ 'EGG': 'GOOSEFINANCE',
621
+ 'GTC': 'GAMECOM', # conflict with Gitcoin and Gastrocoin
622
+ 'GTC_HT': 'GAMECOM_HT',
623
+ 'GTC_BSC': 'GAMECOM_BSC',
624
+ 'HIT': 'HITCHAIN',
625
+ 'MM': 'MILLION', # conflict with MilliMeter
626
+ 'MPH': 'MORPHER', # conflict with 88MPH
627
+ 'POINT': 'GATEPOINT',
628
+ 'RAI': 'RAIREFLEXINDEX', # conflict with RAI Finance
629
+ 'SBTC': 'SUPERBITCOIN',
630
+ 'TNC': 'TRINITYNETWORKCREDIT',
631
631
  'VAI': 'VAIOT',
632
632
  'TRAC': 'TRACO', # conflict with OriginTrail(TRAC)
633
633
  },
@@ -3787,7 +3787,7 @@ class gate(Exchange, ImplicitAPI):
3787
3787
  if isMarketOrder:
3788
3788
  request['price'] = price # set to 0 for market orders
3789
3789
  else:
3790
- request['price'] = self.price_to_precision(symbol, price)
3790
+ request['price'] = '0' if (price == 0) else self.price_to_precision(symbol, price)
3791
3791
  if reduceOnly is not None:
3792
3792
  request['reduce_only'] = reduceOnly
3793
3793
  if timeInForce is not None:
@@ -3858,7 +3858,7 @@ class gate(Exchange, ImplicitAPI):
3858
3858
  'initial': {
3859
3859
  'contract': market['id'],
3860
3860
  'size': amount, # positive = buy, negative = sell, set to 0 to close the position
3861
- 'price': self.price_to_precision(symbol, price), # set to 0 to use market price
3861
+ # 'price': '0' if (price == 0) else self.price_to_precision(symbol, price), # set to 0 to use market price
3862
3862
  # 'close': False, # set to True if trying to close the position
3863
3863
  # 'tif': 'gtc', # gtc, ioc, if using market price, only ioc is supported
3864
3864
  # 'text': clientOrderId, # web, api, app
@@ -3866,6 +3866,10 @@ class gate(Exchange, ImplicitAPI):
3866
3866
  },
3867
3867
  'settle': market['settleId'],
3868
3868
  }
3869
+ if type == 'market':
3870
+ request['initial']['price'] = '0'
3871
+ else:
3872
+ request['initial']['price'] = '0' if (price == 0) else self.price_to_precision(symbol, price)
3869
3873
  if trigger is None:
3870
3874
  rule = None
3871
3875
  triggerOrderPrice = None
ccxt/async_support/htx.py CHANGED
@@ -1237,17 +1237,17 @@ class htx(Exchange, ImplicitAPI):
1237
1237
  # https://github.com/ccxt/ccxt/issues/6081
1238
1238
  # https://github.com/ccxt/ccxt/issues/3365
1239
1239
  # https://github.com/ccxt/ccxt/issues/2873
1240
- 'GET': 'Themis', # conflict with GET(Guaranteed Entrance Token, GET Protocol)
1241
- 'GTC': 'Game.com', # conflict with Gitcoin and Gastrocoin
1242
- 'HIT': 'HitChain',
1240
+ 'GET': 'THEMIS', # conflict with GET(Guaranteed Entrance Token, GET Protocol)
1241
+ 'GTC': 'GAMECOM', # conflict with Gitcoin and Gastrocoin
1242
+ 'HIT': 'HITCHAIN',
1243
1243
  # https://github.com/ccxt/ccxt/issues/7399
1244
1244
  # https://coinmarketcap.com/currencies/pnetwork/
1245
1245
  # https://coinmarketcap.com/currencies/penta/markets/
1246
1246
  # https://en.cryptonomist.ch/blog/eidoo/the-edo-to-pnt-upgrade-what-you-need-to-know-updated/
1247
- 'PNT': 'Penta',
1248
- 'SBTC': 'Super Bitcoin',
1249
- 'SOUL': 'Soulsaver',
1250
- 'BIFI': 'Bitcoin File', # conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
1247
+ 'PNT': 'PENTA',
1248
+ 'SBTC': 'SUPERBITCOIN',
1249
+ 'SOUL': 'SOULSAVER',
1250
+ 'BIFI': 'BITCOINFILE', # conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
1251
1251
  },
1252
1252
  })
1253
1253
 
@@ -3054,6 +3054,7 @@ class htx(Exchange, ImplicitAPI):
3054
3054
  instStatus = self.safe_string(entry, 'instStatus')
3055
3055
  currencyActive = instStatus == 'normal'
3056
3056
  minPrecision = None
3057
+ minDeposit = None
3057
3058
  minWithdraw = None
3058
3059
  maxWithdraw = None
3059
3060
  deposit = False
@@ -3065,6 +3066,7 @@ class htx(Exchange, ImplicitAPI):
3065
3066
  self.options['networkChainIdsByNames'][code][title] = uniqueChainId
3066
3067
  self.options['networkNamesByChainIds'][uniqueChainId] = title
3067
3068
  networkCode = self.network_id_to_code(uniqueChainId)
3069
+ minDeposit = self.safe_number(chainEntry, 'minDepositAmt')
3068
3070
  minWithdraw = self.safe_number(chainEntry, 'minWithdrawAmt')
3069
3071
  maxWithdraw = self.safe_number(chainEntry, 'maxWithdrawAmt')
3070
3072
  withdrawStatus = self.safe_string(chainEntry, 'withdrawStatus')
@@ -3084,7 +3086,7 @@ class htx(Exchange, ImplicitAPI):
3084
3086
  'network': networkCode,
3085
3087
  'limits': {
3086
3088
  'deposit': {
3087
- 'min': None,
3089
+ 'min': minDeposit,
3088
3090
  'max': None,
3089
3091
  },
3090
3092
  'withdraw': {