ccxt 4.4.15__py2.py3-none-any.whl → 4.4.17__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 (149) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/mexc.py +1 -0
  3. ccxt/ascendex.py +5 -5
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/ascendex.py +5 -5
  6. ccxt/async_support/base/exchange.py +1 -1
  7. ccxt/async_support/bigone.py +6 -4
  8. ccxt/async_support/binance.py +66 -10
  9. ccxt/async_support/bingx.py +61 -6
  10. ccxt/async_support/bit2c.py +6 -4
  11. ccxt/async_support/bitbank.py +6 -4
  12. ccxt/async_support/bitbns.py +6 -4
  13. ccxt/async_support/bitfinex.py +4 -2
  14. ccxt/async_support/bitfinex2.py +4 -2
  15. ccxt/async_support/bitget.py +6 -5
  16. ccxt/async_support/bitmart.py +5 -4
  17. ccxt/async_support/bitmex.py +4 -4
  18. ccxt/async_support/bitso.py +5 -4
  19. ccxt/async_support/bitstamp.py +6 -4
  20. ccxt/async_support/bitvavo.py +8 -6
  21. ccxt/async_support/blockchaincom.py +11 -8
  22. ccxt/async_support/blofin.py +21 -0
  23. ccxt/async_support/bybit.py +12 -9
  24. ccxt/async_support/cex.py +5 -4
  25. ccxt/async_support/coinbase.py +4 -4
  26. ccxt/async_support/coinbaseinternational.py +4 -8
  27. ccxt/async_support/coinex.py +5 -5
  28. ccxt/async_support/coinone.py +6 -3
  29. ccxt/async_support/coinsph.py +5 -5
  30. ccxt/async_support/cryptocom.py +5 -4
  31. ccxt/async_support/currencycom.py +5 -5
  32. ccxt/async_support/delta.py +7 -5
  33. ccxt/async_support/deribit.py +6 -4
  34. ccxt/async_support/digifinex.py +6 -4
  35. ccxt/async_support/exmo.py +6 -4
  36. ccxt/async_support/gate.py +5 -4
  37. ccxt/async_support/gemini.py +4 -3
  38. ccxt/async_support/hashkey.py +7 -5
  39. ccxt/async_support/hitbtc.py +6 -5
  40. ccxt/async_support/hollaex.py +6 -5
  41. ccxt/async_support/htx.py +15 -5
  42. ccxt/async_support/hyperliquid.py +8 -7
  43. ccxt/async_support/idex.py +4 -4
  44. ccxt/async_support/independentreserve.py +4 -4
  45. ccxt/async_support/indodax.py +3 -3
  46. ccxt/async_support/kraken.py +7 -5
  47. ccxt/async_support/kucoin.py +6 -5
  48. ccxt/async_support/kucoinfutures.py +5 -3
  49. ccxt/async_support/kuna.py +9 -15
  50. ccxt/async_support/lbank.py +14 -12
  51. ccxt/async_support/lykke.py +6 -4
  52. ccxt/async_support/mexc.py +7 -6
  53. ccxt/async_support/ndax.py +33 -5
  54. ccxt/async_support/oceanex.py +4 -4
  55. ccxt/async_support/okcoin.py +8 -6
  56. ccxt/async_support/okx.py +50 -7
  57. ccxt/async_support/onetrading.py +6 -5
  58. ccxt/async_support/oxfun.py +6 -6
  59. ccxt/async_support/paymium.py +6 -5
  60. ccxt/async_support/phemex.py +8 -6
  61. ccxt/async_support/poloniex.py +6 -4
  62. ccxt/async_support/probit.py +7 -6
  63. ccxt/async_support/timex.py +8 -12
  64. ccxt/async_support/tokocrypto.py +5 -5
  65. ccxt/async_support/upbit.py +7 -6
  66. ccxt/async_support/wavesexchange.py +9 -9
  67. ccxt/async_support/wazirx.py +24 -4
  68. ccxt/async_support/whitebit.py +6 -4
  69. ccxt/async_support/woo.py +6 -4
  70. ccxt/async_support/xt.py +7 -5
  71. ccxt/async_support/yobit.py +32 -23
  72. ccxt/async_support/zonda.py +31 -6
  73. ccxt/base/exchange.py +14 -2
  74. ccxt/base/types.py +8 -0
  75. ccxt/bigone.py +6 -4
  76. ccxt/binance.py +66 -10
  77. ccxt/bingx.py +61 -6
  78. ccxt/bit2c.py +6 -4
  79. ccxt/bitbank.py +6 -4
  80. ccxt/bitbns.py +6 -4
  81. ccxt/bitfinex.py +4 -2
  82. ccxt/bitfinex2.py +4 -2
  83. ccxt/bitget.py +6 -5
  84. ccxt/bitmart.py +5 -4
  85. ccxt/bitmex.py +4 -4
  86. ccxt/bitso.py +5 -4
  87. ccxt/bitstamp.py +6 -4
  88. ccxt/bitvavo.py +8 -6
  89. ccxt/blockchaincom.py +11 -8
  90. ccxt/blofin.py +21 -0
  91. ccxt/bybit.py +12 -9
  92. ccxt/cex.py +5 -4
  93. ccxt/coinbase.py +4 -4
  94. ccxt/coinbaseinternational.py +4 -8
  95. ccxt/coinex.py +5 -5
  96. ccxt/coinone.py +6 -3
  97. ccxt/coinsph.py +5 -5
  98. ccxt/cryptocom.py +5 -4
  99. ccxt/currencycom.py +5 -5
  100. ccxt/delta.py +7 -5
  101. ccxt/deribit.py +6 -4
  102. ccxt/digifinex.py +6 -4
  103. ccxt/exmo.py +6 -4
  104. ccxt/gate.py +5 -4
  105. ccxt/gemini.py +4 -3
  106. ccxt/hashkey.py +7 -5
  107. ccxt/hitbtc.py +6 -5
  108. ccxt/hollaex.py +6 -5
  109. ccxt/htx.py +15 -5
  110. ccxt/hyperliquid.py +8 -7
  111. ccxt/idex.py +4 -4
  112. ccxt/independentreserve.py +4 -4
  113. ccxt/indodax.py +3 -3
  114. ccxt/kraken.py +7 -5
  115. ccxt/kucoin.py +6 -5
  116. ccxt/kucoinfutures.py +5 -3
  117. ccxt/kuna.py +9 -15
  118. ccxt/lbank.py +14 -12
  119. ccxt/lykke.py +6 -4
  120. ccxt/mexc.py +7 -6
  121. ccxt/ndax.py +33 -5
  122. ccxt/oceanex.py +4 -4
  123. ccxt/okcoin.py +8 -6
  124. ccxt/okx.py +50 -7
  125. ccxt/onetrading.py +6 -5
  126. ccxt/oxfun.py +6 -6
  127. ccxt/paymium.py +6 -5
  128. ccxt/phemex.py +8 -6
  129. ccxt/poloniex.py +6 -4
  130. ccxt/pro/__init__.py +1 -1
  131. ccxt/pro/bitvavo.py +1 -1
  132. ccxt/probit.py +7 -6
  133. ccxt/test/tests_async.py +1 -0
  134. ccxt/test/tests_sync.py +1 -0
  135. ccxt/timex.py +8 -12
  136. ccxt/tokocrypto.py +5 -5
  137. ccxt/upbit.py +7 -6
  138. ccxt/wavesexchange.py +9 -9
  139. ccxt/wazirx.py +24 -4
  140. ccxt/whitebit.py +6 -4
  141. ccxt/woo.py +6 -4
  142. ccxt/xt.py +7 -5
  143. ccxt/yobit.py +32 -23
  144. ccxt/zonda.py +31 -6
  145. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/METADATA +4 -4
  146. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/RECORD +149 -149
  147. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/LICENSE.txt +0 -0
  148. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/WHEEL +0 -0
  149. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/top_level.txt +0 -0
