ccxt 4.4.7__py2.py3-none-any.whl → 4.4.9__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 (47) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bigone.py +1 -1
  3. ccxt/abstract/binance.py +1 -0
  4. ccxt/abstract/binancecoinm.py +1 -0
  5. ccxt/abstract/binanceus.py +1 -0
  6. ccxt/abstract/binanceusdm.py +1 -0
  7. ccxt/abstract/bybit.py +5 -0
  8. ccxt/abstract/kucoinfutures.py +5 -0
  9. ccxt/abstract/okx.py +2 -0
  10. ccxt/async_support/__init__.py +1 -1
  11. ccxt/async_support/base/exchange.py +1 -1
  12. ccxt/async_support/bigone.py +35 -86
  13. ccxt/async_support/binance.py +49 -12
  14. ccxt/async_support/bingx.py +7 -2
  15. ccxt/async_support/bitget.py +3 -0
  16. ccxt/async_support/bybit.py +354 -2
  17. ccxt/async_support/gate.py +30 -1
  18. ccxt/async_support/htx.py +22 -0
  19. ccxt/async_support/kucoin.py +1 -0
  20. ccxt/async_support/kucoinfutures.py +152 -3
  21. ccxt/async_support/okx.py +4 -0
  22. ccxt/base/exchange.py +1 -1
  23. ccxt/bigone.py +35 -86
  24. ccxt/binance.py +49 -12
  25. ccxt/bingx.py +7 -2
  26. ccxt/bitget.py +3 -0
  27. ccxt/bybit.py +354 -2
  28. ccxt/gate.py +30 -1
  29. ccxt/htx.py +22 -0
  30. ccxt/kucoin.py +1 -0
  31. ccxt/kucoinfutures.py +152 -3
  32. ccxt/okx.py +4 -0
  33. ccxt/pro/__init__.py +1 -1
  34. ccxt/pro/binance.py +3 -3
  35. ccxt/pro/bitmart.py +72 -0
  36. ccxt/pro/bitvavo.py +87 -2
  37. ccxt/pro/blofin.py +59 -0
  38. ccxt/pro/hitbtc.py +112 -44
  39. ccxt/pro/hollaex.py +5 -0
  40. ccxt/pro/okx.py +12 -1
  41. ccxt/pro/p2b.py +33 -2
  42. ccxt/pro/whitebit.py +29 -1
  43. {ccxt-4.4.7.dist-info → ccxt-4.4.9.dist-info}/METADATA +4 -4
  44. {ccxt-4.4.7.dist-info → ccxt-4.4.9.dist-info}/RECORD +47 -47
  45. {ccxt-4.4.7.dist-info → ccxt-4.4.9.dist-info}/LICENSE.txt +0 -0
  46. {ccxt-4.4.7.dist-info → ccxt-4.4.9.dist-info}/WHEEL +0 -0
  47. {ccxt-4.4.7.dist-info → ccxt-4.4.9.dist-info}/top_level.txt +0 -0
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.kucoin import kucoin
7
7
  from ccxt.abstract.kucoinfutures import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, Int, LeverageTier, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
8
+ from ccxt.base.types import Balances, Currency, Int, Leverage, LeverageTier, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
9
9
  from typing import List
10
10
  from ccxt.base.errors import AuthenticationError
11
11
  from ccxt.base.errors import PermissionDenied
@@ -80,9 +80,10 @@ class kucoinfutures(kucoin, ImplicitAPI):
80
80
  'fetchIsolatedBorrowRates': False,
81
81
  'fetchL3OrderBook': True,
82
82
  'fetchLedger': True,
83
+ 'fetchLeverage': True,
83
84
  'fetchLeverageTiers': False,
84
85
  'fetchMarginAdjustmentHistory': False,
85
- 'fetchMarginMode': False,
86
+ 'fetchMarginMode': True,
86
87
  'fetchMarketLeverageTiers': True,
87
88
  'fetchMarkets': True,
88
89
  'fetchMarkOHLCV': False,
