ccxt 4.1.47__py2.py3-none-any.whl → 4.1.49__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (166) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/abstract/htx.py +541 -0
  7. ccxt/ace.py +2 -2
  8. ccxt/ascendex.py +2 -2
  9. ccxt/async_support/__init__.py +3 -1
  10. ccxt/async_support/ace.py +2 -2
  11. ccxt/async_support/ascendex.py +2 -2
  12. ccxt/async_support/base/exchange.py +1 -1
  13. ccxt/async_support/bigone.py +2 -2
  14. ccxt/async_support/binance.py +5 -3
  15. ccxt/async_support/bingx.py +3 -3
  16. ccxt/async_support/bitbns.py +2 -2
  17. ccxt/async_support/bitfinex.py +2 -2
  18. ccxt/async_support/bitfinex2.py +2 -2
  19. ccxt/async_support/bitget.py +3 -3
  20. ccxt/async_support/bithumb.py +2 -2
  21. ccxt/async_support/bitmart.py +157 -53
  22. ccxt/async_support/bitmex.py +2 -2
  23. ccxt/async_support/bitopro.py +2 -2
  24. ccxt/async_support/bitpanda.py +2 -2
  25. ccxt/async_support/bitrue.py +2 -2
  26. ccxt/async_support/bitstamp.py +2 -2
  27. ccxt/async_support/bittrex.py +2 -2
  28. ccxt/async_support/bitvavo.py +2 -2
  29. ccxt/async_support/blockchaincom.py +2 -2
  30. ccxt/async_support/btcalpha.py +2 -2
  31. ccxt/async_support/btcturk.py +2 -2
  32. ccxt/async_support/bybit.py +2 -2
  33. ccxt/async_support/cex.py +2 -2
  34. ccxt/async_support/coinbase.py +2 -2
  35. ccxt/async_support/coinbasepro.py +2 -2
  36. ccxt/async_support/coinex.py +63 -20
  37. ccxt/async_support/coinfalcon.py +2 -2
  38. ccxt/async_support/coinlist.py +2 -2
  39. ccxt/async_support/coinone.py +2 -2
  40. ccxt/async_support/coinsph.py +2 -2
  41. ccxt/async_support/coinspot.py +2 -2
  42. ccxt/async_support/cryptocom.py +2 -2
  43. ccxt/async_support/currencycom.py +2 -2
  44. ccxt/async_support/delta.py +2 -2
  45. ccxt/async_support/deribit.py +2 -2
  46. ccxt/async_support/digifinex.py +2 -2
  47. ccxt/async_support/exmo.py +2 -2
  48. ccxt/async_support/gate.py +2 -2
  49. ccxt/async_support/gemini.py +3 -3
  50. ccxt/async_support/hitbtc.py +2 -2
  51. ccxt/async_support/hollaex.py +2 -2
  52. ccxt/async_support/htx.py +7853 -0
  53. ccxt/async_support/huobi.py +3 -7846
  54. ccxt/async_support/huobijp.py +2 -2
  55. ccxt/async_support/idex.py +2 -2
  56. ccxt/async_support/indodax.py +2 -2
  57. ccxt/async_support/kraken.py +2 -6
  58. ccxt/async_support/krakenfutures.py +2 -2
  59. ccxt/async_support/kucoin.py +2 -2
  60. ccxt/async_support/kuna.py +2 -2
  61. ccxt/async_support/latoken.py +2 -2
  62. ccxt/async_support/lbank.py +2 -2
  63. ccxt/async_support/lbank2.py +2 -2
  64. ccxt/async_support/luno.py +2 -2
  65. ccxt/async_support/lykke.py +2 -2
  66. ccxt/async_support/mexc.py +23 -23
  67. ccxt/async_support/novadax.py +2 -2
  68. ccxt/async_support/oceanex.py +2 -2
  69. ccxt/async_support/okcoin.py +3 -3
  70. ccxt/async_support/okx.py +3 -3
  71. ccxt/async_support/phemex.py +2 -2
  72. ccxt/async_support/poloniex.py +2 -2
  73. ccxt/async_support/poloniexfutures.py +2 -2
  74. ccxt/async_support/probit.py +2 -2
  75. ccxt/async_support/tidex.py +2 -2
  76. ccxt/async_support/timex.py +4 -4
  77. ccxt/async_support/tokocrypto.py +2 -2
  78. ccxt/async_support/upbit.py +2 -2
  79. ccxt/async_support/wavesexchange.py +2 -2
  80. ccxt/async_support/wazirx.py +2 -2
  81. ccxt/async_support/whitebit.py +2 -2
  82. ccxt/async_support/yobit.py +2 -2
  83. ccxt/async_support/zonda.py +2 -2
  84. ccxt/base/exchange.py +1 -1
  85. ccxt/base/types.py +43 -4
  86. ccxt/bigone.py +2 -2
  87. ccxt/binance.py +5 -3
  88. ccxt/bingx.py +3 -3
  89. ccxt/bitbns.py +2 -2
  90. ccxt/bitfinex.py +2 -2
  91. ccxt/bitfinex2.py +2 -2
  92. ccxt/bitget.py +3 -3
  93. ccxt/bithumb.py +2 -2
  94. ccxt/bitmart.py +157 -53
  95. ccxt/bitmex.py +2 -2
  96. ccxt/bitopro.py +2 -2
  97. ccxt/bitpanda.py +2 -2
  98. ccxt/bitrue.py +2 -2
  99. ccxt/bitstamp.py +2 -2
  100. ccxt/bittrex.py +2 -2
  101. ccxt/bitvavo.py +2 -2
  102. ccxt/blockchaincom.py +2 -2
  103. ccxt/btcalpha.py +2 -2
  104. ccxt/btcturk.py +2 -2
  105. ccxt/bybit.py +2 -2
  106. ccxt/cex.py +2 -2
  107. ccxt/coinbase.py +2 -2
  108. ccxt/coinbasepro.py +2 -2
  109. ccxt/coinex.py +63 -20
  110. ccxt/coinfalcon.py +2 -2
  111. ccxt/coinlist.py +2 -2
  112. ccxt/coinone.py +2 -2
  113. ccxt/coinsph.py +2 -2
  114. ccxt/coinspot.py +2 -2
  115. ccxt/cryptocom.py +2 -2
  116. ccxt/currencycom.py +2 -2
  117. ccxt/delta.py +2 -2
  118. ccxt/deribit.py +2 -2
  119. ccxt/digifinex.py +2 -2
  120. ccxt/exmo.py +2 -2
  121. ccxt/gate.py +2 -2
  122. ccxt/gemini.py +3 -3
  123. ccxt/hitbtc.py +2 -2
  124. ccxt/hollaex.py +2 -2
  125. ccxt/htx.py +7852 -0
  126. ccxt/huobi.py +3 -7845
  127. ccxt/huobijp.py +2 -2
  128. ccxt/idex.py +2 -2
  129. ccxt/indodax.py +2 -2
  130. ccxt/kraken.py +2 -6
  131. ccxt/krakenfutures.py +2 -2
  132. ccxt/kucoin.py +2 -2
  133. ccxt/kuna.py +2 -2
  134. ccxt/latoken.py +2 -2
  135. ccxt/lbank.py +2 -2
  136. ccxt/lbank2.py +2 -2
  137. ccxt/luno.py +2 -2
  138. ccxt/lykke.py +2 -2
  139. ccxt/mexc.py +23 -23
  140. ccxt/novadax.py +2 -2
  141. ccxt/oceanex.py +2 -2
  142. ccxt/okcoin.py +3 -3
  143. ccxt/okx.py +3 -3
  144. ccxt/phemex.py +2 -2
  145. ccxt/poloniex.py +2 -2
  146. ccxt/poloniexfutures.py +2 -2
  147. ccxt/pro/__init__.py +3 -1
  148. ccxt/pro/htx.py +2177 -0
  149. ccxt/pro/huobi.py +4 -2166
  150. ccxt/probit.py +2 -2
  151. ccxt/test/test_async.py +15 -1
  152. ccxt/test/test_sync.py +15 -1
  153. ccxt/tidex.py +2 -2
  154. ccxt/timex.py +4 -4
  155. ccxt/tokocrypto.py +2 -2
  156. ccxt/upbit.py +2 -2
  157. ccxt/wavesexchange.py +2 -2
  158. ccxt/wazirx.py +2 -2
  159. ccxt/whitebit.py +2 -2
  160. ccxt/yobit.py +2 -2
  161. ccxt/zonda.py +2 -2
  162. ccxt-4.1.49.dist-info/METADATA +624 -0
  163. {ccxt-4.1.47.dist-info → ccxt-4.1.49.dist-info}/RECORD +165 -161
  164. ccxt-4.1.47.dist-info/METADATA +0 -624
  165. {ccxt-4.1.47.dist-info → ccxt-4.1.49.dist-info}/WHEEL +0 -0
  166. {ccxt-4.1.47.dist-info → ccxt-4.1.49.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitrue import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
10
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -975,7 +975,7 @@ class bitrue(Exchange, ImplicitAPI):
975
975
  data[market['id']] = response
976
976
  return self.parse_tickers(data, symbols)
977
977
 
978
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
978
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
979
979
  """
980
980
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
981
981
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitstamp import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -743,7 +743,7 @@ class bitstamp(Exchange, ImplicitAPI):
743
743
  #
744
744
  return self.parse_ticker(ticker, market)
745
745
 
746
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
746
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
747
747
  """
748
748
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
749
749
  :see: https://www.bitstamp.net/api/#all-tickers
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bittrex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -566,7 +566,7 @@ class bittrex(Exchange, ImplicitAPI):
566
566
  'info': ticker,
567
567
  }, market)
