bitmex-api 0.0.63__py3-none-any.whl → 0.0.65__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.
bitmex/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.85'
29
+ __version__ = '4.4.86'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -88,9 +88,8 @@ from ccxt.base.errors import UnsubscribeError # noqa: F4
88
88
  from ccxt.base.errors import error_hierarchy # noqa: F401
89
89
 
90
90
  from ccxt.bitmex import bitmex # noqa: F401
91
- from ccxt.kuna import kuna # noqa: F401
92
91
 
93
- exchanges = [ 'bitmex', 'kuna',]
92
+ exchanges = [ 'bitmex',]
94
93
 
95
94
  base = [
96
95
  'Exchange',
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.85'
11
+ __version__ = '4.4.86'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -68,9 +68,8 @@ from ccxt.base.errors import error_hierarchy # noqa: F4
68
68
 
69
69
 
70
70
  from ccxt.async_support.bitmex import bitmex # noqa: F401
71
- from ccxt.async_support.kuna import kuna # noqa: F401
72
71
 
73
- exchanges = [ 'bitmex', 'kuna',]
72
+ exchanges = [ 'bitmex',]
74
73
 
75
74
  base = [
76
75
  'Exchange',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.85'
5
+ __version__ = '4.4.86'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -176,15 +176,7 @@ class Exchange(BaseExchange):
176
176
  if (socksProxy not in self.socks_proxy_sessions):
177
177
  # Create our SSL context object with our CA cert file
178
178
  self.open() # ensure `asyncio_loop` is set
179
- self.aiohttp_socks_connector = ProxyConnector.from_url(
180
- socksProxy,
181
- # extra args copied from self.open()
182
- ssl=self.ssl_context,
183
- loop=self.asyncio_loop,
184
- enable_cleanup_closed=True
185
- )
186
- self.socks_proxy_sessions[socksProxy] = aiohttp.ClientSession(loop=self.asyncio_loop, connector=self.aiohttp_socks_connector, trust_env=self.aiohttp_trust_env)
187
- proxy_session = self.socks_proxy_sessions[socksProxy]
179
+ proxy_session = self.get_socks_proxy_session(socksProxy)
188
180
  # add aiohttp_proxy for python as exclusion
189
181
  elif self.aiohttp_proxy:
190
182
  final_proxy = self.aiohttp_proxy
@@ -267,6 +259,20 @@ class Exchange(BaseExchange):
267
259
  return http_response
268
260
  return response.content
269
261
 
262
+ def get_socks_proxy_session(self, socksProxy):
263
+ if (self.socks_proxy_sessions is None):
264
+ self.socks_proxy_sessions = {}
265
+ if (socksProxy not in self.socks_proxy_sessions):
266
+ self.aiohttp_socks_connector = ProxyConnector.from_url(
267
+ socksProxy,
268
+ # extra args copied from self.open()
269
+ ssl=self.ssl_context,
270
+ loop=self.asyncio_loop,
271
+ enable_cleanup_closed=True
272
+ )
273
+ self.socks_proxy_sessions[socksProxy] = aiohttp.ClientSession(loop=self.asyncio_loop, connector=self.aiohttp_socks_connector, trust_env=self.aiohttp_trust_env)
274
+ return self.socks_proxy_sessions[socksProxy]
275
+
270
276
  async def load_markets_helper(self, reload=False, params={}):
271
277
  if not reload:
272
278
  if self.markets:
@@ -411,19 +417,12 @@ class Exchange(BaseExchange):
411
417
  # we use aiohttp instead of fastClient now because of this
412
418
  # https://github.com/ccxt/ccxt/pull/25995
413
419
  self.clients[url] = AiohttpClient(url, on_message, on_error, on_close, on_connected, options)
414
- self.clients[url].proxy = self.get_ws_proxy()
420
+ # set http/s proxy (socks proxy should be set in other place)
421
+ httpProxy, httpsProxy, socksProxy = self.check_ws_proxy_settings()
422
+ if (httpProxy or httpsProxy):
423
+ self.clients[url].proxy = httpProxy if httpProxy else httpsProxy
415
424
  return self.clients[url]
416
425
 
417
- def get_ws_proxy(self):
418
- httpProxy, httpsProxy, socksProxy = self.check_ws_proxy_settings()
419
- if httpProxy:
420
- return httpProxy
421
- elif httpsProxy:
422
- return httpsProxy
423
- elif socksProxy:
424
- return socksProxy
425
- return None
426
-
427
426
  def delay(self, timeout, method, *args):
428
427
  return self.asyncio_loop.call_later(timeout / 1000, self.spawn, method, *args)
429
428
 
@@ -486,8 +485,13 @@ class Exchange(BaseExchange):
486
485
  if not subscribed:
487
486
  client.subscriptions[subscribe_hash] = subscription or True
488
487
 
488
+ selected_session = self.session
489
+ # http/s proxy is being set in other places
490
+ httpProxy, httpsProxy, socksProxy = self.check_ws_proxy_settings()
491
+ if (socksProxy):
492
+ selected_session = self.get_socks_proxy_session(socksProxy)
489
493
  connected = client.connected if client.connected.done() \
490
- else asyncio.ensure_future(client.connect(self.session, backoff_delay))
494
+ else asyncio.ensure_future(client.connect(selected_session, backoff_delay))
491
495
 
492
496
  def after(fut):
493
497
  # todo: decouple signing from subscriptions
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.85'
7
+ __version__ = '4.4.86'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.85'
11
+ __version__ = '4.4.86'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -79,6 +79,66 @@ from ccxt.base.errors import error_hierarchy # noqa: F4
79
79
 
80
80
 
81
81
 
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
82
142
 
83
143
 
84
144
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitmex-api
3
- Version: 0.0.63
3
+ Version: 0.0.65
4
4
  Summary: bitmex crypto exchange api client
5
5
  Project-URL: Homepage, https://github.com/ccxt/ccxt
6
6
  Project-URL: Issues, https://github.com/ccxt/ccxt
@@ -1,11 +1,11 @@
1
1
  bitmex/__init__.py,sha256=YoXAuxG_VioYinNV_H2dBOxO7R1bhKl6aL_6s6TfuWg,246
2
- bitmex/ccxt/__init__.py,sha256=HSVkQ6UwBT_D2MC-8qBPPboVum1v7IsatFsPvsae1kM,6142
2
+ bitmex/ccxt/__init__.py,sha256=Uf1RqwekjAivE622ZzaTXPiXgu80N55CBh5RqxLSMXE,6048
3
3
  bitmex/ccxt/bitmex.py,sha256=U7MzNIUW_YBtBH2pMXOXPZ9oo25j2n_-iAwDWSDpd58,131801
4
4
  bitmex/ccxt/abstract/bitmex.py,sha256=v15OP-vSO_eotD6KVf1BgKrbPxCPl2eXXYIuzWF1dl4,10774
5
- bitmex/ccxt/async_support/__init__.py,sha256=IFOfl_NmTMFCAn9frG-9h0cUlOiGHo8sHBPwfHHGa6o,4885
5
+ bitmex/ccxt/async_support/__init__.py,sha256=KFCgOyGOf1_X-ywoh6C3MKzd17PhDxdpaSyeZaPSDYU,4781
6
6
  bitmex/ccxt/async_support/bitmex.py,sha256=ySXncjhPs47qdGGkNgjZppMIfHf4UmqKOungNwz-EQk,132379
7
7
  bitmex/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- bitmex/ccxt/async_support/base/exchange.py,sha256=ez6SSEp3QG4HwJ3H4qAFmC4mHA9IVz_gEaReL_Z3kzM,118577
8
+ bitmex/ccxt/async_support/base/exchange.py,sha256=v6BUnxiy1aNvGfPIY_Uoc8bO81Hc2KixZhFYLUZtdgc,119007
9
9
  bitmex/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  bitmex/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  bitmex/ccxt/async_support/base/ws/aiohttp_client.py,sha256=Y5HxAVXyyYduj6b6SbbUZETlq3GrVMzrkW1r-TMgpb8,6329
@@ -18,10 +18,10 @@ bitmex/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9pr
18
18
  bitmex/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
19
19
  bitmex/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
20
20
  bitmex/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
21
- bitmex/ccxt/base/exchange.py,sha256=w3T16lJ5Ii89lYzC5xpr_tZqilvTWgcF6D9WKfRfzzI,328021
21
+ bitmex/ccxt/base/exchange.py,sha256=0eWsLPmC7XqT192_2CilEsKFbcNtDqQktuknty6v8zE,328021
22
22
  bitmex/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
23
23
  bitmex/ccxt/base/types.py,sha256=IbLO7Ni-plO36xlOdJQFqujSJBq0q9qll009ShZ0M_U,11468
24
- bitmex/ccxt/pro/__init__.py,sha256=9t4qr8MBr3vb_FX863YQ4KL9TOAen1Nvv8rtF26OOQs,4123
24
+ bitmex/ccxt/pro/__init__.py,sha256=sotLAgyv1R_ECQ3JYrXeZkCPL3xSATI9RSJ2EZCbefA,4183
25
25
  bitmex/ccxt/pro/bitmex.py,sha256=5gpicgex_am9Km9ZsZpMKBSKX-SFFAD3PPuv9r-nNdA,74693
26
26
  bitmex/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
27
27
  bitmex/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -282,6 +282,6 @@ bitmex/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
282
282
  bitmex/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
283
283
  bitmex/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
284
284
  bitmex/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
285
- bitmex_api-0.0.63.dist-info/METADATA,sha256=X98TwAeQzxdcLyFyuK0nKkkh2IX-OdrCYb90WCpowPI,10822
286
- bitmex_api-0.0.63.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
287
- bitmex_api-0.0.63.dist-info/RECORD,,
285
+ bitmex_api-0.0.65.dist-info/METADATA,sha256=T4fwUuvY7NSWedMJKLopQJyf3KdEScs7eIJbwegOpV0,10822
286
+ bitmex_api-0.0.65.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
287
+ bitmex_api-0.0.65.dist-info/RECORD,,