ccxt 4.4.75__py2.py3-none-any.whl → 4.4.78__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 (111) hide show
  1. ccxt/__init__.py +3 -3
  2. ccxt/abstract/apex.py +31 -0
  3. ccxt/abstract/myokx.py +4 -0
  4. ccxt/abstract/okx.py +4 -0
  5. ccxt/abstract/upbit.py +51 -37
  6. ccxt/abstract/xt.py +3 -0
  7. ccxt/apex.py +1884 -0
  8. ccxt/ascendex.py +2 -2
  9. ccxt/async_support/__init__.py +3 -3
  10. ccxt/async_support/apex.py +1884 -0
  11. ccxt/async_support/ascendex.py +2 -2
  12. ccxt/async_support/base/exchange.py +2 -2
  13. ccxt/async_support/binance.py +39 -217
  14. ccxt/async_support/bingx.py +1 -1
  15. ccxt/async_support/bitfinex.py +2 -2
  16. ccxt/async_support/bitflyer.py +2 -2
  17. ccxt/async_support/bitget.py +135 -65
  18. ccxt/async_support/bitmart.py +2 -2
  19. ccxt/async_support/bitmex.py +6 -6
  20. ccxt/async_support/bitrue.py +48 -0
  21. ccxt/async_support/cex.py +1 -1
  22. ccxt/async_support/coinbase.py +29 -4
  23. ccxt/async_support/coincatch.py +66 -0
  24. ccxt/async_support/coinex.py +3 -1
  25. ccxt/async_support/coinlist.py +85 -2
  26. ccxt/async_support/cryptocom.py +2 -2
  27. ccxt/async_support/defx.py +1 -1
  28. ccxt/async_support/delta.py +1 -1
  29. ccxt/async_support/deribit.py +2 -2
  30. ccxt/async_support/derive.py +2 -2
  31. ccxt/async_support/digifinex.py +2 -2
  32. ccxt/async_support/gate.py +1 -1
  33. ccxt/async_support/hitbtc.py +5 -2
  34. ccxt/async_support/htx.py +2 -2
  35. ccxt/async_support/hyperliquid.py +13 -6
  36. ccxt/async_support/kraken.py +2 -2
  37. ccxt/async_support/krakenfutures.py +2 -2
  38. ccxt/async_support/kucoinfutures.py +2 -2
  39. ccxt/async_support/mexc.py +50 -52
  40. ccxt/async_support/okx.py +21 -9
  41. ccxt/async_support/oxfun.py +2 -2
  42. ccxt/async_support/paradex.py +5 -10
  43. ccxt/async_support/phemex.py +4 -3
  44. ccxt/async_support/poloniex.py +3 -3
  45. ccxt/async_support/probit.py +1 -0
  46. ccxt/async_support/tradeogre.py +2 -1
  47. ccxt/async_support/upbit.py +265 -89
  48. ccxt/async_support/vertex.py +2 -2
  49. ccxt/async_support/whitebit.py +1 -0
  50. ccxt/async_support/woo.py +5 -3
  51. ccxt/async_support/woofipro.py +2 -2
  52. ccxt/async_support/xt.py +115 -5
  53. ccxt/base/exchange.py +76 -3
  54. ccxt/binance.py +39 -217
  55. ccxt/bingx.py +1 -1
  56. ccxt/bitfinex.py +2 -2
  57. ccxt/bitflyer.py +2 -2
  58. ccxt/bitget.py +135 -65
  59. ccxt/bitmart.py +2 -2
  60. ccxt/bitmex.py +6 -6
  61. ccxt/bitrue.py +48 -0
  62. ccxt/cex.py +1 -1
  63. ccxt/coinbase.py +29 -4
  64. ccxt/coincatch.py +66 -0
  65. ccxt/coinex.py +3 -1
  66. ccxt/coinlist.py +85 -2
  67. ccxt/cryptocom.py +2 -2
  68. ccxt/defx.py +1 -1
  69. ccxt/delta.py +1 -1
  70. ccxt/deribit.py +2 -2
  71. ccxt/derive.py +2 -2
  72. ccxt/digifinex.py +2 -2
  73. ccxt/gate.py +1 -1
  74. ccxt/hitbtc.py +5 -2
  75. ccxt/htx.py +2 -2
  76. ccxt/hyperliquid.py +13 -6
  77. ccxt/kraken.py +2 -2
  78. ccxt/krakenfutures.py +2 -2
  79. ccxt/kucoinfutures.py +2 -2
  80. ccxt/mexc.py +50 -52
  81. ccxt/okx.py +21 -9
  82. ccxt/oxfun.py +2 -2
  83. ccxt/paradex.py +5 -10
  84. ccxt/phemex.py +4 -3
  85. ccxt/poloniex.py +3 -3
  86. ccxt/pro/__init__.py +5 -1
  87. ccxt/pro/apex.py +984 -0
  88. ccxt/pro/coinbase.py +4 -6
  89. ccxt/pro/gate.py +22 -2
  90. ccxt/pro/hollaex.py +2 -2
  91. ccxt/pro/hyperliquid.py +1 -1
  92. ccxt/pro/p2b.py +2 -2
  93. ccxt/pro/tradeogre.py +272 -0
  94. ccxt/probit.py +1 -0
  95. ccxt/test/tests_async.py +27 -0
  96. ccxt/test/tests_sync.py +27 -0
  97. ccxt/tradeogre.py +2 -1
  98. ccxt/upbit.py +265 -89
  99. ccxt/vertex.py +2 -2
  100. ccxt/whitebit.py +1 -0
  101. ccxt/woo.py +5 -3
  102. ccxt/woofipro.py +2 -2
  103. ccxt/xt.py +115 -5
  104. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/METADATA +4 -4
  105. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/RECORD +108 -106
  106. ccxt/abstract/ace.py +0 -15
  107. ccxt/ace.py +0 -1152
  108. ccxt/async_support/ace.py +0 -1152
  109. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/LICENSE.txt +0 -0
  110. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/WHEEL +0 -0
  111. {ccxt-4.4.75.dist-info → ccxt-4.4.78.dist-info}/top_level.txt +0 -0
