ccxt 4.3.40__py2.py3-none-any.whl → 4.3.42__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 (68) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/abstract/okx.py +7 -0
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/binance.py +3 -0
  10. ccxt/async_support/bitfinex2.py +1 -1
  11. ccxt/async_support/bithumb.py +9 -1
  12. ccxt/async_support/bitmart.py +191 -100
  13. ccxt/async_support/bitstamp.py +38 -2
  14. ccxt/async_support/blockchaincom.py +11 -7
  15. ccxt/async_support/coinex.py +1 -1
  16. ccxt/async_support/coinlist.py +19 -1
  17. ccxt/async_support/coinmate.py +19 -3
  18. ccxt/async_support/coinone.py +1 -1
  19. ccxt/async_support/coinspot.py +11 -2
  20. ccxt/async_support/independentreserve.py +33 -1
  21. ccxt/async_support/indodax.py +43 -2
  22. ccxt/async_support/kraken.py +30 -3
  23. ccxt/async_support/krakenfutures.py +55 -1
  24. ccxt/async_support/kucoin.py +59 -2
  25. ccxt/async_support/okx.py +7 -0
  26. ccxt/async_support/upbit.py +13 -8
  27. ccxt/async_support/woo.py +6 -2
  28. ccxt/base/exchange.py +1 -1
  29. ccxt/binance.py +3 -0
  30. ccxt/bitfinex2.py +1 -1
  31. ccxt/bithumb.py +9 -1
  32. ccxt/bitmart.py +191 -100
  33. ccxt/bitstamp.py +38 -2
  34. ccxt/blockchaincom.py +11 -7
  35. ccxt/coinex.py +1 -1
  36. ccxt/coinlist.py +19 -1
  37. ccxt/coinmate.py +19 -3
  38. ccxt/coinone.py +1 -1
  39. ccxt/coinspot.py +11 -2
  40. ccxt/independentreserve.py +33 -1
  41. ccxt/indodax.py +43 -2
  42. ccxt/kraken.py +30 -3
  43. ccxt/krakenfutures.py +55 -1
  44. ccxt/kucoin.py +59 -2
  45. ccxt/okx.py +7 -0
  46. ccxt/pro/__init__.py +1 -1
  47. ccxt/pro/alpaca.py +5 -5
  48. ccxt/pro/ascendex.py +3 -3
  49. ccxt/pro/bingx.py +258 -42
  50. ccxt/pro/bitget.py +11 -5
  51. ccxt/pro/bitrue.py +3 -4
  52. ccxt/pro/currencycom.py +6 -5
  53. ccxt/pro/exmo.py +5 -6
  54. ccxt/pro/gemini.py +4 -3
  55. ccxt/pro/independentreserve.py +7 -7
  56. ccxt/pro/lbank.py +4 -4
  57. ccxt/pro/mexc.py +1 -1
  58. ccxt/pro/phemex.py +5 -5
  59. ccxt/pro/probit.py +4 -4
  60. ccxt/pro/upbit.py +299 -4
  61. ccxt/pro/wazirx.py +12 -12
  62. ccxt/pro/woo.py +1 -1
  63. ccxt/upbit.py +13 -8
  64. ccxt/woo.py +6 -2
  65. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/METADATA +4 -4
  66. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/RECORD +68 -68
  67. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/WHEEL +0 -0
  68. {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.40'
25
+ __version__ = '4.3.42'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/binance.py CHANGED
@@ -2,6 +2,8 @@ from ccxt.base.types import Entry
2
2
 
3
3
 
4
4
  class ImplicitAPI:
5
+ sapi_get_copytrading_futures_userstatus = sapiGetCopyTradingFuturesUserStatus = Entry('copyTrading/futures/userStatus', 'sapi', 'GET', {'cost': 2})
6
+ sapi_get_copytrading_futures_leadsymbol = sapiGetCopyTradingFuturesLeadSymbol = Entry('copyTrading/futures/leadSymbol', 'sapi', 'GET', {'cost': 2})
5
7
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
8
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
9
  sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
@@ -2,6 +2,8 @@ from ccxt.base.types import Entry
2
2
 
3
3
 
4
4
  class ImplicitAPI:
5
+ sapi_get_copytrading_futures_userstatus = sapiGetCopyTradingFuturesUserStatus = Entry('copyTrading/futures/userStatus', 'sapi', 'GET', {'cost': 2})
6
+ sapi_get_copytrading_futures_leadsymbol = sapiGetCopyTradingFuturesLeadSymbol = Entry('copyTrading/futures/leadSymbol', 'sapi', 'GET', {'cost': 2})
5
7
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
8
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
9
  sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
@@ -2,6 +2,8 @@ from ccxt.base.types import Entry
2
2
 
3
3
 
4
4
  class ImplicitAPI:
5
+ sapi_get_copytrading_futures_userstatus = sapiGetCopyTradingFuturesUserStatus = Entry('copyTrading/futures/userStatus', 'sapi', 'GET', {'cost': 2})
6
+ sapi_get_copytrading_futures_leadsymbol = sapiGetCopyTradingFuturesLeadSymbol = Entry('copyTrading/futures/leadSymbol', 'sapi', 'GET', {'cost': 2})
5
7
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
8
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
9
  sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
@@ -2,6 +2,8 @@ from ccxt.base.types import Entry
2
2
 
3
3
 
4
4
  class ImplicitAPI:
5
+ sapi_get_copytrading_futures_userstatus = sapiGetCopyTradingFuturesUserStatus = Entry('copyTrading/futures/userStatus', 'sapi', 'GET', {'cost': 2})
6
+ sapi_get_copytrading_futures_leadsymbol = sapiGetCopyTradingFuturesLeadSymbol = Entry('copyTrading/futures/leadSymbol', 'sapi', 'GET', {'cost': 2})
5
7
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
8
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
9
  sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
ccxt/abstract/okx.py CHANGED
@@ -148,6 +148,9 @@ class ImplicitAPI:
148
148
  private_get_account_greeks = privateGetAccountGreeks = Entry('account/greeks', 'private', 'GET', {'cost': 2})
149
149
  private_get_account_position_tiers = privateGetAccountPositionTiers = Entry('account/position-tiers', 'private', 'GET', {'cost': 2})
150
150
  private_get_account_mmp_config = privateGetAccountMmpConfig = Entry('account/mmp-config', 'private', 'GET', {'cost': 4})
151
+ private_get_account_fixed_loan_borrowing_limit = privateGetAccountFixedLoanBorrowingLimit = Entry('account/fixed-loan/borrowing-limit', 'private', 'GET', {'cost': 4})
152
+ private_get_account_fixed_loan_borrowing_quote = privateGetAccountFixedLoanBorrowingQuote = Entry('account/fixed-loan/borrowing-quote', 'private', 'GET', {'cost': 5})
153
+ private_get_account_fixed_loan_borrowing_orders_list = privateGetAccountFixedLoanBorrowingOrdersList = Entry('account/fixed-loan/borrowing-orders-list', 'private', 'GET', {'cost': 5})
151
154
  private_get_users_subaccount_list = privateGetUsersSubaccountList = Entry('users/subaccount/list', 'private', 'GET', {'cost': 10})
152
155
  private_get_account_subaccount_balances = privateGetAccountSubaccountBalances = Entry('account/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
153
156
  private_get_asset_subaccount_balances = privateGetAssetSubaccountBalances = Entry('asset/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
@@ -259,6 +262,10 @@ class ImplicitAPI:
259
262
  private_post_account_set_account_level = privatePostAccountSetAccountLevel = Entry('account/set-account-level', 'private', 'POST', {'cost': 4})
260
263
  private_post_account_mmp_reset = privatePostAccountMmpReset = Entry('account/mmp-reset', 'private', 'POST', {'cost': 4})
261
264
  private_post_account_mmp_config = privatePostAccountMmpConfig = Entry('account/mmp-config', 'private', 'POST', {'cost': 100})
265
+ private_post_account_fixed_loan_borrowing_order = privatePostAccountFixedLoanBorrowingOrder = Entry('account/fixed-loan/borrowing-order', 'private', 'POST', {'cost': 5})
266
+ private_post_account_fixed_loan_amend_borrowing_order = privatePostAccountFixedLoanAmendBorrowingOrder = Entry('account/fixed-loan/amend-borrowing-order', 'private', 'POST', {'cost': 5})
267
+ private_post_account_fixed_loan_manual_reborrow = privatePostAccountFixedLoanManualReborrow = Entry('account/fixed-loan/manual-reborrow', 'private', 'POST', {'cost': 5})
268
+ private_post_account_fixed_loan_repay_borrowing_order = privatePostAccountFixedLoanRepayBorrowingOrder = Entry('account/fixed-loan/repay-borrowing-order', 'private', 'POST', {'cost': 5})
262
269
  private_post_users_subaccount_modify_apikey = privatePostUsersSubaccountModifyApikey = Entry('users/subaccount/modify-apikey', 'private', 'POST', {'cost': 10})
263
270
  private_post_asset_subaccount_transfer = privatePostAssetSubaccountTransfer = Entry('asset/subaccount/transfer', 'private', 'POST', {'cost': 10})
264
271
  private_post_users_subaccount_set_transfer_out = privatePostUsersSubaccountSetTransferOut = Entry('users/subaccount/set-transfer-out', 'private', 'POST', {'cost': 10})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.40'
7
+ __version__ = '4.3.42'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.40'
5
+ __version__ = '4.3.42'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -260,6 +260,9 @@ class binance(Exchange, ImplicitAPI):
260
260
  # UID(sapi) request rate limit of 180 000 per minute
261
261
  # 1 UID(sapi) => cost = 0.006667 =>(1000 / (50 * 0.006667)) * 60 = 180000
262
262
  'get': {
263
+ # copy trading
264
+ 'copyTrading/futures/userStatus': 2,
265
+ 'copyTrading/futures/leadSymbol': 2,
263
266
  'system/status': 0.1,
264
267
  # these endpoints require self.apiKey
265
268
  'accountSnapshot': 240, # Weight(IP): 2400 => cost = 0.1 * 2400 = 240
@@ -1655,7 +1655,7 @@ class bitfinex2(Exchange, ImplicitAPI):
1655
1655
  raise ExchangeError(self.id + ' ' + response[6] + ': ' + errorText + '(#' + errorCode + ')')
1656
1656
  orders = self.safe_list(response, 4, [])
1657
1657
  order = self.safe_list(orders, 0)
1658
- return self.parse_order(order, market)
1658
+ return self.parse_order(self.extend({'result': order}), market)
1659
1659
 
1660
1660
  async def create_orders(self, orders: List[OrderRequest], params={}):
1661
1661
  """
@@ -924,7 +924,15 @@ class bithumb(Exchange, ImplicitAPI):
924
924
  'order_currency': market['base'],
925
925
  'payment_currency': market['quote'],
926
926
  }
927
- return await self.privatePostTradeCancel(self.extend(request, params))
927
+ response = await self.privatePostTradeCancel(self.extend(request, params))
928
+ #
929
+ # {
930
+ # 'status': 'string',
931
+ # }
932
+ #
933
+ return self.safe_order({
934
+ 'info': response,
935
+ })
928
936
 
929
937
  async def cancel_unified_order(self, order, params={}):
930
938
  request: dict = {
@@ -1126,27 +1126,46 @@ class bitmart(Exchange, ImplicitAPI):
1126
1126
 
1127
1127
  def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
1128
1128
  #
1129
- # spot(REST)
1129
+ # spot(REST) fetchTickers
1130
1130
  #
1131
- # {
1132
- # "symbol": "SOLAR_USDT",
1133
- # "last_price": "0.020342",
1134
- # "quote_volume_24h": "56817.811802",
1135
- # "base_volume_24h": "2172060",
1136
- # "high_24h": "0.256000",
1137
- # "low_24h": "0.016980",
1138
- # "open_24h": "0.022309",
1139
- # "close_24h": "0.020342",
1140
- # "best_ask": "0.020389",
1141
- # "best_ask_size": "339.000000000000000000000000000000",
1142
- # "best_bid": "0.020342",
1143
- # "best_bid_size": "3369.000000000000000000000000000000",
1144
- # "fluctuation": "-0.0882",
1145
- # "url": "https://www.bitmart.com/trade?symbol=SOLAR_USDT",
1146
- # "timestamp": 1667403439367
1147
- # }
1131
+ # {
1132
+ # 'result': [
1133
+ # "AFIN_USDT", # symbol
1134
+ # "0.001047", # last
1135
+ # "11110", # v_24h
1136
+ # "11.632170", # qv_24h
1137
+ # "0.001048", # open_24h
1138
+ # "0.001048", # high_24h
1139
+ # "0.001047", # low_24h
1140
+ # "-0.00095", # price_change_24h
1141
+ # "0.001029", # bid_px
1142
+ # "5555", # bid_sz
1143
+ # "0.001041", # ask_px
1144
+ # "5297", # ask_sz
1145
+ # "1717122550482" # timestamp
1146
+ # ]
1147
+ # }
1148
+ #
1149
+ # spot(REST) fetchTicker
1150
+ #
1151
+ # {
1152
+ # "symbol": "BTC_USDT",
1153
+ # "last": "68500.00",
1154
+ # "v_24h": "10491.65490",
1155
+ # "qv_24h": "717178990.42",
1156
+ # "open_24h": "68149.75",
1157
+ # "high_24h": "69499.99",
1158
+ # "low_24h": "67132.40",
1159
+ # "fluctuation": "0.00514",
1160
+ # "bid_px": "68500",
1161
+ # "bid_sz": "0.00162",
1162
+ # "ask_px": "68500.01",
1163
+ # "ask_sz": "0.01722",
1164
+ # "ts": "1717131391671"
1165
+ # }
1148
1166
  #
1149
1167
  # spot(WS)
1168
+ #
1150
1169
  # {
1151
1170
  # "symbol":"BTC_USDT",
1152
1171
  # "last_price":"146.24",
@@ -1172,19 +1191,44 @@ class bitmart(Exchange, ImplicitAPI):
1172
1191
  # "legal_coin_price":"0.1302699"
1173
1192
  # }
1174
1193
  #
1175
- timestamp = self.safe_integer(ticker, 'timestamp')
1176
- if timestamp is None:
1177
- # ticker from WS has a different field(in seconds)
1178
- timestamp = self.safe_integer_product(ticker, 's_t', 1000)
1194
+ result = self.safe_list(ticker, 'result', [])
1195
+ average = self.safe_string_2(ticker, 'avg_price', 'index_price')
1179
1196
  marketId = self.safe_string_2(ticker, 'symbol', 'contract_symbol')
1197
+ timestamp = self.safe_integer_2(ticker, 'timestamp', 'ts')
1198
+ last = self.safe_string_2(ticker, 'last_price', 'last')
1199
+ percentage = self.safe_string(ticker, 'price_change_percent_24h')
1200
+ change = self.safe_string(ticker, 'fluctuation')
1201
+ high = self.safe_string_2(ticker, 'high_24h', 'high_price')
1202
+ low = self.safe_string_2(ticker, 'low_24h', 'low_price')
1203
+ bid = self.safe_string_2(ticker, 'best_bid', 'bid_px')
1204
+ bidVolume = self.safe_string_2(ticker, 'best_bid_size', 'bid_sz')
1205
+ ask = self.safe_string_2(ticker, 'best_ask', 'ask_px')
1206
+ askVolume = self.safe_string_2(ticker, 'best_ask_size', 'ask_sz')
1207
+ open = self.safe_string(ticker, 'open_24h')
1208
+ baseVolume = self.safe_string_2(ticker, 'base_volume_24h', 'v_24h')
1209
+ quoteVolume = self.safe_string_lower_2(ticker, 'quote_volume_24h', 'qv_24h')
1210
+ listMarketId = self.safe_string(result, 0)
1211
+ if listMarketId is not None:
1212
+ marketId = listMarketId
1213
+ timestamp = self.safe_integer(result, 12)
1214
+ high = self.safe_string(result, 5)
1215
+ low = self.safe_string(result, 6)
1216
+ bid = self.safe_string(result, 8)
1217
+ bidVolume = self.safe_string(result, 9)
1218
+ ask = self.safe_string(result, 10)
1219
+ askVolume = self.safe_string(result, 11)
1220
+ open = self.safe_string(result, 4)
1221
+ last = self.safe_string(result, 1)
1222
+ change = self.safe_string(result, 7)
1223
+ baseVolume = self.safe_string(result, 2)
1224
+ quoteVolume = self.safe_string_lower(result, 3)
1180
1225
  market = self.safe_market(marketId, market)
1181
1226
  symbol = market['symbol']
1182
- last = self.safe_string_2(ticker, 'close_24h', 'last_price')
1183
- percentage = self.safe_string(ticker, 'price_change_percent_24h')
1227
+ if timestamp is None:
1228
+ # ticker from WS has a different field(in seconds)
1229
+ timestamp = self.safe_integer_product(ticker, 's_t', 1000)
1184
1230
  if percentage is None:
1185
- percentage = Precise.string_mul(self.safe_string(ticker, 'fluctuation'), '100')
1186
- baseVolume = self.safe_string(ticker, 'base_volume_24h')
1187
- quoteVolume = self.safe_string(ticker, 'quote_volume_24h')
1231
+ percentage = Precise.string_mul(change, '100')
1188
1232
  if quoteVolume is None:
1189
1233
  if baseVolume is None:
1190
1234
  # self is swap
@@ -1194,25 +1238,22 @@ class bitmart(Exchange, ImplicitAPI):
1194
1238
  # contrary to name and documentation, base_volume_24h is actually the quote volume
1195
1239
  quoteVolume = baseVolume
1196
1240
  baseVolume = None
1197
- average = self.safe_string_2(ticker, 'avg_price', 'index_price')
1198
- high = self.safe_string_2(ticker, 'high_24h', 'high_price')
1199
- low = self.safe_string_2(ticker, 'low_24h', 'low_price')
1200
1241
  return self.safe_ticker({
1201
1242
  'symbol': symbol,
1202
1243
  'timestamp': timestamp,
1203
1244
  'datetime': self.iso8601(timestamp),
1204
1245
  'high': high,
1205
1246
  'low': low,
1206
- 'bid': self.safe_string(ticker, 'best_bid'),
1207
- 'bidVolume': self.safe_string(ticker, 'best_bid_size'),
1208
- 'ask': self.safe_string(ticker, 'best_ask'),
1209
- 'askVolume': self.safe_string(ticker, 'best_ask_size'),
1247
+ 'bid': bid,
1248
+ 'bidVolume': bidVolume,
1249
+ 'ask': ask,
1250
+ 'askVolume': askVolume,
1210
1251
  'vwap': None,
1211
- 'open': self.safe_string(ticker, 'open_24h'),
1252
+ 'open': open,
1212
1253
  'close': last,
1213
1254
  'last': last,
1214
1255
  'previousClose': None,
1215
- 'change': None,
1256
+ 'change': change,
1216
1257
  'percentage': percentage,
1217
1258
  'average': average,
1218
1259
  'baseVolume': baseVolume,
@@ -1223,6 +1264,7 @@ class bitmart(Exchange, ImplicitAPI):
1223
1264
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
1224
1265
  """
1225
1266
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1267
+ :see: https://developer-pro.bitmart.com/en/spot/#get-ticker-of-a-trading-pair-v3
1226
1268
  :param str symbol: unified symbol of the market to fetch the ticker for
1227
1269
  :param dict [params]: extra parameters specific to the exchange API endpoint
1228
1270
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -1234,79 +1276,73 @@ class bitmart(Exchange, ImplicitAPI):
1234
1276
  if market['swap']:
1235
1277
  request['contract_symbol'] = market['id']
1236
1278
  response = await self.publicGetContractV1Tickers(self.extend(request, params))
1279
+ #
1280
+ # {
1281
+ # "message":"OK",
1282
+ # "code":1000,
1283
+ # "trace":"4a0ebceb-d3f7-45a3-8feb-f61e230e24cd",
1284
+ # "data":{
1285
+ # "tickers":[
1286
+ # {
1287
+ # "contract_symbol":"DOGEUSDT",
1288
+ # "last_price":"0.130180",
1289
+ # "index_price":"0.13028635",
1290
+ # "last_funding_rate":"0.00002025",
1291
+ # "price_change_percent_24h":"-2.326",
1292
+ # "volume_24h":"116789313.01797258",
1293
+ # "url":"https://futures.bitmart.com/en?symbol=DOGEUSDT",
1294
+ # "high_price":"0.134520",
1295
+ # "low_price":"0.128570",
1296
+ # "legal_coin_price":"0.13017401"
1297
+ # }
1298
+ # ]
1299
+ # }
1300
+ # }
1301
+ #
1237
1302
  elif market['spot']:
1238
1303
  request['symbol'] = market['id']
1239
- response = await self.publicGetSpotV1Ticker(self.extend(request, params))
1304
+ response = await self.publicGetSpotQuotationV3Ticker(self.extend(request, params))
1305
+ #
1306
+ # {
1307
+ # "code": 1000,
1308
+ # "trace": "f2194c2c202d2.99.1717535",
1309
+ # "message": "success",
1310
+ # "data": {
1311
+ # "symbol": "BTC_USDT",
1312
+ # "last": "68500.00",
1313
+ # "v_24h": "10491.65490",
1314
+ # "qv_24h": "717178990.42",
1315
+ # "open_24h": "68149.75",
1316
+ # "high_24h": "69499.99",
1317
+ # "low_24h": "67132.40",
1318
+ # "fluctuation": "0.00514",
1319
+ # "bid_px": "68500",
1320
+ # "bid_sz": "0.00162",
1321
+ # "ask_px": "68500.01",
1322
+ # "ask_sz": "0.01722",
1323
+ # "ts": "1717131391671"
1324
+ # }
1325
+ # }
1326
+ #
1240
1327
  else:
1241
1328
  raise NotSupported(self.id + ' fetchTicker() does not support ' + market['type'] + ' markets, only spot and swap markets are accepted')
1242
- #
1243
- # spot
1244
- #
1245
- # {
1246
- # "message":"OK",
1247
- # "code":1000,
1248
- # "trace":"6aa5b923-2f57-46e3-876d-feca190e0b82",
1249
- # "data":{
1250
- # "tickers":[
1251
- # {
1252
- # "symbol":"ETH_BTC",
1253
- # "last_price":"0.036037",
1254
- # "quote_volume_24h":"4380.6660000000",
1255
- # "base_volume_24h":"159.3582006712",
1256
- # "high_24h":"0.036972",
1257
- # "low_24h":"0.035524",
1258
- # "open_24h":"0.036561",
1259
- # "close_24h":"0.036037",
1260
- # "best_ask":"0.036077",
1261
- # "best_ask_size":"9.9500",
1262
- # "best_bid":"0.035983",
1263
- # "best_bid_size":"4.2792",
1264
- # "fluctuation":"-0.0143",
1265
- # "url":"https://www.bitmart.com/trade?symbol=ETH_BTC"
1266
- # }
1267
- # ]
1268
- # }
1269
- # }
1270
- #
1271
- # swap
1272
- #
1273
- # {
1274
- # "message":"OK",
1275
- # "code":1000,
1276
- # "trace":"4a0ebceb-d3f7-45a3-8feb-f61e230e24cd",
1277
- # "data":{
1278
- # "tickers":[
1279
- # {
1280
- # "contract_symbol":"DOGEUSDT",
1281
- # "last_price":"0.130180",
1282
- # "index_price":"0.13028635",
1283
- # "last_funding_rate":"0.00002025",
1284
- # "price_change_percent_24h":"-2.326",
1285
- # "volume_24h":"116789313.01797258",
1286
- # "url":"https://futures.bitmart.com/en?symbol=DOGEUSDT",
1287
- # "high_price":"0.134520",
1288
- # "low_price":"0.128570",
1289
- # "legal_coin_price":"0.13017401"
1290
- # }
1291
- # ]
1292
- # }
1293
- # }
1294
- #
1295
- data = self.safe_value(response, 'data', {})
1296
- tickers = self.safe_value(data, 'tickers', [])
1297
1329
  # fails in naming for contract tickers 'contract_symbol'
1298
1330
  tickersById = None
1331
+ tickers = []
1332
+ ticker: dict = {}
1299
1333
  if market['spot']:
1300
- tickersById = self.index_by(tickers, 'symbol')
1301
- elif market['swap']:
1334
+ ticker = self.safe_dict(response, 'data', {})
1335
+ else:
1336
+ data = self.safe_dict(response, 'data', {})
1337
+ tickers = self.safe_list(data, 'tickers', [])
1302
1338
  tickersById = self.index_by(tickers, 'contract_symbol')
1303
- ticker = self.safe_dict(tickersById, market['id'])
1339
+ ticker = self.safe_dict(tickersById, market['id'])
1304
1340
  return self.parse_ticker(ticker, market)
1305
1341
 
1306
1342
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
1307
1343
  """
1308
1344
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1309
- :see: https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v2
1345
+ :see: https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v3
1310
1346
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1311
1347
  :param dict [params]: extra parameters specific to the exchange API endpoint
1312
1348
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -1321,16 +1357,71 @@ class bitmart(Exchange, ImplicitAPI):
1321
1357
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
1322
1358
  response = None
1323
1359
  if type == 'spot':
1324
- response = await self.publicGetSpotV2Ticker(params)
1360
+ response = await self.publicGetSpotQuotationV3Tickers(params)
1361
+ #
1362
+ # {
1363
+ # "code": 1000,
1364
+ # "trace": "17c5e5d9ac49f9b71efca2bed55f1a.105.171225637482393",
1365
+ # "message": "success",
1366
+ # "data": [
1367
+ # [
1368
+ # "AFIN_USDT",
1369
+ # "0.001047",
1370
+ # "11110",
1371
+ # "11.632170",
1372
+ # "0.001048",
1373
+ # "0.001048",
1374
+ # "0.001047",
1375
+ # "-0.00095",
1376
+ # "0.001029",
1377
+ # "5555",
1378
+ # "0.001041",
1379
+ # "5297",
1380
+ # "1717122550482"
1381
+ # ],
1382
+ # ]
1383
+ # }
1384
+ #
1325
1385
  elif type == 'swap':
1326
1386
  response = await self.publicGetContractV1Tickers(params)
1387
+ #
1388
+ # {
1389
+ # "message": "OK",
1390
+ # "code": 1000,
1391
+ # "trace": "c1dec681c24ea5d.105.171712565",
1392
+ # "data": {
1393
+ # "tickers": [
1394
+ # {
1395
+ # "contract_symbol": "SNTUSDT",
1396
+ # "last_price": "0.0366600",
1397
+ # "index_price": "0.03587373",
1398
+ # "last_funding_rate": "0.00005000",
1399
+ # "price_change_percent_24h": "-2.629",
1400
+ # "volume_24h": "10102540.19909109848",
1401
+ # "url": "https://futures.bitmart.com/en?symbol=SNTUSDT",
1402
+ # "high_price": "0.0405600",
1403
+ # "low_price": "0.0355000",
1404
+ # "legal_coin_price": "0.03666697"
1405
+ # },
1406
+ # ]
1407
+ # }
1408
+ # }
1409
+ #
1327
1410
  else:
1328
1411
  raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets, only spot and swap markets are accepted')
1329
- data = self.safe_value(response, 'data', {})
1330
- tickers = self.safe_value(data, 'tickers', [])
1412
+ tickers = []
1413
+ if type == 'spot':
1414
+ tickers = self.safe_list(response, 'data', [])
1415
+ else:
1416
+ data = self.safe_dict(response, 'data', {})
1417
+ tickers = self.safe_list(data, 'tickers', [])
1331
1418
  result: dict = {}
1332
1419
  for i in range(0, len(tickers)):
1333
- ticker = self.parse_ticker(tickers[i])
1420
+ ticker: dict = {}
1421
+ if type == 'spot':
1422
+ ticker = self.parse_ticker({'result': tickers[i]})
1423
+ else:
1424
+ ticker = self.parse_ticker(tickers[i])
1334
1425
  symbol = ticker['symbol']
1335
1426
  result[symbol] = ticker
1336
1427
  return self.filter_by_array_tickers(result, 'symbol', symbols)
@@ -1376,7 +1376,17 @@ class bitstamp(Exchange, ImplicitAPI):
1376
1376
  request: dict = {
1377
1377
  'id': id,
1378
1378
  }
1379
- return await self.privatePostCancelOrder(self.extend(request, params))
1379
+ response = await self.privatePostCancelOrder(self.extend(request, params))
1380
+ #
1381
+ # {
1382
+ # "id": 1453282316578816,
1383
+ # "amount": "0.02035278",
1384
+ # "price": "2100.45",
1385
+ # "type": 0,
1386
+ # "market": "BTC/USD"
1387
+ # }
1388
+ #
1389
+ return self.parse_order(response)
1380
1390
 
1381
1391
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1382
1392
  """
@@ -1397,7 +1407,23 @@ class bitstamp(Exchange, ImplicitAPI):
1397
1407
  response = await self.privatePostCancelAllOrdersPair(self.extend(request, params))
1398
1408
  else:
1399
1409
  response = await self.privatePostCancelAllOrders(self.extend(request, params))
1400
- return response
1410
+ #
1411
+ # {
1412
+ # "canceled": [
1413
+ # {
1414
+ # "id": 1453282316578816,
1415
+ # "amount": "0.02035278",
1416
+ # "price": "2100.45",
1417
+ # "type": 0,
1418
+ # "currency_pair": "BTC/USD",
1419
+ # "market": "BTC/USD"
1420
+ # }
1421
+ # ],
1422
+ # "success": True
1423
+ # }
1424
+ #
1425
+ canceled = self.safe_list(response, 'canceled')
1426
+ return self.parse_orders(canceled)
1401
1427
 
1402
1428
  def parse_order_status(self, status: Str):
1403
1429
  statuses: dict = {
@@ -1743,6 +1769,16 @@ class bitstamp(Exchange, ImplicitAPI):
1743
1769
  # "id": "2814205012"
1744
1770
  # }
1745
1771
  #
1772
+ # cancelOrder
1773
+ #
1774
+ # {
1775
+ # "id": 1453282316578816,
1776
+ # "amount": "0.02035278",
1777
+ # "price": "2100.45",
1778
+ # "type": 0,
1779
+ # "market": "BTC/USD"
1780
+ # }
1781
+ #
1746
1782
  id = self.safe_string(order, 'id')
1747
1783
  clientOrderId = self.safe_string(order, 'client_order_id')
1748
1784
  side = self.safe_string(order, 'type')
@@ -589,15 +589,15 @@ class blockchaincom(Exchange, ImplicitAPI):
589
589
  'orderId': id,
590
590
  }
591
591
  response = await self.privateDeleteOrdersOrderId(self.extend(request, params))
592
- return {
592
+ return self.safe_order({
593
593
  'id': id,
594
594
  'info': response,
595
- }
595
+ })
596
596
 
597
597
  async def cancel_all_orders(self, symbol: Str = None, params={}):
598
598
  """
599
599
  cancel all open orders
600
- :see: https://api.blockchain.com/v3/#/trading/deleteAllOrders
600
+ :see: https://api.blockchain.com/v3/#deleteallorders
601
601
  :param str symbol: unified market symbol of the market to cancel orders in, all markets are used if None, default is None
602
602
  :param dict [params]: extra parameters specific to the exchange API endpoint
603
603
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -612,10 +612,14 @@ class blockchaincom(Exchange, ImplicitAPI):
612
612
  marketId = self.market_id(symbol)
613
613
  request['symbol'] = marketId
614
614
  response = await self.privateDeleteOrders(self.extend(request, params))
615
- return {
616
- 'symbol': symbol,
617
- 'info': response,
618
- }
615
+ #
616
+ # {}
617
+ #
618
+ return [
619
+ self.safe_order({
620
+ 'info': response,
621
+ }),
622
+ ]
619
623
 
620
624
  async def fetch_trading_fees(self, params={}) -> TradingFees:
621
625
  """
@@ -5440,7 +5440,7 @@ class coinex(Exchange, ImplicitAPI):
5440
5440
  preparedString += nonce + self.secret
5441
5441
  signature = self.hash(self.encode(preparedString), 'sha256')
5442
5442
  headers = {
5443
- 'Content-Type': 'application/json; charset=utf-8',
5443
+ 'Content-Type': 'application/json',
5444
5444
  'Accept': 'application/json',
5445
5445
  'X-COINEX-KEY': self.apiKey,
5446
5446
  'X-COINEX-SIGN': signature,
@@ -1397,7 +1397,25 @@ class coinlist(Exchange, ImplicitAPI):
1397
1397
  await self.load_markets()
1398
1398
  params = ids
1399
1399
  response = await self.privateDeleteV1OrdersBulk(params)
1400
- return response
1400
+ #
1401
+ # {
1402
+ # "message": "Cancel order requests received.",
1403
+ # "order_ids": [
1404
+ # "ff132955-43bc-4fe5-9d9c-5ba226cc89a0"
1405
+ # ],
1406
+ # "timestamp": "2024-06-01T02:32:30.305Z"
1407
+ # }
1408
+ #
1409
+ orderIds = self.safe_list(response, 'order_ids', [])
1410
+ orders = []
1411
+ datetime = self.safe_string(response, 'timestamp')
1412
+ for i in range(0, len(orderIds)):
1413
+ orders.append(self.safe_order({
1414
+ 'info': orderIds[i],
1415
+ 'id': orderIds[i],
1416
+ 'lastUpdateTimestamp': self.parse8601(datetime),
1417
+ }))
1418
+ return orders
1401
1419
 
1402
1420
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1403
1421
  """