ccxt/kuna.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.kuna import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import ArgumentsRequired
@@ -58,6 +58,8 @@ class kuna(Exchange, ImplicitAPI):
58
58
  'fetchCurrencies': True,
59
59
  'fetchDeposit': True,
60
60
  'fetchDepositAddress': True,
61
+ 'fetchDepositAddresses': False,
62
+ 'fetchDepositAddressesByNetwork': False,
61
63
  'fetchDeposits': True,
62
64
  'fetchDepositsWithdrawals': False,
63
65
  'fetchFundingHistory': False,
@@ -460,15 +462,7 @@ class kuna(Exchange, ImplicitAPI):
460
462
  data = self.safe_value(response, 'data', [])
461
463
  return self.parse_currencies(data)
462
464
 
463
- def parse_currencies(self, currencies, params={}):
464
- currencies = self.to_array(currencies)
465
- result: dict = {}
466
- for i in range(0, len(currencies)):
467
- currency = self.parse_currency(currencies[i])
468
- result[currency['code']] = currency
469
- return result
470
-
471
- def parse_currency(self, currency: dict):
465
+ def parse_currency(self, currency: dict) -> Currency:
472
466
  #
473
467
  # {
474
468
  # "code": "BTC",
@@ -492,7 +486,7 @@ class kuna(Exchange, ImplicitAPI):
492
486
  currencyId = self.safe_string(currency, 'code')
493
487
  precision = self.safe_string(currency, 'precision')
494
488
  tradePrecision = self.safe_string(currency, 'tradePrecision')
495
- return {
489
+ return self.safe_currency_structure({
496
490
  'info': currency,
497
491
  'id': currencyId,
498
492
  'code': self.safe_currency_code(currencyId),
@@ -503,7 +497,7 @@ class kuna(Exchange, ImplicitAPI):
503
497
  'deposit': None,
504
498
  'withdraw': None,
505
499
  'fee': None,
506
- 'precision': Precise.string_min(precision, tradePrecision),
500
+ 'precision': self.parse_number(Precise.string_min(precision, tradePrecision)),
507
501
  'limits': {
508
502
  'amount': {
509
503
  'min': None,
@@ -515,7 +509,7 @@ class kuna(Exchange, ImplicitAPI):
515
509
  },
516
510
  },
517
511
  'networks': {},
518
- }
512
+ })
519
513
 
520
514
  def fetch_markets(self, params={}) -> List[Market]:
521
515
  """
@@ -1511,7 +1505,7 @@ class kuna(Exchange, ImplicitAPI):
1511
1505
  data = self.safe_dict(response, 'data', {})
1512
1506
  return self.parse_deposit_address(data, currency)
1513
1507
 
1514
- def fetch_deposit_address(self, code: str, params={}):
1508
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1515
1509
  """
1516
1510
  fetch the deposit address for a currency associated with self account
1517
1511
  :see: https://docs.kuna.io/docs/find-crypto-address-for-deposit
@@ -1537,7 +1531,7 @@ class kuna(Exchange, ImplicitAPI):
1537
1531
  data = self.safe_dict(response, 'data', {})
1538
1532
  return self.parse_deposit_address(data, currency)
1539
1533
 
1540
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1534
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1541
1535
  #
1542
1536
  # {
1543
1537
  # "id": "c52b6646-fb91-4760-b147-a4f952e8652c", # ID of the address.
ccxt/lbank.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.lbank import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -62,6 +62,8 @@ class lbank(Exchange, ImplicitAPI):
62
62
  'fetchCrossBorrowRate': False,
63
63
  'fetchCrossBorrowRates': False,
64
64
  'fetchDepositAddress': True,
65
+ 'fetchDepositAddresses': False,
66
+ 'fetchDepositAddressesByNetwork': False,
65
67
  'fetchDepositWithdrawFee': 'emulated',
66
68
  'fetchDepositWithdrawFees': True,
67
69
  'fetchFundingHistory': False,
@@ -1831,7 +1833,7 @@ class lbank(Exchange, ImplicitAPI):
1831
1833
  network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
1832
1834
  return network
1833
1835
 
