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

ccxt/coinex.py CHANGED
@@ -31,7 +31,7 @@ class coinex(Exchange, ImplicitAPI):
31
31
  return self.deep_extend(super(coinex, self).describe(), {
32
32
  'id': 'coinex',
33
33
  'name': 'CoinEx',
34
- 'version': 'v1',
34
+ 'version': 'v2',
35
35
  'countries': ['CN'],
36
36
  # IP ratelimit is 400 requests per second
37
37
  # rateLimit = 1000ms / 400 = 2.5
@@ -328,6 +328,8 @@ class coinex(Exchange, ImplicitAPI):
328
328
  'futures/position-level': 1,
329
329
  'futures/liquidation-history': 1,
330
330
  'futures/basis-history': 1,
331
+ 'assets/deposit-withdraw-config': 1,
332
+ 'assets/all-deposit-withdraw-config': 1,
331
333
  },
332
334
  },
333
335
  'private': {
@@ -350,7 +352,6 @@ class coinex(Exchange, ImplicitAPI):
350
352
  'assets/deposit-address': 40,
351
353
  'assets/deposit-history': 40,
352
354
  'assets/withdraw': 40,
353
- 'assets/deposit-withdraw-config': 1,
354
355
  'assets/transfer-history': 40,
355
356
  'spot/order-status': 8,
356
357
  'spot/batch-order-status': 8,
@@ -544,126 +545,125 @@ class coinex(Exchange, ImplicitAPI):
544
545
  })
545
546
 
546
547
  def fetch_currencies(self, params={}) -> Currencies:
547
- response = self.v1PublicGetCommonAssetConfig(params)
548
+ """
549
+ fetches all available currencies on an exchange
550
+ :see: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
551
+ :param dict [params]: extra parameters specific to the exchange API endpoint
552
+ :returns dict: an associative dictionary of currencies
553
+ """
554
+ response = self.v2PublicGetAssetsAllDepositWithdrawConfig(params)
555
+ #
548
556
  # {
549
557
  # "code": 0,
550
- # "data": {
551
- # "USDT-ERC20": {
552
- # "asset": "USDT",
553
- # "chain": "ERC20",
554
- # "withdrawal_precision": 6,
555
- # "can_deposit": True,
556
- # "can_withdraw": True,
557
- # "deposit_least_amount": "4.9",
558
- # "withdraw_least_amount": "4.9",
559
- # "withdraw_tx_fee": "4.9",
560
- # "explorer_asset_url": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7"
561
- # },
562
- # ...
563
- # },
564
- # "message": "Success",
558
+ # "data": [
559
+ # {
560
+ # "asset": {
561
+ # "ccy": "CET",
562
+ # "deposit_enabled": True,
563
+ # "withdraw_enabled": True,
564
+ # "inter_transfer_enabled": True,
565
+ # "is_st": False
566
+ # },
567
+ # "chains": [
568
+ # {
569
+ # "chain": "CSC",
570
+ # "min_deposit_amount": "0.8",
571
+ # "min_withdraw_amount": "8",
572
+ # "deposit_enabled": True,
573
+ # "withdraw_enabled": True,
574
+ # "deposit_delay_minutes": 0,
575
+ # "safe_confirmations": 10,
576
+ # "irreversible_confirmations": 20,
577
+ # "deflation_rate": "0",
578
+ # "withdrawal_fee": "0.026",
579
+ # "withdrawal_precision": 8,
580
+ # "memo": "",
581
+ # "is_memo_required_for_deposit": False,
582
+ # "explorer_asset_url": ""
583
+ # },
584
+ # ]
585
+ # }
586
+ # ],
587
+ # "message": "OK"
565
588
  # }
566
589
  #
567
- data = self.safe_value(response, 'data', [])
568
- coins = list(data.keys())
590
+ data = self.safe_list(response, 'data', [])
569
591
  result: dict = {}
570
- for i in range(0, len(coins)):
571
- coin = coins[i]
572
- currency = data[coin]
573
- currencyId = self.safe_string(currency, 'asset')
574
- networkId = self.safe_string(currency, 'chain')
592
+ for i in range(0, len(data)):
593
+ coin = data[i]
594
+ asset = self.safe_dict(coin, 'asset', {})
595
+ chains = self.safe_list(coin, 'chains', [])
596
+ currencyId = self.safe_string(asset, 'ccy')
597
+ if currencyId is None:
598
+ continue # coinex returns empty structures for some reason
575
599
  code = self.safe_currency_code(currencyId)
