ccxt 4.3.61__py2.py3-none-any.whl → 4.3.63__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 +2 -1
- ccxt/abstract/binance.py +5 -5
- ccxt/abstract/binancecoinm.py +5 -5
- ccxt/abstract/binanceus.py +5 -5
- ccxt/abstract/binanceusdm.py +5 -5
- ccxt/abstract/cryptocom.py +11 -0
- ccxt/abstract/woo.py +3 -0
- ccxt/ace.py +33 -15
- ccxt/async_support/__init__.py +2 -1
- ccxt/async_support/ace.py +33 -15
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/fast_client.py +2 -2
- ccxt/async_support/binance.py +43 -38
- ccxt/async_support/bingx.py +492 -184
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/cryptocom.py +17 -2
- ccxt/async_support/mercado.py +5 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/woo.py +296 -81
- ccxt/async_support/xt.py +4 -4
- ccxt/base/errors.py +8 -1
- ccxt/base/exchange.py +8 -2
- ccxt/binance.py +43 -38
- ccxt/bingx.py +492 -184
- ccxt/bybit.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/cryptocom.py +17 -2
- ccxt/mercado.py +5 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/binance.py +58 -39
- ccxt/pro/bingx.py +2 -2
- ccxt/pro/bitfinex2.py +8 -6
- ccxt/pro/bitget.py +6 -3
- ccxt/pro/bitmex.py +1 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +46 -23
- ccxt/pro/coinbaseexchange.py +2 -2
- ccxt/pro/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/cryptocom.py +8 -3
- ccxt/pro/deribit.py +1 -1
- ccxt/pro/gate.py +8 -5
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/htx.py +6 -2
- ccxt/pro/hyperliquid.py +3 -3
- ccxt/pro/independentreserve.py +6 -4
- ccxt/pro/kraken.py +80 -7
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/okx.py +5 -5
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/phemex.py +1 -1
- ccxt/pro/poloniexfutures.py +5 -2
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/whitebit.py +1 -1
- ccxt/pro/woo.py +1 -1
- ccxt/pro/woofipro.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/woo.py +296 -81
- ccxt/xt.py +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/METADATA +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/RECORD +69 -69
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/WHEEL +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/top_level.txt +0 -0
ccxt/pro/cryptocom.py
CHANGED
@@ -11,7 +11,7 @@ from ccxt.async_support.base.ws.client import Client
|
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
13
13
|
from ccxt.base.errors import NetworkError
|
14
|
-
from ccxt.base.errors import
|
14
|
+
from ccxt.base.errors import ChecksumError
|
15
15
|
|
16
16
|
|
17
17
|
class cryptocom(ccxt.async_support.cryptocom):
|
@@ -52,6 +52,9 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
52
52
|
'fetchPositionsSnapshot': True, # or False
|
53
53
|
'awaitPositionsSnapshot': True, # whether to wait for the positions snapshot before providing updates
|
54
54
|
},
|
55
|
+
'watchOrderBook': {
|
56
|
+
'checksum': True,
|
57
|
+
},
|
55
58
|
},
|
56
59
|
'streaming': {
|
57
60
|
},
|
@@ -213,7 +216,9 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
213
216
|
previousNonce = self.safe_integer(data, 'pu')
|
214
217
|
currentNonce = orderbook['nonce']
|
215
218
|
if currentNonce != previousNonce:
|
216
|
-
|
219
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
220
|
+
if checksum:
|
221
|
+
raise ChecksumError(self.id + ' ' + self.orderbook_checksum_message(symbol))
|
217
222
|
self.handle_deltas(orderbook['asks'], self.safe_value(books, 'asks', []))
|
218
223
|
self.handle_deltas(orderbook['bids'], self.safe_value(books, 'bids', []))
|
219
224
|
orderbook['nonce'] = nonce
|
@@ -310,7 +315,7 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
310
315
|
:param int [since]: the earliest time in ms to fetch trades for
|
311
316
|
:param int [limit]: the maximum number of trade structures to retrieve
|
312
317
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
313
|
-
:returns dict[]: a list of
|
318
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
314
319
|
"""
|
315
320
|
await self.load_markets()
|
316
321
|
market = None
|
ccxt/pro/deribit.py
CHANGED
@@ -537,7 +537,7 @@ class deribit(ccxt.async_support.deribit):
|
|
537
537
|
:param int [since]: the earliest time in ms to fetch orders for
|
538
538
|
:param int [limit]: the maximum number of order structures to retrieve
|
539
539
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
540
|
-
:returns dict[]: a list of
|
540
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
541
541
|
"""
|
542
542
|
await self.load_markets()
|
543
543
|
await self.authenticate(params)
|
ccxt/pro/gate.py
CHANGED
@@ -14,7 +14,7 @@ from ccxt.base.errors import AuthenticationError
|
|
14
14
|
from ccxt.base.errors import ArgumentsRequired
|
15
15
|
from ccxt.base.errors import BadRequest
|
16
16
|
from ccxt.base.errors import NotSupported
|
17
|
-
from ccxt.base.errors import
|
17
|
+
from ccxt.base.errors import ChecksumError
|
18
18
|
from ccxt.base.precise import Precise
|
19
19
|
|
20
20
|
|
@@ -105,6 +105,7 @@ class gate(ccxt.async_support.gate):
|
|
105
105
|
'interval': '100ms',
|
106
106
|
'snapshotDelay': 10, # how many deltas to cache before fetching a snapshot
|
107
107
|
'snapshotMaxRetries': 3,
|
108
|
+
'checksum': True,
|
108
109
|
},
|
109
110
|
'watchBalance': {
|
110
111
|
'settle': 'usdt', # or btc
|
@@ -460,10 +461,12 @@ class gate(ccxt.async_support.gate):
|
|
460
461
|
elif nonce >= deltaStart - 1:
|
461
462
|
self.handle_delta(storedOrderBook, delta)
|
462
463
|
else:
|
463
|
-
error = InvalidNonce(self.id + ' orderbook update has a nonce bigger than u')
|
464
464
|
del client.subscriptions[messageHash]
|
465
465
|
del self.orderbooks[symbol]
|
466
|
-
|
466
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
467
|
+
if checksum:
|
468
|
+
error = ChecksumError(self.id + ' ' + self.orderbook_checksum_message(symbol))
|
469
|
+
client.reject(error, messageHash)
|
467
470
|
client.resolve(storedOrderBook, messageHash)
|
468
471
|
|
469
472
|
def get_cache_index(self, orderBook, cache):
|
@@ -785,7 +788,7 @@ class gate(ccxt.async_support.gate):
|
|
785
788
|
:param int [since]: the earliest time in ms to fetch trades for
|
786
789
|
:param int [limit]: the maximum number of trade structures to retrieve
|
787
790
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
788
|
-
:returns dict[]: a list of
|
791
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
789
792
|
"""
|
790
793
|
await self.load_markets()
|
791
794
|
subType = None
|
@@ -1105,7 +1108,7 @@ class gate(ccxt.async_support.gate):
|
|
1105
1108
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1106
1109
|
:param str [params.type]: spot, margin, swap, future, or option. Required if listening to all symbols.
|
1107
1110
|
:param boolean [params.isInverse]: if future, listen to inverse or linear contracts
|
1108
|
-
:returns dict[]: a list of
|
1111
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1109
1112
|
"""
|
1110
1113
|
await self.load_markets()
|
1111
1114
|
market = None
|
ccxt/pro/hollaex.py
CHANGED
@@ -170,7 +170,7 @@ class hollaex(ccxt.async_support.hollaex):
|
|
170
170
|
:param int [since]: the earliest time in ms to fetch trades for
|
171
171
|
:param int [limit]: the maximum number of trade structures to retrieve
|
172
172
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
173
|
-
:returns dict[]: a list of
|
173
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
174
174
|
"""
|
175
175
|
await self.load_markets()
|
176
176
|
messageHash = 'usertrade'
|
ccxt/pro/htx.py
CHANGED
@@ -16,6 +16,7 @@ from ccxt.base.errors import BadRequest
|
|
16
16
|
from ccxt.base.errors import BadSymbol
|
17
17
|
from ccxt.base.errors import NetworkError
|
18
18
|
from ccxt.base.errors import InvalidNonce
|
19
|
+
from ccxt.base.errors import ChecksumError
|
19
20
|
|
20
21
|
|
21
22
|
class htx(ccxt.async_support.htx):
|
@@ -109,6 +110,7 @@ class htx(ccxt.async_support.htx):
|
|
109
110
|
'api': 'api', # or api-aws for clients hosted on AWS
|
110
111
|
'watchOrderBook': {
|
111
112
|
'maxRetries': 3,
|
113
|
+
'checksum': True,
|
112
114
|
},
|
113
115
|
'ws': {
|
114
116
|
'gunzip': True,
|
@@ -549,7 +551,9 @@ class htx(ccxt.async_support.htx):
|
|
549
551
|
orderbook.reset(snapshot)
|
550
552
|
orderbook['nonce'] = version
|
551
553
|
if (prevSeqNum is not None) and prevSeqNum > orderbook['nonce']:
|
552
|
-
|
554
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
555
|
+
if checksum:
|
556
|
+
raise ChecksumError(self.id + ' ' + self.orderbook_checksum_message(symbol))
|
553
557
|
spotConditon = market['spot'] and (prevSeqNum == orderbook['nonce'])
|
554
558
|
nonSpotCondition = market['contract'] and (version - 1 == orderbook['nonce'])
|
555
559
|
if spotConditon or nonSpotCondition:
|
@@ -641,7 +645,7 @@ class htx(ccxt.async_support.htx):
|
|
641
645
|
:param int [since]: the earliest time in ms to fetch trades for
|
642
646
|
:param int [limit]: the maximum number of trade structures to retrieve
|
643
647
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
644
|
-
:returns dict[]: a list of
|
648
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
645
649
|
"""
|
646
650
|
self.check_required_credentials()
|
647
651
|
await self.load_markets()
|
ccxt/pro/hyperliquid.py
CHANGED
@@ -131,7 +131,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
131
131
|
:param int [limit]: the maximum number of order structures to retrieve
|
132
132
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
133
133
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
134
|
-
:returns dict[]: a list of
|
134
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
135
135
|
"""
|
136
136
|
userAddress = None
|
137
137
|
userAddress, params = self.handlePublicAddress('watchMyTrades', params)
|
@@ -214,7 +214,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
214
214
|
:param int [since]: the earliest time in ms to fetch trades for
|
215
215
|
:param int [limit]: the maximum number of trade structures to retrieve
|
216
216
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
217
|
-
:returns dict[]: a list of
|
217
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
218
218
|
"""
|
219
219
|
await self.load_markets()
|
220
220
|
market = self.market(symbol)
|
@@ -403,7 +403,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
403
403
|
:param int [limit]: the maximum number of order structures to retrieve
|
404
404
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
405
405
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
406
|
-
:returns dict[]: a list of
|
406
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
407
407
|
"""
|
408
408
|
await self.load_markets()
|
409
409
|
userAddress = None
|
ccxt/pro/independentreserve.py
CHANGED
@@ -9,7 +9,7 @@ from ccxt.base.types import Int, OrderBook, 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 NotSupported
|
12
|
-
from ccxt.base.errors import
|
12
|
+
from ccxt.base.errors import ChecksumError
|
13
13
|
|
14
14
|
|
15
15
|
class independentreserve(ccxt.async_support.independentreserve):
|
@@ -33,7 +33,9 @@ class independentreserve(ccxt.async_support.independentreserve):
|
|
33
33
|
},
|
34
34
|
},
|
35
35
|
'options': {
|
36
|
-
'
|
36
|
+
'watchOrderBook': {
|
37
|
+
'checksum': True, # TODO: currently only working for snapshot
|
38
|
+
},
|
37
39
|
},
|
38
40
|
'streaming': {
|
39
41
|
},
|
@@ -196,7 +198,7 @@ class independentreserve(ccxt.async_support.independentreserve):
|
|
196
198
|
self.handle_deltas(orderbook['bids'], bids)
|
197
199
|
orderbook['timestamp'] = timestamp
|
198
200
|
orderbook['datetime'] = self.iso8601(timestamp)
|
199
|
-
checksum = self.
|
201
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
200
202
|
if checksum and receivedSnapshot:
|
201
203
|
storedAsks = orderbook['asks']
|
202
204
|
storedBids = orderbook['bids']
|
@@ -212,7 +214,7 @@ class independentreserve(ccxt.async_support.independentreserve):
|
|
212
214
|
calculatedChecksum = self.crc32(payload, True)
|
213
215
|
responseChecksum = self.safe_integer(orderBook, 'Crc32')
|
214
216
|
if calculatedChecksum != responseChecksum:
|
215
|
-
error =
|
217
|
+
error = ChecksumError(self.id + ' ' + self.orderbook_checksum_message(symbol))
|
216
218
|
del client.subscriptions[messageHash]
|
217
219
|
del self.orderbooks[symbol]
|
218
220
|
client.reject(error, messageHash)
|
ccxt/pro/kraken.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 Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
8
|
+
from ccxt.base.types import Balances, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, 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
|
@@ -20,7 +20,7 @@ from ccxt.base.errors import OrderNotFound
|
|
20
20
|
from ccxt.base.errors import NotSupported
|
21
21
|
from ccxt.base.errors import RateLimitExceeded
|
22
22
|
from ccxt.base.errors import ExchangeNotAvailable
|
23
|
-
from ccxt.base.errors import
|
23
|
+
from ccxt.base.errors import ChecksumError
|
24
24
|
from ccxt.base.precise import Precise
|
25
25
|
|
26
26
|
|
@@ -30,7 +30,7 @@ class kraken(ccxt.async_support.kraken):
|
|
30
30
|
return self.deep_extend(super(kraken, self).describe(), {
|
31
31
|
'has': {
|
32
32
|
'ws': True,
|
33
|
-
'watchBalance':
|
33
|
+
'watchBalance': True,
|
34
34
|
'watchMyTrades': True,
|
35
35
|
'watchOHLCV': True,
|
36
36
|
'watchOrderBook': True,
|
@@ -53,6 +53,7 @@ class kraken(ccxt.async_support.kraken):
|
|
53
53
|
'ws': {
|
54
54
|
'public': 'wss://ws.kraken.com',
|
55
55
|
'private': 'wss://ws-auth.kraken.com',
|
56
|
+
'privateV2': 'wss://ws-auth.kraken.com/v2',
|
56
57
|
'beta': 'wss://beta-ws.kraken.com',
|
57
58
|
'beta-private': 'wss://beta-ws-auth.kraken.com',
|
58
59
|
},
|
@@ -66,7 +67,9 @@ class kraken(ccxt.async_support.kraken):
|
|
66
67
|
'OHLCVLimit': 1000,
|
67
68
|
'ordersLimit': 1000,
|
68
69
|
'symbolsByOrderId': {},
|
69
|
-
'
|
70
|
+
'watchOrderBook': {
|
71
|
+
'checksum': True,
|
72
|
+
},
|
70
73
|
},
|
71
74
|
'exceptions': {
|
72
75
|
'ws': {
|
@@ -715,7 +718,7 @@ class kraken(ccxt.async_support.kraken):
|
|
715
718
|
example = self.safe_value(b, 0)
|
716
719
|
# don't remove self line or I will poop on your face
|
717
720
|
orderbook.limit()
|
718
|
-
checksum = self.
|
721
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
719
722
|
if checksum:
|
720
723
|
priceString = self.safe_string(example, 0)
|
721
724
|
amountString = self.safe_string(example, 1)
|
@@ -734,7 +737,7 @@ class kraken(ccxt.async_support.kraken):
|
|
734
737
|
payload = ''.join(payloadArray)
|
735
738
|
localChecksum = self.crc32(payload, False)
|
736
739
|
if localChecksum != c:
|
737
|
-
error =
|
740
|
+
error = ChecksumError(self.id + ' ' + self.orderbook_checksum_message(symbol))
|
738
741
|
del client.subscriptions[messageHash]
|
739
742
|
del self.orderbooks[symbol]
|
740
743
|
client.reject(error, messageHash)
|
@@ -835,7 +838,7 @@ class kraken(ccxt.async_support.kraken):
|
|
835
838
|
:param int [since]: the earliest time in ms to fetch trades for
|
836
839
|
:param int [limit]: the maximum number of trade structures to retrieve
|
837
840
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
838
|
-
:returns dict[]: a list of
|
841
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
839
842
|
"""
|
840
843
|
return await self.watch_private('ownTrades', symbol, since, limit, params)
|
841
844
|
|
@@ -1247,6 +1250,68 @@ class kraken(ccxt.async_support.kraken):
|
|
1247
1250
|
url = self.urls['api']['ws']['public']
|
1248
1251
|
return await self.watch_multiple(url, messageHashes, self.deep_extend(request, params), messageHashes, subscriptionArgs)
|
1249
1252
|
|
1253
|
+
async def watch_balance(self, params={}) -> Balances:
|
1254
|
+
"""
|
1255
|
+
watch balance and get the amount of funds available for trading or funds locked in orders
|
1256
|
+
:see: https://docs.kraken.com/api/docs/websocket-v2/balances
|
1257
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1258
|
+
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1259
|
+
"""
|
1260
|
+
await self.load_markets()
|
1261
|
+
token = await self.authenticate()
|
1262
|
+
messageHash = 'balances'
|
1263
|
+
url = self.urls['api']['ws']['privateV2']
|
1264
|
+
requestId = self.request_id()
|
1265
|
+
subscribe: dict = {
|
1266
|
+
'method': 'subscribe',
|
1267
|
+
'req_id': requestId,
|
1268
|
+
'params': {
|
1269
|
+
'channel': 'balances',
|
1270
|
+
'token': token,
|
1271
|
+
},
|
1272
|
+
}
|
1273
|
+
request = self.deep_extend(subscribe, params)
|
1274
|
+
return await self.watch(url, messageHash, request, messageHash)
|
1275
|
+
|
1276
|
+
def handle_balance(self, client: Client, message):
|
1277
|
+
#
|
1278
|
+
# {
|
1279
|
+
# "channel": "balances",
|
1280
|
+
# "data": [
|
1281
|
+
# {
|
1282
|
+
# "asset": "BTC",
|
1283
|
+
# "asset_class": "currency",
|
1284
|
+
# "balance": 1.2,
|
1285
|
+
# "wallets": [
|
1286
|
+
# {
|
1287
|
+
# "type": "spot",
|
1288
|
+
# "id": "main",
|
1289
|
+
# "balance": 1.2
|
1290
|
+
# }
|
1291
|
+
# ]
|
1292
|
+
# }
|
1293
|
+
# ],
|
1294
|
+
# "type": "snapshot",
|
1295
|
+
# "sequence": 1
|
1296
|
+
# }
|
1297
|
+
#
|
1298
|
+
data = self.safe_list(message, 'data', [])
|
1299
|
+
result: dict = {'info': message}
|
1300
|
+
for i in range(0, len(data)):
|
1301
|
+
currencyId = self.safe_string(data[i], 'asset')
|
1302
|
+
code = self.safe_currency_code(currencyId)
|
1303
|
+
account = self.account()
|
1304
|
+
eq = self.safe_string(data[i], 'balance')
|
1305
|
+
account['total'] = eq
|
1306
|
+
result[code] = account
|
1307
|
+
type = 'spot'
|
1308
|
+
balance = self.safe_balance(result)
|
1309
|
+
oldBalance = self.safe_value(self.balance, type, {})
|
1310
|
+
newBalance = self.deep_extend(oldBalance, balance)
|
1311
|
+
self.balance[type] = self.safe_balance(newBalance)
|
1312
|
+
channel = self.safe_string(message, 'channel')
|
1313
|
+
client.resolve(self.balance[type], channel)
|
1314
|
+
|
1250
1315
|
def get_message_hash(self, unifiedElementName: str, subChannelName: Str = None, symbol: Str = None):
|
1251
1316
|
# unifiedElementName can be : orderbook, trade, ticker, bidask ...
|
1252
1317
|
# subChannelName only applies to channel that needs specific variation(i.e. depth_50, depth_100..) to be selected
|
@@ -1340,6 +1405,14 @@ class kraken(ccxt.async_support.kraken):
|
|
1340
1405
|
if method is not None:
|
1341
1406
|
method(client, message, subscription)
|
1342
1407
|
else:
|
1408
|
+
channel = self.safe_string(message, 'channel')
|
1409
|
+
if channel is not None:
|
1410
|
+
methods: dict = {
|
1411
|
+
'balances': self.handle_balance,
|
1412
|
+
}
|
1413
|
+
method = self.safe_value(methods, channel)
|
1414
|
+
if method is not None:
|
1415
|
+
method(client, message)
|
1343
1416
|
if self.handle_error_message(client, message):
|
1344
1417
|
event = self.safe_string(message, 'event')
|
1345
1418
|
methods: dict = {
|
ccxt/pro/kucoin.py
CHANGED
@@ -916,7 +916,7 @@ class kucoin(ccxt.async_support.kucoin):
|
|
916
916
|
:param int [limit]: the maximum number of trade structures to retrieve
|
917
917
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
918
918
|
:param str [params.method]: '/spotMarket/tradeOrders' or '/spot/tradeFills' default is '/spotMarket/tradeOrders'
|
919
|
-
:returns dict[]: a list of
|
919
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
920
920
|
"""
|
921
921
|
await self.load_markets()
|
922
922
|
url = await self.negotiate(True)
|
ccxt/pro/mexc.py
CHANGED
@@ -582,7 +582,7 @@ class mexc(ccxt.async_support.mexc):
|
|
582
582
|
:param int [since]: the earliest time in ms to fetch trades for
|
583
583
|
:param int [limit]: the maximum number of trade structures to retrieve
|
584
584
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
585
|
-
:returns dict[]: a list of
|
585
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
586
586
|
"""
|
587
587
|
await self.load_markets()
|
588
588
|
messageHash = 'myTrades'
|
ccxt/pro/okx.py
CHANGED
@@ -13,7 +13,7 @@ from ccxt.base.errors import ExchangeError
|
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
14
14
|
from ccxt.base.errors import ArgumentsRequired
|
15
15
|
from ccxt.base.errors import BadRequest
|
16
|
-
from ccxt.base.errors import
|
16
|
+
from ccxt.base.errors import ChecksumError
|
17
17
|
|
18
18
|
|
19
19
|
class okx(ccxt.async_support.okx):
|
@@ -56,6 +56,7 @@ class okx(ccxt.async_support.okx):
|
|
56
56
|
},
|
57
57
|
'options': {
|
58
58
|
'watchOrderBook': {
|
59
|
+
'checksum': True,
|
59
60
|
#
|
60
61
|
# bbo-tbt
|
61
62
|
# 1. Newly added channel that sends tick-by-tick Level 1 data
|
@@ -103,7 +104,6 @@ class okx(ccxt.async_support.okx):
|
|
103
104
|
'ws': {
|
104
105
|
# 'inflate': True,
|
105
106
|
},
|
106
|
-
'checksum': True,
|
107
107
|
},
|
108
108
|
'streaming': {
|
109
109
|
# okex does not support built-in ws protocol-level ping-pong
|
@@ -861,7 +861,7 @@ class okx(ccxt.async_support.okx):
|
|
861
861
|
self.handle_deltas(storedBids, bids)
|
862
862
|
marketId = self.safe_string(message, 'instId')
|
863
863
|
symbol = self.safe_symbol(marketId)
|
864
|
-
checksum = self.
|
864
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
865
865
|
if checksum:
|
866
866
|
asksLength = len(storedAsks)
|
867
867
|
bidsLength = len(storedBids)
|
@@ -877,7 +877,7 @@ class okx(ccxt.async_support.okx):
|
|
877
877
|
responseChecksum = self.safe_integer(message, 'checksum')
|
878
878
|
localChecksum = self.crc32(payload, True)
|
879
879
|
if responseChecksum != localChecksum:
|
880
|
-
error =
|
880
|
+
error = ChecksumError(self.id + ' ' + self.orderbook_checksum_message(symbol))
|
881
881
|
del client.subscriptions[messageHash]
|
882
882
|
del self.orderbooks[symbol]
|
883
883
|
client.reject(error, messageHash)
|
@@ -1147,7 +1147,7 @@ class okx(ccxt.async_support.okx):
|
|
1147
1147
|
:param bool [params.stop]: True if fetching trigger or conditional trades
|
1148
1148
|
:param str [params.type]: 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
1149
1149
|
:param str [params.marginMode]: 'cross' or 'isolated', for automatically setting the type to spot margin
|
1150
|
-
:returns dict[]: a list of
|
1150
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
1151
1151
|
"""
|
1152
1152
|
# By default, receive order updates from any instrument type
|
1153
1153
|
type = None
|
ccxt/pro/oxfun.py
CHANGED
@@ -83,7 +83,7 @@ class oxfun(ccxt.async_support.oxfun):
|
|
83
83
|
:param int [limit]: the maximum number of trade structures to retrieve
|
84
84
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
85
85
|
:param int|str [params.tag]: If given it will be echoed in the reply and the max size of tag is 32
|
86
|
-
:returns dict[]: a list of
|
86
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
87
87
|
"""
|
88
88
|
return await self.watch_trades_for_symbols([symbol], since, limit, params)
|
89
89
|
|
ccxt/pro/phemex.py
CHANGED
@@ -697,7 +697,7 @@ class phemex(ccxt.async_support.phemex):
|
|
697
697
|
:param int [since]: the earliest time in ms to fetch trades for
|
698
698
|
:param int [limit]: the maximum number of trade structures to retrieve
|
699
699
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
700
|
-
:returns dict[]: a list of
|
700
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
701
701
|
"""
|
702
702
|
await self.load_markets()
|
703
703
|
market = None
|
ccxt/pro/poloniexfutures.py
CHANGED
@@ -10,7 +10,7 @@ from ccxt.async_support.base.ws.client import Client
|
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
12
12
|
from ccxt.base.errors import BadRequest
|
13
|
-
from ccxt.base.errors import
|
13
|
+
from ccxt.base.errors import ChecksumError
|
14
14
|
|
15
15
|
|
16
16
|
class poloniexfutures(ccxt.async_support.poloniexfutures):
|
@@ -57,6 +57,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
57
57
|
'method': '/contractMarket/level2', # can also be '/contractMarket/level3v2'
|
58
58
|
'snapshotDelay': 5,
|
59
59
|
'snapshotMaxRetries': 3,
|
60
|
+
'checksum': True,
|
60
61
|
},
|
61
62
|
'streamLimit': 5, # called tunnels by poloniexfutures docs
|
62
63
|
'streamBySubscriptionsHash': {},
|
@@ -822,7 +823,9 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
822
823
|
if nonce > sequence:
|
823
824
|
return
|
824
825
|
if nonce != lastSequence:
|
825
|
-
|
826
|
+
checksum = self.handle_option('watchOrderBook', 'checksum', True)
|
827
|
+
if checksum:
|
828
|
+
raise ChecksumError(self.id + ' ' + self.orderbook_checksum_message(''))
|
826
829
|
changes = self.safe_list(delta, 'changes')
|
827
830
|
for i in range(0, len(changes)):
|
828
831
|
change = changes[i]
|
ccxt/pro/upbit.py
CHANGED
@@ -293,7 +293,7 @@ class upbit(ccxt.async_support.upbit):
|
|
293
293
|
:param int [since]: the earliest time in ms to fetch orders for
|
294
294
|
:param int [limit]: the maximum number of order structures to retrieve
|
295
295
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
296
|
-
:returns dict[]: a list of
|
296
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
297
297
|
"""
|
298
298
|
await self.load_markets()
|
299
299
|
channel = 'myOrder'
|
ccxt/pro/vertex.py
CHANGED
@@ -90,7 +90,7 @@ class vertex(ccxt.async_support.vertex):
|
|
90
90
|
:param int [since]: the earliest time in ms to fetch trades for
|
91
91
|
:param int [limit]: the maximum number of trade structures to retrieve
|
92
92
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
93
|
-
:returns dict[]: a list of
|
93
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
94
94
|
"""
|
95
95
|
await self.load_markets()
|
96
96
|
market = self.market(symbol)
|
@@ -147,7 +147,7 @@ class vertex(ccxt.async_support.vertex):
|
|
147
147
|
:param int [limit]: the maximum number of order structures to retrieve
|
148
148
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
149
149
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
150
|
-
:returns dict[]: a list of
|
150
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
151
151
|
"""
|
152
152
|
if symbol is None:
|
153
153
|
raise ArgumentsRequired(self.id + ' watchMyTrades requires a symbol.')
|
ccxt/pro/whitebit.py
CHANGED
@@ -453,7 +453,7 @@ class whitebit(ccxt.async_support.whitebit):
|
|
453
453
|
:param int [since]: the earliest time in ms to fetch orders for
|
454
454
|
:param int [limit]: the maximum number of order structures to retrieve
|
455
455
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
456
|
-
:returns dict[]: a list of
|
456
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
457
457
|
"""
|
458
458
|
if symbol is None:
|
459
459
|
raise ArgumentsRequired(self.id + ' watchOrders() requires a symbol argument')
|
ccxt/pro/woo.py
CHANGED
@@ -368,7 +368,7 @@ class woo(ccxt.async_support.woo):
|
|
368
368
|
:param int [since]: the earliest time in ms to fetch trades for
|
369
369
|
:param int [limit]: the maximum number of trade structures to retrieve
|
370
370
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
371
|
-
:returns dict[]: a list of
|
371
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
372
372
|
"""
|
373
373
|
await self.load_markets()
|
374
374
|
market = self.market(symbol)
|
ccxt/pro/woofipro.py
CHANGED
@@ -363,7 +363,7 @@ class woofipro(ccxt.async_support.woofipro):
|
|
363
363
|
:param int [since]: the earliest time in ms to fetch trades for
|
364
364
|
:param int [limit]: the maximum number of trade structures to retrieve
|
365
365
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
366
|
-
:returns dict[]: a list of
|
366
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
367
367
|
"""
|
368
368
|
await self.load_markets()
|
369
369
|
market = self.market(symbol)
|
ccxt/tradeogre.py
CHANGED
@@ -221,7 +221,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
221
221
|
'inverse': None,
|
222
222
|
'contractSize': None,
|
223
223
|
'taker': self.fees['trading']['taker'],
|
224
|
-
'maker': self.fees['trading']['
|
224
|
+
'maker': self.fees['trading']['maker'],
|
225
225
|
'expiry': None,
|
226
226
|
'expiryDatetime': None,
|
227
227
|
'strike': None,
|