ccxt/async_support/okx.py CHANGED
@@ -398,6 +398,7 @@ class okx(Exchange, ImplicitAPI):
398
398
  'asset/subaccount/managed-subaccount-bills': 5 / 3,
399
399
  'users/entrust-subaccount-list': 10,
400
400
  'account/subaccount/interest-limits': 4,
401
+ 'users/subaccount/apikey': 10,
401
402
  # grid trading
402
403
  'tradingBot/grid/orders-algo-pending': 1,
403
404
  'tradingBot/grid/orders-algo-history': 1,
@@ -530,6 +531,9 @@ class okx(Exchange, ImplicitAPI):
530
531
  'asset/subaccount/transfer': 10,
531
532
  'users/subaccount/set-transfer-out': 10,
532
533
  'account/subaccount/set-loan-allocation': 4,
534
+ 'users/subaccount/create-subaccount': 10,
535
+ 'users/subaccount/subaccount-apikey': 10,
536
+ 'users/subaccount/delete-apikey': 10,
533
537
  # grid trading
534
538
  'tradingBot/grid/order-algo': 1,
535
539
  'tradingBot/grid/amend-order-algo': 1,
@@ -940,6 +944,11 @@ class okx(Exchange, ImplicitAPI):
940
944
  '59506': ExchangeError, # APIKey does not exist
941
945
  '59507': ExchangeError, # The two accounts involved in a transfer must be two different sub accounts under the same parent account
942
946
  '59508': AccountSuspended, # The sub account of {0} is suspended
947
+ '59515': ExchangeError, # You are currently not on the custody whitelist. Please contact customer service for assistance.
948
+ '59516': ExchangeError, # Please create the Copper custody funding account first.
949
+ '59517': ExchangeError, # Please create the Komainu custody funding account first.
950
+ '59518': ExchangeError, # You can’t create a sub-account using the API; please use the app or web.
951
+ '59519': ExchangeError, # You can’t use self function/feature while it's frozen, due to: {freezereason}
943
952
  '59642': BadRequest, # Lead and copy traders can only use margin-free or single-currency margin account modes
944
953
  '59643': ExchangeError, # Couldn’t switch account modes’re currently copying spot trades
945
954
  # WebSocket error Codes from 60000-63999
@@ -1608,8 +1617,8 @@ class okx(Exchange, ImplicitAPI):
1608
1617
  swap = (type == 'swap')
1609
1618
  option = (type == 'option')
1610
1619
  contract = swap or future or option
1611
- baseId = self.safe_string(market, 'baseCcy')
1612
- quoteId = self.safe_string(market, 'quoteCcy')
1620
+ baseId = self.safe_string(market, 'baseCcy', '') # defaulting to '' because some weird preopen markets have empty baseId
1621
+ quoteId = self.safe_string(market, 'quoteCcy', '')
1613
1622
  settleId = self.safe_string(market, 'settleCcy')
1614
1623
  settle = self.safe_currency_code(settleId)
1615
1624
  underlying = self.safe_string(market, 'uly')
@@ -1624,18 +1633,21 @@ class okx(Exchange, ImplicitAPI):
1624
1633
  strikePrice = None
1625
1634
  optionType = None
1626
1635
  if contract:
1627
- symbol = symbol + ':' + settle
1636
+ if settle is not None:
1637
+ symbol = symbol + ':' + settle
1628
1638
  if future:
1629
1639
  expiry = self.safe_integer(market, 'expTime')
1630
- ymd = self.yymmdd(expiry)
1631
- symbol = symbol + '-' + ymd
1640
+ if expiry is not None:
1641
+ ymd = self.yymmdd(expiry)
1642
+ symbol = symbol + '-' + ymd
1632
1643
  elif option:
1633
1644
  expiry = self.safe_integer(market, 'expTime')
1634
1645
  strikePrice = self.safe_string(market, 'stk')
1635
1646
  optionType = self.safe_string(market, 'optType')
1636
- ymd = self.yymmdd(expiry)
1637
- symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType
1638
- optionType = 'put' if (optionType == 'P') else 'call'
1647
+ if expiry is not None:
1648
+ ymd = self.yymmdd(expiry)
1649
+ symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType
1650
+ optionType = 'put' if (optionType == 'P') else 'call'
1639
1651
  tickSize = self.safe_string(market, 'tickSz')
1640
1652
  fees = self.safe_dict_2(self.fees, type, 'trading', {})
1641
1653
  maxLeverage = self.safe_string(market, 'lever', '1')
@@ -5390,7 +5402,7 @@ class okx(Exchange, ImplicitAPI):
5390
5402
  return None
5391
5403
  return self.parse_position(position, market)
5392
5404
 
5393
- async def fetch_positions(self, symbols: Strings = None, params={}):
5405
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
5394
5406
  """
5395
5407
 
5396
5408
  https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.oxfun import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -2130,7 +2130,7 @@ class oxfun(Exchange, ImplicitAPI):
2130
2130
  data['type'] = 'withdrawal'
2131
2131
  return self.parse_transaction(data, currency)
2132
2132
 
2133
- async def fetch_positions(self, symbols: Strings = None, params={}):
2133
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2134
2134
  """
2135
2135
  fetch all open positions
