ccxt 4.4.97__py2.py3-none-any.whl → 4.4.99__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.
- ccxt/__init__.py +4 -1
- ccxt/abstract/bitget.py +6 -0
- ccxt/abstract/hibachi.py +26 -0
- ccxt/async_support/__init__.py +4 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +7 -6
- ccxt/async_support/bitget.py +2032 -559
- ccxt/async_support/bybit.py +5 -1
- ccxt/async_support/coinex.py +64 -3
- ccxt/async_support/coinmetro.py +2 -3
- ccxt/async_support/cryptocom.py +2 -1
- ccxt/async_support/gate.py +1 -2
- ccxt/async_support/hibachi.py +2080 -0
- ccxt/async_support/ndax.py +8 -0
- ccxt/async_support/novadax.py +34 -0
- ccxt/async_support/okx.py +2 -0
- ccxt/base/decimal_to_precision.py +7 -9
- ccxt/base/errors.py +6 -6
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +7 -6
- ccxt/bitget.py +2032 -559
- ccxt/bybit.py +5 -1
- ccxt/coinex.py +64 -3
- ccxt/coinmetro.py +2 -3
- ccxt/cryptocom.py +2 -1
- ccxt/gate.py +1 -2
- ccxt/hibachi.py +2079 -0
- ccxt/ndax.py +8 -0
- ccxt/novadax.py +34 -0
- ccxt/okx.py +2 -0
- ccxt/pro/__init__.py +2 -1
- ccxt/pro/alpaca.py +2 -2
- ccxt/pro/apex.py +2 -2
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/binance.py +2 -4
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bithumb.py +2 -2
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +3 -3
- ccxt/pro/bitstamp.py +3 -3
- ccxt/pro/bittrade.py +2 -2
- ccxt/pro/bitvavo.py +4 -2
- ccxt/pro/bybit.py +4 -4
- ccxt/pro/cex.py +3 -2
- ccxt/pro/coinbaseexchange.py +4 -4
- ccxt/pro/coinbaseinternational.py +2 -2
- ccxt/pro/coincatch.py +1 -1
- ccxt/pro/coinone.py +2 -2
- ccxt/pro/cryptocom.py +2 -2
- ccxt/pro/derive.py +2 -2
- ccxt/pro/gate.py +3 -3
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +3 -3
- ccxt/pro/hyperliquid.py +2 -2
- ccxt/pro/kraken.py +2 -2
- ccxt/pro/krakenfutures.py +4 -3
- ccxt/pro/kucoin.py +3 -2
- ccxt/pro/kucoinfutures.py +3 -2
- ccxt/pro/modetrade.py +2 -2
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +5 -5
- ccxt/pro/onetrading.py +2 -2
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/paradex.py +2 -2
- ccxt/pro/poloniex.py +2 -2
- ccxt/pro/probit.py +2 -2
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/whitebit.py +2 -2
- ccxt/pro/woo.py +2 -2
- ccxt/pro/woofipro.py +2 -2
- ccxt/test/tests_async.py +1 -1
- ccxt/test/tests_sync.py +1 -1
- {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/METADATA +7 -6
- {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/RECORD +77 -74
- {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/WHEEL +0 -0
- {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/top_level.txt +0 -0
ccxt/ndax.py
CHANGED
@@ -35,6 +35,9 @@ class ndax(Exchange, ImplicitAPI):
|
|
35
35
|
'future': False,
|
36
36
|
'option': False,
|
37
37
|
'addMargin': False,
|
38
|
+
'borrowCrossMargin': False,
|
39
|
+
'borrowIsolatedMargin': False,
|
40
|
+
'borrowMargin': False,
|
38
41
|
'cancelAllOrders': True,
|
39
42
|
'cancelOrder': True,
|
40
43
|
'closeAllPositions': False,
|
@@ -47,6 +50,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
47
50
|
'createStopOrder': True,
|
48
51
|
'editOrder': True,
|
49
52
|
'fetchAccounts': True,
|
53
|
+
'fetchAllGreeks': False,
|
50
54
|
'fetchBalance': True,
|
51
55
|
'fetchBorrowInterest': False,
|
52
56
|
'fetchBorrowRate': False,
|
@@ -77,12 +81,15 @@ class ndax(Exchange, ImplicitAPI):
|
|
77
81
|
'fetchLeverages': False,
|
78
82
|
'fetchLeverageTiers': False,
|
79
83
|
'fetchLiquidations': False,
|
84
|
+
'fetchLongShortRatio': False,
|
85
|
+
'fetchLongShortRatioHistory': False,
|
80
86
|
'fetchMarginAdjustmentHistory': False,
|
81
87
|
'fetchMarginMode': False,
|
82
88
|
'fetchMarginModes': False,
|
83
89
|
'fetchMarketLeverageTiers': False,
|
84
90
|
'fetchMarkets': True,
|
85
91
|
'fetchMarkOHLCV': False,
|
92
|
+
'fetchMarkPrice': False,
|
86
93
|
'fetchMarkPrices': False,
|
87
94
|
'fetchMyLiquidations': False,
|
88
95
|
'fetchMySettlementHistory': False,
|
@@ -90,6 +97,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
90
97
|
'fetchOHLCV': True,
|
91
98
|
'fetchOpenInterest': False,
|
92
99
|
'fetchOpenInterestHistory': False,
|
100
|
+
'fetchOpenInterests': False,
|
93
101
|
'fetchOpenOrders': True,
|
94
102
|
'fetchOption': False,
|
95
103
|
'fetchOptionChain': False,
|
ccxt/novadax.py
CHANGED
@@ -46,6 +46,9 @@ class novadax(Exchange, ImplicitAPI):
|
|
46
46
|
'future': False,
|
47
47
|
'option': False,
|
48
48
|
'addMargin': False,
|
49
|
+
'borrowCrossMargin': False,
|
50
|
+
'borrowIsolatedMargin': False,
|
51
|
+
'borrowMargin': False,
|
49
52
|
'cancelOrder': True,
|
50
53
|
'closeAllPositions': False,
|
51
54
|
'closePosition': False,
|
@@ -58,9 +61,14 @@ class novadax(Exchange, ImplicitAPI):
|
|
58
61
|
'createStopMarketOrder': True,
|
59
62
|
'createStopOrder': True,
|
60
63
|
'fetchAccounts': True,
|
64
|
+
'fetchAllGreeks': False,
|
61
65
|
'fetchBalance': True,
|
66
|
+
'fetchBorrowInterest': False,
|
67
|
+
'fetchBorrowRate': False,
|
62
68
|
'fetchBorrowRateHistories': False,
|
63
69
|
'fetchBorrowRateHistory': False,
|
70
|
+
'fetchBorrowRates': False,
|
71
|
+
'fetchBorrowRatesPerSymbol': False,
|
64
72
|
'fetchClosedOrders': True,
|
65
73
|
'fetchCrossBorrowRate': False,
|
66
74
|
'fetchCrossBorrowRates': False,
|
@@ -70,20 +78,40 @@ class novadax(Exchange, ImplicitAPI):
|
|
70
78
|
'fetchDeposits': True,
|
71
79
|
'fetchDepositsWithdrawals': True,
|
72
80
|
'fetchFundingHistory': False,
|
81
|
+
'fetchFundingInterval': False,
|
82
|
+
'fetchFundingIntervals': False,
|
73
83
|
'fetchFundingRate': False,
|
74
84
|
'fetchFundingRateHistory': False,
|
75
85
|
'fetchFundingRates': False,
|
86
|
+
'fetchGreeks': False,
|
76
87
|
'fetchIndexOHLCV': False,
|
77
88
|
'fetchIsolatedBorrowRate': False,
|
78
89
|
'fetchIsolatedBorrowRates': False,
|
90
|
+
'fetchIsolatedPositions': False,
|
79
91
|
'fetchLeverage': False,
|
92
|
+
'fetchLeverages': False,
|
80
93
|
'fetchLeverageTiers': False,
|
94
|
+
'fetchLiquidations': False,
|
95
|
+
'fetchLongShortRatio': False,
|
96
|
+
'fetchLongShortRatioHistory': False,
|
97
|
+
'fetchMarginAdjustmentHistory': False,
|
98
|
+
'fetchMarginMode': False,
|
99
|
+
'fetchMarginModes': False,
|
100
|
+
'fetchMarketLeverageTiers': False,
|
81
101
|
'fetchMarkets': True,
|
82
102
|
'fetchMarkOHLCV': False,
|
103
|
+
'fetchMarkPrice': False,
|
104
|
+
'fetchMarkPrices': False,
|
105
|
+
'fetchMyLiquidations': False,
|
106
|
+
'fetchMySettlementHistory': False,
|
83
107
|
'fetchMyTrades': True,
|
84
108
|
'fetchOHLCV': True,
|
109
|
+
'fetchOpenInterest': False,
|
85
110
|
'fetchOpenInterestHistory': False,
|
111
|
+
'fetchOpenInterests': False,
|
86
112
|
'fetchOpenOrders': True,
|
113
|
+
'fetchOption': False,
|
114
|
+
'fetchOptionChain': False,
|
87
115
|
'fetchOrder': True,
|
88
116
|
'fetchOrderBook': True,
|
89
117
|
'fetchOrders': True,
|
@@ -96,6 +124,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
96
124
|
'fetchPositionsHistory': False,
|
97
125
|
'fetchPositionsRisk': False,
|
98
126
|
'fetchPremiumIndexOHLCV': False,
|
127
|
+
'fetchSettlementHistory': False,
|
99
128
|
'fetchTicker': True,
|
100
129
|
'fetchTickers': True,
|
101
130
|
'fetchTime': True,
|
@@ -103,9 +132,14 @@ class novadax(Exchange, ImplicitAPI):
|
|
103
132
|
'fetchTradingFee': False,
|
104
133
|
'fetchTradingFees': False,
|
105
134
|
'fetchTransactions': 'emulated',
|
135
|
+
'fetchUnderlyingAssets': False,
|
136
|
+
'fetchVolatilityHistory': False,
|
106
137
|
'fetchWithdrawals': True,
|
107
138
|
'reduceMargin': False,
|
139
|
+
'repayCrossMargin': False,
|
140
|
+
'repayIsolatedMargin': False,
|
108
141
|
'setLeverage': False,
|
142
|
+
'setMargin': False,
|
109
143
|
'setMarginMode': False,
|
110
144
|
'setPositionMode': False,
|
111
145
|
'transfer': True,
|
ccxt/okx.py
CHANGED
@@ -18,6 +18,7 @@ from ccxt.base.errors import BadRequest
|
|
18
18
|
from ccxt.base.errors import BadSymbol
|
19
19
|
from ccxt.base.errors import OperationRejected
|
20
20
|
from ccxt.base.errors import ManualInteractionNeeded
|
21
|
+
from ccxt.base.errors import RestrictedLocation
|
21
22
|
from ccxt.base.errors import InsufficientFunds
|
22
23
|
from ccxt.base.errors import InvalidAddress
|
23
24
|
from ccxt.base.errors import InvalidOrder
|
@@ -761,6 +762,7 @@ class okx(Exchange, ImplicitAPI):
|
|
761
762
|
'51137': InvalidOrder, # Your opening price has triggered the limit price, and the max buy price is {0}
|
762
763
|
'51138': InvalidOrder, # Your opening price has triggered the limit price, and the min sell price is {0}
|
763
764
|
'51139': InvalidOrder, # Reduce-only feature is unavailable for the spot transactions by simple account
|
765
|
+
'51155': RestrictedLocation, # {"code":"1","data":[{"clOrdId":"e847xxx","ordId":"","sCode":"51155","sMsg":"You can't trade self pair or borrow self crypto due to local compliance restrictions. ","tag":"e847xxx","ts":"1753979177157"}],"inTime":"1753979177157408","msg":"All operations failed","outTime":"1753979177157874"}
|
764
766
|
'51156': BadRequest, # You're leading trades in long/short mode and can't use self API endpoint to close positions
|
765
767
|
'51159': BadRequest, # You're leading trades in buy/sell mode. If you want to place orders using self API endpoint, the orders must be in the same direction existing positions and open orders.
|
766
768
|
'51162': InvalidOrder, # You have {instrument} open orders. Cancel these orders and try again
|
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.99'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -27,6 +27,7 @@ from ccxt.base.errors import NoChange # noqa: F4
|
|
27
27
|
from ccxt.base.errors import MarginModeAlreadySet # noqa: F401
|
28
28
|
from ccxt.base.errors import MarketClosed # noqa: F401
|
29
29
|
from ccxt.base.errors import ManualInteractionNeeded # noqa: F401
|
30
|
+
from ccxt.base.errors import RestrictedLocation # noqa: F401
|
30
31
|
from ccxt.base.errors import InsufficientFunds # noqa: F401
|
31
32
|
from ccxt.base.errors import InvalidAddress # noqa: F401
|
32
33
|
from ccxt.base.errors import AddressPending # noqa: F401
|
ccxt/pro/alpaca.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
|
8
|
-
from ccxt.base.types import Any, Int, Order, OrderBook, Str, Ticker, Trade
|
8
|
+
from ccxt.base.types import Any, Bool, Int, Order, OrderBook, Str, Ticker, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
@@ -579,7 +579,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
579
579
|
self.watch(url, messageHash, request, messageHash, future)
|
580
580
|
return await future
|
581
581
|
|
582
|
-
def handle_error_message(self, client: Client, message):
|
582
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
583
583
|
#
|
584
584
|
# {
|
585
585
|
# "T": "error",
|
ccxt/pro/apex.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById,
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Any, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
11
|
+
from ccxt.base.types import Any, Bool, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
12
12
|
from ccxt.async_support.base.ws.client import Client
|
13
13
|
from typing import List
|
14
14
|
from ccxt.base.errors import ExchangeError
|
@@ -805,7 +805,7 @@ class apex(ccxt.async_support.apex):
|
|
805
805
|
self.watch(url, messageHash, message, messageHash)
|
806
806
|
return await future
|
807
807
|
|
808
|
-
def handle_error_message(self, client: Client, message):
|
808
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
809
809
|
#
|
810
810
|
# {
|
811
811
|
# "success": False,
|
ccxt/pro/ascendex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Str, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Str, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -695,7 +695,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
695
695
|
'trades': None,
|
696
696
|
}, market)
|
697
697
|
|
698
|
-
def handle_error_message(self, client: Client, message):
|
698
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
699
699
|
#
|
700
700
|
# {
|
701
701
|
# "m": "disconnected",
|
ccxt/pro/binance.py
CHANGED
@@ -217,7 +217,7 @@ class binance(ccxt.async_support.binance):
|
|
217
217
|
"""
|
218
218
|
return await self.watch_liquidations_for_symbols([symbol], since, limit, params)
|
219
219
|
|
220
|
-
async def watch_liquidations_for_symbols(self, symbols: List[str]
|
220
|
+
async def watch_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
|
221
221
|
"""
|
222
222
|
watch the public liquidations of a trading pair
|
223
223
|
|
@@ -3729,7 +3729,7 @@ class binance(ccxt.async_support.binance):
|
|
3729
3729
|
trades = await self.watch(url, messageHash, message, messageHash, subscription)
|
3730
3730
|
return self.filter_by_symbol_since_limit(trades, symbol, since, limit)
|
3731
3731
|
|
3732
|
-
async def fetch_trades_ws(self, symbol:
|
3732
|
+
async def fetch_trades_ws(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
3733
3733
|
"""
|
3734
3734
|
fetch all trades made by the user
|
3735
3735
|
|
@@ -3745,8 +3745,6 @@ class binance(ccxt.async_support.binance):
|
|
3745
3745
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
3746
3746
|
"""
|
3747
3747
|
await self.load_markets()
|
3748
|
-
if symbol is None:
|
3749
|
-
raise BadRequest(self.id + ' fetchTradesWs() requires a symbol argument')
|
3750
3748
|
market = self.market(symbol)
|
3751
3749
|
type = self.get_market_type('fetchTradesWs', market, params)
|
3752
3750
|
if type != 'spot' and type != 'future':
|
ccxt/pro/bitget.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -1485,7 +1485,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1485
1485
|
type, params = self.handle_market_type_and_params('watchMyTrades', market, params)
|
1486
1486
|
instType = None
|
1487
1487
|
if market is None and type == 'spot':
|
1488
|
-
instType = '
|
1488
|
+
instType = 'spot'
|
1489
1489
|
else:
|
1490
1490
|
instType, params = self.get_inst_type(market, params)
|
1491
1491
|
subscriptionHash = 'fill:' + instType
|
@@ -1800,7 +1800,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1800
1800
|
future = self.safe_value(client.futures, messageHash)
|
1801
1801
|
future.resolve(True)
|
1802
1802
|
|
1803
|
-
def handle_error_message(self, client: Client, message):
|
1803
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1804
1804
|
#
|
1805
1805
|
# {event: "error", code: 30015, msg: "Invalid sign"}
|
1806
1806
|
#
|
ccxt/pro/bithumb.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache
|
8
|
-
from ccxt.base.types import Any, Int, OrderBook, Strings, Ticker, Tickers, Trade
|
8
|
+
from ccxt.base.types import Any, Bool, Int, OrderBook, Strings, Ticker, Tickers, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
@@ -348,7 +348,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
348
348
|
'fee': None,
|
349
349
|
}, market)
|
350
350
|
|
351
|
-
def handle_error_message(self, client: Client, message):
|
351
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
352
352
|
#
|
353
353
|
# {
|
354
354
|
# "status" : "5100",
|
ccxt/pro/bitmart.py
CHANGED
@@ -7,7 +7,7 @@ import ccxt.async_support
|
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
from ccxt.async_support.base.ws.order_book_side import Asks, Bids
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Any, Balances, Int, Market, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
10
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Market, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
11
11
|
from ccxt.async_support.base.ws.client import Client
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
@@ -1462,7 +1462,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
1462
1462
|
future = self.safe_value(client.futures, messageHash)
|
1463
1463
|
future.resolve(True)
|
1464
1464
|
|
1465
|
-
def handle_error_message(self, client: Client, message):
|
1465
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1466
1466
|
#
|
1467
1467
|
# {event: "error", message: "Invalid sign", errorCode: 30013}
|
1468
1468
|
# {"event":"error","message":"Unrecognized request: {\"event\":\"subscribe\",\"channel\":\"spot/depth:BTC-USDT\"}","errorCode":30039}
|
ccxt/pro/bitmex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Liquidation, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Liquidation, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -374,7 +374,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
374
374
|
"""
|
375
375
|
return self.watch_liquidations_for_symbols([symbol], since, limit, params)
|
376
376
|
|
377
|
-
async def watch_liquidations_for_symbols(self, symbols: List[str]
|
377
|
+
async def watch_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
|
378
378
|
"""
|
379
379
|
watch the public liquidations of a trading pair
|
380
380
|
|
@@ -1596,7 +1596,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1596
1596
|
#
|
1597
1597
|
return message
|
1598
1598
|
|
1599
|
-
def handle_error_message(self, client: Client, message):
|
1599
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1600
1600
|
#
|
1601
1601
|
# generic error format
|
1602
1602
|
#
|
ccxt/pro/bitstamp.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
|
8
|
-
from ccxt.base.types import Any, Int, Order, OrderBook, Str, Trade
|
8
|
+
from ccxt.base.types import Any, Bool, Int, Order, OrderBook, Str, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -464,7 +464,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
464
464
|
method = methods[key]
|
465
465
|
method(client, message)
|
466
466
|
|
467
|
-
def handle_error_message(self, client: Client, message):
|
467
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
468
468
|
# {
|
469
469
|
# "event": "bts:error",
|
470
470
|
# "channel": '',
|
@@ -476,7 +476,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
476
476
|
data = self.safe_value(message, 'data', {})
|
477
477
|
code = self.safe_number(data, 'code')
|
478
478
|
self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
|
479
|
-
return
|
479
|
+
return True
|
480
480
|
|
481
481
|
def handle_message(self, client: Client, message):
|
482
482
|
if not self.handle_error_message(client, message):
|
ccxt/pro/bittrade.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheByTimestamp
|
8
|
-
from ccxt.base.types import Any, Int, OrderBook, Ticker, Trade
|
8
|
+
from ccxt.base.types import Any, Bool, Int, OrderBook, Ticker, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
@@ -521,7 +521,7 @@ class bittrade(ccxt.async_support.bittrade):
|
|
521
521
|
def handle_ping(self, client: Client, message):
|
522
522
|
self.spawn(self.pong, client, message)
|
523
523
|
|
524
|
-
def handle_error_message(self, client: Client, message):
|
524
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
525
525
|
#
|
526
526
|
# {
|
527
527
|
# "ts": 1586323747018,
|
ccxt/pro/bitvavo.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -1277,7 +1277,7 @@ class bitvavo(ccxt.async_support.bitvavo):
|
|
1277
1277
|
if messageHash in client.subscriptions:
|
1278
1278
|
del client.subscriptions[messageHash]
|
1279
1279
|
|
1280
|
-
def handle_error_message(self, client: Client, message):
|
1280
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1281
1281
|
#
|
1282
1282
|
# {
|
1283
1283
|
# action: 'privateCreateOrder',
|
@@ -1306,6 +1306,8 @@ class bitvavo(ccxt.async_support.bitvavo):
|
|
1306
1306
|
client.reject(e, messageHash)
|
1307
1307
|
if not rejected:
|
1308
1308
|
client.reject(message, messageHash)
|
1309
|
+
return True
|
1310
|
+
return None
|
1309
1311
|
|
1310
1312
|
def handle_message(self, client: Client, message):
|
1311
1313
|
#
|
ccxt/pro/bybit.py
CHANGED
@@ -7,7 +7,7 @@ import ccxt.async_support
|
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Any, Balances, Int, Liquidation, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
10
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Liquidation, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
11
11
|
from ccxt.async_support.base.ws.client import Client
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
@@ -870,7 +870,7 @@ class bybit(ccxt.async_support.bybit):
|
|
870
870
|
orderbook = await self.watch_topics(url, messageHashes, topics, params)
|
871
871
|
return orderbook.limit()
|
872
872
|
|
873
|
-
async def un_watch_order_book_for_symbols(self, symbols:
|
873
|
+
async def un_watch_order_book_for_symbols(self, symbols: List[str], params={}) -> Any:
|
874
874
|
"""
|
875
875
|
unsubscribe from the orderbook channel
|
876
876
|
|
@@ -1044,7 +1044,7 @@ class bybit(ccxt.async_support.bybit):
|
|
1044
1044
|
limit = trades.getLimit(tradeSymbol, limit)
|
1045
1045
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
1046
1046
|
|
1047
|
-
async def un_watch_trades_for_symbols(self, symbols:
|
1047
|
+
async def un_watch_trades_for_symbols(self, symbols: List[str], params={}) -> Any:
|
1048
1048
|
"""
|
1049
1049
|
unsubscribe from the trades channel
|
1050
1050
|
|
@@ -2154,7 +2154,7 @@ class bybit(ccxt.async_support.bybit):
|
|
2154
2154
|
self.watch(url, messageHash, message, messageHash)
|
2155
2155
|
return await future
|
2156
2156
|
|
2157
|
-
def handle_error_message(self, client: Client, message):
|
2157
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
2158
2158
|
#
|
2159
2159
|
# {
|
2160
2160
|
# "success": False,
|
ccxt/pro/cex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -1378,7 +1378,7 @@ class cex(ccxt.async_support.cex):
|
|
1378
1378
|
#
|
1379
1379
|
return message
|
1380
1380
|
|
1381
|
-
def handle_error_message(self, client: Client, message):
|
1381
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1382
1382
|
#
|
1383
1383
|
# {
|
1384
1384
|
# "e": "get-balance",
|
@@ -1400,6 +1400,7 @@ class cex(ccxt.async_support.cex):
|
|
1400
1400
|
future = self.safe_value(client['futures'], messageHash)
|
1401
1401
|
if future is not None:
|
1402
1402
|
client.reject(error, messageHash)
|
1403
|
+
return True
|
1403
1404
|
else:
|
1404
1405
|
raise error
|
1405
1406
|
|
ccxt/pro/coinbaseexchange.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Any, Bool, Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -203,7 +203,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
|
|
203
203
|
limit = trades.getLimit(symbol, limit)
|
204
204
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
205
205
|
|
206
|
-
async def watch_my_trades_for_symbols(self, symbols:
|
206
|
+
async def watch_my_trades_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
207
207
|
"""
|
208
208
|
watches information on multiple trades made by the user
|
209
209
|
:param str[] symbols: unified symbol of the market to fetch trades for
|
@@ -224,7 +224,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
|
|
224
224
|
limit = trades.getLimit(tradeSymbol, limit)
|
225
225
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
226
226
|
|
227
|
-
async def watch_orders_for_symbols(self, symbols:
|
227
|
+
async def watch_orders_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
228
228
|
"""
|
229
229
|
watches information on multiple orders made by the user
|
230
230
|
:param str[] symbols: unified symbol of the market to fetch orders for
|
@@ -841,7 +841,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
|
|
841
841
|
#
|
842
842
|
return message
|
843
843
|
|
844
|
-
def handle_error_message(self, client: Client, message):
|
844
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
845
845
|
#
|
846
846
|
# {
|
847
847
|
# "type": "error",
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Int, Market, OrderBook, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade
|
9
|
+
from ccxt.base.types import Any, Bool, Int, Market, OrderBook, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -729,7 +729,7 @@ class coinbaseinternational(ccxt.async_support.coinbaseinternational):
|
|
729
729
|
self.fundingRates[fundingRate['symbol']] = fundingRate
|
730
730
|
client.resolve(fundingRate, channel + '::' + fundingRate['symbol'])
|
731
731
|
|
732
|
-
def handle_error_message(self, client: Client, message):
|
732
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
733
733
|
#
|
734
734
|
# {
|
735
735
|
# message: 'Failed to subscribe',
|
ccxt/pro/coincatch.py
CHANGED
@@ -1298,7 +1298,7 @@ class coincatch(ccxt.async_support.coincatch):
|
|
1298
1298
|
'info': position,
|
1299
1299
|
})
|
1300
1300
|
|
1301
|
-
def handle_error_message(self, client: Client, message):
|
1301
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1302
1302
|
#
|
1303
1303
|
# {event: "error", code: 30001, msg: "Channel does not exist"}
|
1304
1304
|
#
|
ccxt/pro/coinone.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache
|
8
|
-
from ccxt.base.types import Any, Int, Market, OrderBook, Ticker, Trade
|
8
|
+
from ccxt.base.types import Any, Bool, Int, Market, OrderBook, Ticker, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -348,7 +348,7 @@ class coinone(ccxt.async_support.coinone):
|
|
348
348
|
'fee': None,
|
349
349
|
}, market)
|
350
350
|
|
351
|
-
def handle_error_message(self, client: Client, message):
|
351
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
352
352
|
#
|
353
353
|
# {
|
354
354
|
# "response_type": "ERROR",
|
ccxt/pro/cryptocom.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -1188,7 +1188,7 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
1188
1188
|
message = self.extend(request, params)
|
1189
1189
|
return await self.watch(url, messageHash, message, messageHash)
|
1190
1190
|
|
1191
|
-
def handle_error_message(self, client: Client, message):
|
1191
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1192
1192
|
#
|
1193
1193
|
# {
|
1194
1194
|
# "id": 0,
|
ccxt/pro/derive.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
|
8
|
-
from ccxt.base.types import Any, Int, Order, OrderBook, Str, Ticker, Trade
|
8
|
+
from ccxt.base.types import Any, Bool, Int, Order, OrderBook, Str, Ticker, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
@@ -618,7 +618,7 @@ class derive(ccxt.async_support.derive):
|
|
618
618
|
messageHash = topic + trade['symbol']
|
619
619
|
client.resolve(myTrades, messageHash)
|
620
620
|
|
621
|
-
def handle_error_message(self, client: Client, message):
|
621
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
622
622
|
#
|
623
623
|
# {
|
624
624
|
# id: '690c6276-0fc6-4121-aafa-f28bf5adedcb',
|
ccxt/pro/gate.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Liquidation, Market, MarketType, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Liquidation, Market, MarketType, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -1332,7 +1332,7 @@ class gate(ccxt.async_support.gate):
|
|
1332
1332
|
"""
|
1333
1333
|
return self.watch_my_liquidations_for_symbols([symbol], since, limit, params)
|
1334
1334
|
|
1335
|
-
async def watch_my_liquidations_for_symbols(self, symbols: List[str]
|
1335
|
+
async def watch_my_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
|
1336
1336
|
"""
|
1337
1337
|
watch the private liquidations of a trading pair
|
1338
1338
|
|
@@ -1486,7 +1486,7 @@ class gate(ccxt.async_support.gate):
|
|
1486
1486
|
'datetime': self.iso8601(timestamp),
|
1487
1487
|
})
|
1488
1488
|
|
1489
|
-
def handle_error_message(self, client: Client, message):
|
1489
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
1490
1490
|
#
|
1491
1491
|
# {
|
1492
1492
|
# "time": 1647274664,
|
ccxt/pro/hollaex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
import ccxt.async_support
|
7
7
|
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Str, Trade
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Str, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -443,7 +443,7 @@ class hollaex(ccxt.async_support.hollaex):
|
|
443
443
|
message = self.extend(request, params)
|
444
444
|
return await self.watch(signedUrl, messageHash, message, messageHash)
|
445
445
|
|
446
|
-
def handle_error_message(self, client: Client, message):
|
446
|
+
def handle_error_message(self, client: Client, message) -> Bool:
|
447
447
|
#
|
448
448
|
# {error: "Bearer or HMAC authentication required"}
|
449
449
|
# {error: "Error: wrong input"}
|