ccxt 4.4.85__py2.py3-none-any.whl → 4.4.86__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 (54) hide show
  1. ccxt/__init__.py +3 -5
  2. ccxt/abstract/myokx.py +2 -0
  3. ccxt/abstract/okx.py +2 -0
  4. ccxt/ascendex.py +187 -151
  5. ccxt/async_support/__init__.py +3 -5
  6. ccxt/async_support/ascendex.py +187 -151
  7. ccxt/async_support/base/exchange.py +26 -22
  8. ccxt/async_support/bequant.py +1 -1
  9. ccxt/async_support/bitget.py +4 -4
  10. ccxt/async_support/bitmart.py +1 -1
  11. ccxt/async_support/{huobijp.py → bittrade.py} +11 -11
  12. ccxt/async_support/coinbase.py +2 -5
  13. ccxt/async_support/deribit.py +4 -5
  14. ccxt/async_support/hollaex.py +106 -49
  15. ccxt/async_support/htx.py +20 -43
  16. ccxt/async_support/hyperliquid.py +4 -4
  17. ccxt/async_support/mexc.py +2 -2
  18. ccxt/async_support/ndax.py +25 -24
  19. ccxt/async_support/okcoin.py +12 -29
  20. ccxt/async_support/okx.py +9 -0
  21. ccxt/async_support/onetrading.py +10 -7
  22. ccxt/async_support/oxfun.py +40 -110
  23. ccxt/async_support/paradex.py +3 -0
  24. ccxt/base/exchange.py +1 -1
  25. ccxt/bequant.py +1 -1
  26. ccxt/bitget.py +4 -4
  27. ccxt/bitmart.py +1 -1
  28. ccxt/{huobijp.py → bittrade.py} +11 -11
  29. ccxt/coinbase.py +2 -5
  30. ccxt/deribit.py +4 -5
  31. ccxt/hollaex.py +106 -49
  32. ccxt/htx.py +20 -43
  33. ccxt/hyperliquid.py +4 -4
  34. ccxt/mexc.py +2 -2
  35. ccxt/ndax.py +25 -24
  36. ccxt/okcoin.py +12 -29
  37. ccxt/okx.py +9 -0
  38. ccxt/onetrading.py +10 -7
  39. ccxt/oxfun.py +40 -110
  40. ccxt/paradex.py +3 -0
  41. ccxt/pro/__init__.py +41 -3
  42. ccxt/pro/binance.py +1 -0
  43. ccxt/pro/{huobijp.py → bittrade.py} +3 -3
  44. ccxt/pro/luno.py +6 -5
  45. ccxt/pro/mexc.py +2 -0
  46. {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/METADATA +7 -8
  47. {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/RECORD +51 -54
  48. ccxt/abstract/kuna.py +0 -182
  49. ccxt/async_support/kuna.py +0 -1935
  50. ccxt/kuna.py +0 -1935
  51. /ccxt/abstract/{huobijp.py → bittrade.py} +0 -0
  52. {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/LICENSE.txt +0 -0
  53. {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/WHEEL +0 -0
  54. {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.85'
25
+ __version__ = '4.4.86'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -107,6 +107,7 @@ from ccxt.bitrue import bitrue # noqa: F4
107
107
  from ccxt.bitso import bitso # noqa: F401
108
108
  from ccxt.bitstamp import bitstamp # noqa: F401
109
109
  from ccxt.bitteam import bitteam # noqa: F401
110
+ from ccxt.bittrade import bittrade # noqa: F401
110
111
  from ccxt.bitvavo import bitvavo # noqa: F401
111
112
  from ccxt.blockchaincom import blockchaincom # noqa: F401
112
113
  from ccxt.blofin import blofin # noqa: F401
@@ -147,7 +148,6 @@ from ccxt.hitbtc import hitbtc # noqa: F4
147
148
  from ccxt.hollaex import hollaex # noqa: F401
148
149
  from ccxt.htx import htx # noqa: F401
149
150
  from ccxt.huobi import huobi # noqa: F401
150
- from ccxt.huobijp import huobijp # noqa: F401
151
151
  from ccxt.hyperliquid import hyperliquid # noqa: F401
152
152
  from ccxt.independentreserve import independentreserve # noqa: F401
153
153
  from ccxt.indodax import indodax # noqa: F401
@@ -155,7 +155,6 @@ from ccxt.kraken import kraken # noqa: F4
155
155
  from ccxt.krakenfutures import krakenfutures # noqa: F401
156
156
  from ccxt.kucoin import kucoin # noqa: F401
157
157
  from ccxt.kucoinfutures import kucoinfutures # noqa: F401
158
- from ccxt.kuna import kuna # noqa: F401
159
158
  from ccxt.latoken import latoken # noqa: F401
160
159
  from ccxt.lbank import lbank # noqa: F401
161
160
  from ccxt.luno import luno # noqa: F401
@@ -214,6 +213,7 @@ exchanges = [
214
213
  'bitso',
215
214
  'bitstamp',
216
215
  'bitteam',
216
+ 'bittrade',
217
217
  'bitvavo',
218
218
  'blockchaincom',
219
219
  'blofin',
@@ -254,7 +254,6 @@ exchanges = [
254
254
  'hollaex',
255
255
  'htx',
256
256
  'huobi',
257
- 'huobijp',
258
257
  'hyperliquid',
259
258
  'independentreserve',
260
259
  'indodax',
@@ -262,7 +261,6 @@ exchanges = [
262
261
  'krakenfutures',
263
262
  'kucoin',
264
263
  'kucoinfutures',
265
- 'kuna',
266
264
  'latoken',
267
265
  'lbank',
268
266
  'luno',
ccxt/abstract/myokx.py CHANGED
@@ -161,6 +161,7 @@ class ImplicitAPI:
161
161
  private_get_account_spot_manual_borrow_repay = privateGetAccountSpotManualBorrowRepay = Entry('account/spot-manual-borrow-repay', 'private', 'GET', {'cost': 10})
162
162
  private_get_account_set_auto_repay = privateGetAccountSetAutoRepay = Entry('account/set-auto-repay', 'private', 'GET', {'cost': 4})
163
163
  private_get_account_spot_borrow_repay_history = privateGetAccountSpotBorrowRepayHistory = Entry('account/spot-borrow-repay-history', 'private', 'GET', {'cost': 4})
164
+ private_get_account_move_positions_history = privateGetAccountMovePositionsHistory = Entry('account/move-positions-history', 'private', 'GET', {'cost': 10})
164
165
  private_get_users_subaccount_list = privateGetUsersSubaccountList = Entry('users/subaccount/list', 'private', 'GET', {'cost': 10})
165
166
  private_get_account_subaccount_balances = privateGetAccountSubaccountBalances = Entry('account/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
166
167
  private_get_asset_subaccount_balances = privateGetAssetSubaccountBalances = Entry('asset/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
@@ -284,6 +285,7 @@ class ImplicitAPI:
284
285
  private_post_account_fixed_loan_manual_reborrow = privatePostAccountFixedLoanManualReborrow = Entry('account/fixed-loan/manual-reborrow', 'private', 'POST', {'cost': 5})
285
286
  private_post_account_fixed_loan_repay_borrowing_order = privatePostAccountFixedLoanRepayBorrowingOrder = Entry('account/fixed-loan/repay-borrowing-order', 'private', 'POST', {'cost': 5})
286
287
  private_post_account_bills_history_archive = privatePostAccountBillsHistoryArchive = Entry('account/bills-history-archive', 'private', 'POST', {'cost': 72000})
288
+ private_post_account_move_positions = privatePostAccountMovePositions = Entry('account/move-positions', 'private', 'POST', {'cost': 10})
287
289
  private_post_users_subaccount_modify_apikey = privatePostUsersSubaccountModifyApikey = Entry('users/subaccount/modify-apikey', 'private', 'POST', {'cost': 10})
288
290
  private_post_asset_subaccount_transfer = privatePostAssetSubaccountTransfer = Entry('asset/subaccount/transfer', 'private', 'POST', {'cost': 10})
289
291
  private_post_users_subaccount_set_transfer_out = privatePostUsersSubaccountSetTransferOut = Entry('users/subaccount/set-transfer-out', 'private', 'POST', {'cost': 10})
ccxt/abstract/okx.py CHANGED
@@ -161,6 +161,7 @@ class ImplicitAPI:
161
161
  private_get_account_spot_manual_borrow_repay = privateGetAccountSpotManualBorrowRepay = Entry('account/spot-manual-borrow-repay', 'private', 'GET', {'cost': 10})
162
162
  private_get_account_set_auto_repay = privateGetAccountSetAutoRepay = Entry('account/set-auto-repay', 'private', 'GET', {'cost': 4})
163
163
  private_get_account_spot_borrow_repay_history = privateGetAccountSpotBorrowRepayHistory = Entry('account/spot-borrow-repay-history', 'private', 'GET', {'cost': 4})
164
+ private_get_account_move_positions_history = privateGetAccountMovePositionsHistory = Entry('account/move-positions-history', 'private', 'GET', {'cost': 10})
164
165
  private_get_users_subaccount_list = privateGetUsersSubaccountList = Entry('users/subaccount/list', 'private', 'GET', {'cost': 10})
165
166
  private_get_account_subaccount_balances = privateGetAccountSubaccountBalances = Entry('account/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
166
167
  private_get_asset_subaccount_balances = privateGetAssetSubaccountBalances = Entry('asset/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
@@ -284,6 +285,7 @@ class ImplicitAPI:
284
285
  private_post_account_fixed_loan_manual_reborrow = privatePostAccountFixedLoanManualReborrow = Entry('account/fixed-loan/manual-reborrow', 'private', 'POST', {'cost': 5})
285
286
  private_post_account_fixed_loan_repay_borrowing_order = privatePostAccountFixedLoanRepayBorrowingOrder = Entry('account/fixed-loan/repay-borrowing-order', 'private', 'POST', {'cost': 5})
286
287
  private_post_account_bills_history_archive = privatePostAccountBillsHistoryArchive = Entry('account/bills-history-archive', 'private', 'POST', {'cost': 72000})
288
+ private_post_account_move_positions = privatePostAccountMovePositions = Entry('account/move-positions', 'private', 'POST', {'cost': 10})
287
289
  private_post_users_subaccount_modify_apikey = privatePostUsersSubaccountModifyApikey = Entry('users/subaccount/modify-apikey', 'private', 'POST', {'cost': 10})
288
290
  private_post_asset_subaccount_transfer = privatePostAssetSubaccountTransfer = Entry('asset/subaccount/transfer', 'private', 'POST', {'cost': 10})
289
291
  private_post_users_subaccount_set_transfer_out = privatePostUsersSubaccountSetTransferOut = Entry('users/subaccount/set-transfer-out', 'private', 'POST', {'cost': 10})
ccxt/ascendex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.ascendex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -477,6 +477,7 @@ class ascendex(Exchange, ImplicitAPI):
477
477
  'broad': {},
478
478
  },
479
479
  'commonCurrencies': {
480
+ 'XBT': 'XBT', # self is not BTC ! just another token
480
481
  'BOND': 'BONDED',
481
482
  'BTCBEAR': 'BEAR',
482
483
  'BTCBULL': 'BULL',
@@ -497,112 +498,82 @@ class ascendex(Exchange, ImplicitAPI):
497
498
  :param dict [params]: extra parameters specific to the exchange API endpoint
498
499
  :returns dict: an associative dictionary of currencies
499
500
  """
500
- assetsPromise = self.v1PublicGetAssets(params)
501
- #
502
- # {
503
- # "code":0,
504
- # "data":[
505
- # {
506
- # "assetCode" : "LTCBULL",
507
- # "assetName" : "3X Long LTC Token",
508
- # "precisionScale" : 9,
509
- # "nativeScale" : 4,
510
- # "withdrawalFee" : "0.2",
511
- # "minWithdrawalAmt" : "1.0",
512
- # "status" : "Normal"
513
- # },
514
- # ]
515
- # }
516
- #
517
- marginPromise = self.v1PublicGetMarginAssets(params)
518
- #
519
- # {
520
- # "code":0,
521
- # "data":[
522
- # {
523
- # "assetCode":"BTT",
524
- # "displayName": "BTT",
525
- # "borrowAssetCode":"BTT-B",
526
- # "interestAssetCode":"BTT-I",
527
- # "nativeScale":0,
528
- # "numConfirmations":1,
529
- # "withdrawFee":"100.0",
530
- # "minWithdrawalAmt":"1000.0",
531
- # "statusCode":"Normal",
532
- # "statusMessage":"",
533
- # "interestRate":"0.001"
534
- # }
535
- # ]
536
- # }
537
- #
538
- cashPromise = self.v1PublicGetCashAssets(params)
501
+ response = self.v2PublicGetAssets(params)
539
502
  #
540
- # {
541
- # "code":0,
542
- # "data":[
543
- # {
544
- # "assetCode":"LTCBULL",
545
- # "displayName": "LTCBULL",
546
- # "nativeScale":4,
547
- # "numConfirmations":20,
548
- # "withdrawFee":"0.2",
549
- # "minWithdrawalAmt":"1.0",
550
- # "statusCode":"Normal",
551
- # "statusMessage":"" # hideFromWalletTx
552
- # }
503
+ # {
504
+ # "code": "0",
505
+ # "data": [
506
+ # {
507
+ # "assetCode": "USDT",
508
+ # "assetName": "Tether",
509
+ # "precisionScale": 9,
510
+ # "nativeScale": 4,
511
+ # "blockChain": [
512
+ # {
513
+ # "chainName": "Solana",
514
+ # "withdrawFee": "2.0",
515
+ # "allowDeposit": True,
516
+ # "allowWithdraw": True,
517
+ # "minDepositAmt": "0.01",
518
+ # "minWithdrawal": "4.0",
519
+ # "numConfirmations": 1
520
+ # },
521
+ # ...
522
+ # ]
523
+ # },
553
524
  # ]
554
- # }
525
+ # }
555
526
  #
556
- assets, margin, cash = [assetsPromise, marginPromise, cashPromise]
557
- assetsData = self.safe_list(assets, 'data', [])
558
- marginData = self.safe_list(margin, 'data', [])
559
- cashData = self.safe_list(cash, 'data', [])
560
- assetsById = self.index_by(assetsData, 'assetCode')
561
- marginById = self.index_by(marginData, 'assetCode')
562
- cashById = self.index_by(cashData, 'assetCode')
563
- dataById = self.deep_extend(assetsById, marginById, cashById)
564
- ids = list(dataById.keys())
527
+ data = self.safe_list(response, 'data', [])
565
528
  result: dict = {}
566
- for i in range(0, len(ids)):
567
- id = self.safe_string(ids, i)
568
- currency = dataById[id]
529
+ for i in range(0, len(data)):
530
+ currency = data[i]
531
+ id = self.safe_string(currency, 'assetCode')
569
532
  code = self.safe_currency_code(id)
570
- scale = self.safe_string_2(currency, 'precisionScale', 'nativeScale')
571
- precision = self.parse_number(self.parse_precision(scale))
572
- fee = self.safe_number_2(currency, 'withdrawFee', 'withdrawalFee')
573
- status = self.safe_string(currency, 'status')
574
- statusCode = self.safe_string(currency, 'statusCode')
575
- active = (status == 'Normal')
576
- depositEnabled: Bool = None
577
- withdrawEnabled: Bool = None
578
- if status == 'Delisted' or statusCode == 'hideFromWalletTx':
579
- depositEnabled = False
580
- withdrawEnabled = False
581
- elif status == 'Normal':
582
- depositEnabled = True
583
- withdrawEnabled = True
584
- elif status == 'NoTransaction' or statusCode == 'NoTransaction':
585
- depositEnabled = True
586
- withdrawEnabled = False
587
- elif status == 'NoDeposit':
588
- depositEnabled = False
589
- withdrawEnabled = True
590
- marginInside = ('borrowAssetCode' in currency)
591
- result[code] = {
533
+ chains = self.safe_list(currency, 'blockChain', [])
534
+ precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'nativeScale')))
535
+ networks = {}
536
+ for j in range(0, len(chains)):
537
+ networkEtnry = chains[j]
538
+ networkId = self.safe_string(networkEtnry, 'chainName')
539
+ networkCode = self.network_code_to_id(networkId)
540
+ networks[networkCode] = {
541
+ 'fee': self.safe_number(networkEtnry, 'withdrawFee'),
542
+ 'active': None,
543
+ 'withdraw': self.safe_bool(networkEtnry, 'allowWithdraw'),
544
+ 'deposit': self.safe_bool(networkEtnry, 'allowDeposit'),
545
+ 'precision': precision,
546
+ 'limits': {
547
+ 'amount': {
548
+ 'min': None,
549
+ 'max': None,
550
+ },
551
+ 'withdraw': {
552
+ 'min': self.safe_number(networkEtnry, 'minWithdrawal'),
553
+ 'max': None,
554
+ },
555
+ 'deposit': {
556
+ 'min': self.safe_number(networkEtnry, 'minDepositAmt'),
557
+ 'max': None,
558
+ },
559
+ },
560
+ }
561
+ # todo type: if chainsLength == 0 and (assetName.endswith(' Staking') or assetName.find(' Reward ') >= 0 or assetName.find('Slot Auction') >= 0 or assetName.find(' Freeze Asset') >= 0):
562
+ result[code] = self.safe_currency_structure({
592
563
  'id': id,
593
564
  'code': code,
594
565
  'info': currency,
595
566
  'type': None,
596
- 'margin': marginInside,
567
+ 'margin': None,
597
568
  'name': self.safe_string(currency, 'assetName'),
598
- 'active': active,
599
- 'deposit': depositEnabled,
600
- 'withdraw': withdrawEnabled,
601
- 'fee': fee,
569
+ 'active': None,
570
+ 'deposit': None,
571
+ 'withdraw': None,
572
+ 'fee': None,
602
573
  'precision': precision,
603
574
  'limits': {
604
575
  'amount': {
605
- 'min': precision,
576
+ 'min': None,
606
577
  'max': None,
607
578
  },
608
579
  'withdraw': {
@@ -610,8 +581,8 @@ class ascendex(Exchange, ImplicitAPI):
610
581
  'max': None,
611
582
  },
612
583
  },
613
- 'networks': {}, # todo
614
- }
584
+ 'networks': networks,
585
+ })
615
586
  return result
616
587
 
617
588
  def fetch_markets(self, params={}) -> List[Market]:
@@ -620,6 +591,12 @@ class ascendex(Exchange, ImplicitAPI):
620
591
  :param dict [params]: extra parameters specific to the exchange API endpoint
621
592
  :returns dict[]: an array of objects representing market data
622
593
  """
594
+ spotPromise = self.fetch_spot_markets(params)
595
+ contractPromise = self.fetch_contract_markets(params)
596
+ spotMarkets, contractMarkets = [spotPromise, contractPromise]
597
+ return self.array_concat(spotMarkets, contractMarkets)
598
+
599
+ def fetch_spot_markets(self, params={}) -> List[Market]:
623
600
  productsPromise = self.v1PublicGetProducts(params)
624
601
  #
625
602
  # {
@@ -671,7 +648,91 @@ class ascendex(Exchange, ImplicitAPI):
671
648
  # ]
672
649
  # }
673
650
  #
674
- perpetualsPromise = self.v2PublicGetFuturesContract(params)
651
+ products, cash = [productsPromise, cashPromise]
652
+ productsData = self.safe_list(products, 'data', [])
653
+ productsById = self.index_by(productsData, 'symbol')
654
+ cashData = self.safe_list(cash, 'data', [])
655
+ cashAndPerpetualsById = self.index_by(cashData, 'symbol')
656
+ dataById = self.deep_extend(productsById, cashAndPerpetualsById)
657
+ ids = list(dataById.keys())
658
+ result = []
659
+ for i in range(0, len(ids)):
660
+ id = ids[i]
661
+ if id.find('-PERP') >= 0:
662
+ continue # skip perpetuals, endpoint returns them
663
+ market = dataById[id]
664
+ status = self.safe_string(market, 'status')
665
+ domain = self.safe_string(market, 'domain')
666
+ active = False
667
+ if ((status == 'Normal') or (status == 'InternalTrading')) and (domain != 'LeveragedETF'):
668
+ active = True
669
+ minQty = self.safe_number(market, 'minQty')
670
+ maxQty = self.safe_number(market, 'maxQty')
671
+ minPrice = self.safe_number(market, 'tickSize')
672
+ maxPrice: Num = None
673
+ underlying = self.safe_string_2(market, 'underlying', 'symbol')
674
+ parts = underlying.split('/')
675
+ baseId = self.safe_string(parts, 0)
676
+ quoteId = self.safe_string(parts, 1)
677
+ base = self.safe_currency_code(baseId)
678
+ quote = self.safe_currency_code(quoteId)
679
+ fee = self.safe_number(market, 'commissionReserveRate')
680
+ marginTradable = self.safe_bool(market, 'marginTradable', False)
681
+ result.append({
682
+ 'id': id,
683
+ 'symbol': base + '/' + quote,
684
+ 'base': base,
685
+ 'baseId': baseId,
686
+ 'quote': quote,
687
+ 'quoteId': quoteId,
688
+ 'settle': None,
689
+ 'settleId': None,
690
+ 'type': 'spot',
691
+ 'spot': True,
692
+ 'margin': marginTradable,
693
+ 'swap': False,
694
+ 'future': False,
695
+ 'option': False,
696
+ 'active': active,
697
+ 'contract': False,
698
+ 'linear': None,
699
+ 'inverse': None,
700
+ 'taker': fee,
701
+ 'maker': fee,
702
+ 'contractSize': None,
703
+ 'expiry': None,
704
+ 'expiryDatetime': None,
705
+ 'strike': None,
706
+ 'optionType': None,
707
+ 'precision': {
708
+ 'amount': self.safe_number(market, 'lotSize'),
709
+ 'price': self.safe_number(market, 'tickSize'),
710
+ },
711
+ 'limits': {
712
+ 'leverage': {
713
+ 'min': None,
714
+ 'max': None,
715
+ },
716
+ 'amount': {
717
+ 'min': minQty,
718
+ 'max': maxQty,
719
+ },
720
+ 'price': {
721
+ 'min': minPrice,
722
+ 'max': maxPrice,
723
+ },
724
+ 'cost': {
725
+ 'min': self.safe_number(market, 'minNotional'),
726
+ 'max': self.safe_number(market, 'maxNotional'),
727
+ },
728
+ },
729
+ 'created': self.safe_integer(market, 'tradingStartTime'),
730
+ 'info': market,
731
+ })
732
+ return result
733
+
734
+ def fetch_contract_markets(self, params={}) -> List[Market]:
735
+ contracts = self.v2PublicGetFuturesContract(params)
675
736
  #
676
737
  # {
677
738
  # "code": 0,
@@ -684,9 +745,9 @@ class ascendex(Exchange, ImplicitAPI):
684
745
  # "underlying": "BTC/USDT",
685
746
  # "tradingStartTime": 1579701600000,
686
747
  # "priceFilter": {
687
- # "minPrice": "1",
748
+ # "minPrice": "0.1",
688
749
  # "maxPrice": "1000000",
689
- # "tickSize": "1"
750
+ # "tickSize": "0.1"
690
751
  # },
691
752
  # "lotSizeFilter": {
692
753
  # "minQty": "0.0001",
@@ -709,50 +770,25 @@ class ascendex(Exchange, ImplicitAPI):
709
770
  # ]
710
771
  # }
711
772
  #
712
- products, cash, perpetuals = [productsPromise, cashPromise, perpetualsPromise]
713
- productsData = self.safe_list(products, 'data', [])
714
- productsById = self.index_by(productsData, 'symbol')
715
- cashData = self.safe_list(cash, 'data', [])
716
- perpetualsData = self.safe_list(perpetuals, 'data', [])
717
- cashAndPerpetualsData = self.array_concat(cashData, perpetualsData)
718
- cashAndPerpetualsById = self.index_by(cashAndPerpetualsData, 'symbol')
719
- dataById = self.deep_extend(productsById, cashAndPerpetualsById)
720
- ids = list(dataById.keys())
773
+ data = self.safe_list(contracts, 'data', [])
721
774
  result = []
722
- for i in range(0, len(ids)):
723
- id = ids[i]
724
- market = dataById[id]
725
- settleId = self.safe_string(market, 'settlementAsset')
726
- settle = self.safe_currency_code(settleId)
727
- status = self.safe_string(market, 'status')
728
- domain = self.safe_string(market, 'domain')
729
- active = False
730
- if ((status == 'Normal') or (status == 'InternalTrading')) and (domain != 'LeveragedETF'):
731
- active = True
732
- spot = settle is None
733
- swap = not spot
734
- linear = True if swap else None
735
- minQty = self.safe_number(market, 'minQty')
736
- maxQty = self.safe_number(market, 'maxQty')
737
- minPrice = self.safe_number(market, 'tickSize')
738
- maxPrice: Num = None
739
- underlying = self.safe_string_2(market, 'underlying', 'symbol')
775
+ for i in range(0, len(data)):
776
+ market = data[i]
777
+ id = self.safe_string(market, 'symbol')
778
+ underlying = self.safe_string(market, 'underlying')
740
779
  parts = underlying.split('/')
741
780
  baseId = self.safe_string(parts, 0)
742
- quoteId = self.safe_string(parts, 1)
743
781
  base = self.safe_currency_code(baseId)
782
+ quoteId = self.safe_string(parts, 1)
744
783
  quote = self.safe_currency_code(quoteId)
745
- symbol = base + '/' + quote
746
- if swap:
747
- lotSizeFilter = self.safe_dict(market, 'lotSizeFilter')
748
- minQty = self.safe_number(lotSizeFilter, 'minQty')
749
- maxQty = self.safe_number(lotSizeFilter, 'maxQty')
750
- priceFilter = self.safe_dict(market, 'priceFilter')
751
- minPrice = self.safe_number(priceFilter, 'minPrice')
752
- maxPrice = self.safe_number(priceFilter, 'maxPrice')
753
- symbol = base + '/' + quote + ':' + settle
784
+ settleId = self.safe_string(market, 'settlementAsset')
785
+ settle = self.safe_currency_code(settleId)
786
+ linear = settle == quote
787
+ inverse = settle == base
788
+ symbol = base + '/' + quote + ':' + settle
789
+ priceFilter = self.safe_dict(market, 'priceFilter')
790
+ lotSizeFilter = self.safe_dict(market, 'lotSizeFilter')
754
791
  fee = self.safe_number(market, 'commissionReserveRate')
755
- marginTradable = self.safe_bool(market, 'marginTradable', False)
756
792
  result.append({
757
793
  'id': id,
758
794
  'symbol': symbol,
@@ -762,26 +798,26 @@ class ascendex(Exchange, ImplicitAPI):
762
798
  'baseId': baseId,
763
799
  'quoteId': quoteId,
764
800
  'settleId': settleId,
765
- 'type': 'swap' if swap else 'spot',
766
- 'spot': spot,
767
- 'margin': marginTradable if spot else None,
768
- 'swap': swap,
801
+ 'type': 'swap',
802
+ 'spot': False,
803
+ 'margin': None,
804
+ 'swap': True,
769
805
  'future': False,
770
806
  'option': False,
771
- 'active': active,
772
- 'contract': swap,
807
+ 'active': self.safe_string(market, 'status') == 'Normal',
808
+ 'contract': True,
773
809
  'linear': linear,
774
- 'inverse': not linear if swap else None,
810
+ 'inverse': inverse,
775
811
  'taker': fee,
776
812
  'maker': fee,
777
- 'contractSize': self.parse_number('1') if swap else None,
813
+ 'contractSize': self.parse_number('1'),
778
814
  'expiry': None,
779
815
  'expiryDatetime': None,
780
816
  'strike': None,
781
817
  'optionType': None,
782
818
  'precision': {
783
- 'amount': self.safe_number(market, 'lotSize'),
784
- 'price': self.safe_number(market, 'tickSize'),
819
+ 'amount': self.safe_number(lotSizeFilter, 'lotSize'),
820
+ 'price': self.safe_number(priceFilter, 'tickSize'),
785
821
  },
786
822
  'limits': {
787
823
  'leverage': {
@@ -789,12 +825,12 @@ class ascendex(Exchange, ImplicitAPI):
789
825
  'max': None,
790
826
  },
791
827
  'amount': {
792
- 'min': minQty,
793
- 'max': maxQty,
828
+ 'min': self.safe_number(lotSizeFilter, 'minQty'),
829
+ 'max': self.safe_number(lotSizeFilter, 'maxQty'),
794
830
  },
795
831
  'price': {
796
- 'min': minPrice,
797
- 'max': maxPrice,
832
+ 'min': self.safe_number(priceFilter, 'minPrice'),
833
+ 'max': self.safe_number(priceFilter, 'maxPrice'),
798
834
  },
799
835
  'cost': {
800
836
  'min': self.safe_number(market, 'minNotional'),
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.85'
7
+ __version__ = '4.4.86'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -87,6 +87,7 @@ from ccxt.async_support.bitrue import bitrue
87
87
  from ccxt.async_support.bitso import bitso # noqa: F401
88
88
  from ccxt.async_support.bitstamp import bitstamp # noqa: F401
89
89
  from ccxt.async_support.bitteam import bitteam # noqa: F401
90
+ from ccxt.async_support.bittrade import bittrade # noqa: F401
90
91
  from ccxt.async_support.bitvavo import bitvavo # noqa: F401
91
92
  from ccxt.async_support.blockchaincom import blockchaincom # noqa: F401
92
93
  from ccxt.async_support.blofin import blofin # noqa: F401
@@ -127,7 +128,6 @@ from ccxt.async_support.hitbtc import hitbtc
127
128
  from ccxt.async_support.hollaex import hollaex # noqa: F401
128
129
  from ccxt.async_support.htx import htx # noqa: F401
129
130
  from ccxt.async_support.huobi import huobi # noqa: F401
130
- from ccxt.async_support.huobijp import huobijp # noqa: F401
131
131
  from ccxt.async_support.hyperliquid import hyperliquid # noqa: F401
132
132
  from ccxt.async_support.independentreserve import independentreserve # noqa: F401
133
133
  from ccxt.async_support.indodax import indodax # noqa: F401
@@ -135,7 +135,6 @@ from ccxt.async_support.kraken import kraken
135
135
  from ccxt.async_support.krakenfutures import krakenfutures # noqa: F401
136
136
  from ccxt.async_support.kucoin import kucoin # noqa: F401
137
137
  from ccxt.async_support.kucoinfutures import kucoinfutures # noqa: F401
138
- from ccxt.async_support.kuna import kuna # noqa: F401
139
138
  from ccxt.async_support.latoken import latoken # noqa: F401
140
139
  from ccxt.async_support.lbank import lbank # noqa: F401
141
140
  from ccxt.async_support.luno import luno # noqa: F401
@@ -194,6 +193,7 @@ exchanges = [
194
193
  'bitso',
195
194
  'bitstamp',
196
195
  'bitteam',
196
+ 'bittrade',
197
197
  'bitvavo',
198
198
  'blockchaincom',
199
199
  'blofin',
@@ -234,7 +234,6 @@ exchanges = [
234
234
  'hollaex',
235
235
  'htx',
236
236
  'huobi',
237
- 'huobijp',
238
237
  'hyperliquid',
239
238
  'independentreserve',
240
239
  'indodax',
@@ -242,7 +241,6 @@ exchanges = [
242
241
  'krakenfutures',
243
242
  'kucoin',
244
243
  'kucoinfutures',
245
- 'kuna',
246
244
  'latoken',
247
245
  'lbank',
248
246
  'luno',