2136
2136
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.paradex import ImplicitAPI
8
- from ccxt.base.types import Any, Balances, Currency, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
8
+ from ccxt.base.types import Any, Balances, Currency, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -703,14 +703,9 @@ class paradex(Exchange, ImplicitAPI):
703
703
  """
704
704
  await self.load_markets()
705
705
  symbols = self.market_symbols(symbols)
706
- request: dict = {}
707
- if symbols is not None:
708
- if isinstance(symbols, list):
709
- request['market'] = self.market_id(symbols[0])
710
- else:
711
- request['market'] = self.market_id(symbols)
712
- else:
713
- request['market'] = 'ALL'
706
+ request: dict = {
707
+ 'market': 'ALL',
708
+ }
714
709
  response = await self.publicGetMarketsSummary(self.extend(request, params))
715
710
  #
716
711
  # {
@@ -1820,7 +1815,7 @@ class paradex(Exchange, ImplicitAPI):
1820
1815
  positions = await self.fetch_positions([market['symbol']], params)
1821
1816
  return self.safe_dict(positions, 0, {})
1822
1817
 
1823
- async def fetch_positions(self, symbols: Strings = None, params={}):
1818
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
1824
1819
  """
1825
1820
  fetch all open positions
1826
1821
 
@@ -8,7 +8,7 @@ from ccxt.abstract.phemex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import numbers
11
- from ccxt.base.types import Any, Balances, Conversion, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
11
+ from ccxt.base.types import Any, Balances, Conversion, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -1167,7 +1167,8 @@ class phemex(Exchange, ImplicitAPI):
1167
1167
  },
1168
1168
  },
1169
1169
  'valueScale': valueScale,
1170
- 'networks': {},
1170
+ 'networks': None,
1171
+ 'type': 'crypto',
1171
1172
  }
1172
1173
  return result
1173
1174
 
@@ -3571,7 +3572,7 @@ class phemex(Exchange, ImplicitAPI):
3571
3572
  'fee': fee,
3572
3573
  }
3573
3574
 
3574
- async def fetch_positions(self, symbols: Strings = None, params={}):
3575
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
3575
3576
  """
3576
3577
  fetch all open positions
3577
3578
 
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.poloniex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -1828,7 +1828,7 @@ class poloniex(Exchange, ImplicitAPI):
1828
1828
  isTrigger = self.safe_value_2(params, 'trigger', 'stop')
1829
1829
  params = self.omit(params, ['trigger', 'stop'])
1830
1830
  response = None
1831
- if not market['spot']:
1831
+ if marketType != 'spot':
1832
1832
  raw = await self.swapPrivateGetV3TradeOrderOpens(self.extend(request, params))
1833
1833
  #
1834
1834
  # {
@@ -3285,7 +3285,7 @@ class poloniex(Exchange, ImplicitAPI):
3285
3285
  #
3286
3286
  return response
3287
3287
 
3288
- async def fetch_positions(self, symbols: Strings = None, params={}):
3288
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
3289
3289
  """
3290
3290
  fetch all open positions
3291
3291
 
@@ -563,6 +563,7 @@ class probit(Exchange, ImplicitAPI):
563
563
  'active': active,
564
564
  'deposit': deposit,
565
565
  'withdraw': withdraw,
566
+ 'type': 'crypto',
566
567
  'fee': fee,
567
568
  'precision': self.parse_number(self.parse_precision(self.safe_string(platform, 'precision'))),
568
569
  'limits': {
@@ -24,7 +24,7 @@ class tradeogre(Exchange, ImplicitAPI):
24
24
  'countries': [],
25
25
  'rateLimit': 100,
26
26
  'version': 'v2',
27
- 'pro': False,
27
+ 'pro': True,
28
28
  'has': {
29
29
  'CORS': None,
30
30
  'spot': True,
@@ -525,6 +525,7 @@ class tradeogre(Exchange, ImplicitAPI):
525
525
  'asks': rawAsks,
526
526
  }
527
527
  orderbook = self.parse_order_book(rawOrderbook, symbol)
528
+ orderbook['nonce'] = self.safe_integer(response, 's')
528
529
  return orderbook
529
530
 
530
531
  def parse_bids_asks(self, bidasks, priceKey: IndexType = 0, amountKey: IndexType = 1, countOrIdKey: IndexType = 2):