ccxt 4.4.14__py2.py3-none-any.whl → 4.4.16__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 (150) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/ascendex.py +5 -5
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/ascendex.py +5 -5
  5. ccxt/async_support/base/exchange.py +1 -1
  6. ccxt/async_support/bigone.py +6 -4
  7. ccxt/async_support/binance.py +58 -7
  8. ccxt/async_support/bingx.py +7 -6
  9. ccxt/async_support/bit2c.py +6 -4
  10. ccxt/async_support/bitbank.py +6 -4
  11. ccxt/async_support/bitbns.py +6 -4
  12. ccxt/async_support/bitfinex.py +4 -2
  13. ccxt/async_support/bitfinex2.py +4 -2
  14. ccxt/async_support/bitget.py +6 -5
  15. ccxt/async_support/bitmart.py +5 -4
  16. ccxt/async_support/bitmex.py +4 -4
  17. ccxt/async_support/bitso.py +5 -4
  18. ccxt/async_support/bitstamp.py +6 -4
  19. ccxt/async_support/bitvavo.py +6 -4
  20. ccxt/async_support/blockchaincom.py +11 -8
  21. ccxt/async_support/blofin.py +21 -0
  22. ccxt/async_support/bybit.py +6 -6
  23. ccxt/async_support/cex.py +5 -4
  24. ccxt/async_support/coinbase.py +4 -4
  25. ccxt/async_support/coinex.py +5 -5
  26. ccxt/async_support/coinone.py +6 -3
  27. ccxt/async_support/coinsph.py +5 -5
  28. ccxt/async_support/cryptocom.py +5 -4
  29. ccxt/async_support/currencycom.py +5 -5
  30. ccxt/async_support/delta.py +7 -5
  31. ccxt/async_support/deribit.py +6 -4
  32. ccxt/async_support/digifinex.py +6 -4
  33. ccxt/async_support/exmo.py +6 -4
  34. ccxt/async_support/gate.py +5 -4
  35. ccxt/async_support/gemini.py +4 -3
  36. ccxt/async_support/hashkey.py +7 -5
  37. ccxt/async_support/hitbtc.py +6 -5
  38. ccxt/async_support/hollaex.py +6 -5
  39. ccxt/async_support/htx.py +16 -6
  40. ccxt/async_support/hyperliquid.py +8 -7
  41. ccxt/async_support/idex.py +4 -4
  42. ccxt/async_support/independentreserve.py +4 -4
  43. ccxt/async_support/indodax.py +3 -3
  44. ccxt/async_support/kraken.py +7 -5
  45. ccxt/async_support/kucoin.py +6 -5
  46. ccxt/async_support/kucoinfutures.py +5 -3
  47. ccxt/async_support/kuna.py +5 -3
  48. ccxt/async_support/lbank.py +14 -12
  49. ccxt/async_support/lykke.py +6 -4
  50. ccxt/async_support/mexc.py +6 -6
  51. ccxt/async_support/ndax.py +33 -5
  52. ccxt/async_support/oceanex.py +4 -4
  53. ccxt/async_support/okcoin.py +8 -6
  54. ccxt/async_support/okx.py +17 -6
  55. ccxt/async_support/onetrading.py +8 -7
  56. ccxt/async_support/oxfun.py +6 -6
  57. ccxt/async_support/paymium.py +6 -5
  58. ccxt/async_support/phemex.py +8 -6
  59. ccxt/async_support/poloniex.py +6 -4
  60. ccxt/async_support/probit.py +7 -6
  61. ccxt/async_support/timex.py +4 -4
  62. ccxt/async_support/tokocrypto.py +5 -5
  63. ccxt/async_support/upbit.py +7 -6
  64. ccxt/async_support/vertex.py +8 -0
  65. ccxt/async_support/wavesexchange.py +9 -9
  66. ccxt/async_support/wazirx.py +24 -4
  67. ccxt/async_support/whitebit.py +6 -4
  68. ccxt/async_support/woo.py +6 -4
  69. ccxt/async_support/xt.py +7 -5
  70. ccxt/async_support/yobit.py +32 -23
  71. ccxt/async_support/zonda.py +31 -6
  72. ccxt/base/exchange.py +2 -2
  73. ccxt/base/types.py +8 -0
  74. ccxt/bigone.py +6 -4
  75. ccxt/binance.py +58 -7
  76. ccxt/bingx.py +7 -6
  77. ccxt/bit2c.py +6 -4
  78. ccxt/bitbank.py +6 -4
  79. ccxt/bitbns.py +6 -4
  80. ccxt/bitfinex.py +4 -2
  81. ccxt/bitfinex2.py +4 -2
  82. ccxt/bitget.py +6 -5
  83. ccxt/bitmart.py +5 -4
  84. ccxt/bitmex.py +4 -4
  85. ccxt/bitso.py +5 -4
  86. ccxt/bitstamp.py +6 -4
  87. ccxt/bitvavo.py +6 -4
  88. ccxt/blockchaincom.py +11 -8
  89. ccxt/blofin.py +21 -0
  90. ccxt/bybit.py +6 -6
  91. ccxt/cex.py +5 -4
  92. ccxt/coinbase.py +4 -4
  93. ccxt/coinex.py +5 -5
  94. ccxt/coinone.py +6 -3
  95. ccxt/coinsph.py +5 -5
  96. ccxt/cryptocom.py +5 -4
  97. ccxt/currencycom.py +5 -5
  98. ccxt/delta.py +7 -5
  99. ccxt/deribit.py +6 -4
  100. ccxt/digifinex.py +6 -4
  101. ccxt/exmo.py +6 -4
  102. ccxt/gate.py +5 -4
  103. ccxt/gemini.py +4 -3
  104. ccxt/hashkey.py +7 -5
  105. ccxt/hitbtc.py +6 -5
  106. ccxt/hollaex.py +6 -5
  107. ccxt/htx.py +16 -6
  108. ccxt/hyperliquid.py +8 -7
  109. ccxt/idex.py +4 -4
  110. ccxt/independentreserve.py +4 -4
  111. ccxt/indodax.py +3 -3
  112. ccxt/kraken.py +7 -5
  113. ccxt/kucoin.py +6 -5
  114. ccxt/kucoinfutures.py +5 -3
  115. ccxt/kuna.py +5 -3
  116. ccxt/lbank.py +14 -12
  117. ccxt/lykke.py +6 -4
  118. ccxt/mexc.py +6 -6
  119. ccxt/ndax.py +33 -5
  120. ccxt/oceanex.py +4 -4
  121. ccxt/okcoin.py +8 -6
  122. ccxt/okx.py +17 -6
  123. ccxt/onetrading.py +8 -7
  124. ccxt/oxfun.py +6 -6
  125. ccxt/paymium.py +6 -5
  126. ccxt/phemex.py +8 -6
  127. ccxt/poloniex.py +6 -4
  128. ccxt/pro/__init__.py +1 -1
  129. ccxt/pro/binance.py +1 -1
  130. ccxt/pro/upbit.py +42 -1
  131. ccxt/pro/vertex.py +11 -0
  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 +4 -4
  136. ccxt/tokocrypto.py +5 -5
  137. ccxt/upbit.py +7 -6
  138. ccxt/vertex.py +8 -0
  139. ccxt/wavesexchange.py +9 -9
  140. ccxt/wazirx.py +24 -4
  141. ccxt/whitebit.py +6 -4
  142. ccxt/woo.py +6 -4
  143. ccxt/xt.py +7 -5
  144. ccxt/yobit.py +32 -23
  145. ccxt/zonda.py +31 -6
  146. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/METADATA +4 -4
  147. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/RECORD +150 -150
  148. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/LICENSE.txt +0 -0
  149. {ccxt-4.4.14.dist-info → ccxt-4.4.16.dist-info}/WHEEL +0 -0
  150. {ccxt-4.4.14.dist-info → ccxt-4.4.16.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, Leverage, LeverageTier, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
8
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Leverage, LeverageTier, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, 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
@@ -69,6 +69,8 @@ class kucoinfutures(kucoin, ImplicitAPI):
69
69
  'fetchCrossBorrowRates': False,
70
70
  'fetchCurrencies': False,
71
71
  'fetchDepositAddress': True,
72
+ 'fetchDepositAddresses': False,
73
+ 'fetchDepositAddressesByNetwork': False,
72
74
  'fetchDeposits': True,
73
75
  'fetchDepositWithdrawFee': False,
74
76
  'fetchDepositWithdrawFees': False,
@@ -640,7 +642,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
640
642
  self.safe_number(ohlcv, 5),
641
643
  ]