568
568
 
569
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
569
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
570
570
  """
571
571
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
572
572
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitvavo import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -589,7 +589,7 @@ class bitvavo(Exchange, ImplicitAPI):
589
589
  'info': ticker,
590
590
  }, market)
591
591
 
592
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
592
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
593
593
  """
594
594
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
595
595
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.blockchaincom import ImplicitAPI
8
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
8
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
9
9
  from typing import Optional
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
@@ -442,7 +442,7 @@ class blockchaincom(Exchange, ImplicitAPI):
442
442
  response = await self.publicGetTickersSymbol(self.extend(request, params))
443
443
  return self.parse_ticker(response, market)
444
444
 
445
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
445
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
446
446
  """
447
447
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
448
448
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.btcalpha import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -236,7 +236,7 @@ class btcalpha(Exchange, ImplicitAPI):
236
236
  })
237
237
  return result
238
238
 
239
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
239
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
240
240
  """
241
241
  :see: https://btc-alpha.github.io/api-docs/#tickers
242
242
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.btcturk import ImplicitAPI
8
8
  import hashlib
9
9
  import math
10
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade
10
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -392,7 +392,7 @@ class btcturk(Exchange, ImplicitAPI):
392
392
  'info': ticker,
393
393
  }, market)
394
394
 
395
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
395
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
396
396
  """
397
397
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
398
398
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bybit import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
10
+ from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -2018,7 +2018,7 @@ class bybit(Exchange, ImplicitAPI):
2018
2018
  rawTicker = self.safe_value(tickers, 0)
2019
2019
  return self.parse_ticker(rawTicker, market)
2020
2020
 
2021
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
2021
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
2022
2022
  """
2023
2023
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
2024
2024
  :see: https://bybit-exchange.github.io/docs/v5/market/tickers
ccxt/async_support/cex.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.cex import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade
10
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -582,7 +582,7 @@ class cex(Exchange, ImplicitAPI):
582
582
  'info': ticker,
583
583
  }, market)
584
584
 
585
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
585
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
586
586
  """
587
587
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
588
588
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinbase import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1167,7 +1167,7 @@ class coinbase(Exchange, ImplicitAPI):
1167
1167
  }
1168
1168
  return result
1169
1169
 
1170
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
1170
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
1171
1171
  """
1172
1172
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1173
1173
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinbasepro import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -611,7 +611,7 @@ class coinbasepro(Exchange, ImplicitAPI):
611
611
  'info': ticker,
612
612
  }, market)
613
613
 
614
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
614
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
615
615
  """
616
616
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
617
617
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinex import ImplicitAPI
8
8
  import asyncio
9
- from ccxt.base.types import Balances, Order, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -297,6 +297,7 @@ class coinex(Exchange, ImplicitAPI):
297
297
  },
298
298
  },
299
299
  'options': {
300
+ 'brokerId': 'x-167673045',
300
301
  'createMarketBuyOrderRequiresPrice': True,
301
302
  'defaultType': 'spot', # spot, swap, margin
302
303
  'defaultSubType': 'linear', # linear, inverse
@@ -316,6 +317,26 @@ class coinex(Exchange, ImplicitAPI):
316
317
  'ACM': 'Actinium',
317
318
  },
318
319
  'precisionMode': TICK_SIZE,
320
+ 'exceptions': {
321
+ 'exact': {
322
+ # https://github.com/coinexcom/coinex_exchange_api/wiki/013error_code
323
+ '23': PermissionDenied, # IP Prohibited
324
+ '24': AuthenticationError,
325
+ '25': AuthenticationError,
326
+ '34': AuthenticationError, # Access id is expires
327
+ '35': ExchangeNotAvailable, # Service unavailable
328
+ '36': RequestTimeout, # Service timeout
329
+ '213': RateLimitExceeded, # Too many requests
330
+ '107': InsufficientFunds,
331
+ '600': OrderNotFound,
332
+ '601': InvalidOrder,
333
+ '602': InvalidOrder,
334
+ '606': InvalidOrder,
335
+ },
336
+ 'broad': {
337
+ 'ip not allow visit': PermissionDenied,
338
+ },
339
+ },
319
340
  })
320
341
 
321
342
  async def fetch_currencies(self, params={}):
@@ -777,7 +798,7 @@ class coinex(Exchange, ImplicitAPI):
777
798
  #
778
799
  return self.parse_ticker(response['data'], market)
779
800
 
780
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
801
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
781
802
  """
782
803
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
783
804
  :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market008_all_market_ticker
@@ -1500,6 +1521,7 @@ class coinex(Exchange, ImplicitAPI):
1500
1521
  # "status": "done",
1501
1522
  # "taker_fee_rate": "0.0005",
1502
1523
  # "type": "sell",
1524
+ # "client_id": "",
1503
1525
  # }
1504
1526
  #
1505
1527
  # Spot and Margin createOrder, cancelOrder, fetchOrder
@@ -1527,6 +1549,7 @@ class coinex(Exchange, ImplicitAPI):
1527
1549
  # "stock_fee":"0",
1528
1550
  # "taker_fee_rate":"0.002",
1529
1551
  # "type":"buy"
1552
+ # "client_id": "",
1530
1553
  # }
1531
1554
  #
1532
1555
  # Swap createOrder, cancelOrder, fetchOrder
@@ -1734,9 +1757,12 @@ class coinex(Exchange, ImplicitAPI):
1734
1757
  type = 'market'
1735
1758
  else:
1736
1759
  type = rawType
1760
+ clientOrderId = self.safe_string(order, 'client_id')
1761
+ if clientOrderId == '':
1762
+ clientOrderId = None
1737
1763
  return self.safe_order({
1738
1764
  'id': self.safe_string_2(order, 'id', 'order_id'),
1739
- 'clientOrderId': None,
1765
+ 'clientOrderId': clientOrderId,
1740
1766
  'datetime': self.iso8601(timestamp),
1741
1767
  'timestamp': timestamp,
1742
1768
  'lastTradeTimestamp': self.safe_timestamp(order, 'update_time'),
@@ -1791,6 +1817,7 @@ class coinex(Exchange, ImplicitAPI):
1791
1817
  await self.load_markets()
1792
1818
  market = self.market(symbol)
1793
1819
  swap = market['swap']
1820
+ clientOrderId = self.safe_string_2(params, 'client_id', 'clientOrderId')
1794
1821
  stopPrice = self.safe_value_2(params, 'stopPrice', 'triggerPrice')
1795
1822
  stopLossPrice = self.safe_value(params, 'stopLossPrice')
1796
1823
  takeProfitPrice = self.safe_value(params, 'takeProfitPrice')
@@ -1809,6 +1836,12 @@ class coinex(Exchange, ImplicitAPI):
1809
1836
  request = {
1810
1837
  'market': market['id'],
1811
1838
  }
1839
+ if clientOrderId is None:
1840
+ defaultId = 'x-167673045'
1841
+ brokerId = self.safe_string(self.options, 'brokerId', defaultId)
1842
+ request['client_id'] = brokerId + '-' + self.uuid16()
1843
+ else:
1844
+ request['client_id'] = clientOrderId
1812
1845
  if swap:
1813
1846
  if stopLossPrice or takeProfitPrice:
1814
1847
  request['stop_type'] = self.safe_integer(params, 'stop_type', 1) # 1: triggered by the latest transaction, 2: mark price, 3: index price
@@ -4499,6 +4532,29 @@ class coinex(Exchange, ImplicitAPI):
4499
4532
  url = self.urls['api'][api] + '/' + self.version + '/' + path
4500
4533
  query = self.omit(params, self.extract_params(path))
4501
4534
  nonce = str(self.nonce())
4535
+ if method == 'POST':
4536
+ parts = path.split('/')
4537
+ firstPart = self.safe_string(parts, 0, '')
4538
+ numParts = len(parts)
4539
+ lastPart = self.safe_string(parts, numParts - 1, '')
4540
+ lastWords = lastPart.split('_')
4541
+ numWords = len(lastWords)
4542
+ lastWord = self.safe_string(lastWords, numWords - 1, '')
4543
+ if (firstPart == 'order') and (lastWord == 'limit' or lastWord == 'market'):
4544
+ # inject in implicit API calls
4545
+ # POST /order/limit - Place limit orders
4546
+ # POST /order/market - Place market orders
4547
+ # POST /order/stop/limit - Place stop limit orders
4548
+ # POST /order/stop/market - Place stop market orders
4549
+ # POST /perpetual/v1/order/put_limit - Place limit orders
4550
+ # POST /perpetual/v1/order/put_market - Place market orders
4551
+ # POST /perpetual/v1/order/put_stop_limit - Place stop limit orders
4552
+ # POST /perpetual/v1/order/put_stop_market - Place stop market orders
4553
+ clientOrderId = self.safe_string(params, 'client_id')
4554
+ if clientOrderId is None:
4555
+ defaultId = 'x-167673045'
4556
+ brokerId = self.safe_value(self.options, 'brokerId', defaultId)
4557
+ query['client_id'] = brokerId + '_' + self.uuid16()
4502
4558
  if api == 'perpetualPrivate' or url == 'https://api.coinex.com/perpetual/v1/market/user_deals':
4503
4559
  self.check_required_credentials()
4504
4560
  query = self.extend({
@@ -4546,21 +4602,8 @@ class coinex(Exchange, ImplicitAPI):
4546
4602
  data = self.safe_value(response, 'data')
4547
4603
  message = self.safe_string(response, 'message')
4548
4604
  if (code != '0') or ((message != 'Success') and (message != 'Succeeded') and (message != 'Ok') and not data):
4549
- responseCodes = {
4550
- # https://github.com/coinexcom/coinex_exchange_api/wiki/013error_code
4551
- '23': PermissionDenied, # IP Prohibited
4552
- '24': AuthenticationError,
4553
- '25': AuthenticationError,
4554
- '34': AuthenticationError, # Access id is expires
4555
- '35': ExchangeNotAvailable, # Service unavailable
4556
- '36': RequestTimeout, # Service timeout
4557
- '213': RateLimitExceeded, # Too many requests
4558
- '107': InsufficientFunds,
4559
- '600': OrderNotFound,
4560
- '601': InvalidOrder,
4561
- '602': InvalidOrder,
4562
- '606': InvalidOrder,
4563
- }
4564
- ErrorClass = self.safe_value(responseCodes, code, ExchangeError)
4565
- raise ErrorClass(response['message'])
4605
+ feedback = self.id + ' ' + message
4606
+ self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
4607
+ self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
4608
+ raise ExchangeError(feedback)
4566
4609
  return None
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinfalcon import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -275,7 +275,7 @@ class coinfalcon(Exchange, ImplicitAPI):
275
275
  tickers = await self.fetch_tickers([symbol], params)
276
276
  return tickers[symbol]
277
277
 
278
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
278
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
279
279
  """
280
280
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
281
281
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinlist import ImplicitAPI
8
8
  import hashlib
9
9
  import math
10
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
10
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -483,7 +483,7 @@ class coinlist(Exchange, ImplicitAPI):
483
483
  })
484
484
  return result
485
485
 
486
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
486
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
487
487
  """
488
488
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
489
489
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#get-symbol-summaries
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinone import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -285,7 +285,7 @@ class coinone(Exchange, ImplicitAPI):
285
285
  timestamp = self.safe_timestamp(response, 'timestamp')
286
286
  return self.parse_order_book(response, market['symbol'], timestamp, 'bid', 'ask', 'price', 'qty')
287
287
 
288
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
288
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
289
289
  """
290
290
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
291
291
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinsph import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -604,7 +604,7 @@ class coinsph(Exchange, ImplicitAPI):
604
604
  self.set_markets(result)
605
605
  return result
606
606
 
607
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
607
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
608
608
  """
609
609
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
610
610
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinspot import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, OrderBook, OrderSide, OrderType, Ticker, Trade
9
+ from ccxt.base.types import Balances, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -272,7 +272,7 @@ class coinspot(Exchange, ImplicitAPI):
272
272
  ticker = self.safe_value(prices, id)
273
273
  return self.parse_ticker(ticker, market)
274
274
 
275
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
275
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
276
276
  """
277
277
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
278
278
  :see: https://www.coinspot.com.au/api#latestprices
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.cryptocom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -581,7 +581,7 @@ class cryptocom(Exchange, ImplicitAPI):
581
581
  })
582
582
  return result
583
583
 
584
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
584
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
585
585
  """
586
586
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
587
587
  :see: https://exchange-docs.crypto.com/spot/index.html#public-get-ticker
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.currencycom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -884,7 +884,7 @@ class currencycom(Exchange, ImplicitAPI):
884
884
  #
885
885
  return self.parse_ticker(response, market)
886
886
 
887
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
887
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
888
888
  """
889
889
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
890
890
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.delta import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1091,7 +1091,7 @@ class delta(Exchange, ImplicitAPI):
1091
1091
  result = self.safe_value(response, 'result', {})
1092
1092
  return self.parse_ticker(result, market)
1093
1093
 
1094
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
1094
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
1095
1095
  """
1096
1096
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1097
1097
  :see: https://docs.delta.exchange/#get-tickers-for-products
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.deribit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1077,7 +1077,7 @@ class deribit(Exchange, ImplicitAPI):
1077
1077
  result = self.safe_value(response, 'result')
1078
1078
  return self.parse_ticker(result, market)
1079
1079
 
1080
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
1080
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
1081
1081
  """
1082
1082
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1083
1083
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -8,7 +8,7 @@ from ccxt.abstract.digifinex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
11
+ from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
12
12
  from typing import Optional
13
13
  from typing import List
14
14
  from ccxt.base.errors import ExchangeError
@@ -926,7 +926,7 @@ class digifinex(Exchange, ImplicitAPI):
926
926
  timestamp = self.safe_timestamp(response, 'date')
927
927
  return self.parse_order_book(orderBook, market['symbol'], timestamp)
928
928
 
929
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
929
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
930
930
  """
931
931
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
932
932
  :see: https://docs.digifinex.com/en-ww/spot/v3/rest.html#ticker-price
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.exmo import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1032,7 +1032,7 @@ class exmo(Exchange, ImplicitAPI):
1032
1032
  'info': ticker,
1033
1033
  }, market)
1034
1034
 
1035
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
1035
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
1036
1036
  """
1037
1037
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1038
1038
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.gate import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, FundingHistory, Ticker, Trade, Transaction
10
+ from ccxt.base.types import OrderRequest, Balances, Order, OrderBook, OrderSide, OrderType, FundingHistory, Ticker, Tickers, Trade, Transaction
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -2469,7 +2469,7 @@ class gate(Exchange, ImplicitAPI):
2469
2469
  'info': ticker,
2470
2470
  }, market)
2471
2471
 
2472
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
2472
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
2473
2473
  """
2474
2474
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
2475
2475
  :see: https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.gemini import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Trade, Transaction
10
+ from ccxt.base.types import Balances, Market, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, Trade, Transaction
11
11
  from typing import Optional
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
@@ -578,7 +578,7 @@ class gemini(Exchange, ImplicitAPI):
578
578
  result[marketId] = self.parse_market(responseInner)
579
579
  return self.to_array(result)
580
580
 
581
- def parse_market(self, response):
581
+ def parse_market(self, response) -> Market:
582
582
  marketId = self.safe_string_lower(response, 'symbol')
583
583
  baseId = self.safe_string(response, 'base_currency')
584
584
  quoteId = self.safe_string(response, 'quote_currency')
@@ -821,7 +821,7 @@ class gemini(Exchange, ImplicitAPI):
821
821
  'info': ticker,
822
822
  }, market)
823
823
 
824
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
824
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
825
825
  """
826
826
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
827
827
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.hitbtc import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, MarginMode, Trade, Transaction
9
+ from ccxt.base.types import Balances, Order, OrderBook, OrderSide, OrderType, Ticker, Tickers, MarginMode, Trade, Transaction
10
10
  from typing import Optional
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1042,7 +1042,7 @@ class hitbtc(Exchange, ImplicitAPI):
1042
1042
  #
1043
1043
  return self.parse_ticker(response, market)
1044
1044
 
1045
- async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
1045
+ async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}) -> Tickers:
1046
1046
  """
1047
1047
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1048
1048
  :see: https://api.hitbtc.com/#tickers