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
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
@@ -1813,6 +1813,16 @@ class okx(Exchange, ImplicitAPI):
1813
1813
  # "sodUtc0": "0.07872",
1814
1814
  # "sodUtc8": "0.07345"
1815
1815
  # }
1816
+ # {
1817
+ # instId: 'LTC-USDT',
1818
+ # idxPx: '65.74',
1819
+ # open24h: '65.37',
1820
+ # high24h: '66.15',
1821
+ # low24h: '64.97',
1822
+ # sodUtc0: '65.68',
1823
+ # sodUtc8: '65.54',
1824
+ # ts: '1728467346900'
1825
+ # },
1816
1826
  #
1817
1827
  timestamp = self.safe_integer(ticker, 'ts')
1818
1828
  marketId = self.safe_string(ticker, 'instId')
@@ -1846,6 +1856,7 @@ class okx(Exchange, ImplicitAPI):
1846
1856
  'baseVolume': baseVolume,
1847
1857
  'quoteVolume': quoteVolume,
1848
1858
  'markPrice': self.safe_string(ticker, 'markPx'),
1859
+ 'indexPrice': self.safe_string(ticker, 'idxPx'),
1849
1860
  'info': ticker,
1850
1861
  }, market)
1851
1862
 
@@ -4424,7 +4435,7 @@ class okx(Exchange, ImplicitAPI):
4424
4435
  'fee': fee,
4425
4436
  }, currency)
4426
4437
 
4427
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4438
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4428
4439
  #
4429
4440
  # {
4430
4441
  # "addr": "okbtothemoon",
@@ -4512,14 +4523,14 @@ class okx(Exchange, ImplicitAPI):
4512
4523
  networkCode = self.network_id_to_code(network, code)
4513
4524
  self.check_address(address)
4514
4525
  return {
4526
+ 'info': depositAddress,
4515
4527
  'currency': code,
4528
+ 'network': networkCode,
4516
4529
  'address': address,
4517
4530
  'tag': tag,
4518
- 'network': networkCode,
4519
- 'info': depositAddress,
4520
4531
  }
4521
4532
 
4522
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
4533
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4523
4534
  """
4524
4535
  fetch a dictionary of addresses for a currency, indexed by network
4525
4536
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -4559,7 +4570,7 @@ class okx(Exchange, ImplicitAPI):
4559
4570
  parsed = self.parse_deposit_addresses(filtered, [currency['code']], False)
4560
4571
  return self.index_by(parsed, 'network')
4561
4572
 
4562
- def fetch_deposit_address(self, code: str, params={}):
4573
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4563
4574
  """
4564
4575
  fetch the deposit address for a currency associated with self account
4565
4576
  :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,
@@ -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
  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
ccxt/oxfun.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.oxfun import ImplicitAPI
8
8
  import hashlib
9
- 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
9
+ 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
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -76,7 +76,7 @@ class oxfun(Exchange, ImplicitAPI):
76
76
  'fetchCrossBorrowRates': False,
77
77
  'fetchCurrencies': True,
78
78
  'fetchDeposit': False,
79
- 'fetchDepositAddress': False,
79
+ 'fetchDepositAddress': True,
80
80
  'fetchDepositAddresses': False,
81
81
  'fetchDepositAddressesByNetwork': False,
82
82
  'fetchDeposits': True,
@@ -1709,7 +1709,7 @@ class oxfun(Exchange, ImplicitAPI):
1709
1709
  }
1710
1710
  return self.safe_string(statuses, status, status)
1711
1711
 
1712
- def fetch_deposit_address(self, code: str, params={}):
1712
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1713
1713
  """
1714
1714
  fetch the deposit address for a currency associated with self account
1715
1715
  :see: https://docs.ox.fun/?json#get-v3-deposit-addresses
@@ -1736,18 +1736,18 @@ class oxfun(Exchange, ImplicitAPI):
1736
1736
  data = self.safe_dict(response, 'data', {})
1737
1737
  return self.parse_deposit_address(data, currency)
1738
1738
 
1739
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1739
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1740
1740
  #
1741
1741
  # {"address":"0x998dEc76151FB723963Bd8AFD517687b38D33dE8"}
1742
1742
  #
1743
1743
  address = self.safe_string(depositAddress, 'address')
1744
1744
  self.check_address(address)
1745
1745
  return {
1746
+ 'info': depositAddress,
1746
1747
  'currency': currency['code'],
1748
+ 'network': None,
1747
1749
  'address': address,
1748
1750
  'tag': None,
1749
- 'network': None,
1750
- 'info': depositAddress,
1751
1751
  }
1752
1752
 
1753
1753
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
ccxt/paymium.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.paymium import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TransferEntry
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.decimal_to_precision import TICK_SIZE
@@ -35,6 +35,7 @@ class paymium(Exchange, ImplicitAPI):
35
35
  'fetchBalance': True,
36
36
  'fetchDepositAddress': True,
37
37
  'fetchDepositAddresses': True,
38
+ 'fetchDepositAddressesByNetwork': False,
38
39
  'fetchFundingHistory': False,
39
40
  'fetchFundingRate': False,
40
41
  'fetchFundingRateHistory': False,
@@ -302,7 +303,7 @@ class paymium(Exchange, ImplicitAPI):
302
303
  #
303
304
  return self.parse_deposit_address(response)
304
305
 
305
- def fetch_deposit_address(self, code: str, params={}):
306
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
306
307
  """
307
308
  fetch the deposit address for a currency associated with self account
308
309
  :see: https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses~1%7Baddress%7D/get
@@ -325,7 +326,7 @@ class paymium(Exchange, ImplicitAPI):
325
326
  #
326
327
  return self.parse_deposit_address(response)
327
328
 
328
- def fetch_deposit_addresses(self, codes: Strings = None, params={}):
329
+ def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
329
330
  """
330
331
  fetch deposit addresses for multiple currencies and chain types
331
332
  :see: https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses/get
@@ -347,7 +348,7 @@ class paymium(Exchange, ImplicitAPI):
347
348
  #
348
349
  return self.parse_deposit_addresses(response, codes)
349
350
 
350
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
351
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
351
352
  #
352
353
  # {
353
354
  # "address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe",
@@ -361,9 +362,9 @@ class paymium(Exchange, ImplicitAPI):
361
362
  return {
362
363
  'info': depositAddress,
363
364
  'currency': self.safe_currency_code(currencyId, currency),
365
+ 'network': None,
364
366
  'address': address,
365
367
  'tag': None,
366
- 'network': None,
367
368
  }
368
369
 
369
370
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
ccxt/phemex.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.phemex import ImplicitAPI
8
8
  import hashlib
9
9
  import numbers
10
- from ccxt.base.types import Balances, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, 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
@@ -64,6 +64,8 @@ class phemex(Exchange, ImplicitAPI):
64
64
  'fetchCrossBorrowRates': False,
65
65
  'fetchCurrencies': True,
66
66
  'fetchDepositAddress': True,
67
+ 'fetchDepositAddresses': False,
68
+ 'fetchDepositAddressesByNetwork': False,
67
69
  'fetchDeposits': True,
68
70
  'fetchFundingHistory': True,
69
71
  'fetchFundingRate': True,
@@ -3145,7 +3147,7 @@ class phemex(Exchange, ImplicitAPI):
3145
3147
  data = self.safe_value(data, 'rows', [])
3146
3148
  return self.parse_trades(data, market, since, limit)
3147
3149
 
3148
- def fetch_deposit_address(self, code: str, params={}):
3150
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
3149
3151
  """
3150
3152
  fetch the deposit address for a currency associated with self account
3151
3153
  :param str code: unified currency code
@@ -3157,9 +3159,9 @@ class phemex(Exchange, ImplicitAPI):
3157
3159
  request: dict = {
3158
3160
  'currency': currency['id'],
3159
3161
  }
3160
- defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
3162
+ defaultNetworks = self.safe_dict(self.options, 'defaultNetworks')
3161
3163
  defaultNetwork = self.safe_string_upper(defaultNetworks, code)
3162
- networks = self.safe_value(self.options, 'networks', {})
3164
+ networks = self.safe_dict(self.options, 'networks', {})
3163
3165
  network = self.safe_string_upper(params, 'network', defaultNetwork)
3164
3166
  network = self.safe_string(networks, network, network)
3165
3167
  if network is None:
@@ -3182,11 +3184,11 @@ class phemex(Exchange, ImplicitAPI):
3182
3184
  tag = self.safe_string(data, 'tag')
3183
3185
  self.check_address(address)
3184
3186
  return {
3187
+ 'info': response,
3185
3188
  'currency': code,
3189
+ 'network': None,
3186
3190
  'address': address,
3187
3191
  'tag': tag,
3188
- 'network': None,
3189
- 'info': response,
3190
3192
  }
3191
3193
 
3192
3194
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
ccxt/poloniex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.poloniex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, 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
@@ -56,6 +56,8 @@ class poloniex(Exchange, ImplicitAPI):
56
56
  'fetchClosedOrder': False,
57
57
  'fetchCurrencies': True,
58
58
  'fetchDepositAddress': True,
59
+ 'fetchDepositAddresses': False,
60
+ 'fetchDepositAddressesByNetwork': False,
59
61
  'fetchDeposits': True,
60
62
  'fetchDepositsWithdrawals': True,
61
63
  'fetchDepositWithdrawFee': 'emulated',
@@ -1700,7 +1702,7 @@ class poloniex(Exchange, ImplicitAPI):
1700
1702
  'info': response,
1701
1703
  }
1702
1704
 
1703
- def fetch_deposit_address(self, code: str, params={}):
1705
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1704
1706
  """
1705
1707
  fetch the deposit address for a currency associated with self account
1706
1708
  :see: https://api-docs.poloniex.com/spot/api/private/wallet#deposit-addresses
@@ -1737,11 +1739,11 @@ class poloniex(Exchange, ImplicitAPI):
1737
1739
  tag = address
1738
1740
  address = depositAddress
1739
1741
  return {
1742
+ 'info': response,
1740
1743
  'currency': code,
1744
+ 'network': network,
1741
1745
  'address': address,
1742
1746
  'tag': tag,
1743
- 'network': network,
1744
- 'info': response,
1745
1747
  }
1746
1748
 
1747
1749
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.14'
7
+ __version__ = '4.4.16'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/binance.py CHANGED
@@ -243,7 +243,7 @@ class binance(ccxt.async_support.binance):
243
243
  type = None
244
244
  type, params = self.handle_market_type_and_params('watchLiquidationsForSymbols', firstMarket, params)
245
245
  if type == 'spot':
246
- raise BadRequest(self.id + 'watchLiquidationsForSymbols is not supported for swap symbols')
246
+ raise BadRequest(self.id + 'watchLiquidationsForSymbols is not supported for spot symbols')
247
247
  subType = None
248
248
  subType, params = self.handle_sub_type_and_params('watchLiquidationsForSymbols', firstMarket, params)
249
249
  if self.isLinear(type, subType):
ccxt/pro/upbit.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
8
- from ccxt.base.types import Balances, Int, Order, OrderBook, Str, Ticker, Trade
8
+ from ccxt.base.types import Balances, Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
11
 
@@ -18,6 +18,7 @@ class upbit(ccxt.async_support.upbit):
18
18
  'ws': True,
19
19
  'watchOrderBook': True,
20
20
  'watchTicker': True,
21
+ 'watchTickers': True,
21
22
  'watchTrades': True,
22
23
  'watchTradesForSymbols': True,
23
24
  'watchOrders': True,
@@ -60,6 +61,31 @@ class upbit(ccxt.async_support.upbit):
60
61
  messageHash = channel + ':' + marketId
61
62
  return await self.watch(url, messageHash, request, messageHash)
62
63
 
64
+ async def watch_public_multiple(self, symbols: Strings, channel, params={}):
65
+ await self.load_markets()
66
+ if symbols is None:
67
+ symbols = self.symbols
68
+ symbols = self.market_symbols(symbols)
69
+ marketIds = self.market_ids(symbols)
70
+ url = self.implode_params(self.urls['api']['ws'], {
71
+ 'hostname': self.hostname,
72
+ })
73
+ messageHashes = []
74
+ for i in range(0, len(marketIds)):
75
+ messageHashes.append(channel + ':' + marketIds[i])
76
+ request = [
77
+ {
78
+ 'ticket': self.uuid(),
79
+ },
80
+ {
81
+ 'type': channel,
82
+ 'codes': marketIds,
83
+ # 'isOnlySnapshot': False,
84
+ # 'isOnlyRealtime': False,
85
+ },
86
+ ]
87
+ return await self.watch_multiple(url, messageHashes, request, messageHashes)
88
+
63
89
  async def watch_ticker(self, symbol: str, params={}) -> Ticker:
64
90
  """
65
91
  watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
@@ -70,6 +96,21 @@ class upbit(ccxt.async_support.upbit):
70
96
  """
71
97
  return await self.watch_public(symbol, 'ticker')
72
98
 
99
+ async def watch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
100
+ """
101
+ watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
102
+ :see: https://global-docs.upbit.com/reference/websocket-ticker
103
+ :param str symbol: unified symbol of the market to fetch the ticker for
104
+ :param dict [params]: extra parameters specific to the exchange API endpoint
105
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
106
+ """
107
+ newTickers = await self.watch_public_multiple(symbols, 'ticker')
108
+ if self.newUpdates:
109
+ tickers: dict = {}
110
+ tickers[newTickers['symbol']] = newTickers
111
+ return tickers
112
+ return self.filter_by_array(self.tickers, 'symbol', symbols)
113
+
73
114
  async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
74
115
  """
75
116
  get the list of most recent trades for a particular symbol
ccxt/pro/vertex.py CHANGED
@@ -53,6 +53,9 @@ class vertex(ccxt.async_support.vertex):
53
53
  'fetchPositionsSnapshot': True, # or False
54
54
  'awaitPositionsSnapshot': True, # whether to wait for the positions snapshot before providing updates
55
55
  },
56
+ 'ws': {
57
+ 'inflate': True,
58
+ },
56
59
  },
57
60
  'streaming': {
58
61
  # 'ping': self.ping,
@@ -81,6 +84,14 @@ class vertex(ccxt.async_support.vertex):
81
84
  'id': requestId,
82
85
  }
83
86
  request = self.extend(subscribe, message)
87
+ wsOptions = {
88
+ 'headers': {
89
+ 'Sec-WebSocket-Extensions': 'permessage-deflate',
90
+ },
91
+ }
92
+ self.options['ws'] = {
93
+ 'options': wsOptions,
94
+ }
84
95
  return await self.watch(url, messageHash, request, messageHash, subscribe)
85
96
 
86
97
  async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
ccxt/probit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.probit import ImplicitAPI
8
8
  import math
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, 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,7 @@ class probit(Exchange, ImplicitAPI):
62
62
  'fetchCurrencies': True,
63
63
  'fetchDepositAddress': True,
64
64
  'fetchDepositAddresses': True,
65
+ 'fetchDepositAddressesByNetwork': False,
65
66
  'fetchDeposits': True,
66
67
  'fetchDepositsWithdrawals': True,
67
68
  'fetchFundingHistory': False,
@@ -1232,7 +1233,7 @@ class probit(Exchange, ImplicitAPI):
1232
1233
  data = self.safe_dict(response, 'data')
1233
1234
  return self.parse_order(data)
1234
1235
 
1235
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1236
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1236
1237
  address = self.safe_string(depositAddress, 'address')