@@ -106,7 +107,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
106
107
  'fetchTransactionFee': False,
107
108
  'fetchWithdrawals': True,
108
109
  'setLeverage': False,
109
- 'setMarginMode': False,
110
+ 'setMarginMode': True,
110
111
  'transfer': True,
111
112
  'withdraw': None,
112
113
  },
@@ -183,12 +184,15 @@ class kucoinfutures(kucoin, ImplicitAPI):
183
184
  'trade-fees': 1,
184
185
  'history-positions': 1,
185
186
  'getMaxOpenSize': 1,
187
+ 'getCrossUserLeverage': 1,
188
+ 'position/getMarginMode': 1,
186
189
  },
187
190
  'post': {
188
191
  'withdrawals': 1,
189
192
  'transfer-out': 1, # v2
190
193
  'transfer-in': 1,
191
194
  'orders': 1.33,
195
+ 'st-orders': 1.33,
192
196
  'orders/test': 1.33,
193
197
  'position/margin/auto-deposit-status': 1,
194
198
  'position/margin/deposit-margin': 1,
@@ -196,6 +200,8 @@ class kucoinfutures(kucoin, ImplicitAPI):
196
200
  'bullet-private': 1,
197
201
  'sub/api-key': 1,
198
202
  'sub/api-key/update': 1,
203
+ 'changeCrossUserLeverage': 1,
204
+ 'position/changeMarginMode': 1,
199
205
  },
200
206
  'delete': {
201
207
  'withdrawals/{withdrawalId}': 1,
@@ -330,9 +336,13 @@ class kucoinfutures(kucoin, ImplicitAPI):
330
336
  'futuresPrivate': {
331
337
  'GET': {
332
338
  'getMaxOpenSize': 'v2',
339
+ 'getCrossUserLeverage': 'v2',
340
+ 'position/getMarginMode': 'v2',
333
341
  },
334
342
  'POST': {
335
343
  'transfer-out': 'v2',
344
+ 'changeCrossUserLeverage': 'v2',
345
+ 'position/changeMarginMode': 'v2',
336
346
  },
337
347
  },
338
348
  'futuresPublic': {
@@ -2721,3 +2731,142 @@ class kucoinfutures(kucoin, ImplicitAPI):
2721
2731
  'percentage': True,
2722
2732
  'tierBased': True,
2723
2733
  }
2734
+
2735
+ async def fetch_margin_mode(self, symbol: str, params={}) -> MarginMode:
2736
+ """
2737
+ fetches the margin mode of a trading pair
2738
+ :see: https://www.kucoin.com/docs/rest/futures-trading/positions/get-margin-mode
2739
+ :param str symbol: unified symbol of the market to fetch the margin mode for
2740
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2741
+ :returns dict: a `margin mode structure <https://docs.ccxt.com/#/?id=margin-mode-structure>`
2742
+ """
2743
+ await self.load_markets()
2744
+ market = self.market(symbol)
2745
+ request: dict = {
2746
+ 'symbol': market['id'],
2747
+ }
2748
+ response = await self.futuresPrivateGetPositionGetMarginMode(self.extend(request, params))
2749
+ #
2750
+ # {
2751
+ # "code": "200000",
2752
+ # "data": {
2753
+ # "symbol": "XBTUSDTM",
2754
+ # "marginMode": "ISOLATED"
2755
+ # }
2756
+ # }
2757
+ #
2758
+ data = self.safe_dict(response, 'data', {})
2759
+ return self.parse_margin_mode(data, market)
2760
+
2761
+ def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
2762
+ marginType = self.safe_string(marginMode, 'marginMode')
2763
+ marginType = 'isolated' if (marginType == 'ISOLATED') else 'cross'
2764
+ return {
2765
+ 'info': marginMode,
2766
+ 'symbol': market['symbol'],
2767
+ 'marginMode': marginType,
2768
+ }
2769
+
2770
+ async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
2771
+ """
2772
+ set margin mode to 'cross' or 'isolated'
2773
+ :see: https://www.kucoin.com/docs/rest/futures-trading/positions/modify-margin-mode
2774
+ :param str marginMode: 'cross' or 'isolated'
2775
+ :param str symbol: unified market symbol
2776
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2777
+ :returns dict: response from the exchange
2778
+ """
2779
+ if symbol is None:
2780
+ raise ArgumentsRequired(self.id + ' setMarginMode() requires a symbol argument')
2781
+ self.check_required_argument('setMarginMode', marginMode, 'marginMode', ['cross', 'isolated'])
2782
+ await self.load_markets()
2783
+ market = self.market(symbol)
2784
+ request: dict = {
2785
+ 'symbol': market['id'],
2786
+ 'marginMode': marginMode.upper(),
2787
+ }
2788
+ response = await self.futuresPrivatePostPositionChangeMarginMode(self.extend(request, params))
2789
+ #
2790
+ # {
2791
+ # "code": "200000",
2792
+ # "data": {
2793
+ # "symbol": "XBTUSDTM",
2794
+ # "marginMode": "ISOLATED"
2795
+ # }
2796
+ # }
2797
+ #
2798
+ data = self.safe_dict(response, 'data', {})
2799
+ return self.parse_margin_mode(data, market)
2800
+
2801
+ async def fetch_leverage(self, symbol: str, params={}) -> Leverage:
2802
+ """
2803
+ fetch the set leverage for a market
2804
+ :see: https://www.kucoin.com/docs/rest/futures-trading/positions/get-cross-margin-leverage
2805
+ :param str symbol: unified market symbol
2806
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2807
+ :returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
2808
+ """
2809
+ marginMode = None
2810
+ marginMode, params = self.handle_margin_mode_and_params(symbol, params)
2811
+ if marginMode != 'cross':
2812
+ raise NotSupported(self.id + ' fetchLeverage() currently supports only params["marginMode"] = "cross"')
2813
+ await self.load_markets()
2814
+ market = self.market(symbol)
2815
+ request: dict = {
2816
+ 'symbol': market['id'],
2817
+ }
2818
+ response = await self.futuresPrivateGetGetCrossUserLeverage(self.extend(request, params))
2819
+ #
2820
+ # {
2821
+ # "code": "200000",
2822
+ # "data": {
2823
+ # "symbol": "XBTUSDTM",
2824
+ # "leverage": "3"
2825
+ # }
2826
+ # }
2827
+ #
2828
+ data = self.safe_dict(response, 'data', {})
2829
+ parsed = self.parse_leverage(data, market)
2830
+ return self.extend(parsed, {
2831
+ 'marginMode': marginMode,
2832
+ })
2833
+
2834
+ async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2835
+ """
2836
+ set the level of leverage for a market
2837
+ :see: https://www.kucoin.com/docs/rest/futures-trading/positions/modify-cross-margin-leverage
2838
+ :param float leverage: the rate of leverage
2839
+ :param str symbol: unified market symbol
2840
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2841
+ :returns dict: response from the exchange
2842
+ """
2843
+ marginMode = None
2844
+ marginMode, params = self.handle_margin_mode_and_params(symbol, params)
2845
+ if marginMode != 'cross':
2846
+ raise NotSupported(self.id + ' setLeverage() currently supports only params["marginMode"] = "cross"')
2847
+ await self.load_markets()
2848
+ market = self.market(symbol)
2849
+ request: dict = {
2850
+ 'symbol': market['id'],
2851
+ 'leverage': str(leverage),
2852
+ }
2853
+ response = await self.futuresPrivatePostChangeCrossUserLeverage(self.extend(request, params))
2854
+ #
2855
+ # {
2856
+ # "code": "200000",
2857
+ # "data": True
2858
+ # }
2859
+ #
2860
+ return self.parse_leverage(response, market)
2861
+
2862
+ def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
2863
+ marketId = self.safe_string(leverage, 'symbol')
2864
+ market = self.safe_market(marketId, market)
2865
+ leverageNum = self.safe_integer(leverage, 'leverage')
2866
+ return {
2867
+ 'info': leverage,
2868
+ 'symbol': market['symbol'],
2869
+ 'marginMode': None,
2870
+ 'longLeverage': leverageNum,
2871
+ 'shortLeverage': leverageNum,
2872
+ }
ccxt/async_support/okx.py CHANGED
@@ -291,6 +291,7 @@ class okx(Exchange, ImplicitAPI):
291
291
  'copytrading/public-preference-currency': 4,
292
292
  'copytrading/public-current-subpositions': 4,
293
293
  'copytrading/public-subpositions-history': 4,
294
+ 'support/announcements-types': 20,
294
295
  },
295
296
  },
296
297
  'private': {
@@ -436,6 +437,7 @@ class okx(Exchange, ImplicitAPI):
436
437
  # affiliate
437
438
  'affiliate/invitee/detail': 1,
438
439
  'users/partner/if-rebate': 1,
440
+ 'support/announcements': 4,
439
441
  },
440
442
  'post': {
441
443
  # rfq
@@ -815,6 +817,8 @@ class okx(Exchange, ImplicitAPI):
815
817
  # SPOT/MARGIN error codes 54000-54999
816
818
  '54000': ExchangeError, # Margin transactions unavailable
817
819
  '54001': ExchangeError, # Only Multi-currency margin account can be set to borrow coins automatically
820
+ '54008': InvalidOrder, # This operation is disabled by the 'mass cancel order' endpoint. Please enable it using self endpoint.
821
+ '54009': InvalidOrder, # The range of {param0} should be [{param1}, {param2}].
818
822
  '54011': InvalidOrder, # 200 Pre-market trading contracts are only allowed to reduce the number of positions within 1 hour before delivery. Please modify or cancel the order.
819
823
  # Trading bot Error Code from 55100 to 55999
820
824
  '55100': InvalidOrder, # Take profit % should be within the range of {parameter1}-{parameter2}
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.7'
7
+ __version__ = '4.4.9'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/bigone.py CHANGED
@@ -167,7 +167,7 @@ class bigone(Exchange, ImplicitAPI):
167
167
  },
168
168
  'webExchange': {
169
169
  'get': [
170
- 'uc/v2/assets',
170
+ 'v3/assets',
171
171
  ],
172
172
  },
173
173
  },
@@ -346,7 +346,7 @@ class bigone(Exchange, ImplicitAPI):
346
346
  :returns dict: an associative dictionary of currencies
347
347
  """
348
348
  # we use undocumented link(possible, less informative alternative is : https://big.one/api/uc/v3/assets/accounts)
349
- data = self.fetch_web_endpoint('fetchCurrencies', 'webExchangeGetUcV2Assets', True)
349
+ data = self.fetch_web_endpoint('fetchCurrencies', 'webExchangeGetV3Assets', True)
350
350
  if data is None:
351
351
  return None
352
352
  #
@@ -355,91 +355,40 @@ class bigone(Exchange, ImplicitAPI):
355
355
  # "message": "",
356
356
  # "data": [
357
357
  # {
358
- # "name": "TetherUS",
359
- # "symbol": "USDT",
360
- # "contract_address": "31",
361
- # "is_deposit_enabled": True,
362
- # "is_withdrawal_enabled": True,
363
- # "is_stub": False,
364
- # "withdrawal_fee": "5.0",
365
- # "is_fiat": False,
366
- # "is_memo_required": False,
367
- # "logo": {
368
- # "default": "https://assets.peatio.com/assets/v1/color/normal/usdt.png",
369
- # "white": "https://assets.peatio.com/assets/v1/white/normal/usdt.png",
358
+ # "uuid": "17082d1c-0195-4fb6-8779-2cdbcb9eeb3c",
359
+ # "symbol": "USDT",
360
+ # "name": "TetherUS",
361
+ # "scale": 12,
362
+ # "is_fiat": False,
363
+ # "is_transfer_enabled": True,
364
+ # "transfer_scale": 12,
365
+ # "binding_gateways": [
366
+ # {
367
+ # "guid": "07efc37f-d1ec-4bc9-8339-a745256ea2ba",
368
+ # "is_deposit_enabled": True,
369
+ # "gateway_name": "Ethereum",
370
+ # "min_withdrawal_amount": "0.000001",
371
+ # "withdrawal_fee": "5.71",
372
+ # "is_withdrawal_enabled": True,
373
+ # "min_deposit_amount": "0.000001",
374
+ # "is_memo_required": False,
375
+ # "withdrawal_scale": 6,
376
+ # "scale": 12
377
+ # },
378
+ # {
379
+ # "guid": "4e387a9a-a480-40a3-b4ae-ed1773c2db5a",
380
+ # "is_deposit_enabled": True,
381
+ # "gateway_name": "BinanceSmartChain",
382
+ # "min_withdrawal_amount": "10",
383
+ # "withdrawal_fee": "5",
384
+ # "is_withdrawal_enabled": False,
385
+ # "min_deposit_amount": "1",
386
+ # "is_memo_required": False,
387
+ # "withdrawal_scale": 8,
388
+ # "scale": 12
389
+ # }
390
+ # ]
370
391
  # },
371
- # "info_link": null,
372
- # "scale": "12",
373
- # "default_gateway": ..., # one object from "gateways"
374
- # "gateways": [
375
- # {
376
- # "uuid": "f0fa5a85-7f65-428a-b7b7-13aad55c2837",
377
- # "name": "Mixin",
378
- # "kind": "CHAIN",
379
- # "required_confirmations": "0",
380
- # },
381
- # {
382
- # "uuid": "b75446c6-1446-4c8d-b3d1-39f385b0a926",
383
- # "name": "Ethereum",
384
- # "kind": "CHAIN",
385
- # "required_confirmations": "18",
386
- # },
387
- # {
388
- # "uuid": "fe9b1b0b-e55c-4017-b5ce-16f524df5fc0",
389
- # "name": "Tron",
390
- # "kind": "CHAIN",
391
- # "required_confirmations": "1",
392
- # },
393
- # ...
394
- # ],
395
- # "payments": [],
396
- # "uuid": "17082d1c-0195-4fb6-8779-2cdbcb9eeb3c",
397
- # "binding_gateways": [
398
- # {
399
- # "guid": "07efc37f-d1ec-4bc9-8339-a745256ea2ba",
400
- # "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
401
- # "is_deposit_enabled": True,
402
- # "display_name": "Ethereum(ERC20)",
403
- # "gateway_name": "Ethereum",
404
- # "min_withdrawal_amount": "0.000001",
405
- # "min_internal_withdrawal_amount": "0.00000001",
406
- # "withdrawal_fee": "14",
407
- # "is_withdrawal_enabled": True,
408
- # "min_deposit_amount": "0.000001",
409
- # "is_memo_required": False,
410
- # "withdrawal_scale": "2",
411
- # "gateway": {
412
- # "uuid": "b75446c6-1446-4c8d-b3d1-39f385b0a926",
413
- # "name": "Ethereum",
414
- # "kind": "CHAIN",
415
- # "required_confirmations": "18",
416
- # },
417
- # "scale": "12",
418
- # },
419
- # {
420
- # "guid": "b80a4d13-cac7-4319-842d-b33c3bfab8ec",
421
- # "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
422
- # "is_deposit_enabled": True,
423
- # "display_name": "Tron(TRC20)",
424
- # "gateway_name": "Tron",
425
- # "min_withdrawal_amount": "0.000001",
426
- # "min_internal_withdrawal_amount": "0.00000001",
427
- # "withdrawal_fee": "1",
428
- # "is_withdrawal_enabled": True,
429
- # "min_deposit_amount": "0.000001",
430
- # "is_memo_required": False,
431
- # "withdrawal_scale": "6",
432
- # "gateway": {
433
- # "uuid": "fe9b1b0b-e55c-4017-b5ce-16f524df5fc0",
434
- # "name": "Tron",
435
- # "kind": "CHAIN",
436
- # "required_confirmations": "1",
437
- # },
438
- # "scale": "12",
439
- # },
440
- # ...
441
- # ],
442
- # },
443
392
  # ...
444
393
  # ],
445
394
  # }
ccxt/binance.py CHANGED
@@ -1114,6 +1114,7 @@ class binance(Exchange, ImplicitAPI):
1114
1114
  'repay-futures-negative-balance': 150, # Weight(IP): 1500 => cost = 0.1 * 1500 = 150
1115
1115
  'listenKey': 1, # 1
1116
1116
  'asset-collection': 3,
1117
+ 'margin/repay-debt': 0.4, # Weight(Order): 0.4 =>(1000 / (50 * 0.4)) * 60 = 3000
1117
1118
  },
1118
1119
  'put': {
1119
1120
  'listenKey': 1, # 1
@@ -1231,6 +1232,7 @@ class binance(Exchange, ImplicitAPI):
1231
1232
  ],
1232
1233
  'fetchCurrencies': True, # self is a private call and it requires API keys
1233
1234
  # 'fetchTradesMethod': 'publicGetAggTrades', # publicGetTrades, publicGetHistoricalTrades, eapiPublicGetTrades
1235
+ # 'repayCrossMarginMethod': 'papiPostRepayLoan', # papiPostMarginRepayDebt
1234
1236
  'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
1235
1237
  'defaultType': 'spot', # 'spot', 'future', 'margin', 'delivery', 'option'
1236
1238
  'defaultSubType': None, # 'linear', 'inverse'
@@ -2878,7 +2880,7 @@ class binance(Exchange, ImplicitAPI):
2878
2880
  res = self.safe_value(results, i)
2879
2881
  if fetchMargins and isinstance(res, list):
2880
2882
  keysList = list(self.index_by(res, 'symbol').keys())
2881
- length = (self.options['crossMarginPairsData'])
2883
+ length = len(self.options['crossMarginPairsData'])
2882
2884
  # first one is the cross-margin promise
2883
2885
  if length == 0:
2884
2886
  self.options['crossMarginPairsData'] = keysList
@@ -11241,10 +11243,13 @@ class binance(Exchange, ImplicitAPI):
11241
11243
  repay borrowed margin and interest
11242
11244
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
11243
11245
  :see: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
11246
+ :see: https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
11244
11247
  :param str code: unified currency code of the currency to repay
11245
11248
  :param float amount: the amount to repay
11246
11249
  :param dict [params]: extra parameters specific to the exchange API endpoint
11247
11250
  :param boolean [params.portfolioMargin]: set to True if you would like to repay margin in a portfolio margin account
11251
+ :param str [params.repayCrossMarginMethod]: *portfolio margin only* 'papiPostRepayLoan'(default), 'papiPostMarginRepayDebt'(alternative)
11252
+ :param str [params.specifyRepayAssets]: *portfolio margin papiPostMarginRepayDebt only* specific asset list to repay debt
11248
11253
  :returns dict: a `margin loan structure <https://docs.ccxt.com/#/?id=margin-loan-structure>`
11249
11254
  """
11250
11255
  self.load_markets()
@@ -11257,17 +11262,37 @@ class binance(Exchange, ImplicitAPI):
11257
11262
  isPortfolioMargin = None
11258
11263
  isPortfolioMargin, params = self.handle_option_and_params_2(params, 'repayCrossMargin', 'papi', 'portfolioMargin', False)
11259
11264
  if isPortfolioMargin:
11260
- response = self.papiPostRepayLoan(self.extend(request, params))
11265
+ method = None
11266
+ method, params = self.handle_option_and_params_2(params, 'repayCrossMargin', 'repayCrossMarginMethod', 'method')
11267
+ if method == 'papiPostMarginRepayDebt':
11268
+ response = self.papiPostMarginRepayDebt(self.extend(request, params))
11269
+ #
11270
+ # {
11271
+ # "asset": "USDC",
11272
+ # "amount": 10,
11273
+ # "specifyRepayAssets": null,
11274
+ # "updateTime": 1727170761267,
11275
+ # "success": True
11276
+ # }
11277
+ #
11278
+ else:
11279
+ response = self.papiPostRepayLoan(self.extend(request, params))
11280
+ #
11281
+ # {
11282
+ # "tranId": 108988250265,
11283
+ # "clientTag":""
11284
+ # }
11285
+ #
11261
11286
  else:
11262
11287
  request['isIsolated'] = 'FALSE'
11263
11288
  request['type'] = 'REPAY'
11264
11289
  response = self.sapiPostMarginBorrowRepay(self.extend(request, params))
11265
- #
11266
- # {
11267
- # "tranId": 108988250265,
11268
- # "clientTag":""
11269
- # }
11270
- #
11290
+ #
11291
+ # {
11292
+ # "tranId": 108988250265,
11293
+ # "clientTag":""
11294
+ # }
11295
+ #
11271
11296
  return self.parse_margin_loan(response, currency)
11272
11297
 
11273
11298
  def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
@@ -11369,13 +11394,25 @@ class binance(Exchange, ImplicitAPI):
11369
11394
  # "clientTag":""
11370
11395
  # }
11371
11396
  #
11397
+ # repayCrossMargin alternative endpoint
11398
+ #
11399
+ # {
11400
+ # "asset": "USDC",
11401
+ # "amount": 10,
11402
+ # "specifyRepayAssets": null,
11403
+ # "updateTime": 1727170761267,
11404
+ # "success": True
11405
+ # }
11406
+ #
11407
+ currencyId = self.safe_string(info, 'asset')
11408
+ timestamp = self.safe_integer(info, 'updateTime')
11372
11409
  return {
11373
11410
  'id': self.safe_integer(info, 'tranId'),
11374
- 'currency': self.safe_currency_code(None, currency),
11375
- 'amount': None,
11411
+ 'currency': self.safe_currency_code(currencyId, currency),
11412
+ 'amount': self.safe_number(info, 'amount'),
11376
11413
  'symbol': None,
11377
- 'timestamp': None,
11378
- 'datetime': None,
11414
+ 'timestamp': timestamp,
11415
+ 'datetime': self.iso8601(timestamp),
11379
11416
  'info': info,
11380
11417
  }
11381
11418
 
ccxt/bingx.py CHANGED
@@ -654,7 +654,12 @@ class bingx(Exchange, ImplicitAPI):
654
654
  # "maxNotional": 20000,
655
655
  # "status": 1,
656
656
  # "tickSize": 0.000001,
657
- # "stepSize": 1
657
+ # "stepSize": 1,
658
+ # "apiStateSell": True,
659
+ # "apiStateBuy": True,
660
+ # "timeOnline": 0,
661
+ # "offTime": 0,
662
+ # "maintainTime": 0
658
663
  # },
659
664
  # ...
660
665
  # ]
@@ -758,7 +763,7 @@ class bingx(Exchange, ImplicitAPI):
758
763
  isActive = False
759
764
  if (self.safe_string(market, 'apiStateOpen') == 'true') and (self.safe_string(market, 'apiStateClose') == 'true'):
760
765
  isActive = True # swap active
761
- elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy'):
766
+ elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy') and (self.safe_number(market, 'status') == 1):
762
767
  isActive = True # spot active
763
768
  isInverse = None if (spot) else checkIsInverse
764
769
  isLinear = None if (spot) else checkIsLinear
ccxt/bitget.py CHANGED
@@ -1441,6 +1441,9 @@ class bitget(Exchange, ImplicitAPI):
1441
1441
  'STARKNET': 'Starknet',
1442
1442
  'OPTIMISM': 'Optimism',
1443
1443
  'ARBITRUM': 'Arbitrum',
1444
+ 'APT': 'APTOS',
1445
+ 'MATIC': 'POLYGON',
1446
+ 'VIC': 'VICTION',
1444
1447
  },
1445
1448
  'networksById': {
1446
1449
  },