642
644
 
643
- async def fetch_deposit_address(self, code: str, params={}):
645
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
644
646
  """
645
647
  fetch the deposit address for a currency associated with self account
646
648
  :see: https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-address
@@ -672,9 +674,9 @@ class kucoinfutures(kucoin, ImplicitAPI):
672
674
  return {
673
675
  'info': response,
674
676
  'currency': currencyId,
677
+ 'network': self.safe_string(data, 'chain'),
675
678
  'address': address,
676
679
  'tag': self.safe_string(data, 'memo'),
677
- 'network': self.safe_string(data, 'chain'),
678
680
  }
679
681
 
680
682
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
@@ -7,7 +7,7 @@ from ccxt.async_support.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,
@@ -1511,7 +1513,7 @@ class kuna(Exchange, ImplicitAPI):
1511
1513
  data = self.safe_dict(response, 'data', {})
1512
1514
  return self.parse_deposit_address(data, currency)
1513
1515
 
1514
- async def fetch_deposit_address(self, code: str, params={}):
1516
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1515
1517
  """
1516
1518
  fetch the deposit address for a currency associated with self account
1517
1519
  :see: https://docs.kuna.io/docs/find-crypto-address-for-deposit
@@ -1537,7 +1539,7 @@ class kuna(Exchange, ImplicitAPI):
1537
1539
  data = self.safe_dict(response, 'data', {})
1538
1540
  return self.parse_deposit_address(data, currency)
1539
1541
 
1540
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1542
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1541
1543
  #
1542
1544
  # {
1543
1545
  # "id": "c52b6646-fb91-4760-b147-a4f952e8652c", # ID of the address.
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.lbank import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
10
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -63,6 +63,8 @@ class lbank(Exchange, ImplicitAPI):
63
63
  'fetchCrossBorrowRate': False,
64
64
  'fetchCrossBorrowRates': False,
65
65
  'fetchDepositAddress': True,
66
+ 'fetchDepositAddresses': False,
67
+ 'fetchDepositAddressesByNetwork': False,
66
68
  'fetchDepositWithdrawFee': 'emulated',
67
69
  'fetchDepositWithdrawFees': True,
68
70
  'fetchFundingHistory': False,
@@ -1832,7 +1834,7 @@ class lbank(Exchange, ImplicitAPI):
1832
1834
  network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
1833
1835
  return network
1834
1836
 
1835
- async def fetch_deposit_address(self, code: str, params={}):
1837
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1836
1838
  """
1837
1839
  fetch the deposit address for a currency associated with self account
1838
1840
  :see: https://www.lbank.com/en-US/docs/index.html#get-deposit-address
@@ -1853,7 +1855,7 @@ class lbank(Exchange, ImplicitAPI):
1853
1855
  response = await self.fetch_deposit_address_default(code, params)
1854
1856
  return response
1855
1857
 
1856
- async def fetch_deposit_address_default(self, code: str, params={}):
1858
+ async def fetch_deposit_address_default(self, code: str, params={}) -> DepositAddress:
1857
1859
  await self.load_markets()
1858
1860
  currency = self.currency(code)
1859
1861
  request: dict = {
@@ -1884,14 +1886,14 @@ class lbank(Exchange, ImplicitAPI):
1884
1886
  inverseNetworks = self.safe_value(self.options, 'inverse-networks', {})
1885
1887
  networkCode = self.safe_string_upper(inverseNetworks, networkId, networkId)
1886
1888
  return {
1889
+ 'info': response,
1887
1890
  'currency': code,
1891
+ 'network': networkCode,
1888
1892
  'address': address,
1889
1893
  'tag': tag,
1890
- 'network': networkCode,
1891
- 'info': response,
1892
1894
  }
1893
1895
 
1894
- async def fetch_deposit_address_supplement(self, code: str, params={}):
1896
+ async def fetch_deposit_address_supplement(self, code: str, params={}) -> DepositAddress:
1895
1897
  # returns the address for whatever the default network is...
1896
1898
  await self.load_markets()
1897
1899
  currency = self.currency(code)
@@ -1923,11 +1925,11 @@ class lbank(Exchange, ImplicitAPI):
1923
1925
  inverseNetworks = self.safe_value(self.options, 'inverse-networks', {})
1924
1926
  networkCode = self.safe_string_upper(inverseNetworks, network, network)
1925
1927
  return {
1928
+ 'info': response,
1926
1929
  'currency': code,
1930
+ 'network': networkCode, # will be None if not specified in request
1927
1931
  'address': address,
1928
1932
  'tag': tag,
1929
- 'network': networkCode, # will be None if not specified in request
1930
- 'info': response,
1931
1933
  }
1932
1934
 
1933
1935
  async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
@@ -2329,7 +2331,7 @@ class lbank(Exchange, ImplicitAPI):
2329
2331
  when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying self.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
2330
2332
  :see: https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
2331
2333
  :see: https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
2332
- :param str[]|None codes: array of unified currency codes
2334
+ :param str[] [codes]: array of unified currency codes
2333
2335
  :param dict [params]: extra parameters specific to the exchange API endpoint
2334
2336
  :returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
2335
2337
  """
@@ -2342,11 +2344,11 @@ class lbank(Exchange, ImplicitAPI):
2342
2344
  method = self.safe_string(params, 'method', defaultMethod)
2343
2345
  params = self.omit(params, 'method')
2344
2346
  if method == 'fetchPublicDepositWithdrawFees':
2345
- await self.fetch_public_deposit_withdraw_fees(codes, params)
2347
+ response = await self.fetch_public_deposit_withdraw_fees(codes, params)
2346
2348
  else:
2347
- await self.fetch_private_deposit_withdraw_fees(codes, params)
2349
+ response = await self.fetch_private_deposit_withdraw_fees(codes, params)
2348
2350
  else:
2349
- await self.fetch_public_deposit_withdraw_fees(codes, params)
2351
+ response = await self.fetch_public_deposit_withdraw_fees(codes, params)
2350
2352
  return response
2351
2353
 
2352
2354
  async def fetch_private_deposit_withdraw_fees(self, codes=None, params={}):
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.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
- async def fetch_deposit_address(self, code: str, params={}):
1077
+ async 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:
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.mexc import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- 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
10
+ 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
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -4221,7 +4221,7 @@ class mexc(Exchange, ImplicitAPI):
4221
4221
  floor = cap
4222
4222
  return tiers
4223
4223
 
4224
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4224
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4225
4225
  #
4226
4226
  # {
4227
4227
  # coin: "USDT",
@@ -4235,14 +4235,14 @@ class mexc(Exchange, ImplicitAPI):
4235
4235
  networkId = self.safe_string(depositAddress, 'netWork')
4236
4236
  self.check_address(address)
4237
4237
  return {
4238
+ 'info': depositAddress,
4238
4239
  'currency': self.safe_currency_code(currencyId, currency),
4240
+ 'network': self.network_id_to_code(networkId),
4239
4241
  'address': address,
4240
4242
  'tag': self.safe_string(depositAddress, 'memo'),
4241
- 'network': self.network_id_to_code(networkId),
4242
- 'info': depositAddress,
4243
4243
  }
4244
4244
 
4245
- async def fetch_deposit_addresses_by_network(self, code: str, params={}):
4245
+ async def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4246
4246
  """
4247
4247
  fetch a dictionary of addresses for a currency, indexed by network
4248
4248
  :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
@@ -4324,7 +4324,7 @@ class mexc(Exchange, ImplicitAPI):
4324
4324
  # }
4325
4325
  return self.parse_deposit_address(response, currency)
4326
4326
 
4327
- async def fetch_deposit_address(self, code: str, params={}):
4327
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4328
4328
  """
4329
4329
  fetch the deposit address for a currency associated with self account
4330
4330
  :see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
@@ -7,7 +7,7 @@ from ccxt.async_support.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
- async def fetch_deposit_address(self, code: str, params={}):
1902
+ async 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
  async def create_deposit_address(self, code: str, params={}):
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.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
- async def fetch_deposit_addresses_by_network(self, code: str, params={}):
866
+ async 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):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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
- async def fetch_deposit_address(self, code: str, params={}):
2111
+ async 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
- async def fetch_deposit_addresses_by_network(self, code: str, params={}):
2130
+ async 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/async_support/okx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.okx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- 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
10
+ 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
11
11
  from typing import List
12
12
  from typing import Any
13
13
  from ccxt.base.errors import ExchangeError
@@ -1814,6 +1814,16 @@ class okx(Exchange, ImplicitAPI):
1814
1814
  # "sodUtc0": "0.07872",
1815
1815
  # "sodUtc8": "0.07345"
1816
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
+ # },
1817
1827
  #
1818
1828
  timestamp = self.safe_integer(ticker, 'ts')
1819
1829
  marketId = self.safe_string(ticker, 'instId')
@@ -1847,6 +1857,7 @@ class okx(Exchange, ImplicitAPI):
1847
1857
  'baseVolume': baseVolume,