1237
1238
  tag = self.safe_string(depositAddress, 'destination_tag')
1238
1239
  currencyId = self.safe_string(depositAddress, 'currency_id')
@@ -1241,14 +1242,14 @@ class probit(Exchange, ImplicitAPI):
1241
1242
  network = self.safe_string(depositAddress, 'platform_id')
1242
1243
  self.check_address(address)
1243
1244
  return {
1245
+ 'info': depositAddress,
1244
1246
  'currency': code,
1247
+ 'network': network,
1245
1248
  'address': address,
1246
1249
  'tag': tag,
1247
- 'network': network,
1248
- 'info': depositAddress,
1249
1250
  }
1250
1251
 
1251
- def fetch_deposit_address(self, code: str, params={}):
1252
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1252
1253
  """
1253
1254
  :see: https://docs-en.probit.com/reference/deposit_address
1254
1255
  fetch the deposit address for a currency associated with self account
@@ -1298,7 +1299,7 @@ class probit(Exchange, ImplicitAPI):
1298
1299
  raise InvalidAddress(self.id + ' fetchDepositAddress() returned an empty response')
1299
1300
  return self.parse_deposit_address(firstAddress, currency)
1300
1301
 
1301
- def fetch_deposit_addresses(self, codes: Strings = None, params={}):
1302
+ def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
1302
1303
  """
1303
1304
  :see: https://docs-en.probit.com/reference/deposit_address
1304
1305
  fetch deposit addresses for multiple currencies and chain types
ccxt/test/tests_async.py CHANGED
@@ -66,6 +66,7 @@ class testMainClass:
66
66
  'symbol': symbol_argv,
67
67
  'method': method_argv,
68
68
  'isWs': self.ws_tests,
69
+ 'useProxy': get_cli_arg_value('--useProxy'),
69
70
  }, new_line)
70
71
  exchange_args = {
71
72
  'verbose': self.verbose,
ccxt/test/tests_sync.py CHANGED
@@ -63,6 +63,7 @@ class testMainClass:
63
63
  'symbol': symbol_argv,
64
64
  'method': method_argv,
65
65
  'isWs': self.ws_tests,
66
+ 'useProxy': get_cli_arg_value('--useProxy'),
66
67
  }, new_line)
67
68
  exchange_args = {
68
69
  'verbose': self.verbose,
ccxt/timex.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.timex import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
8
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -1514,7 +1514,7 @@ class timex(Exchange, ImplicitAPI):
1514
1514
  'trades': rawTrades,
1515
1515
  }, market)
1516
1516
 
1517
- def fetch_deposit_address(self, code: str, params={}):
1517
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1518
1518
  """
1519
1519
  fetch the deposit address for a currency associated with self account, does not accept params["network"]
1520
1520
  :see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Currency/selectCurrencyBySymbol
@@ -1548,7 +1548,7 @@ class timex(Exchange, ImplicitAPI):
1548
1548
  data = self.safe_dict(response, 'currency', {})
1549
1549
  return self.parse_deposit_address(data, currency)
1550
1550
 
1551
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1551
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1552
1552
  #
1553
1553
  # {
1554
1554
  # symbol: 'BTC',
@@ -1567,9 +1567,9 @@ class timex(Exchange, ImplicitAPI):
1567
1567
  return {
1568
1568
  'info': depositAddress,
1569
1569
  'currency': self.safe_currency_code(currencyId, currency),
1570
+ 'network': None,
1570
1571
  'address': self.safe_string(depositAddress, 'address'),
1571
1572
  'tag': None,
1572
- 'network': None,
1573
1573
  }
1574
1574
 
1575
1575
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/tokocrypto.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.tokocrypto import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
+ from ccxt.base.types import Balances, 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 AuthenticationError
@@ -1950,10 +1950,10 @@ class tokocrypto(Exchange, ImplicitAPI):
1950
1950
  trades = self.safe_list(data, 'list', [])
1951
1951
  return self.parse_trades(trades, market, since, limit)
1952
1952
 
1953
- def fetch_deposit_address(self, code: str, params={}):
1953
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1954
1954
  """