1834
- def fetch_deposit_address(self, code: str, params={}):
1836
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1835
1837
  """
1836
1838
  fetch the deposit address for a currency associated with self account
1837
1839
  :see: https://www.lbank.com/en-US/docs/index.html#get-deposit-address
@@ -1852,7 +1854,7 @@ class lbank(Exchange, ImplicitAPI):
1852
1854
  response = self.fetch_deposit_address_default(code, params)
1853
1855
  return response
1854
1856
 
1855
- def fetch_deposit_address_default(self, code: str, params={}):
1857
+ def fetch_deposit_address_default(self, code: str, params={}) -> DepositAddress:
1856
1858
  self.load_markets()
1857
1859
  currency = self.currency(code)
1858
1860
  request: dict = {
@@ -1883,14 +1885,14 @@ class lbank(Exchange, ImplicitAPI):
1883
1885
  inverseNetworks = self.safe_value(self.options, 'inverse-networks', {})
1884
1886
  networkCode = self.safe_string_upper(inverseNetworks, networkId, networkId)
1885
1887
  return {
1888
+ 'info': response,
1886
1889
  'currency': code,
1890
+ 'network': networkCode,
1887
1891
  'address': address,
1888
1892
  'tag': tag,
1889
- 'network': networkCode,
1890
- 'info': response,
1891
1893
  }
1892
1894
 
1893
- def fetch_deposit_address_supplement(self, code: str, params={}):
1895
+ def fetch_deposit_address_supplement(self, code: str, params={}) -> DepositAddress:
1894
1896
  # returns the address for whatever the default network is...
1895
1897
  self.load_markets()
1896
1898
  currency = self.currency(code)
@@ -1922,11 +1924,11 @@ class lbank(Exchange, ImplicitAPI):
1922
1924
  inverseNetworks = self.safe_value(self.options, 'inverse-networks', {})
1923
1925
  networkCode = self.safe_string_upper(inverseNetworks, network, network)
1924
1926
  return {
1927
+ 'info': response,
1925
1928
  'currency': code,
1929
+ 'network': networkCode, # will be None if not specified in request
1926
1930
  'address': address,
1927
1931
  'tag': tag,
1928
- 'network': networkCode, # will be None if not specified in request
1929
- 'info': response,
1930
1932
  }
1931
1933
 
1932
1934
  def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
@@ -2328,7 +2330,7 @@ class lbank(Exchange, ImplicitAPI):
2328
2330
  when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying self.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
2329
2331
  :see: https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
2330
2332
  :see: https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
2331
- :param str[]|None codes: array of unified currency codes
2333
+ :param str[] [codes]: array of unified currency codes
2332
2334
  :param dict [params]: extra parameters specific to the exchange API endpoint
2333
2335
  :returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
2334
2336
  """
@@ -2341,11 +2343,11 @@ class lbank(Exchange, ImplicitAPI):
2341
2343
  method = self.safe_string(params, 'method', defaultMethod)
2342
2344
  params = self.omit(params, 'method')
2343
2345
  if method == 'fetchPublicDepositWithdrawFees':
2344
- self.fetch_public_deposit_withdraw_fees(codes, params)
2346
+ response = self.fetch_public_deposit_withdraw_fees(codes, params)
2345
2347
  else:
2346
- self.fetch_private_deposit_withdraw_fees(codes, params)
2348
+ response = self.fetch_private_deposit_withdraw_fees(codes, params)
2347
2349
  else:
2348
- self.fetch_public_deposit_withdraw_fees(codes, params)
2350
+ response = self.fetch_public_deposit_withdraw_fees(codes, params)
2349
2351
  return response
2350
2352
 
2351
2353
  def fetch_private_deposit_withdraw_fees(self, codes=None, params={}):
ccxt/lykke.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.lykke import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
8
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, 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 BadRequest
@@ -50,6 +50,8 @@ class lykke(Exchange, ImplicitAPI):
50
50
  'fetchCrossBorrowRates': False,
51
51
  'fetchCurrencies': True,
52
52
  'fetchDepositAddress': True,
53
+ 'fetchDepositAddresses': False,
54
+ 'fetchDepositAddressesByNetwork': False,
53
55
  'fetchDeposits': False,
54
56
  'fetchDepositsWithdrawals': True,
55
57
  'fetchFundingHistory': False,
@@ -1072,7 +1074,7 @@ class lykke(Exchange, ImplicitAPI):
1072
1074
  amount = Precise.string_abs(self.safe_string(bidask, amountKey))
1073
1075
  return [self.parse_number(price), self.parse_number(amount)]
1074
1076
 
1075
- def fetch_deposit_address(self, code: str, params={}):
1077
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1076
1078
  """
1077
1079
  fetch the deposit address for a currency associated with self account
1078
1080
  :see: https://lykkecity.github.io/Trading-API/#get-deposit-address-for-a-given-asset
@@ -1100,11 +1102,11 @@ class lykke(Exchange, ImplicitAPI):
1100
1102
  tag = self.safe_string(response, 'addressExtension')
1101
1103
  self.check_address(address)
1102
1104
  return {
1105
+ 'info': response,
1103
1106
  'currency': code,
1107
+ 'network': None,
1104
1108
  'address': address,
1105
1109
  'tag': tag,
1106
- 'network': None,
1107
- 'info': response,
1108
1110
  }
1109
1111
 
1110
1112
  def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
ccxt/mexc.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.mexc import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currencies, Currency, IndexType, Int, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, IndexType, Int, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, 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
@@ -242,6 +242,7 @@ class mexc(Exchange, ImplicitAPI):
242
242
  'rebate/affiliate/commission/detail': 1,
243
243
  'mxDeduct/enable': 1,
244
244
  'userDataStream': 1,
245
+ 'selfSymbols': 1,
245
246
  },
246
247
  'post': {
247
248
  'order': 1,
@@ -4220,7 +4221,7 @@ class mexc(Exchange, ImplicitAPI):
4220
4221
  floor = cap
4221
4222
  return tiers
4222
4223
 
4223
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4224
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4224
4225
  #
4225
4226
  # {
4226
4227
  # coin: "USDT",
@@ -4234,14 +4235,14 @@ class mexc(Exchange, ImplicitAPI):
4234
4235
  networkId = self.safe_string(depositAddress, 'netWork')
4235
4236
  self.check_address(address)
4236
4237
  return {
4238
+ 'info': depositAddress,
4237
4239
  'currency': self.safe_currency_code(currencyId, currency),
4240
+ 'network': self.network_id_to_code(networkId),
4238
4241
  'address': address,
4239
4242
  'tag': self.safe_string(depositAddress, 'memo'),
4240
- 'network': self.network_id_to_code(networkId),
4241
- 'info': depositAddress,
4242
4243
  }
4243
4244
 
4244
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
4245
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4245
4246
  """
4246
4247
  fetch a dictionary of addresses for a currency, indexed by network
4247
4248
  :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
@@ -4323,7 +4324,7 @@ class mexc(Exchange, ImplicitAPI):
4323
4324
  # }
4324
4325
  return self.parse_deposit_address(response, currency)
4325
4326
 
4326
- def fetch_deposit_address(self, code: str, params={}):
4327
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4327
4328
  """
4328
4329
  fetch the deposit address for a currency associated with self account
4329
4330
  :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
ccxt/ndax.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.ndax import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Account, Balances, Currencies, Currency, IndexType, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
10
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, IndexType, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -48,29 +48,51 @@ class ndax(Exchange, ImplicitAPI):
48
48
  'editOrder': True,
49
49
  'fetchAccounts': True,
50
50
  'fetchBalance': True,
51
+ 'fetchBorrowInterest': False,
52
+ 'fetchBorrowRate': False,
51
53
  'fetchBorrowRateHistories': False,
52
54
  'fetchBorrowRateHistory': False,
55
+ 'fetchBorrowRates': False,
56
+ 'fetchBorrowRatesPerSymbol': False,
53
57
  'fetchCrossBorrowRate': False,
54
58
  'fetchCrossBorrowRates': False,
55
59
  'fetchCurrencies': True,
56
60
  'fetchDepositAddress': True,
61
+ 'fetchDepositAddresses': False,
62
+ 'fetchDepositAddressesByNetwork': False,
57
63
  'fetchDeposits': True,
58
64
  'fetchFundingHistory': False,
65
+ 'fetchFundingInterval': False,
66
+ 'fetchFundingIntervals': False,
59
67
  'fetchFundingRate': False,
60
68
  'fetchFundingRateHistory': False,
61
69
  'fetchFundingRates': False,
70
+ 'fetchGreeks': False,
62
71
  'fetchIndexOHLCV': False,
63
72
  'fetchIsolatedBorrowRate': False,
64
73
  'fetchIsolatedBorrowRates': False,
74
+ 'fetchIsolatedPositions': False,
65
75
  'fetchLedger': True,
66
76
  'fetchLeverage': False,
77
+ 'fetchLeverages': False,
67
78
  'fetchLeverageTiers': False,
79
+ 'fetchLiquidations': False,
80
+ 'fetchMarginAdjustmentHistory': False,
81
+ 'fetchMarginMode': False,
82
+ 'fetchMarginModes': False,
83
+ 'fetchMarketLeverageTiers': False,
68
84
  'fetchMarkets': True,
69
85
  'fetchMarkOHLCV': False,
86
+ 'fetchMarkPrices': False,
87
+ 'fetchMyLiquidations': False,
88
+ 'fetchMySettlementHistory': False,
70
89
  'fetchMyTrades': True,
71
90
  'fetchOHLCV': True,
91
+ 'fetchOpenInterest': False,
72
92
  'fetchOpenInterestHistory': False,
73
93
  'fetchOpenOrders': True,
94
+ 'fetchOption': False,
95
+ 'fetchOptionChain': False,
74
96
  'fetchOrder': True,
75
97
  'fetchOrderBook': True,
76
98
  'fetchOrders': True,
@@ -83,16 +105,22 @@ class ndax(Exchange, ImplicitAPI):
83
105
  'fetchPositionsHistory': False,
84
106
  'fetchPositionsRisk': False,
85
107
  'fetchPremiumIndexOHLCV': False,
108
+ 'fetchSettlementHistory': False,
86
109
  'fetchTicker': True,
87
110
  'fetchTickers': False,
88
111
  'fetchTime': False,
89
112
  'fetchTrades': True,
90
113
  'fetchTradingFee': False,
91
114
  'fetchTradingFees': False,
115
+ 'fetchUnderlyingAssets': False,
116
+ 'fetchVolatilityHistory': False,
92
117
  'fetchWithdrawals': True,
93
118
  'reduceMargin': False,
119
+ 'repayCrossMargin': False,
120
+ 'repayIsolatedMargin': False,
94
121
  'sandbox': True,
95
122
  'setLeverage': False,
123
+ 'setMargin': False,
96
124
  'setMarginMode': False,
97
125
  'setPositionMode': False,
98
126
  'signIn': True,
@@ -1871,7 +1899,7 @@ class ndax(Exchange, ImplicitAPI):
1871
1899
  trades = self.safe_list(grouped, 'Trade', [])
1872
1900
  return self.parse_trades(trades, market, since, limit)
1873
1901
 
1874
- def fetch_deposit_address(self, code: str, params={}):
1902
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1875
1903
  """