576
- precisionString = self.parse_precision(self.safe_string(currency, 'withdrawal_precision'))
577
- precision = self.parse_number(precisionString)
578
- canDeposit = self.safe_value(currency, 'can_deposit')
579
- canWithdraw = self.safe_value(currency, 'can_withdraw')
580
- feeString = self.safe_string(currency, 'withdraw_tx_fee')
581
- fee = self.parse_number(feeString)
582
- minNetworkDepositString = self.safe_string(currency, 'deposit_least_amount')
583
- minNetworkDeposit = self.parse_number(minNetworkDepositString)
584
- minNetworkWithdrawString = self.safe_string(currency, 'withdraw_least_amount')
585
- minNetworkWithdraw = self.parse_number(minNetworkWithdrawString)
586
- if self.safe_value(result, code) is None:
587
- result[code] = {
588
- 'id': currencyId,
589
- 'numericId': None,
590
- 'code': code,
591
- 'info': None,
592
- 'name': None,
593
- 'active': canDeposit and canWithdraw,
594
- 'deposit': canDeposit,
595
- 'withdraw': canWithdraw,
596
- 'fee': fee,
597
- 'precision': precision,
598
- 'limits': {
599
- 'amount': {
600
- 'min': None,
601
- 'max': None,
602
- },
603
- 'deposit': {
604
- 'min': minNetworkDeposit,
605
- 'max': None,
606
- },
607
- 'withdraw': {
608
- 'min': minNetworkWithdraw,
609
- 'max': None,
610
- },
611
- },
612
- }
613
- minFeeString = self.safe_string(result[code], 'fee')
614
- if feeString is not None:
615
- minFeeString = feeString if (minFeeString is None) else Precise.string_min(feeString, minFeeString)
616
- depositAvailable = self.safe_value(result[code], 'deposit')
617
- depositAvailable = canDeposit if (canDeposit) else depositAvailable
618
- withdrawAvailable = self.safe_value(result[code], 'withdraw')
619
- withdrawAvailable = canWithdraw if (canWithdraw) else withdrawAvailable
620
- minDepositString = self.safe_string(result[code]['limits']['deposit'], 'min')
621
- if minNetworkDepositString is not None:
622
- minDepositString = minNetworkDepositString if (minDepositString is None) else Precise.string_min(minNetworkDepositString, minDepositString)
623
- minWithdrawString = self.safe_string(result[code]['limits']['withdraw'], 'min')
624
- if minNetworkWithdrawString is not None:
625
- minWithdrawString = minNetworkWithdrawString if (minWithdrawString is None) else Precise.string_min(minNetworkWithdrawString, minWithdrawString)
626
- minPrecisionString = self.safe_string(result[code], 'precision')
627
- if precisionString is not None:
628
- minPrecisionString = precisionString if (minPrecisionString is None) else Precise.string_min(precisionString, minPrecisionString)
629
- networks = self.safe_value(result[code], 'networks', {})
630
- network: dict = {
631
- 'info': currency,
632
- 'id': networkId,
633
- 'network': networkId,
600
+ canDeposit = self.safe_bool(asset, 'deposit_enabled')
601
+ canWithdraw = self.safe_bool(asset, 'withdraw_enabled')
602
+ firstChain = self.safe_dict(chains, 0, {})
603
+ firstPrecisionString = self.parse_precision(self.safe_string(firstChain, 'withdrawal_precision'))
604
+ result[code] = {
605
+ 'id': currencyId,
606
+ 'code': code,
634
607
  'name': None,
608
+ 'active': canDeposit and canWithdraw,
609
+ 'deposit': canDeposit,
610
+ 'withdraw': canWithdraw,
611
+ 'fee': None,
612
+ 'precision': self.parse_number(firstPrecisionString),
635
613
  'limits': {
636
614
  'amount': {
637
615
  'min': None,
638
616
  'max': None,
639
617
  },
640
618
  'deposit': {
641
- 'min': self.safe_number(currency, 'deposit_least_amount'),
619
+ 'min': None,
642
620
  'max': None,
643
621
  },
644
622
  'withdraw': {
645
- 'min': self.safe_number(currency, 'withdraw_least_amount'),
623
+ 'min': None,
646
624
  'max': None,
647
625
  },
648
626
  },
649
- 'active': canDeposit and canWithdraw,
650
- 'deposit': canDeposit,
651
- 'withdraw': canWithdraw,
652
- 'fee': fee,
653
- 'precision': precision,
627
+ 'networks': {},
628
+ 'info': coin,
654
629
  }
655
- networks[networkId] = network
656
- result[code]['networks'] = networks
657
- result[code]['active'] = depositAvailable and withdrawAvailable
658
- result[code]['deposit'] = depositAvailable
659
- result[code]['withdraw'] = withdrawAvailable
660
- info = self.safe_value(result[code], 'info', [])
661
- info.append(currency)
662
- result[code]['info'] = info
663
- result[code]['fee'] = self.parse_number(minFeeString)
664
- result[code]['precision'] = self.parse_number(minPrecisionString)
665
- result[code]['limits']['deposit']['min'] = self.parse_number(minDepositString)
666
- result[code]['limits']['withdraw']['min'] = self.parse_number(minWithdrawString)
630
+ for j in range(0, len(chains)):
631
+ chain = chains[j]
632
+ networkId = self.safe_string(chain, 'chain')
633
+ precisionString = self.parse_precision(self.safe_string(chain, 'withdrawal_precision'))
634
+ feeString = self.safe_string(chain, 'withdrawal_fee')
635
+ minNetworkDepositString = self.safe_string(chain, 'min_deposit_amount')
636
+ minNetworkWithdrawString = self.safe_string(chain, 'min_withdraw_amount')
637
+ canDepositChain = self.safe_bool(chain, 'deposit_enabled')
638
+ canWithdrawChain = self.safe_bool(chain, 'withdraw_enabled')
639
+ network: dict = {
640
+ 'id': networkId,
641
+ 'network': networkId,
642
+ 'name': None,
643
+ 'active': canDepositChain and canWithdrawChain,
644
+ 'deposit': canDepositChain,
645
+ 'withdraw': canWithdrawChain,
646
+ 'fee': self.parse_number(feeString),
647
+ 'precision': self.parse_number(precisionString),
648
+ 'limits': {
649
+ 'amount': {
650
+ 'min': None,
651
+ 'max': None,
652
+ },
653
+ 'deposit': {
654
+ 'min': self.parse_number(minNetworkDepositString),
655
+ 'max': None,
656
+ },
657
+ 'withdraw': {
658
+ 'min': self.parse_number(minNetworkWithdrawString),
659
+ 'max': None,
660
+ },
661
+ },
662
+ 'info': chain,
663
+ }
664
+ networks = self.safe_dict(result[code], 'networks', {})
665
+ networks[networkId] = network
666
+ result[code]['networks'] = networks
667
667
  return result
668
668
 
669
669
  def fetch_markets(self, params={}) -> List[Market]:
@@ -5107,7 +5107,7 @@ class coinex(Exchange, ImplicitAPI):
5107
5107
  request: dict = {
5108
5108
  'ccy': currency['id'],
5109
5109
  }
5110
- response = self.v2PrivateGetAssetsDepositWithdrawConfig(self.extend(request, params))
5110
+ response = self.v2PublicGetAssetsDepositWithdrawConfig(self.extend(request, params))
5111
5111
  #
5112
5112
  # {
5113
5113
  # "code": 0,
@@ -5439,7 +5439,7 @@ class coinex(Exchange, ImplicitAPI):
5439
5439
  preparedString += nonce + self.secret
5440
5440
  signature = self.hash(self.encode(preparedString), 'sha256')
5441
5441
  headers = {
5442
- 'Content-Type': 'application/json; charset=utf-8',
5442
+ 'Content-Type': 'application/json',
5443
5443
  'Accept': 'application/json',
5444
5444
  'X-COINEX-KEY': self.apiKey,
5445
5445
  'X-COINEX-SIGN': signature,
ccxt/kraken.py CHANGED
@@ -2008,12 +2008,22 @@ class kraken(Exchange, ImplicitAPI):
2008
2008
  params = self.omit(params, ['userref', 'clientOrderId'])
2009
2009
  try:
2010
2010
  response = self.privatePostCancelOrder(self.extend(request, params))
2011
+ #
2012
+ # {
2013
+ # error: [],
2014
+ # result: {
2015
+ # count: '1'
2016
+ # }
2017
+ # }
2018
+ #
2011
2019
  except Exception as e:
2012
2020
  if self.last_http_response:
2013
2021
  if self.last_http_response.find('EOrder:Unknown order') >= 0:
2014
2022
  raise OrderNotFound(self.id + ' cancelOrder() error ' + self.last_http_response)
2015
2023
  raise e
2016
- return response
2024
+ return self.safe_order({
2025
+ 'info': response,
2026
+ })
2017
2027
 
2018
2028
  def cancel_orders(self, ids, symbol: Str = None, params={}):
2019
2029
  """
@@ -2036,7 +2046,11 @@ class kraken(Exchange, ImplicitAPI):
2036
2046
  # }
2037
2047
  # }
2038
2048
  #
2039
- return response
2049
+ return [
2050
+ self.safe_order({
2051
+ 'info': response,
2052
+ }),
2053
+ ]
2040
2054
 
2041
2055
  def cancel_all_orders(self, symbol: Str = None, params={}):
2042
2056
  """
@@ -2047,7 +2061,20 @@ class kraken(Exchange, ImplicitAPI):
2047
2061
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2048
2062
  """
2049
2063
  self.load_markets()
2050
- return self.privatePostCancelAll(params)
2064
+ response = self.privatePostCancelAll(params)
2065
+ #
2066
+ # {
2067
+ # error: [],
2068
+ # result: {
2069
+ # count: '1'
2070
+ # }
2071
+ # }
2072
+ #
2073
+ return [
2074
+ self.safe_order({
2075
+ 'info': response,
2076
+ }),
2077
+ ]
2051
2078
 
2052
2079
  def cancel_all_orders_after(self, timeout: Int, params={}):
2053
2080
  """
ccxt/krakenfutures.py CHANGED
@@ -1207,7 +1207,45 @@ class krakenfutures(Exchange, ImplicitAPI):
1207
1207
  if symbol is not None:
1208
1208
  request['symbol'] = self.market_id(symbol)
1209
1209
  response = self.privatePostCancelallorders(self.extend(request, params))
1210
- return response
1210
+ #
1211
+ # {
1212
+ # result: 'success',
1213
+ # cancelStatus: {
1214
+ # receivedTime: '2024-06-06T01:12:44.814Z',
1215
+ # cancelOnly: 'PF_XRPUSD',
1216
+ # status: 'cancelled',
1217
+ # cancelledOrders: [{order_id: '272fd0ac-45c0-4003-b84d-d39b9e86bd36'}],
1218
+ # orderEvents: [
1219
+ # {
1220
+ # uid: '272fd0ac-45c0-4003-b84d-d39b9e86bd36',
1221
+ # order: {
1222
+ # orderId: '272fd0ac-45c0-4003-b84d-d39b9e86bd36',
1223
+ # cliOrdId: null,
1224
+ # type: 'lmt',
1225
+ # symbol: 'PF_XRPUSD',
1226
+ # side: 'buy',
1227
+ # quantity: '10',
1228
+ # filled: '0',
1229
+ # limitPrice: '0.4',
1230
+ # reduceOnly: False,
1231
+ # timestamp: '2024-06-06T01:11:16.045Z',
1232
+ # lastUpdateTimestamp: '2024-06-06T01:11:16.045Z'
1233
+ # },
1234
+ # type: 'CANCEL'
1235
+ # }
1236
+ # ]
1237
+ # },
1238
+ # serverTime: '2024-06-06T01:12:44.814Z'
1239
+ # }
1240
+ #
1241
+ cancelStatus = self.safe_dict(response, 'cancelStatus')
1242
+ orderEvents = self.safe_list(cancelStatus, 'orderEvents', [])
1243
+ orders = []
1244
+ for i in range(0, len(orderEvents)):
1245
+ orderEvent = self.safe_dict(orderEvents, 0)
1246
+ order = self.safe_dict(orderEvent, 'order', {})
1247
+ orders.append(order)
1248
+ return self.parse_orders(orders)
1211
1249
 
1212
1250
  def cancel_all_orders_after(self, timeout: Int, params={}):
1213
1251
  """
@@ -1551,6 +1589,22 @@ class krakenfutures(Exchange, ImplicitAPI):
1551
1589
  # ]
1552
1590
  # }
1553
1591
  #
1592
+ # cancelAllOrders
1593
+ #
1594
+ # {
1595
+ # "orderId": "85c40002-3f20-4e87-9302-262626c3531b",
1596
+ # "cliOrdId": null,
1597
+ # "type": "lmt",
1598
+ # "symbol": "pi_xbtusd",
1599
+ # "side": "buy",
1600
+ # "quantity": 1000,
1601
+ # "filled": 0,
1602
+ # "limitPrice": 10144,
1603
+ # "stopPrice": null,
1604
+ # "reduceOnly": False,
1605
+ # "timestamp": "2019-08-01T15:26:27.790Z"
1606
+ # }
1607
+ #
1554
1608
  # FETCH OPEN ORDERS
1555
1609
  #
1556
1610
  # {
ccxt/kucoin.py CHANGED
@@ -2237,19 +2237,76 @@ class kucoin(Exchange, ImplicitAPI):
2237
2237
  request['clientOid'] = clientOrderId
2238
2238
  if stop:
2239
2239
  response = self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
2240
+ #
2241
+ # {
2242
+ # code: '200000',
2243
+ # data: {
2244
+ # cancelledOrderId: 'vs8lgpiuao41iaft003khbbk',
2245
+ # clientOid: '123456'
2246
+ # }
2247
+ # }
2248
+ #
2240
2249
  elif hf:
2241
2250
  response = self.privateDeleteHfOrdersClientOrderClientOid(self.extend(request, params))
2251
+ #
2252
+ # {
2253
+ # "code": "200000",
2254
+ # "data": {
2255
+ # "clientOid": "6d539dc614db3"
2256
+ # }
2257
+ # }
2258
+ #
2242
2259
  else:
2243
2260
  response = self.privateDeleteOrderClientOrderClientOid(self.extend(request, params))
2261
+ #
2262
+ # {
2263
+ # code: '200000',
2264
+ # data: {
2265
+ # cancelledOrderId: '665e580f6660500007aba341',
2266
+ # clientOid: '1234567',
2267
+ # cancelledOcoOrderIds: null
2268
+ # }
2269
+ # }
2270
+ #
2271
+ response = self.safe_dict(response, 'data')
2272
+ return self.parse_order(response)
2244
2273
  else:
2245
2274
  request['orderId'] = id
2246
2275
  if stop:
2247
2276
  response = self.privateDeleteStopOrderOrderId(self.extend(request, params))
2277
+ #
2278
+ # {
2279
+ # code: '200000',
2280
+ # data: {cancelledOrderIds: ['vs8lgpiuaco91qk8003vebu9']}
2281
+ # }
2282
+ #
2248
2283
  elif hf:
2249
2284
  response = self.privateDeleteHfOrdersOrderId(self.extend(request, params))
2285
+ #
2286
+ # {
2287
+ # "code": "200000",
2288
+ # "data": {
2289
+ # "orderId": "630625dbd9180300014c8d52"
2290
+ # }
2291
+ # }
2292
+ #
2293
+ response = self.safe_dict(response, 'data')
2294
+ return self.parse_order(response)
2250
2295
  else:
2251
2296
  response = self.privateDeleteOrdersOrderId(self.extend(request, params))
2252
- return response
2297
+ #
2298
+ # {
2299
+ # code: '200000',
2300
+ # data: {cancelledOrderIds: ['665e4fbe28051a0007245c41']}
2301
+ # }
2302
+ #
2303
+ data = self.safe_dict(response, 'data')
2304
+ orderIds = self.safe_list(data, 'cancelledOrderIds', [])
2305
+ orderId = self.safe_string(orderIds, 0)
2306
+ return self.safe_order({
2307
+ 'info': data,
2308
+ 'id': orderId,
2309
+ })
2253
2310
 
2254
2311
  def cancel_all_orders(self, symbol: Str = None, params={}):
2255
2312
  """
@@ -2663,7 +2720,7 @@ class kucoin(Exchange, ImplicitAPI):
2663
2720
  stopPrice = self.safe_number(order, 'stopPrice')
2664
2721
  return self.safe_order({
2665
2722
  'info': order,
2666
- 'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId']),
2723
+ 'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId', 'cancelledOrderId']),
2667
2724
  'clientOrderId': self.safe_string(order, 'clientOid'),
2668
2725
  'symbol': self.safe_symbol(marketId, market, '-'),
2669
2726
  'type': self.safe_string(order, 'type'),
ccxt/phemex.py CHANGED
@@ -21,7 +21,6 @@ from ccxt.base.errors import InvalidOrder
21
21
  from ccxt.base.errors import OrderNotFound
22
22
  from ccxt.base.errors import CancelPending
23
23
  from ccxt.base.errors import DuplicateOrderId
24
- from ccxt.base.errors import NotSupported
25
24
  from ccxt.base.errors import DDoSProtection
26
25
  from ccxt.base.errors import RateLimitExceeded
27
26
  from ccxt.base.decimal_to_precision import TICK_SIZE
@@ -2772,6 +2771,7 @@ class phemex(Exchange, ImplicitAPI):
2772
2771
 
2773
2772
  def fetch_order(self, id: str, symbol: Str = None, params={}):
2774
2773
  """
2774
+ :see: https://phemex-docs.github.io/#query-orders-by-ids
2775
2775
  fetches information on an order made by the user
2776
2776
  :param str symbol: unified symbol of the market the order was made in
2777
2777
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -2781,8 +2781,6 @@ class phemex(Exchange, ImplicitAPI):
2781
2781
  raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
2782
2782
  self.load_markets()
2783
2783
  market = self.market(symbol)
2784
- if market['settle'] == 'USDT':
2785
- raise NotSupported(self.id + 'fetchOrder() is not supported yet for USDT settled swap markets') # https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-user-order-by-orderid-or-query-user-order-by-client-order-id
2786
2784
  request: dict = {
2787
2785
  'symbol': market['id'],
2788
2786
  }
@@ -2793,7 +2791,9 @@ class phemex(Exchange, ImplicitAPI):
2793
2791
  else:
2794
2792
  request['orderID'] = id
2795
2793
  response = None
2796
- if market['spot']:
2794
+ if market['settle'] == 'USDT':
2795
+ response = self.privateGetApiDataGFuturesOrdersByOrderId(self.extend(request, params))
2796
+ elif market['spot']:
2797
2797
  response = self.privateGetSpotOrdersActive(self.extend(request, params))
2798
2798
  else:
2799
2799
  response = self.privateGetExchangeOrder(self.extend(request, params))
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.41'
7
+ __version__ = '4.3.43'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/bitget.py CHANGED
@@ -961,6 +961,7 @@ class bitget(ccxt.async_support.bitget):
961
961
  marginMode, params = self.handle_margin_mode_and_params('watchOrders', params)
962
962
  if marginMode is not None:
963
963
  instType = 'MARGIN'
964
+ messageHash = messageHash + ':' + marginMode
964
965
  if marginMode == 'isolated':
965
966
  channel = 'orders-isolated'
966
967
  else:
@@ -1046,6 +1047,10 @@ class bitget(ccxt.async_support.bitget):
1046
1047
  for i in range(0, len(keys)):
1047
1048
  symbol = keys[i]
1048
1049
  innerMessageHash = messageHash + ':' + symbol
1050
+ if channel == 'orders-crossed':
1051
+ innerMessageHash = innerMessageHash + ':cross'
1052
+ elif channel == 'orders-isolated':
1053
+ innerMessageHash = innerMessageHash + ':isolated'
1049
1054
  client.resolve(stored, innerMessageHash)
1050
1055
  client.resolve(stored, messageHash)
1051
1056
  if isLinearSwap:
@@ -1148,23 +1153,30 @@ class bitget(ccxt.async_support.bitget):
1148
1153
  # isolated and cross margin
1149
1154
  #
1150
1155
  # {
1151
- # "enterPointSource": "web",
1152
- # "force": "gtc",
1153
- # "feeDetail": [],
1154
- # "orderType": "limit",
1155
- # "price": "35000.000000000",
1156
- # "quoteSize": "10.500000000",
1157
- # "side": "buy",
1158
- # "status": "live",
1159
- # "baseSize": "0.000300000",
1160
- # "cTime": "1701923982427",
1161
- # "clientOid": "4902047879864dc980c4840e9906db4e",
1162
- # "fillPrice": "0.000000000",
1163
- # "baseVolume": "0.000000000",
1164
- # "fillTotalAmount": "0.000000000",
1165
- # "loanType": "auto-loan-and-repay",
1166
- # "orderId": "1116515595178356737"
1167
- # }
1156
+ # enterPointSource: "web",
1157
+ # feeDetail: [
1158
+ # {
1159
+ # feeCoin: "AAVE",
1160
+ # deduction: "no",
1161
+ # totalDeductionFee: "0",
1162
+ # totalFee: "-0.00010740",
1163
+ # },
1164
+ # ],
1165
+ # force: "gtc",
1166
+ # orderType: "limit",
1167
+ # price: "93.170000000",
1168
+ # fillPrice: "93.170000000",
1169
+ # baseSize: "0.110600000", # total amount of order
1170
+ # quoteSize: "10.304602000", # total cost of order(independently if order is filled or pending)
1171
+ # baseVolume: "0.107400000", # filled amount of order(during order's lifecycle, and not for self specific incoming update)
1172
+ # fillTotalAmount: "10.006458000", # filled cost of order(during order's lifecycle, and not for self specific incoming update)
1173
+ # side: "buy",
1174
+ # status: "partially_filled",
1175
+ # cTime: "1717875017306",
1176
+ # clientOid: "b57afe789a06454e9c560a2aab7f7201",
1177
+ # loanType: "auto-loan",
1178
+ # orderId: "1183419084588060673",
1179
+ # }
1168
1180
  #
1169
1181
  isSpot = not ('posMode' in order)
1170
1182
  isMargin = ('loanType' in order)
@@ -1205,9 +1217,9 @@ class bitget(ccxt.async_support.bitget):
1205
1217
  totalFilled = self.safe_string(order, 'accBaseVolume')
1206
1218
  if isSpot:
1207
1219
  if isMargin:
1208
- filledAmount = self.omit_zero(self.safe_string(order, 'fillTotalAmount'))
1209
- totalAmount = self.omit_zero(self.safe_string(order, 'baseSize')) # for margin trading
1210
- cost = self.safe_string(order, 'quoteSize')
1220
+ totalAmount = self.safe_string(order, 'baseSize')
1221
+ totalFilled = self.safe_string(order, 'baseVolume')
1222
+ cost = self.safe_string(order, 'fillTotalAmount')
1211
1223
  else:
1212
1224
  partialFillAmount = self.safe_string(order, 'baseVolume')
1213
1225
  if partialFillAmount is not None:
ccxt/pro/bybit.py CHANGED
@@ -133,7 +133,7 @@ class bybit(ccxt.async_support.bybit):
133
133
  },
134
134
  'streaming': {
135
135
  'ping': self.ping,
136
- 'keepAlive': 19000,
136
+ 'keepAlive': 18000,
137
137
  },
138
138
  })
139
139
 
ccxt/pro/mexc.py CHANGED
@@ -40,7 +40,7 @@ class mexc(ccxt.async_support.mexc):
40
40
  'api': {
41
41
  'ws': {
42
42
  'spot': 'wss://wbs.mexc.com/ws',
43
- 'swap': 'wss://contract.mexc.com/ws',
43
+ 'swap': 'wss://contract.mexc.com/edge',
44
44
  },
45
45
  },
46
46
  },
@@ -67,7 +67,7 @@ class mexc(ccxt.async_support.mexc):
67
67
  },
68
68
  'streaming': {
69
69
  'ping': self.ping,
70
- 'keepAlive': 10000,
70
+ 'keepAlive': 8000,
71
71
  },
72
72
  'exceptions': {
73
73
  },