1955
- :see: https://www.tokocrypto.com/apidocs/#deposit-address-signed
1956
1955
  fetch the deposit address for a currency associated with self account
1956
+ :see: https://www.tokocrypto.com/apidocs/#deposit-address-signed
1957
1957
  :param str code: unified currency code
1958
1958
  :param dict [params]: extra parameters specific to the exchange API endpoint
1959
1959
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
@@ -1995,11 +1995,11 @@ class tokocrypto(Exchange, ImplicitAPI):
1995
1995
  tag = None
1996
1996
  self.check_address(address)
1997
1997
  return {
1998
+ 'info': response,
1998
1999
  'currency': code,
2000
+ 'network': self.safe_string(data, 'network'),
1999
2001
  'address': address,
2000
2002
  'tag': tag,
2001
- 'network': self.safe_string(data, 'network'),
2002
- 'info': response,
2003
2003
  }
2004
2004
 
2005
2005
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
ccxt/upbit.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.upbit import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
8
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -51,6 +51,7 @@ class upbit(Exchange, ImplicitAPI):
51
51
  'fetchDeposit': True,
52
52
  'fetchDepositAddress': True,
53
53
  'fetchDepositAddresses': True,
54
+ 'fetchDepositAddressesByNetwork': False,
54
55
  'fetchDeposits': True,
55
56
  'fetchFundingHistory': False,
56
57
  'fetchFundingRate': False,
@@ -1696,7 +1697,7 @@ class upbit(Exchange, ImplicitAPI):
1696
1697
  #
1697
1698
  return self.parse_order(response)
1698
1699
 
1699
- def fetch_deposit_addresses(self, codes: Strings = None, params={}):
1700
+ def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
1700
1701
  """
1701
1702
  :see: https://docs.upbit.com/reference/%EC%A0%84%EC%B2%B4-%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%A1%B0%ED%9A%8C
1702
1703
  fetch deposit addresses for multiple currencies and chain types
@@ -1727,7 +1728,7 @@ class upbit(Exchange, ImplicitAPI):
1727
1728
  #
1728
1729
  return self.parse_deposit_addresses(response, codes)
1729
1730
 
1730
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1731
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1731
1732
  #
1732
1733
  # {
1733
1734
  # currency: 'XRP',
@@ -1743,14 +1744,14 @@ class upbit(Exchange, ImplicitAPI):
1743
1744
  networkId = self.safe_string(depositAddress, 'net_type')
1744
1745
  self.check_address(address)
1745
1746
  return {
1747
+ 'info': depositAddress,
1746
1748
  'currency': code,
1749
+ 'network': self.network_id_to_code(networkId),
1747
1750
  'address': address,
1748
1751
  'tag': tag,
1749
- 'network': self.network_id_to_code(networkId),
1750
- 'info': depositAddress,
1751
1752
  }
1752
1753
 
1753
- def fetch_deposit_address(self, code: str, params={}):
1754
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1754
1755
  """
1755
1756
  :see: https://docs.upbit.com/reference/%EC%A0%84%EC%B2%B4-%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%A1%B0%ED%9A%8C
1756
1757
  fetch the deposit address for a currency associated with self account
ccxt/vertex.py CHANGED
@@ -2821,4 +2821,12 @@ class vertex(Exchange, ImplicitAPI):
2821
2821
  else:
2822
2822
  if params:
2823
2823
  url += '?' + self.urlencode(params)
2824
+ if path != 'execute':
2825
+ # required encoding for public methods
2826
+ if headers is not None:
2827
+ headers['Accept-Encoding'] = 'gzip'
2828
+ else:
2829
+ headers = {
2830
+ 'Accept-Encoding': 'gzip',
2831
+ }
2824
2832
  return {'url': url, 'method': method, 'body': body, 'headers': headers}