1848
1858
  'quoteVolume': quoteVolume,
1849
1859
  'markPrice': self.safe_string(ticker, 'markPx'),
1860
+ 'indexPrice': self.safe_string(ticker, 'idxPx'),
1850
1861
  'info': ticker,
1851
1862
  }, market)
1852
1863
 
@@ -4425,7 +4436,7 @@ class okx(Exchange, ImplicitAPI):
4425
4436
  'fee': fee,
4426
4437
  }, currency)
4427
4438
 
4428
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4439
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4429
4440
  #
4430
4441
  # {
4431
4442
  # "addr": "okbtothemoon",
@@ -4513,14 +4524,14 @@ class okx(Exchange, ImplicitAPI):
4513
4524
  networkCode = self.network_id_to_code(network, code)
4514
4525
  self.check_address(address)
4515
4526
  return {
4527
+ 'info': depositAddress,
4516
4528
  'currency': code,
4529
+ 'network': networkCode,
4517
4530
  'address': address,
4518
4531
  'tag': tag,
4519
- 'network': networkCode,
4520
- 'info': depositAddress,
4521
4532
  }
4522
4533
 
4523
- async def fetch_deposit_addresses_by_network(self, code: str, params={}):
4534
+ async def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4524
4535
  """
4525
4536
  fetch a dictionary of addresses for a currency, indexed by network
4526
4537
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -4560,7 +4571,7 @@ class okx(Exchange, ImplicitAPI):
4560
4571
  parsed = self.parse_deposit_addresses(filtered, [currency['code']], False)
4561
4572
  return self.index_by(parsed, 'network')
4562
4573
 
4563
- async def fetch_deposit_address(self, code: str, params={}):
4574
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4564
4575
  """
4565
4576
  fetch the deposit address for a currency associated with self account
4566
4577
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.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,
@@ -128,8 +129,8 @@ class onetrading(Exchange, ImplicitAPI):
128
129
  'urls': {
129
130
  'logo': 'https://github.com/ccxt/ccxt/assets/43336371/bdbc26fd-02f2-4ca7-9f1e-17333690bb1c',
130
131
  'api': {
131
- 'public': 'https://api.onetrading.com/public',
132
- 'private': 'https://api.onetrading.com/public',
132
+ 'public': 'https://api.onetrading.com/fast',
133
+ 'private': 'https://api.onetrading.com/fast',
133
134
  },
134
135
  'www': 'https://onetrading.com/',
135
136
  'doc': [
@@ -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
  async 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
- async def fetch_deposit_address(self, code: str, params={}):
1045
+ async 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
@@ -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, Balances, Bool, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, 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
@@ -77,7 +77,7 @@ class oxfun(Exchange, ImplicitAPI):
77
77
  'fetchCrossBorrowRates': False,
78
78
  'fetchCurrencies': True,
79
79
  'fetchDeposit': False,
80
- 'fetchDepositAddress': False,
80
+ 'fetchDepositAddress': True,
81
81
  'fetchDepositAddresses': False,
82
82
  'fetchDepositAddressesByNetwork': False,
83
83
  'fetchDeposits': True,
@@ -1710,7 +1710,7 @@ class oxfun(Exchange, ImplicitAPI):
1710
1710
  }
1711
1711
  return self.safe_string(statuses, status, status)
1712
1712
 
1713
- async def fetch_deposit_address(self, code: str, params={}):
1713
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1714
1714
  """
1715
1715
  fetch the deposit address for a currency associated with self account
1716
1716
  :see: https://docs.ox.fun/?json#get-v3-deposit-addresses
@@ -1737,18 +1737,18 @@ class oxfun(Exchange, ImplicitAPI):
1737
1737
  data = self.safe_dict(response, 'data', {})
1738
1738
  return self.parse_deposit_address(data, currency)
1739
1739
 
1740
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1740
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1741
1741
  #
1742
1742
  # {"address":"0x998dEc76151FB723963Bd8AFD517687b38D33dE8"}
1743
1743
  #
1744
1744
  address = self.safe_string(depositAddress, 'address')
1745
1745
  self.check_address(address)
1746
1746
  return {
1747
+ 'info': depositAddress,
1747
1748
  'currency': currency['code'],
1749
+ 'network': None,
1748
1750
  'address': address,
1749
1751
  'tag': None,
1750
- 'network': None,
1751
- 'info': depositAddress,
1752
1752
  }
1753
1753
 
1754
1754
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]: