coinex-api 0.0.89__py3-none-any.whl → 0.0.110__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 coinex-api might be problematic. Click here for more details.

Files changed (197) hide show
  1. coinex/ccxt/__init__.py +1 -1
  2. coinex/ccxt/async_support/__init__.py +1 -1
  3. coinex/ccxt/async_support/base/exchange.py +139 -10
  4. coinex/ccxt/async_support/base/throttler.py +1 -1
  5. coinex/ccxt/async_support/base/ws/cache.py +1 -0
  6. coinex/ccxt/async_support/base/ws/client.py +26 -4
  7. coinex/ccxt/async_support/coinex.py +2 -2
  8. coinex/ccxt/base/exchange.py +587 -91
  9. coinex/ccxt/base/types.py +11 -2
  10. coinex/ccxt/coinex.py +2 -2
  11. coinex/ccxt/pro/__init__.py +1 -1
  12. coinex/ccxt/pro/coinex.py +10 -7
  13. coinex/ccxt/static_dependencies/bip/__init__.py +6 -0
  14. coinex/ccxt/static_dependencies/bip/addr/P2PKH_addr.py +205 -0
  15. coinex/ccxt/static_dependencies/bip/addr/__init__.py +5 -0
  16. coinex/ccxt/static_dependencies/bip/addr/addr_dec_utils.py +125 -0
  17. coinex/ccxt/static_dependencies/bip/addr/addr_key_validator.py +162 -0
  18. coinex/ccxt/static_dependencies/bip/addr/iaddr_decoder.py +48 -0
  19. coinex/ccxt/static_dependencies/bip/addr/iaddr_encoder.py +50 -0
  20. coinex/ccxt/static_dependencies/bip/base58/__init__.py +3 -0
  21. coinex/ccxt/static_dependencies/bip/base58/base58.py +207 -0
  22. coinex/ccxt/static_dependencies/bip/base58/base58_ex.py +25 -0
  23. coinex/ccxt/static_dependencies/bip/base58/base58_xmr.py +155 -0
  24. coinex/ccxt/static_dependencies/bip/bech32/__init__.py +4 -0
  25. coinex/ccxt/static_dependencies/bip/bech32/bch_bech32.py +220 -0
  26. coinex/ccxt/static_dependencies/bip/bech32/bech32.py +235 -0
  27. coinex/ccxt/static_dependencies/bip/bech32/bech32_base.py +246 -0
  28. coinex/ccxt/static_dependencies/bip/bech32/bech32_ex.py +25 -0
  29. coinex/ccxt/static_dependencies/bip/bech32/segwit_bech32.py +173 -0
  30. coinex/ccxt/static_dependencies/bip/bip32/__init__.py +14 -0
  31. coinex/ccxt/static_dependencies/bip/bip32/base/__init__.py +3 -0
  32. coinex/ccxt/static_dependencies/bip/bip32/base/bip32_base.py +581 -0
  33. coinex/ccxt/static_dependencies/bip/bip32/base/ibip32_key_derivator.py +83 -0
  34. coinex/ccxt/static_dependencies/bip/bip32/base/ibip32_mst_key_generator.py +47 -0
  35. coinex/ccxt/static_dependencies/bip/bip32/bip32_const.py +35 -0
  36. coinex/ccxt/static_dependencies/bip/bip32/bip32_ex.py +29 -0
  37. coinex/ccxt/static_dependencies/bip/bip32/bip32_key_data.py +500 -0
  38. coinex/ccxt/static_dependencies/bip/bip32/bip32_key_net_ver.py +83 -0
  39. coinex/ccxt/static_dependencies/bip/bip32/bip32_key_ser.py +294 -0
  40. coinex/ccxt/static_dependencies/bip/bip32/bip32_keys.py +457 -0
  41. coinex/ccxt/static_dependencies/bip/bip32/bip32_path.py +247 -0
  42. coinex/ccxt/static_dependencies/bip/bip32/bip32_utils.py +72 -0
  43. coinex/ccxt/static_dependencies/bip/bip32/kholaw/__init__.py +4 -0
  44. coinex/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_ed25519.py +82 -0
  45. coinex/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_ed25519_key_derivator.py +118 -0
  46. coinex/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_key_derivator_base.py +204 -0
  47. coinex/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_mst_key_generator.py +119 -0
  48. coinex/ccxt/static_dependencies/bip/bip32/slip10/__init__.py +1 -0
  49. coinex/ccxt/static_dependencies/bip/bip32/slip10/bip32_slip10_key_derivator.py +200 -0
  50. coinex/ccxt/static_dependencies/bip/bip32/slip10/bip32_slip10_mst_key_generator.py +168 -0
  51. coinex/ccxt/static_dependencies/bip/bip32/slip10/bip32_slip10_secp256k1.py +82 -0
  52. coinex/ccxt/static_dependencies/bip/bip44/__init__.py +1 -0
  53. coinex/ccxt/static_dependencies/bip/bip44/bip44.py +265 -0
  54. coinex/ccxt/static_dependencies/bip/bip44_base/__init__.py +3 -0
  55. coinex/ccxt/static_dependencies/bip/bip44_base/bip44_base.py +624 -0
  56. coinex/ccxt/static_dependencies/bip/bip44_base/bip44_base_ex.py +25 -0
  57. coinex/ccxt/static_dependencies/bip/bip44_base/bip44_keys.py +225 -0
  58. coinex/ccxt/static_dependencies/bip/coin_conf/__init__.py +2 -0
  59. coinex/ccxt/static_dependencies/bip/coin_conf/coin_conf.py +68 -0
  60. coinex/ccxt/static_dependencies/bip/coin_conf/coins_conf.py +890 -0
  61. coinex/ccxt/static_dependencies/bip/conf/__init__.py +0 -0
  62. coinex/ccxt/static_dependencies/bip/conf/bip44/__init__.py +3 -0
  63. coinex/ccxt/static_dependencies/bip/conf/bip44/bip44_coins.py +126 -0
  64. coinex/ccxt/static_dependencies/bip/conf/bip44/bip44_conf.py +1360 -0
  65. coinex/ccxt/static_dependencies/bip/conf/bip44/bip44_conf_getter.py +153 -0
  66. coinex/ccxt/static_dependencies/bip/conf/bip49/__init__.py +3 -0
  67. coinex/ccxt/static_dependencies/bip/conf/bip49/bip49_coins.py +53 -0
  68. coinex/ccxt/static_dependencies/bip/conf/bip49/bip49_conf.py +366 -0
  69. coinex/ccxt/static_dependencies/bip/conf/bip49/bip49_conf_getter.py +80 -0
  70. coinex/ccxt/static_dependencies/bip/conf/bip84/__init__.py +3 -0
  71. coinex/ccxt/static_dependencies/bip/conf/bip84/bip84_coins.py +39 -0
  72. coinex/ccxt/static_dependencies/bip/conf/bip84/bip84_conf.py +113 -0
  73. coinex/ccxt/static_dependencies/bip/conf/bip84/bip84_conf_getter.py +66 -0
  74. coinex/ccxt/static_dependencies/bip/conf/bip86/__init__.py +3 -0
  75. coinex/ccxt/static_dependencies/bip/conf/bip86/bip86_coins.py +37 -0
  76. coinex/ccxt/static_dependencies/bip/conf/bip86/bip86_conf.py +83 -0
  77. coinex/ccxt/static_dependencies/bip/conf/bip86/bip86_conf_getter.py +64 -0
  78. coinex/ccxt/static_dependencies/bip/conf/common/__init__.py +8 -0
  79. coinex/ccxt/static_dependencies/bip/conf/common/atom_addr.py +104 -0
  80. coinex/ccxt/static_dependencies/bip/conf/common/bip_bitcoin_cash_conf.py +106 -0
  81. coinex/ccxt/static_dependencies/bip/conf/common/bip_coin_conf.py +217 -0
  82. coinex/ccxt/static_dependencies/bip/conf/common/bip_coins.py +28 -0
  83. coinex/ccxt/static_dependencies/bip/conf/common/bip_conf_const.py +30 -0
  84. coinex/ccxt/static_dependencies/bip/conf/common/bip_litecoin_conf.py +121 -0
  85. coinex/ccxt/static_dependencies/bip/ecc/__init__.py +42 -0
  86. coinex/ccxt/static_dependencies/bip/ecc/common/__init__.py +0 -0
  87. coinex/ccxt/static_dependencies/bip/ecc/common/dummy_point.py +219 -0
  88. coinex/ccxt/static_dependencies/bip/ecc/common/ikeys.py +263 -0
  89. coinex/ccxt/static_dependencies/bip/ecc/common/ipoint.py +190 -0
  90. coinex/ccxt/static_dependencies/bip/ecc/conf.py +28 -0
  91. coinex/ccxt/static_dependencies/bip/ecc/curve/__init__.py +0 -0
  92. coinex/ccxt/static_dependencies/bip/ecc/curve/elliptic_curve.py +121 -0
  93. coinex/ccxt/static_dependencies/bip/ecc/curve/elliptic_curve_getter.py +74 -0
  94. coinex/ccxt/static_dependencies/bip/ecc/curve/elliptic_curve_types.py +37 -0
  95. coinex/ccxt/static_dependencies/bip/ecc/ecdsa/__init__.py +0 -0
  96. coinex/ccxt/static_dependencies/bip/ecc/ecdsa/ecdsa_keys.py +36 -0
  97. coinex/ccxt/static_dependencies/bip/ecc/secp256k1/__init__.py +0 -0
  98. coinex/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1.py +36 -0
  99. coinex/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1_const.py +59 -0
  100. coinex/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1_keys_ecdsa.py +248 -0
  101. coinex/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1_point_ecdsa.py +234 -0
  102. coinex/ccxt/static_dependencies/bip/slip/__init__.py +0 -0
  103. coinex/ccxt/static_dependencies/bip/slip/slip173/__init__.py +1 -0
  104. coinex/ccxt/static_dependencies/bip/slip/slip173/slip173.py +60 -0
  105. coinex/ccxt/static_dependencies/bip/slip/slip32/__init__.py +4 -0
  106. coinex/ccxt/static_dependencies/bip/slip/slip32/slip32.py +322 -0
  107. coinex/ccxt/static_dependencies/bip/slip/slip32/slip32_key_net_ver.py +62 -0
  108. coinex/ccxt/static_dependencies/bip/slip/slip44/__init__.py +1 -0
  109. coinex/ccxt/static_dependencies/bip/slip/slip44/slip44.py +81 -0
  110. coinex/ccxt/static_dependencies/bip/utils/__init__.py +0 -0
  111. coinex/ccxt/static_dependencies/bip/utils/conf/__init__.py +1 -0
  112. coinex/ccxt/static_dependencies/bip/utils/conf/coin_names.py +59 -0
  113. coinex/ccxt/static_dependencies/bip/utils/crypto/__init__.py +10 -0
  114. coinex/ccxt/static_dependencies/bip/utils/crypto/aes_ecb.py +152 -0
  115. coinex/ccxt/static_dependencies/bip/utils/crypto/blake2.py +191 -0
  116. coinex/ccxt/static_dependencies/bip/utils/crypto/chacha20_poly1305.py +101 -0
  117. coinex/ccxt/static_dependencies/bip/utils/crypto/hash160.py +57 -0
  118. coinex/ccxt/static_dependencies/bip/utils/crypto/hmac.py +118 -0
  119. coinex/ccxt/static_dependencies/bip/utils/crypto/pbkdf2.py +66 -0
  120. coinex/ccxt/static_dependencies/bip/utils/crypto/ripemd.py +58 -0
  121. coinex/ccxt/static_dependencies/bip/utils/crypto/scrypt.py +66 -0
  122. coinex/ccxt/static_dependencies/bip/utils/crypto/sha2.py +182 -0
  123. coinex/ccxt/static_dependencies/bip/utils/crypto/sha3.py +99 -0
  124. coinex/ccxt/static_dependencies/bip/utils/misc/__init__.py +7 -0
  125. coinex/ccxt/static_dependencies/bip/utils/misc/algo.py +108 -0
  126. coinex/ccxt/static_dependencies/bip/utils/misc/base32.py +151 -0
  127. coinex/ccxt/static_dependencies/bip/utils/misc/bit.py +115 -0
  128. coinex/ccxt/static_dependencies/bip/utils/misc/bytes.py +200 -0
  129. coinex/ccxt/static_dependencies/bip/utils/misc/data_bytes.py +181 -0
  130. coinex/ccxt/static_dependencies/bip/utils/misc/integer.py +97 -0
  131. coinex/ccxt/static_dependencies/bip/utils/misc/string.py +54 -0
  132. coinex/ccxt/static_dependencies/bip/utils/typing/__init__.py +1 -0
  133. coinex/ccxt/static_dependencies/bip/utils/typing/literal.py +27 -0
  134. coinex/ccxt/static_dependencies/bip/wif/__init__.py +1 -0
  135. coinex/ccxt/static_dependencies/bip/wif/wif.py +144 -0
  136. coinex/ccxt/static_dependencies/dydx_v4_client/amino/amino_pb2.py +31 -0
  137. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/base/v1beta1/coin_pb2.py +47 -0
  138. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/crypto/multisig/keys_pb2.py +33 -0
  139. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/crypto/multisig/v1beta1/multisig_pb2.py +33 -0
  140. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/crypto/secp256k1/keys_pb2.py +34 -0
  141. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/msg/v1/msg_pb2.py +27 -0
  142. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/tx/signing/v1beta1/signing_pb2.py +38 -0
  143. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos/tx/v1beta1/tx_pb2.py +75 -0
  144. coinex/ccxt/static_dependencies/dydx_v4_client/cosmos_proto/cosmos_pb2.py +36 -0
  145. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/accountplus_pb2.py +31 -0
  146. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/genesis_pb2.py +40 -0
  147. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/models_pb2.py +26 -0
  148. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/params_pb2.py +29 -0
  149. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/query_pb2.py +57 -0
  150. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/tx_pb2.py +51 -0
  151. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/block_rate_limit_config_pb2.py +37 -0
  152. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/clob_pair_pb2.py +41 -0
  153. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/equity_tier_limit_config_pb2.py +35 -0
  154. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/finalize_block_pb2.py +27 -0
  155. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/liquidations_config_pb2.py +39 -0
  156. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/liquidations_pb2.py +38 -0
  157. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/matches_pb2.py +55 -0
  158. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/mev_pb2.py +49 -0
  159. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/operation_pb2.py +32 -0
  160. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/order_pb2.py +86 -0
  161. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/order_removals_pb2.py +32 -0
  162. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/process_proposer_matches_events_pb2.py +42 -0
  163. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/query_pb2.py +124 -0
  164. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/streaming_pb2.py +29 -0
  165. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/tx_pb2.py +117 -0
  166. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/genesis_pb2.py +26 -0
  167. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/query_pb2.py +26 -0
  168. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/transfer_pb2.py +61 -0
  169. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/tx_pb2.py +37 -0
  170. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/asset_position_pb2.py +29 -0
  171. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/genesis_pb2.py +30 -0
  172. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/perpetual_position_pb2.py +33 -0
  173. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/query_pb2.py +63 -0
  174. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/streaming_pb2.py +31 -0
  175. coinex/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/subaccount_pb2.py +33 -0
  176. coinex/ccxt/static_dependencies/dydx_v4_client/gogoproto/gogo_pb2.py +102 -0
  177. coinex/ccxt/static_dependencies/dydx_v4_client/registry.py +38 -0
  178. coinex/ccxt/static_dependencies/ecdsa/ellipticcurve.py +842 -0
  179. coinex/ccxt/static_dependencies/ecdsa/keys.py +15 -4
  180. coinex/ccxt/static_dependencies/mnemonic/__init__.py +4 -0
  181. coinex/ccxt/static_dependencies/mnemonic/mnemonic.py +282 -0
  182. coinex/ccxt/static_dependencies/mnemonic/py.typed +1 -0
  183. coinex/ccxt/static_dependencies/mnemonic/wordlist/chinese_simplified.txt +2048 -0
  184. coinex/ccxt/static_dependencies/mnemonic/wordlist/chinese_traditional.txt +2048 -0
  185. coinex/ccxt/static_dependencies/mnemonic/wordlist/czech.txt +2048 -0
  186. coinex/ccxt/static_dependencies/mnemonic/wordlist/english.txt +2048 -0
  187. coinex/ccxt/static_dependencies/mnemonic/wordlist/french.txt +2048 -0
  188. coinex/ccxt/static_dependencies/mnemonic/wordlist/italian.txt +2048 -0
  189. coinex/ccxt/static_dependencies/mnemonic/wordlist/japanese.txt +2048 -0
  190. coinex/ccxt/static_dependencies/mnemonic/wordlist/korean.txt +2048 -0
  191. coinex/ccxt/static_dependencies/mnemonic/wordlist/portuguese.txt +2048 -0
  192. coinex/ccxt/static_dependencies/mnemonic/wordlist/russian.txt +2048 -0
  193. coinex/ccxt/static_dependencies/mnemonic/wordlist/spanish.txt +2048 -0
  194. coinex/ccxt/static_dependencies/mnemonic/wordlist/turkish.txt +2048 -0
  195. {coinex_api-0.0.89.dist-info → coinex_api-0.0.110.dist-info}/METADATA +3 -3
  196. {coinex_api-0.0.89.dist-info → coinex_api-0.0.110.dist-info}/RECORD +197 -17
  197. {coinex_api-0.0.89.dist-info → coinex_api-0.0.110.dist-info}/WHEEL +1 -1
coinex/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.5.5'
29
+ __version__ = '4.5.25'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.5.5'
11
+ __version__ = '4.5.25'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.5.5'
5
+ __version__ = '4.5.25'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -25,7 +25,7 @@ from ccxt.async_support.base.throttler import Throttler
25
25
  # -----------------------------------------------------------------------------
26
26
 
27
27
  from ccxt.base.errors import BaseError, BadSymbol, BadRequest, BadResponse, ExchangeError, ExchangeNotAvailable, RequestTimeout, NotSupported, NullResponse, InvalidAddress, RateLimitExceeded, OperationFailed
28
- from ccxt.base.types import ConstructorArgs, OrderType, OrderSide, OrderRequest, CancellationRequest
28
+ from ccxt.base.types import ConstructorArgs, OrderType, OrderSide, OrderRequest, CancellationRequest, Order
29
29
 
30
30
  # -----------------------------------------------------------------------------
31
31
 
@@ -42,9 +42,9 @@ from ccxt.async_support.base.ws.order_book import OrderBook, IndexedOrderBook, C
42
42
  # -----------------------------------------------------------------------------
43
43
 
44
44
  try:
45
- from aiohttp_socks import ProxyConnector
45
+ from aiohttp_socks import ProxyConnector as SocksProxyConnector
46
46
  except ImportError:
47
- ProxyConnector = None
47
+ SocksProxyConnector = None
48
48
 
49
49
  # -----------------------------------------------------------------------------
50
50
 
@@ -177,7 +177,7 @@ class Exchange(BaseExchange):
177
177
  elif httpsProxy:
178
178
  final_proxy = httpsProxy
179
179
  elif socksProxy:
180
- if ProxyConnector is None:
180
+ if SocksProxyConnector is None:
181
181
  raise NotSupported(self.id + ' - to use SOCKS proxy with ccxt, you need "aiohttp_socks" module that can be installed by "pip install aiohttp_socks"')
182
182
  # override session
183
183
  if (self.socks_proxy_sessions is None):
@@ -274,12 +274,15 @@ class Exchange(BaseExchange):
274
274
  if (self.socks_proxy_sessions is None):
275
275
  self.socks_proxy_sessions = {}
276
276
  if (socksProxy not in self.socks_proxy_sessions):
277
- self.aiohttp_socks_connector = ProxyConnector.from_url(
278
- socksProxy,
277
+ reverse_dns = socksProxy.startswith('socks5h://')
278
+ socks_proxy_selected = socksProxy if not reverse_dns else socksProxy.replace('socks5h://', 'socks5://')
279
+ self.aiohttp_socks_connector = SocksProxyConnector.from_url(
280
+ socks_proxy_selected,
279
281
  # extra args copied from self.open()
280
282
  ssl=self.ssl_context,
281
283
  loop=self.asyncio_loop,
282
- enable_cleanup_closed=True
284
+ enable_cleanup_closed=True,
285
+ rdns=reverse_dns if reverse_dns else None
283
286
  )
284
287
  self.socks_proxy_sessions[socksProxy] = aiohttp.ClientSession(loop=self.asyncio_loop, connector=self.aiohttp_socks_connector, trust_env=self.aiohttp_trust_env)
285
288
  return self.socks_proxy_sessions[socksProxy]
@@ -608,6 +611,9 @@ class Exchange(BaseExchange):
608
611
  # }
609
612
  return dict_msg
610
613
 
614
+ async def load_dydx_protos(self):
615
+ return
616
+
611
617
  # ########################################################################
612
618
  # ########################################################################
613
619
  # ########################################################################
@@ -711,6 +717,12 @@ class Exchange(BaseExchange):
711
717
  async def un_watch_ticker(self, symbol: str, params={}):
712
718
  raise NotSupported(self.id + ' unWatchTicker() is not supported yet')
713
719
 
720
+ async def un_watch_mark_price(self, symbol: str, params={}):
721
+ raise NotSupported(self.id + ' unWatchMarkPrice() is not supported yet')
722
+
723
+ async def un_watch_mark_prices(self, symbols: Strings = None, params={}):
724
+ raise NotSupported(self.id + ' unWatchMarkPrices() is not supported yet')
725
+
714
726
  async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
715
727
  raise NotSupported(self.id + ' fetchDepositAddresses() is not supported yet')
716
728
 
@@ -968,7 +980,8 @@ class Exchange(BaseExchange):
968
980
  if isinstance(e, OperationFailed):
969
981
  if i < retries:
970
982
  if self.verbose:
971
- self.log('Request failed with the error: ' + str(e) + ', retrying ' + (i + str(1)) + ' of ' + str(retries) + '...')
983
+ index = i + 1
984
+ self.log('Request failed with the error: ' + str(e) + ', retrying ' + str(index) + ' of ' + str(retries) + '...')
972
985
  if (retryDelay is not None) and (retryDelay != 0):
973
986
  await self.sleep(retryDelay)
974
987
  else:
@@ -1004,6 +1017,9 @@ class Exchange(BaseExchange):
1004
1017
  await self.cancel_order(id, symbol)
1005
1018
  return await self.create_order(symbol, type, side, amount, price, params)
1006
1019
 
1020
+ async def edit_order_with_client_order_id(self, clientOrderId: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1021
+ return await self.edit_order('', symbol, type, side, amount, price, self.extend({'clientOrderId': clientOrderId}, params))
1022
+
1007
1023
  async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1008
1024
  await self.cancel_order_ws(id, symbol)
1009
1025
  return await self.create_order_ws(symbol, type, side, amount, price, params)
@@ -1193,6 +1209,17 @@ class Exchange(BaseExchange):
1193
1209
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
1194
1210
  raise NotSupported(self.id + ' fetchOrder() is not supported yet')
1195
1211
 
1212
+ async def fetch_order_with_client_order_id(self, clientOrderId: str, symbol: Str = None, params={}):
1213
+ """
1214
+ create a market order by providing the symbol, side and cost
1215
+ :param str clientOrderId: client order Id
1216
+ :param str symbol: unified symbol of the market to create an order in
1217
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1218
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1219
+ """
1220
+ extendedParams = self.extend(params, {'clientOrderId': clientOrderId})
1221
+ return await self.fetch_order('', symbol, extendedParams)
1222
+
1196
1223
  async def fetch_order_ws(self, id: str, symbol: Str = None, params={}):
1197
1224
  raise NotSupported(self.id + ' fetchOrderWs() is not supported yet')
1198
1225
 
@@ -1536,9 +1563,34 @@ class Exchange(BaseExchange):
1536
1563
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
1537
1564
  raise NotSupported(self.id + ' cancelOrder() is not supported yet')
1538
1565
 
1566
+ async def cancel_order_with_client_order_id(self, clientOrderId: str, symbol: Str = None, params={}):
1567
+ """
1568
+ create a market order by providing the symbol, side and cost
1569
+ :param str clientOrderId: client order Id
1570
+ :param str symbol: unified symbol of the market to create an order in
1571
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1572
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1573
+ """
1574
+ extendedParams = self.extend(params, {'clientOrderId': clientOrderId})
1575
+ return await self.cancel_order('', symbol, extendedParams)
1576
+
1539
1577
  async def cancel_order_ws(self, id: str, symbol: Str = None, params={}):
1540
1578
  raise NotSupported(self.id + ' cancelOrderWs() is not supported yet')
1541
1579
 
1580
+ async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
1581
+ raise NotSupported(self.id + ' cancelOrders() is not supported yet')
1582
+
1583
+ async def cancel_orders_with_client_order_ids(self, clientOrderIds: List[str], symbol: Str = None, params={}):
1584
+ """
1585
+ create a market order by providing the symbol, side and cost
1586
+ :param str[] clientOrderIds: client order Ids
1587
+ :param str symbol: unified symbol of the market to create an order in
1588
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1589
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1590
+ """
1591
+ extendedParams = self.extend(params, {'clientOrderIds': clientOrderIds})
1592
+ return await self.cancel_orders([], symbol, extendedParams)
1593
+
1542
1594
  async def cancel_orders_ws(self, ids: List[str], symbol: Str = None, params={}):
1543
1595
  raise NotSupported(self.id + ' cancelOrdersWs() is not supported yet')
1544
1596
 
@@ -1554,7 +1606,7 @@ class Exchange(BaseExchange):
1554
1606
  async def cancel_all_orders_ws(self, symbol: Str = None, params={}):
1555
1607
  raise NotSupported(self.id + ' cancelAllOrdersWs() is not supported yet')
1556
1608
 
1557
- async def cancel_unified_order(self, order, params={}):
1609
+ async def cancel_unified_order(self, order: Order, params={}):
1558
1610
  return self.cancel_order(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
1559
1611
 
1560
1612
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -2181,3 +2233,80 @@ class Exchange(BaseExchange):
2181
2233
  :returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
2182
2234
  """
2183
2235
  raise NotSupported(self.id + ' fetchTransfers() is not supported yet')
2236
+
2237
+ async def un_watch_ohlcv(self, symbol: str, timeframe: str = '1m', params={}):
2238
+ """
2239
+ watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
2240
+ :param str symbol: unified symbol of the market to fetch OHLCV data for
2241
+ :param str timeframe: the length of time each candle represents
2242
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2243
+ :returns int[][]: A list of candles ordered, open, high, low, close, volume
2244
+ """
2245
+ raise NotSupported(self.id + ' unWatchOHLCV() is not supported yet')
2246
+
2247
+ async def watch_mark_price(self, symbol: str, params={}):
2248
+ """
2249
+ watches a mark price for a specific market
2250
+ :param str symbol: unified symbol of the market to fetch the ticker for
2251
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2252
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
2253
+ """
2254
+ raise NotSupported(self.id + ' watchMarkPrice() is not supported yet')
2255
+
2256
+ async def watch_mark_prices(self, symbols: Strings = None, params={}):
2257
+ """
2258
+ watches the mark price for all markets
2259
+ :param str[] symbols: unified symbol of the market to fetch the ticker for
2260
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2261
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
2262
+ """
2263
+ raise NotSupported(self.id + ' watchMarkPrices() is not supported yet')
2264
+
2265
+ async def withdraw_ws(self, code: str, amount: float, address: str, tag: Str = None, params={}):
2266
+ """
2267
+ make a withdrawal
2268
+ :param str code: unified currency code
2269
+ :param float amount: the amount to withdraw
2270
+ :param str address: the address to withdraw to
2271
+ :param str tag:
2272
+ :param dict [params]: extra parameters specific to the bitvavo api endpoint
2273
+ :returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
2274
+ """
2275
+ raise NotSupported(self.id + ' withdrawWs() is not supported yet')
2276
+
2277
+ async def un_watch_my_trades(self, symbol: Str = None, params={}):
2278
+ """
2279
+ unWatches information on multiple trades made by the user
2280
+ :param str symbol: unified market symbol of the market orders were made in
2281
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2282
+ :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2283
+ """
2284
+ raise NotSupported(self.id + ' unWatchMyTrades() is not supported yet')
2285
+
2286
+ async def create_orders_ws(self, orders: List[OrderRequest], params={}):
2287
+ """
2288
+ create a list of trade orders
2289
+ :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
2290
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2291
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2292
+ """
2293
+ raise NotSupported(self.id + ' createOrdersWs() is not supported yet')
2294
+
2295
+ async def fetch_orders_by_status_ws(self, status: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2296
+ """
2297
+ watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
2298
+ :param str symbol: unified symbol of the market to fetch the order book for
2299
+ :param int [limit]: the maximum amount of order book entries to return
2300
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2301
+ :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
2302
+ """
2303
+ raise NotSupported(self.id + ' fetchOrdersByStatusWs() is not supported yet')
2304
+
2305
+ async def un_watch_bids_asks(self, symbols: Strings = None, params={}):
2306
+ """
2307
+ unWatches best bid & ask for symbols
2308
+ :param str[] symbols: unified symbol of the market to fetch the ticker for
2309
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2310
+ :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
2311
+ """
2312
+ raise NotSupported(self.id + ' unWatchBidsAsks() is not supported yet')
@@ -42,7 +42,7 @@ class Throttler:
42
42
  def __call__(self, cost=None):
43
43
  future = asyncio.Future()
44
44
  if len(self.queue) > self.config['maxCapacity']:
45
- raise RuntimeError('throttle queue is over maxCapacity (' + str(int(self.config['maxCapacity'])) + '), see https://github.com/ccxt/ccxt/issues/11645#issuecomment-1195695526')
45
+ raise RuntimeError('throttle queue is over maxCapacity (' + str(int(self.config['maxCapacity'])) + '), see https://docs.ccxt.com/#/README?id=maximum-requests-capacity')
46
46
  self.queue.append((future, cost))
47
47
  if not self.running:
48
48
  self.running = True
@@ -62,6 +62,7 @@ class BaseCache(list):
62
62
  class ArrayCache(BaseCache):
63
63
  def __init__(self, max_size=None):
64
64
  super(ArrayCache, self).__init__(max_size)
65
+ self.hashmap = {}
65
66
  self._nested_new_updates_by_symbol = False
66
67
  self._new_updates_by_symbol = {}
67
68
  self._clear_updates_by_symbol = {}
@@ -72,6 +72,7 @@ class Client(object):
72
72
  else:
73
73
  setattr(self, key, settings[key])
74
74
  # connection-related Future
75
+ self.options = config
75
76
  self.connected = Future()
76
77
 
77
78
  def future(self, message_hash):
@@ -83,6 +84,12 @@ class Client(object):
83
84
  del self.rejections[message_hash]
84
85
  return future
85
86
 
87
+ def reusable_future(self, message_hash):
88
+ return self.future(message_hash) # only used in go
89
+
90
+ def reusableFuture(self, message_hash):
91
+ return self.future(message_hash) # only used in go
92
+
86
93
  def resolve(self, result, message_hash):
87
94
  if self.verbose and message_hash is None:
88
95
  self.log(iso8601(milliseconds()), 'resolve received None messageHash')
@@ -111,7 +118,7 @@ class Client(object):
111
118
  self.log(iso8601(milliseconds()), 'receive loop')
112
119
  if not self.closed():
113
120
  # let's drain the aiohttp buffer to avoid latency
114
- if len(self.buffer) > 1:
121
+ if self.buffer and len(self.buffer) > 1:
115
122
  size_delta = 0
116
123
  while len(self.buffer) > 1:
117
124
  message, size = self.buffer.popleft()
@@ -180,6 +187,16 @@ class Client(object):
180
187
  # looks like they exposed it in C
181
188
  # this means we can bypass it
182
189
  # https://github.com/aio-libs/aiohttp/blob/master/aiohttp/_websocket/reader_c.pxd#L53C24-L53C31
190
+ # these checks are necessary to protect these errors: AttributeError: 'NoneType' object has no attribute '_buffer'
191
+ # upon getting an error message
192
+ if self.connection is None:
193
+ return None
194
+ if self.connection._conn is None:
195
+ return None
196
+ if self.connection._conn.protocol is None:
197
+ return None
198
+ if self.connection._conn.protocol._payload is None:
199
+ return None
183
200
  return self.connection._conn.protocol._payload._buffer
184
201
 
185
202
  def connect(self, session, backoff_delay=0):
@@ -218,9 +235,8 @@ class Client(object):
218
235
  def handle_text_or_binary_message(self, data):
219
236
  if self.verbose:
220
237
  self.log(iso8601(milliseconds()), 'message', data)
221
- if isinstance(data, bytes):
222
- if self.decompressBinary:
223
- data = data.decode()
238
+ if self.decompressBinary and isinstance(data, bytes):
239
+ data = data.decode()
224
240
  # decoded = json.loads(data) if is_json_encoded_object(data) else data
225
241
  decode = None
226
242
  if is_json_encoded_object(data):
@@ -273,6 +289,10 @@ class Client(object):
273
289
  # otherwise aiohttp's websockets client won't trigger WSMsgType.PONG
274
290
  # call aenter here to simulate async with otherwise we get the error "await not called with future"
275
291
  # if connecting to a non-existent endpoint
292
+ # set cookies if defined
293
+ if 'cookies' in self.options:
294
+ for key, value in self.options['cookies'].items():
295
+ session.cookie_jar.update_cookies({key: value})
276
296
  if (self.proxy):
277
297
  return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), proxy=self.proxy, max_msg_size=10485760).__aenter__()
278
298
  return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), max_msg_size=10485760).__aenter__()
@@ -288,6 +308,8 @@ class Client(object):
288
308
  send_msg = json.dumps(message, separators=(',', ':'))
289
309
  else:
290
310
  send_msg = orjson.dumps(message).decode('utf-8')
311
+ if self.closed():
312
+ raise ConnectionError('Cannot Send Message: Connection closed before send')
291
313
  return await self.connection.send_str(send_msg)
292
314
 
293
315
  async def close(self, code=1000):
@@ -1601,7 +1601,7 @@ class coinex(Exchange, ImplicitAPI):
1601
1601
  self.safe_number(ohlcv, 'value'),
1602
1602
  ]
1603
1603
 
1604
- async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
1604
+ async def fetch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
1605
1605
  """
1606
1606
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1607
1607
 
@@ -2617,7 +2617,7 @@ class coinex(Exchange, ImplicitAPI):
2617
2617
  results.append(order)
2618
2618
  return results
2619
2619
 
2620
- async def cancel_orders(self, ids, symbol: Str = None, params={}):
2620
+ async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
2621
2621
  """
2622
2622
  cancel multiple orders
2623
2623