ccxt 4.3.29__py2.py3-none-any.whl → 4.3.30__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.
- ccxt/__init__.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/aiohttp_client.py +1 -0
- ccxt/async_support/base/ws/future.py +27 -29
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/coinex.py +254 -307
- ccxt/async_support/whitebit.py +43 -3
- ccxt/base/exchange.py +5 -1
- ccxt/bingx.py +1 -1
- ccxt/coinex.py +254 -307
- ccxt/pro/__init__.py +1 -1
- ccxt/whitebit.py +43 -3
- {ccxt-4.3.29.dist-info → ccxt-4.3.30.dist-info}/METADATA +4 -4
- {ccxt-4.3.29.dist-info → ccxt-4.3.30.dist-info}/RECORD +17 -17
- {ccxt-4.3.29.dist-info → ccxt-4.3.30.dist-info}/WHEEL +0 -0
- {ccxt-4.3.29.dist-info → ccxt-4.3.30.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/async_support/__init__.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import asyncio
|
2
2
|
from ccxt import ExchangeClosedByUser
|
3
3
|
|
4
|
-
|
5
4
|
class Future(asyncio.Future):
|
6
5
|
|
7
6
|
is_race_future = False
|
@@ -23,38 +22,37 @@ class Future(asyncio.Future):
|
|
23
22
|
task = asyncio.create_task(coro)
|
24
23
|
|
25
24
|
def callback(done):
|
26
|
-
|
27
|
-
|
28
|
-
complete, _ = done.result()
|
25
|
+
try:
|
26
|
+
complete, pending = done.result()
|
29
27
|
# check for exceptions
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
else:
|
43
|
-
futures_list = list(complete)
|
44
|
-
are_all_canceled = all(f._state == 'CANCELLED' for f in futures_list)
|
45
|
-
if are_all_canceled and future._state == 'PENDING':
|
46
|
-
future.set_exception(ExchangeClosedByUser('Connection closed by the user'))
|
28
|
+
for i, f in enumerate(complete):
|
29
|
+
try:
|
30
|
+
f.result()
|
31
|
+
except ExchangeClosedByUser as e:
|
32
|
+
if len(pending) == 0 and i == len(complete) - 1:
|
33
|
+
future.reject(e)
|
34
|
+
# wait for all the sub promises to be reject before rejecting future
|
35
|
+
continue
|
36
|
+
except asyncio.CancelledError as e:
|
37
|
+
continue
|
38
|
+
except Exception as e:
|
39
|
+
future.reject(e)
|
47
40
|
return
|
41
|
+
# no exceptions return first result
|
42
|
+
futures_list = list(complete)
|
48
43
|
|
49
|
-
|
50
|
-
|
51
|
-
|
44
|
+
are_all_canceled = all([f.cancelled() for f in futures_list])
|
45
|
+
if are_all_canceled:
|
46
|
+
future.reject(ExchangeClosedByUser('Connection closed by the user'))
|
47
|
+
return
|
52
48
|
|
53
|
-
|
49
|
+
first = futures_list[0]
|
54
50
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
future.
|
51
|
+
first_result = first.result()
|
52
|
+
future.resolve(first_result)
|
53
|
+
except asyncio.CancelledError as e:
|
54
|
+
future.reject(e)
|
55
|
+
except Exception as e:
|
56
|
+
future.reject(e)
|
59
57
|
task.add_done_callback(callback)
|
60
58
|
return future
|
ccxt/async_support/bingx.py
CHANGED
@@ -2390,7 +2390,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2390
2390
|
'stopLossPrice': stopLossPrice,
|
2391
2391
|
'takeProfitPrice': takeProfitPrice,
|
2392
2392
|
'average': self.safe_string_2(order, 'avgPrice', 'ap'),
|
2393
|
-
'cost':
|
2393
|
+
'cost': self.safe_string(order, 'cummulativeQuoteQty'),
|
2394
2394
|
'amount': self.safe_string_n(order, ['origQty', 'q', 'quantity']),
|
2395
2395
|
'filled': self.safe_string_2(order, 'executedQty', 'z'),
|
2396
2396
|
'remaining': None,
|