ccxt 4.3.58__py2.py3-none-any.whl → 4.3.60__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (84) hide show
  1. ccxt/__init__.py +5 -5
  2. ccxt/abstract/bingx.py +1 -1
  3. ccxt/abstract/bitmart.py +1 -0
  4. ccxt/abstract/btcbox.py +1 -0
  5. ccxt/abstract/upbit.py +3 -0
  6. ccxt/abstract/xt.py +1 -0
  7. ccxt/async_support/__init__.py +5 -5
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/binance.py +91 -2
  10. ccxt/async_support/bingx.py +448 -123
  11. ccxt/async_support/bitfinex.py +38 -4
  12. ccxt/async_support/bitget.py +1 -1
  13. ccxt/async_support/bitmart.py +1 -0
  14. ccxt/async_support/bitso.py +4 -1
  15. ccxt/async_support/btcbox.py +145 -8
  16. ccxt/async_support/bybit.py +3 -5
  17. ccxt/async_support/cex.py +1 -1
  18. ccxt/async_support/coinsph.py +1 -1
  19. ccxt/async_support/cryptocom.py +11 -5
  20. ccxt/async_support/deribit.py +15 -1
  21. ccxt/async_support/digifinex.py +30 -7
  22. ccxt/async_support/gate.py +17 -18
  23. ccxt/async_support/htx.py +7 -7
  24. ccxt/async_support/hyperliquid.py +107 -3
  25. ccxt/async_support/kraken.py +2 -2
  26. ccxt/async_support/mexc.py +11 -11
  27. ccxt/async_support/novadax.py +1 -1
  28. ccxt/async_support/okcoin.py +1 -1
  29. ccxt/async_support/okx.py +11 -2
  30. ccxt/async_support/phemex.py +1 -1
  31. ccxt/async_support/probit.py +1 -1
  32. ccxt/async_support/timex.py +16 -2
  33. ccxt/async_support/tokocrypto.py +1 -1
  34. ccxt/async_support/upbit.py +139 -45
  35. ccxt/async_support/xt.py +71 -8
  36. ccxt/base/errors.py +23 -23
  37. ccxt/base/exchange.py +9 -9
  38. ccxt/binance.py +91 -2
  39. ccxt/bingx.py +448 -123
  40. ccxt/bitfinex.py +38 -4
  41. ccxt/bitget.py +1 -1
  42. ccxt/bitmart.py +1 -0
  43. ccxt/bitso.py +4 -1
  44. ccxt/btcbox.py +145 -8
  45. ccxt/bybit.py +3 -5
  46. ccxt/cex.py +1 -1
  47. ccxt/coinsph.py +1 -1
  48. ccxt/cryptocom.py +11 -5
  49. ccxt/deribit.py +15 -1
  50. ccxt/digifinex.py +30 -7
  51. ccxt/gate.py +17 -18
  52. ccxt/htx.py +7 -7
  53. ccxt/hyperliquid.py +107 -3
  54. ccxt/kraken.py +2 -2
  55. ccxt/mexc.py +11 -11
  56. ccxt/novadax.py +1 -1
  57. ccxt/okcoin.py +1 -1
  58. ccxt/okx.py +11 -2
  59. ccxt/phemex.py +1 -1
  60. ccxt/pro/__init__.py +3 -1
  61. ccxt/pro/binance.py +11 -13
  62. ccxt/pro/bingx.py +11 -8
  63. ccxt/pro/bitmart.py +2 -2
  64. ccxt/pro/bitopro.py +1 -1
  65. ccxt/pro/cex.py +1 -1
  66. ccxt/pro/coincheck.py +1 -1
  67. ccxt/pro/coinone.py +1 -1
  68. ccxt/pro/hyperliquid.py +1 -1
  69. ccxt/pro/kucoin.py +35 -3
  70. ccxt/pro/phemex.py +1 -1
  71. ccxt/pro/xt.py +1046 -0
  72. ccxt/probit.py +1 -1
  73. ccxt/test/tests_async.py +2 -2
  74. ccxt/test/tests_helpers.py +1 -1
  75. ccxt/test/tests_sync.py +2 -2
  76. ccxt/timex.py +16 -2
  77. ccxt/tokocrypto.py +1 -1
  78. ccxt/upbit.py +139 -45
  79. ccxt/xt.py +71 -8
  80. {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/METADATA +5 -5
  81. {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/RECORD +84 -83
  82. {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/LICENSE.txt +0 -0
  83. {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/WHEEL +0 -0
  84. {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/top_level.txt +0 -0
ccxt/bitfinex.py CHANGED
@@ -1111,17 +1111,51 @@ class bitfinex(Exchange, ImplicitAPI):
1111
1111
  request: dict = {
1112
1112
  'order_id': int(id),
1113
1113
  }
1114
- return self.privatePostOrderCancel(self.extend(request, params))
1114
+ response = self.privatePostOrderCancel(self.extend(request, params))
1115
+ #
1116
+ # {
1117
+ # id: '161236928925',
1118
+ # cid: '1720172026812',
1119
+ # cid_date: '2024-07-05',
1120
+ # gid: null,
1121
+ # symbol: 'adaust',
1122
+ # exchange: 'bitfinex',
1123
+ # price: '0.33',
1124
+ # avg_execution_price: '0.0',
1125
+ # side: 'buy',
1126
+ # type: 'exchange limit',
1127
+ # timestamp: '1720172026.813',
1128
+ # is_live: True,
1129
+ # is_cancelled: False,
1130
+ # is_hidden: False,
1131
+ # oco_order: null,
1132
+ # was_forced: False,
1133
+ # original_amount: '10.0',
1134
+ # remaining_amount: '10.0',
1135
+ # executed_amount: '0.0',
1136
+ # src: 'api',
1137
+ # meta: {}
1138
+ # }
1139
+ #
1140
+ return self.parse_order(response)
1115
1141
 
1116
1142
  def cancel_all_orders(self, symbol: Str = None, params={}):
1117
1143
  """
1118
1144
  cancel all open orders
1119
1145
  :see: https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1120
- :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
1146
+ :param str symbol: not used by bitfinex cancelAllOrders
1121
1147
  :param dict [params]: extra parameters specific to the exchange API endpoint
1122
1148
  :returns dict: response from exchange
1123
1149
  """
1124
- return self.privatePostOrderCancelAll(params)
1150
+ response = self.privatePostOrderCancelAll(params)
1151
+ #
1152
+ # {result: 'Submitting 1 order cancellations.'}
1153
+ #
1154
+ return [
1155
+ self.safe_order({
1156
+ 'info': response,
1157
+ }),
1158
+ ]
1125
1159
 
1126
1160
  def parse_order(self, order: dict, market: Market = None) -> Order:
1127
1161
  #
@@ -1560,7 +1594,7 @@ class bitfinex(Exchange, ImplicitAPI):
1560
1594
  return response
1561
1595
 
1562
1596
  def nonce(self):
1563
- return self.milliseconds()
1597
+ return self.microseconds()
1564
1598
 
1565
1599
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
1566
1600
  request = '/' + self.implode_params(path, params)
ccxt/bitget.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 DDoSProtection
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/bitmart.py CHANGED
@@ -219,6 +219,7 @@ class bitmart(Exchange, ImplicitAPI):
219
219
  'contract/private/get-open-orders': 1.2,
220
220
  'contract/private/current-plan-order': 1.2,
221
221
  'contract/private/trades': 10,
222
+ 'contract/private/position-risk': 10,
222
223
  },
223
224
  'post': {
224
225
  # sub-account endpoints
ccxt/bitso.py CHANGED
@@ -105,7 +105,10 @@ class bitso(Exchange, ImplicitAPI):
105
105
  'urls': {
106
106
  'logo': 'https://user-images.githubusercontent.com/51840849/87295554-11f98280-c50e-11ea-80d6-15b3bafa8cbf.jpg',
107
107
  'api': {
108
- 'rest': 'https://api.bitso.com',
108
+ 'rest': 'https://bitso.com/api',
109
+ },
110
+ 'test': {
111
+ 'rest': 'https://stage.bitso.com/api',
109
112
  },
110
113
  'www': 'https://bitso.com',
111
114
  'doc': 'https://bitso.com/api_info',
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)
@@ -4147,10 +4147,8 @@ class bybit(Exchange, ImplicitAPI):
4147
4147
  """
4148
4148
  cancel multiple orders for multiple symbols
4149
4149
  :see: https://bybit-exchange.github.io/docs/v5/order/batch-cancel
4150
- :param str[] ids: order ids
4151
- :param str symbol: unified symbol of the market the order was made in
4150
+ :param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
4152
4151
  :param dict [params]: extra parameters specific to the exchange API endpoint
4153
- :param str[] [params.clientOrderIds]: client order ids
4154
4152
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
4155
4153
  """
4156
4154
  self.load_markets()
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/cryptocom.py CHANGED
@@ -798,13 +798,19 @@ class cryptocom(Exchange, ImplicitAPI):
798
798
  'instrument_name': market['id'],
799
799
  'timeframe': self.safe_string(self.timeframes, timeframe, timeframe),
800
800
  }
801
- if since is not None:
802
- request['start_ts'] = since
803
801
  if limit is not None:
804
802
  request['count'] = limit
805
- until = self.safe_integer(params, 'until')
803
+ now = self.microseconds()
804
+ duration = self.parse_timeframe(timeframe)
805
+ until = self.safe_integer(params, 'until', now)
806
806
  params = self.omit(params, ['until'])
807
- if until is not None:
807
+ if since is not None:
808
+ request['start_ts'] = since
809
+ if limit is not None:
810
+ request['end_ts'] = self.sum(since, duration * (limit + 1) * 1000) - 1
811
+ else:
812
+ request['end_ts'] = until
813
+ else:
808
814
  request['end_ts'] = until
809
815
  response = self.v1PublicGetPublicGetCandlestick(self.extend(request, params))
810
816
  #
@@ -1362,7 +1368,7 @@ class cryptocom(Exchange, ImplicitAPI):
1362
1368
  """
1363
1369
  cancel multiple orders for multiple symbols
1364
1370
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order-list-list
1365
- :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol
1371
+ :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
1366
1372
  :param dict [params]: extra parameters specific to the exchange API endpoint
1367
1373
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1368
1374
  """
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
  },
@@ -4779,8 +4779,7 @@ class gate(Exchange, ImplicitAPI):
4779
4779
  """
4780
4780
  cancel multiple orders for multiple symbols
4781
4781
  :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
4782
- :param str[] ids: order ids
4783
- :param str symbol: unified symbol of the market the order was made in
4782
+ :param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
4784
4783
  :param dict [params]: extra parameters specific to the exchange API endpoint
4785
4784
  :param str[] [params.clientOrderIds]: client order ids
4786
4785
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
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