1876
1904
  fetch the deposit address for a currency associated with self account
1877
1905
  :param str code: unified currency code
@@ -1906,7 +1934,7 @@ class ndax(Exchange, ImplicitAPI):
1906
1934
  #
1907
1935
  return self.parse_deposit_address(response, currency)
1908
1936
 
1909
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1937
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1910
1938
  #
1911
1939
  # fetchDepositAddress, createDepositAddress
1912
1940
  #
@@ -1933,11 +1961,11 @@ class ndax(Exchange, ImplicitAPI):
1933
1961
  code = currency['code']
1934
1962
  self.check_address(address)
1935
1963
  return {
1964
+ 'info': depositAddress,
1936
1965
  'currency': code,
1966
+ 'network': None,
1937
1967
  'address': address,
1938
1968
  'tag': tag,
1939
- 'network': None,
1940
- 'info': depositAddress,
1941
1969
  }
1942
1970
 
1943
1971
  def create_deposit_address(self, code: str, params={}):
ccxt/oceanex.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.oceanex import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
8
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -863,7 +863,7 @@ class oceanex(Exchange, ImplicitAPI):
863
863
  data = self.safe_list(response, 'data')
864
864
  return self.parse_orders(data)
865
865
 
866
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
866
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
867
867
  """
868
868
  fetch the deposit addresses for a currency associated with self account
869
869
  :see: https://api.oceanex.pro/doc/v1/#deposit-addresses-post
@@ -912,7 +912,7 @@ class oceanex(Exchange, ImplicitAPI):
912
912
  result[parsedAddress['currency']] = parsedAddress
913
913
  return result
914
914
 
915
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
915
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
916
916
  #
917
917
  # {
918
918
  # chain_name: 'TRC20',
@@ -929,9 +929,9 @@ class oceanex(Exchange, ImplicitAPI):
929
929
  return {
930
930
  'info': depositAddress,
931
931
  'currency': self.safe_currency_code(currencyId, currency),
932
+ 'network': self.network_id_to_code(networkId),
932
933
  'address': address,
933
934
  'tag': self.safe_string(depositAddress, 'memo'),
934
- 'network': self.network_id_to_code(networkId),
935
935
  }
936
936
 
937
937
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/okcoin.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.okcoin import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -66,6 +66,8 @@ class okcoin(Exchange, ImplicitAPI):
66
66
  'fetchClosedOrders': True,
67
67
  'fetchCurrencies': True, # see below
68
68
  'fetchDepositAddress': True,
69
+ 'fetchDepositAddresses': False,
70
+ 'fetchDepositAddressesByNetwork': False,
69
71
  'fetchDeposits': True,
70
72
  'fetchFundingHistory': False,
71
73
  'fetchFundingRate': False,
@@ -2016,7 +2018,7 @@ class okcoin(Exchange, ImplicitAPI):
2016
2018
  data = self.safe_list(response, 'data', [])
2017
2019
  return self.parse_orders(data, market, since, limit)
2018
2020
 
2019
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
2021
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
2020
2022
  #
2021
2023
  # {
2022
2024
  # "addr": "okbtothemoon",
@@ -2099,14 +2101,14 @@ class okcoin(Exchange, ImplicitAPI):
2099
2101
  #
2100
2102
  self.check_address(address)
2101
2103
  return {
2104
+ 'info': depositAddress,
2102
2105
  'currency': code,
2106
+ 'network': network,
2103
2107
  'address': address,
2104
2108
  'tag': tag,
2105
- 'network': network,
2106
- 'info': depositAddress,
2107
2109
  }
2108
2110
 
2109
- def fetch_deposit_address(self, code: str, params={}):
2111
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2110
2112
  """
2111
2113
  fetch the deposit address for a currency associated with self account
2112
2114
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -2125,7 +2127,7 @@ class okcoin(Exchange, ImplicitAPI):
2125
2127
  raise InvalidAddress(self.id + ' fetchDepositAddress() cannot find ' + networkCode + ' deposit address for ' + code)
2126
2128
  return result
2127
2129
 
2128
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
2130
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
2129
2131
  """
2130
2132
  fetch a dictionary of addresses for a currency, indexed by network
2131
2133
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
ccxt/okx.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.okx import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Greeks, Int, LedgerEntry, Leverage, LeverageTier, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from typing import Any
12
12
  from ccxt.base.errors import ExchangeError
@@ -122,6 +122,7 @@ class okx(Exchange, ImplicitAPI):
122
122
  'fetchMarketLeverageTiers': True,
123
123
  'fetchMarkets': True,
124
124
  'fetchMarkOHLCV': True,
125
+ 'fetchMarkPrice': True,
125
126
  'fetchMarkPrices': True,
126
127
  'fetchMySettlementHistory': False,
127
128
  'fetchMyTrades': True,
@@ -1813,6 +1814,16 @@ class okx(Exchange, ImplicitAPI):
1813
1814
  # "sodUtc0": "0.07872",
1814
1815
  # "sodUtc8": "0.07345"
1815
1816
  # }
1817
+ # {
1818
+ # instId: 'LTC-USDT',
1819
+ # idxPx: '65.74',
1820
+ # open24h: '65.37',
1821
+ # high24h: '66.15',
1822
+ # low24h: '64.97',
1823
+ # sodUtc0: '65.68',
1824
+ # sodUtc8: '65.54',
1825
+ # ts: '1728467346900'
1826
+ # },
1816
1827
  #
1817
1828
  timestamp = self.safe_integer(ticker, 'ts')
1818
1829
  marketId = self.safe_string(ticker, 'instId')
@@ -1846,6 +1857,7 @@ class okx(Exchange, ImplicitAPI):
1846
1857
  'baseVolume': baseVolume,
1847
1858
  'quoteVolume': quoteVolume,
1848
1859
  'markPrice': self.safe_string(ticker, 'markPx'),
1860
+ 'indexPrice': self.safe_string(ticker, 'idxPx'),
1849
1861
  'info': ticker,
1850
1862
  }, market)
1851
1863
 
@@ -1946,6 +1958,37 @@ class okx(Exchange, ImplicitAPI):
1946
1958
  tickers = self.safe_list(response, 'data', [])
1947
1959
  return self.parse_tickers(tickers, symbols)
1948
1960
 
1961
+ def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
1962
+ """
1963
+ fetches mark price for the market
1964
+ :see: https://www.okx.com/docs-v5/en/#public-data-rest-api-get-mark-price
1965
+ :param str symbol: unified symbol of the market to fetch the ticker for
1966
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1967
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
1968
+ """
1969
+ self.load_markets()
1970
+ market = self.market(symbol)
1971
+ request: dict = {
1972
+ 'instId': market['id'],
1973
+ }
1974
+ response = self.publicGetPublicMarkPrice(self.extend(request, params))
1975
+ #
1976
+ # {
1977
+ # "code": "0",
1978
+ # "data": [
1979
+ # {
1980
+ # "instId": "ETH-USDT",
1981
+ # "instType": "MARGIN",
1982
+ # "markPx": "2403.98",
1983
+ # "ts": "1728578500703"
1984
+ # }
1985
+ # ],
1986
+ # "msg": ""
1987
+ # }
1988
+ #
1989
+ data = self.safe_list(response, 'data')
1990
+ return self.parse_ticker(self.safe_dict(data, 0), market)
1991
+
1949
1992
  def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
1950
1993
  """
1951
1994
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
@@ -1966,7 +2009,7 @@ class okx(Exchange, ImplicitAPI):
1966
2009
  defaultUnderlying = self.safe_string(self.options, 'defaultUnderlying', 'BTC-USD')
1967
2010
  currencyId = self.safe_string_2(params, 'uly', 'marketId', defaultUnderlying)
1968
2011
  if currencyId is None:
1969
- raise ArgumentsRequired(self.id + ' fetchTickers() requires an underlying uly or marketId parameter for options markets')
2012
+ raise ArgumentsRequired(self.id + ' fetchMarkPrices() requires an underlying uly or marketId parameter for options markets')
1970
2013
  else:
1971
2014
  request['uly'] = currencyId
1972
2015
  response = self.publicGetPublicMarkPrice(self.extend(request, params))
@@ -4424,7 +4467,7 @@ class okx(Exchange, ImplicitAPI):
4424
4467
  'fee': fee,
4425
4468
  }, currency)
4426
4469
 
4427
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4470
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4428
4471
  #
4429
4472
  # {
4430
4473
  # "addr": "okbtothemoon",
@@ -4512,14 +4555,14 @@ class okx(Exchange, ImplicitAPI):
4512
4555
  networkCode = self.network_id_to_code(network, code)
4513
4556
  self.check_address(address)
4514
4557
  return {
4558
+ 'info': depositAddress,
4515
4559
  'currency': code,
4560
+ 'network': networkCode,
4516
4561
  'address': address,
4517
4562
  'tag': tag,
4518
- 'network': networkCode,
4519
- 'info': depositAddress,
4520
4563
  }
4521
4564
 
4522
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
4565
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4523
4566
  """
4524
4567
  fetch a dictionary of addresses for a currency, indexed by network
4525
4568
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -4559,7 +4602,7 @@ class okx(Exchange, ImplicitAPI):
4559
4602
  parsed = self.parse_deposit_addresses(filtered, [currency['code']], False)
4560
4603
  return self.index_by(parsed, 'network')
4561
4604
 
4562
- def fetch_deposit_address(self, code: str, params={}):
4605
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4563
4606
  """
4564
4607
  fetch the deposit address for a currency associated with self account
4565
4608
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
ccxt/onetrading.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.onetrading import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
8
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -63,6 +63,7 @@ class onetrading(Exchange, ImplicitAPI):
63
63
  'fetchDeposit': False,
64
64
  'fetchDepositAddress': True,
65
65
  'fetchDepositAddresses': False,
66
+ 'fetchDepositAddressesByNetwork': False,
66
67
  'fetchDeposits': True,
67
68
  'fetchDepositsWithdrawals': False,
68
69
  'fetchFundingHistory': False,
@@ -1003,7 +1004,7 @@ class onetrading(Exchange, ImplicitAPI):
1003
1004
  #
1004
1005
  return self.parse_balance(response)
1005
1006
 
1006
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1007
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1007
1008
  code = None
1008
1009
  if currency is not None:
1009
1010
  code = currency['code']
@@ -1011,11 +1012,11 @@ class onetrading(Exchange, ImplicitAPI):
1011
1012
  tag = self.safe_string(depositAddress, 'destination_tag')
1012
1013
  self.check_address(address)
1013
1014
  return {
1015
+ 'info': depositAddress,
1014
1016
  'currency': code,
1017
+ 'network': None,
1015
1018
  'address': address,
1016
1019
  'tag': tag,
1017
- 'network': None,
1018
- 'info': depositAddress,
1019
1020
  }
1020
1021
 
1021
1022
  def create_deposit_address(self, code: str, params={}):
@@ -1041,7 +1042,7 @@ class onetrading(Exchange, ImplicitAPI):
1041
1042
  #
1042
1043
  return self.parse_deposit_address(response, currency)
1043
1044
 
1044
- def fetch_deposit_address(self, code: str, params={}):
1045
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1045
1046
  """
1046
1047
  fetch the deposit address for a currency associated with self account
1047
1048
  :param str code: unified currency code