ccxt 4.2.93__py2.py3-none-any.whl → 4.2.95__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 (190) hide show
  1. ccxt/__init__.py +2 -2
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/bitstamp.py +6 -0
  7. ccxt/ace.py +1 -1
  8. ccxt/ascendex.py +1 -1
  9. ccxt/async_support/__init__.py +2 -2
  10. ccxt/async_support/ace.py +1 -1
  11. ccxt/async_support/ascendex.py +1 -1
  12. ccxt/async_support/base/exchange.py +7 -1
  13. ccxt/async_support/bigone.py +1 -1
  14. ccxt/async_support/binance.py +63 -5
  15. ccxt/async_support/bingx.py +1 -1
  16. ccxt/async_support/bit2c.py +1 -1
  17. ccxt/async_support/bitbank.py +1 -1
  18. ccxt/async_support/bitfinex.py +1 -1
  19. ccxt/async_support/bitfinex2.py +1 -1
  20. ccxt/async_support/bitget.py +136 -2
  21. ccxt/async_support/bithumb.py +1 -1
  22. ccxt/async_support/bitmart.py +1 -1
  23. ccxt/async_support/bitmex.py +1 -1
  24. ccxt/async_support/bitopro.py +1 -1
  25. ccxt/async_support/bitrue.py +1 -1
  26. ccxt/async_support/bitso.py +1 -1
  27. ccxt/async_support/bitstamp.py +7 -1
  28. ccxt/async_support/bitteam.py +1 -1
  29. ccxt/async_support/bitvavo.py +1 -1
  30. ccxt/async_support/blockchaincom.py +1 -1
  31. ccxt/async_support/blofin.py +1 -1
  32. ccxt/async_support/btcalpha.py +1 -1
  33. ccxt/async_support/btcbox.py +1 -1
  34. ccxt/async_support/bybit.py +2 -2
  35. ccxt/async_support/cex.py +1 -1
  36. ccxt/async_support/coinbase.py +1 -1
  37. ccxt/async_support/coinbaseinternational.py +1 -1
  38. ccxt/async_support/coinbasepro.py +1 -1
  39. ccxt/async_support/coincheck.py +1 -1
  40. ccxt/async_support/coinex.py +62 -56
  41. ccxt/async_support/coinlist.py +1 -1
  42. ccxt/async_support/coinmate.py +1 -1
  43. ccxt/async_support/coinsph.py +1 -1
  44. ccxt/async_support/cryptocom.py +1 -1
  45. ccxt/async_support/currencycom.py +1 -1
  46. ccxt/async_support/delta.py +1 -1
  47. ccxt/async_support/deribit.py +1 -1
  48. ccxt/async_support/digifinex.py +1 -1
  49. ccxt/async_support/exmo.py +1 -1
  50. ccxt/async_support/gate.py +1 -1
  51. ccxt/async_support/gemini.py +3 -2
  52. ccxt/async_support/hitbtc.py +1 -1
  53. ccxt/async_support/hollaex.py +1 -1
  54. ccxt/async_support/htx.py +117 -116
  55. ccxt/async_support/huobijp.py +1 -1
  56. ccxt/async_support/idex.py +1 -1
  57. ccxt/async_support/indodax.py +1 -1
  58. ccxt/async_support/kraken.py +1 -1
  59. ccxt/async_support/krakenfutures.py +2 -2
  60. ccxt/async_support/kucoin.py +1 -1
  61. ccxt/async_support/kucoinfutures.py +1 -1
  62. ccxt/async_support/latoken.py +1 -1
  63. ccxt/async_support/lbank.py +1 -1
  64. ccxt/async_support/mexc.py +1 -1
  65. ccxt/async_support/ndax.py +1 -1
  66. ccxt/async_support/novadax.py +1 -1
  67. ccxt/async_support/oceanex.py +1 -1
  68. ccxt/async_support/okcoin.py +1 -1
  69. ccxt/async_support/okx.py +191 -43
  70. ccxt/async_support/onetrading.py +1 -1
  71. ccxt/async_support/p2b.py +1 -1
  72. ccxt/async_support/phemex.py +1 -1
  73. ccxt/async_support/poloniex.py +1 -1
  74. ccxt/async_support/poloniexfutures.py +1 -1
  75. ccxt/async_support/probit.py +1 -1
  76. ccxt/async_support/timex.py +1 -1
  77. ccxt/async_support/tokocrypto.py +1 -1
  78. ccxt/async_support/tradeogre.py +1 -1
  79. ccxt/async_support/upbit.py +2 -2
  80. ccxt/async_support/wavesexchange.py +1 -1
  81. ccxt/async_support/whitebit.py +1 -1
  82. ccxt/async_support/woo.py +136 -2
  83. ccxt/async_support/yobit.py +1 -1
  84. ccxt/async_support/zonda.py +1 -1
  85. ccxt/base/errors.py +7 -7
  86. ccxt/base/exchange.py +18 -1
  87. ccxt/base/types.py +13 -0
  88. ccxt/bigone.py +1 -1
  89. ccxt/binance.py +63 -5
  90. ccxt/bingx.py +1 -1
  91. ccxt/bit2c.py +1 -1
  92. ccxt/bitbank.py +1 -1
  93. ccxt/bitfinex.py +1 -1
  94. ccxt/bitfinex2.py +1 -1
  95. ccxt/bitget.py +136 -2
  96. ccxt/bithumb.py +1 -1
  97. ccxt/bitmart.py +1 -1
  98. ccxt/bitmex.py +1 -1
  99. ccxt/bitopro.py +1 -1
  100. ccxt/bitrue.py +1 -1
  101. ccxt/bitso.py +1 -1
  102. ccxt/bitstamp.py +7 -1
  103. ccxt/bitteam.py +1 -1
  104. ccxt/bitvavo.py +1 -1
  105. ccxt/blockchaincom.py +1 -1
  106. ccxt/blofin.py +1 -1
  107. ccxt/btcalpha.py +1 -1
  108. ccxt/btcbox.py +1 -1
  109. ccxt/bybit.py +2 -2
  110. ccxt/cex.py +1 -1
  111. ccxt/coinbase.py +1 -1
  112. ccxt/coinbaseinternational.py +1 -1
  113. ccxt/coinbasepro.py +1 -1
  114. ccxt/coincheck.py +1 -1
  115. ccxt/coinex.py +62 -56
  116. ccxt/coinlist.py +1 -1
  117. ccxt/coinmate.py +1 -1
  118. ccxt/coinsph.py +1 -1
  119. ccxt/cryptocom.py +1 -1
  120. ccxt/currencycom.py +1 -1
  121. ccxt/delta.py +1 -1
  122. ccxt/deribit.py +1 -1
  123. ccxt/digifinex.py +1 -1
  124. ccxt/exmo.py +1 -1
  125. ccxt/gate.py +1 -1
  126. ccxt/gemini.py +3 -2
  127. ccxt/hitbtc.py +1 -1
  128. ccxt/hollaex.py +1 -1
  129. ccxt/htx.py +117 -116
  130. ccxt/huobijp.py +1 -1
  131. ccxt/idex.py +1 -1
  132. ccxt/indodax.py +1 -1
  133. ccxt/kraken.py +1 -1
  134. ccxt/krakenfutures.py +2 -2
  135. ccxt/kucoin.py +1 -1
  136. ccxt/kucoinfutures.py +1 -1
  137. ccxt/latoken.py +1 -1
  138. ccxt/lbank.py +1 -1
  139. ccxt/mexc.py +1 -1
  140. ccxt/ndax.py +1 -1
  141. ccxt/novadax.py +1 -1
  142. ccxt/oceanex.py +1 -1
  143. ccxt/okcoin.py +1 -1
  144. ccxt/okx.py +191 -43
  145. ccxt/onetrading.py +1 -1
  146. ccxt/p2b.py +1 -1
  147. ccxt/phemex.py +1 -1
  148. ccxt/poloniex.py +1 -1
  149. ccxt/poloniexfutures.py +1 -1
  150. ccxt/pro/__init__.py +1 -1
  151. ccxt/pro/ascendex.py +1 -1
  152. ccxt/pro/bitfinex2.py +1 -1
  153. ccxt/pro/bitget.py +1 -1
  154. ccxt/pro/bitmart.py +1 -1
  155. ccxt/pro/bitmex.py +1 -1
  156. ccxt/pro/bitstamp.py +1 -1
  157. ccxt/pro/bitvavo.py +1 -1
  158. ccxt/pro/blockchaincom.py +1 -1
  159. ccxt/pro/bybit.py +1 -1
  160. ccxt/pro/coinbase.py +12 -0
  161. ccxt/pro/coinbaseinternational.py +1 -1
  162. ccxt/pro/coinbasepro.py +1 -1
  163. ccxt/pro/coinex.py +1 -1
  164. ccxt/pro/cryptocom.py +1 -1
  165. ccxt/pro/gate.py +1 -1
  166. ccxt/pro/hitbtc.py +1 -1
  167. ccxt/pro/hollaex.py +1 -1
  168. ccxt/pro/htx.py +1 -1
  169. ccxt/pro/kraken.py +97 -19
  170. ccxt/pro/krakenfutures.py +105 -40
  171. ccxt/pro/kucoin.py +25 -16
  172. ccxt/pro/okcoin.py +1 -1
  173. ccxt/pro/okx.py +1 -1
  174. ccxt/pro/poloniex.py +1 -1
  175. ccxt/pro/poloniexfutures.py +1 -1
  176. ccxt/pro/whitebit.py +1 -1
  177. ccxt/probit.py +1 -1
  178. ccxt/timex.py +1 -1
  179. ccxt/tokocrypto.py +1 -1
  180. ccxt/tradeogre.py +1 -1
  181. ccxt/upbit.py +2 -2
  182. ccxt/wavesexchange.py +1 -1
  183. ccxt/whitebit.py +1 -1
  184. ccxt/woo.py +136 -2
  185. ccxt/yobit.py +1 -1
  186. ccxt/zonda.py +1 -1
  187. {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/METADATA +4 -4
  188. {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/RECORD +190 -190
  189. {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/WHEEL +0 -0
  190. {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/top_level.txt +0 -0
ccxt/woo.py CHANGED
@@ -6,16 +6,16 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.woo import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, Int, Leverage, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Bool, Conversion, Currencies, Currency, Int, Leverage, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
+ from ccxt.base.errors import AuthenticationError
12
13
  from ccxt.base.errors import ArgumentsRequired
13
14
  from ccxt.base.errors import BadRequest
14
15
  from ccxt.base.errors import InvalidOrder
15
16
  from ccxt.base.errors import NotSupported
16
17
  from ccxt.base.errors import RateLimitExceeded
17
18
  from ccxt.base.errors import OnMaintenance
18
- from ccxt.base.errors import AuthenticationError
19
19
  from ccxt.base.decimal_to_precision import TICK_SIZE
20
20
  from ccxt.base.precise import Precise
21
21
 
@@ -66,6 +66,8 @@ class woo(Exchange, ImplicitAPI):
66
66
  'fetchCanceledOrders': False,
67
67
  'fetchClosedOrder': False,
68
68
  'fetchClosedOrders': True,
69
+ 'fetchConvertCurrencies': True,
70
+ 'fetchConvertQuote': True,
69
71
  'fetchCurrencies': True,
70
72
  'fetchDepositAddress': True,
71
73
  'fetchDeposits': True,
@@ -2781,6 +2783,138 @@ class woo(Exchange, ImplicitAPI):
2781
2783
  'takeProfitPrice': None,
2782
2784
  })
2783
2785
 
2786
+ def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
2787
+ """
2788
+ fetch a quote for converting from one currency to another
2789
+ :see: https://docs.woo.org/#get-quote-rfq
2790
+ :param str fromCode: the currency that you want to sell and convert from
2791
+ :param str toCode: the currency that you want to buy and convert into
2792
+ :param float [amount]: how much you want to trade in units of the from currency
2793
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2794
+ :returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
2795
+ """
2796
+ self.load_markets()
2797
+ request = {
2798
+ 'sellToken': fromCode.upper(),
2799
+ 'buyToken': toCode.upper(),
2800
+ 'sellQuantity': self.number_to_string(amount),
2801
+ }
2802
+ response = self.v3PrivateGetConvertRfq(self.extend(request, params))
2803
+ #
2804
+ # {
2805
+ # "success": True,
2806
+ # "data": {
2807
+ # "quoteId": 123123123,
2808
+ # "counterPartyId": "",
2809
+ # "sellToken": "ETH",
2810
+ # "sellQuantity": "0.0445",
2811
+ # "buyToken": "USDT",
2812
+ # "buyQuantity": "33.45",
2813
+ # "buyPrice": "6.77",
2814
+ # "expireTimestamp": 1659084466000,
2815
+ # "message": 1659084466000
2816
+ # }
2817
+ # }
2818
+ #
2819
+ data = self.safe_dict(response, 'data', {})
2820
+ fromCurrencyId = self.safe_string(data, 'sellToken', fromCode)
2821
+ fromCurrency = self.currency(fromCurrencyId)
2822
+ toCurrencyId = self.safe_string(data, 'buyToken', toCode)
2823
+ toCurrency = self.currency(toCurrencyId)
2824
+ return self.parse_conversion(data, fromCurrency, toCurrency)
2825
+
2826
+ def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
2827
+ #
2828
+ # fetchConvertQuote
2829
+ #
2830
+ # {
2831
+ # "quoteId": 123123123,
2832
+ # "counterPartyId": "",
2833
+ # "sellToken": "ETH",
2834
+ # "sellQuantity": "0.0445",
2835
+ # "buyToken": "USDT",
2836
+ # "buyQuantity": "33.45",
2837
+ # "buyPrice": "6.77",
2838
+ # "expireTimestamp": 1659084466000,
2839
+ # "message": 1659084466000
2840
+ # }
2841
+ #
2842
+ timestamp = self.safe_integer(conversion, 'expireTimestamp')
2843
+ fromCoin = self.safe_string(conversion, 'sellToken')
2844
+ fromCode = self.safe_currency_code(fromCoin, fromCurrency)
2845
+ to = self.safe_string(conversion, 'buyToken')
2846
+ toCode = self.safe_currency_code(to, toCurrency)
2847
+ return {
2848
+ 'info': conversion,
2849
+ 'timestamp': timestamp,
2850
+ 'datetime': self.iso8601(timestamp),
2851
+ 'id': self.safe_string(conversion, 'quoteId'),
2852
+ 'fromCurrency': fromCode,
2853
+ 'fromAmount': self.safe_number(conversion, 'sellQuantity'),
2854
+ 'toCurrency': toCode,
2855
+ 'toAmount': self.safe_number(conversion, 'buyQuantity'),
2856
+ 'price': self.safe_number(conversion, 'buyPrice'),
2857
+ 'fee': None,
2858
+ }
2859
+
2860
+ def fetch_convert_currencies(self, params={}) -> Currencies:
2861
+ """
2862
+ fetches all available currencies that can be converted
2863
+ :see: https://docs.woo.org/#get-quote-asset-info
2864
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2865
+ :returns dict: an associative dictionary of currencies
2866
+ """
2867
+ self.load_markets()
2868
+ response = self.v3PrivateGetConvertAssetInfo(params)
2869
+ #
2870
+ # {
2871
+ # "success": True,
2872
+ # "rows": [
2873
+ # {
2874
+ # "token": "BTC",
2875
+ # "tick": 0.0001,
2876
+ # "createdTime": "1575014248.99", # Unix epoch time in seconds
2877
+ # "updatedTime": "1575014248.99" # Unix epoch time in seconds
2878
+ # },
2879
+ # ]
2880
+ # }
2881
+ #
2882
+ result = {}
2883
+ data = self.safe_list(response, 'rows', [])
2884
+ for i in range(0, len(data)):
2885
+ entry = data[i]
2886
+ id = self.safe_string(entry, 'token')
2887
+ code = self.safe_currency_code(id)
2888
+ result[code] = {
2889
+ 'info': entry,
2890
+ 'id': id,
2891
+ 'code': code,
2892
+ 'networks': None,
2893
+ 'type': None,
2894
+ 'name': None,
2895
+ 'active': None,
2896
+ 'deposit': None,
2897
+ 'withdraw': None,
2898
+ 'fee': None,
2899
+ 'precision': self.safe_number(entry, 'tick'),
2900
+ 'limits': {
2901
+ 'amount': {
2902
+ 'min': None,
2903
+ 'max': None,
2904
+ },
2905
+ 'withdraw': {
2906
+ 'min': None,
2907
+ 'max': None,
2908
+ },
2909
+ 'deposit': {
2910
+ 'min': None,
2911
+ 'max': None,
2912
+ },
2913
+ },
2914
+ 'created': self.safe_timestamp(entry, 'createdTime'),
2915
+ }
2916
+ return result
2917
+
2784
2918
  def default_network_code_for_currency(self, code):
2785
2919
  currencyItem = self.currency(code)
2786
2920
  networks = currencyItem['networks']
ccxt/yobit.py CHANGED
@@ -9,6 +9,7 @@ import hashlib
9
9
  from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
+ from ccxt.base.errors import AuthenticationError
12
13
  from ccxt.base.errors import ArgumentsRequired
13
14
  from ccxt.base.errors import InsufficientFunds
14
15
  from ccxt.base.errors import InvalidOrder
@@ -17,7 +18,6 @@ from ccxt.base.errors import DDoSProtection
17
18
  from ccxt.base.errors import RateLimitExceeded
18
19
  from ccxt.base.errors import ExchangeNotAvailable
19
20
  from ccxt.base.errors import InvalidNonce
20
- from ccxt.base.errors import AuthenticationError
21
21
  from ccxt.base.decimal_to_precision import TICK_SIZE
22
22
  from ccxt.base.precise import Precise
23
23
 
ccxt/zonda.py CHANGED
@@ -9,6 +9,7 @@ import hashlib
9
9
  from ccxt.base.types import Balances, Currency, Int, 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
+ from ccxt.base.errors import AuthenticationError
12
13
  from ccxt.base.errors import PermissionDenied
13
14
  from ccxt.base.errors import AccountSuspended
14
15
  from ccxt.base.errors import BadRequest
@@ -20,7 +21,6 @@ from ccxt.base.errors import OrderImmediatelyFillable
20
21
  from ccxt.base.errors import RateLimitExceeded
21
22
  from ccxt.base.errors import OnMaintenance
22
23
  from ccxt.base.errors import InvalidNonce
23
- from ccxt.base.errors import AuthenticationError
24
24
  from ccxt.base.decimal_to_precision import TICK_SIZE
25
25
  from ccxt.base.precise import Precise
26
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ccxt
3
- Version: 4.2.93
3
+ Version: 4.2.95
4
4
  Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
5
5
  Home-page: https://ccxt.com
6
6
  Author: Igor Kroitor
@@ -261,13 +261,13 @@ console.log(version, Object.keys(exchanges));
261
261
 
262
262
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
263
263
 
264
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.93/dist/ccxt.browser.js
265
- * unpkg: https://unpkg.com/ccxt@4.2.93/dist/ccxt.browser.js
264
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.95/dist/ccxt.browser.js
265
+ * unpkg: https://unpkg.com/ccxt@4.2.95/dist/ccxt.browser.js
266
266
 
267
267
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
268
268
 
269
269
  ```HTML
270
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.93/dist/ccxt.browser.js"></script>
270
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.95/dist/ccxt.browser.js"></script>
271
271
  ```
272
272
 
273
273
  Creates a global `ccxt` object: