ccxt 4.3.30__py2.py3-none-any.whl → 4.3.32__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 +1 -1
- ccxt/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +21 -21
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +208 -175
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +37 -37
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +48 -36
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +21 -21
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +208 -175
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +20 -20
- ccxt/pro/coinbase.py +32 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/test/test_async.py +1 -1
- ccxt/test/test_sync.py +1 -1
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +37 -37
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/RECORD +260 -260
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/top_level.txt +0 -0
ccxt/pro/mexc.py
CHANGED
@@ -88,7 +88,7 @@ class mexc(ccxt.async_support.mexc):
|
|
88
88
|
return await self.watch_spot_public(channel, messageHash, params)
|
89
89
|
else:
|
90
90
|
channel = 'sub.ticker'
|
91
|
-
requestParams = {
|
91
|
+
requestParams: dict = {
|
92
92
|
'symbol': market['id'],
|
93
93
|
}
|
94
94
|
return await self.watch_swap_public(channel, messageHash, requestParams, params)
|
@@ -157,7 +157,7 @@ class mexc(ccxt.async_support.mexc):
|
|
157
157
|
|
158
158
|
async def watch_spot_public(self, channel, messageHash, params={}):
|
159
159
|
url = self.urls['api']['ws']['spot']
|
160
|
-
request = {
|
160
|
+
request: dict = {
|
161
161
|
'method': 'SUBSCRIPTION',
|
162
162
|
'params': [channel],
|
163
163
|
}
|
@@ -167,7 +167,7 @@ class mexc(ccxt.async_support.mexc):
|
|
167
167
|
self.check_required_credentials()
|
168
168
|
listenKey = await self.authenticate(channel)
|
169
169
|
url = self.urls['api']['ws']['spot'] + '?listenKey=' + listenKey
|
170
|
-
request = {
|
170
|
+
request: dict = {
|
171
171
|
'method': 'SUBSCRIPTION',
|
172
172
|
'params': [channel],
|
173
173
|
}
|
@@ -175,7 +175,7 @@ class mexc(ccxt.async_support.mexc):
|
|
175
175
|
|
176
176
|
async def watch_swap_public(self, channel, messageHash, requestParams, params={}):
|
177
177
|
url = self.urls['api']['ws']['swap']
|
178
|
-
request = {
|
178
|
+
request: dict = {
|
179
179
|
'method': channel,
|
180
180
|
'param': requestParams,
|
181
181
|
}
|
@@ -189,7 +189,7 @@ class mexc(ccxt.async_support.mexc):
|
|
189
189
|
timestamp = str(self.milliseconds())
|
190
190
|
payload = self.apiKey + timestamp
|
191
191
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha256)
|
192
|
-
request = {
|
192
|
+
request: dict = {
|
193
193
|
'method': channel,
|
194
194
|
'param': {
|
195
195
|
'apiKey': self.apiKey,
|
@@ -223,7 +223,7 @@ class mexc(ccxt.async_support.mexc):
|
|
223
223
|
ohlcv = await self.watch_spot_public(channel, messageHash, params)
|
224
224
|
else:
|
225
225
|
channel = 'sub.kline'
|
226
|
-
requestParams = {
|
226
|
+
requestParams: dict = {
|
227
227
|
'symbol': market['id'],
|
228
228
|
'interval': timeframeId,
|
229
229
|
}
|
@@ -359,7 +359,7 @@ class mexc(ccxt.async_support.mexc):
|
|
359
359
|
orderbook = await self.watch_spot_public(channel, messageHash, params)
|
360
360
|
else:
|
361
361
|
channel = 'sub.depth'
|
362
|
-
requestParams = {
|
362
|
+
requestParams: dict = {
|
363
363
|
'symbol': market['id'],
|
364
364
|
}
|
365
365
|
orderbook = await self.watch_swap_public(channel, messageHash, requestParams, params)
|
@@ -514,7 +514,7 @@ class mexc(ccxt.async_support.mexc):
|
|
514
514
|
trades = await self.watch_spot_public(channel, messageHash, params)
|
515
515
|
else:
|
516
516
|
channel = 'sub.deal'
|
517
|
-
requestParams = {
|
517
|
+
requestParams: dict = {
|
518
518
|
'symbol': market['id'],
|
519
519
|
}
|
520
520
|
trades = await self.watch_swap_public(channel, messageHash, requestParams, params)
|
@@ -917,7 +917,7 @@ class mexc(ccxt.async_support.mexc):
|
|
917
917
|
}, market)
|
918
918
|
|
919
919
|
def parse_ws_order_status(self, status, market=None):
|
920
|
-
statuses = {
|
920
|
+
statuses: dict = {
|
921
921
|
'1': 'open', # new order
|
922
922
|
'2': 'closed', # filled
|
923
923
|
'3': 'open', # partially filled
|
@@ -932,7 +932,7 @@ class mexc(ccxt.async_support.mexc):
|
|
932
932
|
return self.safe_string(statuses, status, status)
|
933
933
|
|
934
934
|
def parse_ws_order_type(self, type):
|
935
|
-
types = {
|
935
|
+
types: dict = {
|
936
936
|
'1': 'limit', # LIMIT_ORDER
|
937
937
|
'2': None, # POST_ONLY
|
938
938
|
'3': None, # IMMEDIATE_OR_CANCEL
|
@@ -943,7 +943,7 @@ class mexc(ccxt.async_support.mexc):
|
|
943
943
|
return self.safe_string(types, type)
|
944
944
|
|
945
945
|
def parse_ws_time_in_force(self, timeInForce):
|
946
|
-
timeInForceIds = {
|
946
|
+
timeInForceIds: dict = {
|
947
947
|
'1': 'GTC', # LIMIT_ORDER
|
948
948
|
'2': 'PO', # POST_ONLY
|
949
949
|
'3': 'IOC', # IMMEDIATE_OR_CANCEL
|
@@ -1042,7 +1042,7 @@ class mexc(ccxt.async_support.mexc):
|
|
1042
1042
|
async def keep_alive_listen_key(self, listenKey, params={}):
|
1043
1043
|
if listenKey is None:
|
1044
1044
|
return
|
1045
|
-
request = {
|
1045
|
+
request: dict = {
|
1046
1046
|
'listenKey': listenKey,
|
1047
1047
|
}
|
1048
1048
|
try:
|
@@ -1074,7 +1074,7 @@ class mexc(ccxt.async_support.mexc):
|
|
1074
1074
|
elif msg.find('@') > -1:
|
1075
1075
|
parts = msg.split('@')
|
1076
1076
|
channel = self.safe_string(parts, 1)
|
1077
|
-
methods = {
|
1077
|
+
methods: dict = {
|
1078
1078
|
'public.increase.depth.v3.api': self.handle_order_book_subscription,
|
1079
1079
|
}
|
1080
1080
|
method = self.safe_value(methods, channel)
|
@@ -1097,7 +1097,7 @@ class mexc(ccxt.async_support.mexc):
|
|
1097
1097
|
else:
|
1098
1098
|
parts = c.split('@')
|
1099
1099
|
channel = self.safe_string(parts, 1)
|
1100
|
-
methods = {
|
1100
|
+
methods: dict = {
|
1101
1101
|
'public.deals.v3.api': self.handle_trades,
|
1102
1102
|
'push.deal': self.handle_trades,
|
1103
1103
|
'public.kline.v3.api': self.handle_ohlcv,
|
ccxt/pro/ndax.py
CHANGED
@@ -56,12 +56,12 @@ class ndax(ccxt.async_support.ndax):
|
|
56
56
|
messageHash = name + ':' + market['id']
|
57
57
|
url = self.urls['api']['ws']
|
58
58
|
requestId = self.request_id()
|
59
|
-
payload = {
|
59
|
+
payload: dict = {
|
60
60
|
'OMSId': omsId,
|
61
61
|
'InstrumentId': int(market['id']), # conditionally optional
|
62
62
|
# 'Symbol': market['info']['symbol'], # conditionally optional
|
63
63
|
}
|
64
|
-
request = {
|
64
|
+
request: dict = {
|
65
65
|
'm': 0, # message type, 0 request, 1 reply, 2 subscribe, 3 event, unsubscribe, 5 error
|
66
66
|
'i': requestId, # sequence number identifies an individual request or request-and-response pair, to your application
|
67
67
|
'n': name, # function name is the name of the function being called or that the server is responding to, the server echoes your call
|
@@ -122,12 +122,12 @@ class ndax(ccxt.async_support.ndax):
|
|
122
122
|
messageHash = name + ':' + market['id']
|
123
123
|
url = self.urls['api']['ws']
|
124
124
|
requestId = self.request_id()
|
125
|
-
payload = {
|
125
|
+
payload: dict = {
|
126
126
|
'OMSId': omsId,
|
127
127
|
'InstrumentId': int(market['id']), # conditionally optional
|
128
128
|
'IncludeLastCount': 100, # the number of previous trades to retrieve in the immediate snapshot, 100 by default
|
129
129
|
}
|
130
|
-
request = {
|
130
|
+
request: dict = {
|
131
131
|
'm': 0, # message type, 0 request, 1 reply, 2 subscribe, 3 event, unsubscribe, 5 error
|
132
132
|
'i': requestId, # sequence number identifies an individual request or request-and-response pair, to your application
|
133
133
|
'n': name, # function name is the name of the function being called or that the server is responding to, the server echoes your call
|
@@ -161,7 +161,7 @@ class ndax(ccxt.async_support.ndax):
|
|
161
161
|
# ]
|
162
162
|
#
|
163
163
|
name = 'SubscribeTrades'
|
164
|
-
updates = {}
|
164
|
+
updates: dict = {}
|
165
165
|
for i in range(0, len(payload)):
|
166
166
|
trade = self.parse_trade(payload[i])
|
167
167
|
symbol = trade['symbol']
|
@@ -198,13 +198,13 @@ class ndax(ccxt.async_support.ndax):
|
|
198
198
|
messageHash = name + ':' + timeframe + ':' + market['id']
|
199
199
|
url = self.urls['api']['ws']
|
200
200
|
requestId = self.request_id()
|
201
|
-
payload = {
|
201
|
+
payload: dict = {
|
202
202
|
'OMSId': omsId,
|
203
203
|
'InstrumentId': int(market['id']), # conditionally optional
|
204
204
|
'Interval': int(self.safe_string(self.timeframes, timeframe, timeframe)),
|
205
205
|
'IncludeLastCount': 100, # the number of previous candles to retrieve in the immediate snapshot, 100 by default
|
206
206
|
}
|
207
|
-
request = {
|
207
|
+
request: dict = {
|
208
208
|
'm': 0, # message type, 0 request, 1 reply, 2 subscribe, 3 event, unsubscribe, 5 error
|
209
209
|
'i': requestId, # sequence number identifies an individual request or request-and-response pair, to your application
|
210
210
|
'n': name, # function name is the name of the function being called or that the server is responding to, the server echoes your call
|
@@ -242,7 +242,7 @@ class ndax(ccxt.async_support.ndax):
|
|
242
242
|
# ]
|
243
243
|
# ]
|
244
244
|
#
|
245
|
-
updates = {}
|
245
|
+
updates: dict = {}
|
246
246
|
for i in range(0, len(payload)):
|
247
247
|
ohlcv = payload[i]
|
248
248
|
marketId = self.safe_string(ohlcv, 8)
|
@@ -317,19 +317,19 @@ class ndax(ccxt.async_support.ndax):
|
|
317
317
|
url = self.urls['api']['ws']
|
318
318
|
requestId = self.request_id()
|
319
319
|
limit = 100 if (limit is None) else limit
|
320
|
-
payload = {
|
320
|
+
payload: dict = {
|
321
321
|
'OMSId': omsId,
|
322
322
|
'InstrumentId': int(market['id']), # conditionally optional
|
323
323
|
# 'Symbol': market['info']['symbol'], # conditionally optional
|
324
324
|
'Depth': limit, # default 100
|
325
325
|
}
|
326
|
-
request = {
|
326
|
+
request: dict = {
|
327
327
|
'm': 0, # message type, 0 request, 1 reply, 2 subscribe, 3 event, unsubscribe, 5 error
|
328
328
|
'i': requestId, # sequence number identifies an individual request or request-and-response pair, to your application
|
329
329
|
'n': name, # function name is the name of the function being called or that the server is responding to, the server echoes your call
|
330
330
|
'o': self.json(payload), # JSON-formatted string containing the data being sent with the message
|
331
331
|
}
|
332
|
-
subscription = {
|
332
|
+
subscription: dict = {
|
333
333
|
'id': requestId,
|
334
334
|
'messageHash': messageHash,
|
335
335
|
'name': name,
|
@@ -490,7 +490,7 @@ class ndax(ccxt.async_support.ndax):
|
|
490
490
|
if payload is None:
|
491
491
|
return
|
492
492
|
message['o'] = json.loads(payload)
|
493
|
-
methods = {
|
493
|
+
methods: dict = {
|
494
494
|
'SubscribeLevel2': self.handle_subscription_status,
|
495
495
|
'SubscribeLevel1': self.handle_ticker,
|
496
496
|
'Level2UpdateEvent': self.handle_order_book,
|
ccxt/pro/okcoin.py
CHANGED
@@ -63,7 +63,7 @@ class okcoin(ccxt.async_support.okcoin):
|
|
63
63
|
market = self.market(symbol)
|
64
64
|
url = self.urls['api']['ws']
|
65
65
|
messageHash = market['type'] + '/' + channel + ':' + market['id']
|
66
|
-
request = {
|
66
|
+
request: dict = {
|
67
67
|
'op': 'subscribe',
|
68
68
|
'args': [messageHash],
|
69
69
|
}
|
@@ -150,7 +150,7 @@ class okcoin(ccxt.async_support.okcoin):
|
|
150
150
|
if self.orders is None:
|
151
151
|
self.orders = ArrayCacheBySymbolById(limit)
|
152
152
|
stored = self.orders
|
153
|
-
marketIds = {}
|
153
|
+
marketIds: dict = {}
|
154
154
|
parsed = self.parse_orders(orders)
|
155
155
|
for i in range(0, len(parsed)):
|
156
156
|
order = parsed[i]
|
@@ -442,7 +442,7 @@ class okcoin(ccxt.async_support.okcoin):
|
|
442
442
|
path = '/users/self/verify'
|
443
443
|
auth = timestamp + method + path
|
444
444
|
signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256, 'base64')
|
445
|
-
request = {
|
445
|
+
request: dict = {
|
446
446
|
'op': messageHash,
|
447
447
|
'args': [
|
448
448
|
self.apiKey,
|
@@ -502,7 +502,7 @@ class okcoin(ccxt.async_support.okcoin):
|
|
502
502
|
messageHash = accountType + '/' + account
|
503
503
|
subscriptionHash = messageHash + ':' + suffix
|
504
504
|
url = self.urls['api']['ws']
|
505
|
-
request = {
|
505
|
+
request: dict = {
|
506
506
|
'op': 'subscribe',
|
507
507
|
'args': [subscriptionHash],
|
508
508
|
}
|
@@ -668,7 +668,7 @@ class okcoin(ccxt.async_support.okcoin):
|
|
668
668
|
if table is None:
|
669
669
|
event = self.safe_string(message, 'event')
|
670
670
|
if event is not None:
|
671
|
-
methods = {
|
671
|
+
methods: dict = {
|
672
672
|
# 'info': self.handleSystemStatus,
|
673
673
|
# 'book': 'handleOrderBook',
|
674
674
|
'login': self.handle_authenticate,
|
@@ -680,7 +680,7 @@ class okcoin(ccxt.async_support.okcoin):
|
|
680
680
|
else:
|
681
681
|
parts = table.split('/')
|
682
682
|
name = self.safe_string(parts, 1)
|
683
|
-
methods = {
|
683
|
+
methods: dict = {
|
684
684
|
'depth': self.handle_order_book,
|
685
685
|
'depth5': self.handle_order_book,
|
686
686
|
'depth_l2_tbt': self.handle_order_book,
|
ccxt/pro/okx.py
CHANGED
@@ -133,12 +133,12 @@ class okx(ccxt.async_support.okx):
|
|
133
133
|
messageHash += '::' + ','.join(symbols)
|
134
134
|
for i in range(0, len(symbols)):
|
135
135
|
marketId = self.market_id(symbols[i])
|
136
|
-
arg = {
|
136
|
+
arg: dict = {
|
137
137
|
'channel': channel,
|
138
138
|
'instId': marketId,
|
139
139
|
}
|
140
140
|
args.append(self.extend(arg, params))
|
141
|
-
request = {
|
141
|
+
request: dict = {
|
142
142
|
'op': 'subscribe',
|
143
143
|
'args': args,
|
144
144
|
}
|
@@ -147,14 +147,14 @@ class okx(ccxt.async_support.okx):
|
|
147
147
|
async def subscribe(self, access, messageHash, channel, symbol, params={}):
|
148
148
|
await self.load_markets()
|
149
149
|
url = self.get_url(channel, access)
|
150
|
-
firstArgument = {
|
150
|
+
firstArgument: dict = {
|
151
151
|
'channel': channel,
|
152
152
|
}
|
153
153
|
if symbol is not None:
|
154
154
|
market = self.market(symbol)
|
155
155
|
messageHash += ':' + market['id']
|
156
156
|
firstArgument['instId'] = market['id']
|
157
|
-
request = {
|
157
|
+
request: dict = {
|
158
158
|
'op': 'subscribe',
|
159
159
|
'args': [
|
160
160
|
self.deep_extend(firstArgument, params),
|
@@ -194,12 +194,12 @@ class okx(ccxt.async_support.okx):
|
|
194
194
|
symbol = symbols[i]
|
195
195
|
messageHashes.append(channel + ':' + symbol)
|
196
196
|
marketId = self.market_id(symbol)
|
197
|
-
topic = {
|
197
|
+
topic: dict = {
|
198
198
|
'channel': channel,
|
199
199
|
'instId': marketId,
|
200
200
|
}
|
201
201
|
topics.append(topic)
|
202
|
-
request = {
|
202
|
+
request: dict = {
|
203
203
|
'op': 'subscribe',
|
204
204
|
'args': topics,
|
205
205
|
}
|
@@ -272,12 +272,12 @@ class okx(ccxt.async_support.okx):
|
|
272
272
|
symbol = symbols[i]
|
273
273
|
messageHashes.append(channel + ':' + symbol)
|
274
274
|
marketId = self.market_id(symbol)
|
275
|
-
topic = {
|
275
|
+
topic: dict = {
|
276
276
|
'channel': channel,
|
277
277
|
'instId': marketId,
|
278
278
|
}
|
279
279
|
topics.append(topic)
|
280
|
-
request = {
|
280
|
+
request: dict = {
|
281
281
|
'op': 'subscribe',
|
282
282
|
'args': topics,
|
283
283
|
}
|
@@ -285,7 +285,7 @@ class okx(ccxt.async_support.okx):
|
|
285
285
|
fundingRate = await self.watch_multiple(url, messageHashes, request, messageHashes)
|
286
286
|
if self.newUpdates:
|
287
287
|
symbol = self.safe_string(fundingRate, 'symbol')
|
288
|
-
result = {}
|
288
|
+
result: dict = {}
|
289
289
|
result[symbol] = fundingRate
|
290
290
|
return result
|
291
291
|
return self.filter_by_array(self.fundingRates, 'symbol', symbols)
|
@@ -440,13 +440,13 @@ class okx(ccxt.async_support.okx):
|
|
440
440
|
marketId = self.market_id(sym)
|
441
441
|
interval = self.safe_string(self.timeframes, tf, tf)
|
442
442
|
channel = 'candle' + interval
|
443
|
-
topic = {
|
443
|
+
topic: dict = {
|
444
444
|
'channel': channel,
|
445
445
|
'instId': marketId,
|
446
446
|
}
|
447
447
|
topics.append(topic)
|
448
448
|
messageHashes.append('multi:' + channel + ':' + sym)
|
449
|
-
request = {
|
449
|
+
request: dict = {
|
450
450
|
'op': 'subscribe',
|
451
451
|
'args': topics,
|
452
452
|
}
|
@@ -568,12 +568,12 @@ class okx(ccxt.async_support.okx):
|
|
568
568
|
symbol = symbols[i]
|
569
569
|
messageHashes.append(depth + ':' + symbol)
|
570
570
|
marketId = self.market_id(symbol)
|
571
|
-
topic = {
|
571
|
+
topic: dict = {
|
572
572
|
'channel': depth,
|
573
573
|
'instId': marketId,
|
574
574
|
}
|
575
575
|
topics.append(topic)
|
576
|
-
request = {
|
576
|
+
request: dict = {
|
577
577
|
'op': 'subscribe',
|
578
578
|
'args': topics,
|
579
579
|
}
|
@@ -741,7 +741,7 @@ class okx(ccxt.async_support.okx):
|
|
741
741
|
marketId = self.safe_string(arg, 'instId')
|
742
742
|
market = self.safe_market(marketId)
|
743
743
|
symbol = market['symbol']
|
744
|
-
depths = {
|
744
|
+
depths: dict = {
|
745
745
|
'bbo-tbt': 1,
|
746
746
|
'books': 400,
|
747
747
|
'books5': 5,
|
@@ -794,7 +794,7 @@ class okx(ccxt.async_support.okx):
|
|
794
794
|
auth = timestamp + method + path
|
795
795
|
signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256, 'base64')
|
796
796
|
operation = 'login'
|
797
|
-
request = {
|
797
|
+
request: dict = {
|
798
798
|
'op': operation,
|
799
799
|
'args': [
|
800
800
|
{
|
@@ -932,7 +932,7 @@ class okx(ccxt.async_support.okx):
|
|
932
932
|
if uppercaseType == 'SPOT':
|
933
933
|
if marginMode is not None:
|
934
934
|
uppercaseType = 'MARGIN'
|
935
|
-
request = {
|
935
|
+
request: dict = {
|
936
936
|
'instType': uppercaseType,
|
937
937
|
}
|
938
938
|
orders = await self.subscribe('private', messageHash, channel, None, self.extend(request, params))
|
@@ -951,18 +951,18 @@ class okx(ccxt.async_support.okx):
|
|
951
951
|
await self.load_markets()
|
952
952
|
await self.authenticate(params)
|
953
953
|
symbols = self.market_symbols(symbols)
|
954
|
-
request = {
|
954
|
+
request: dict = {
|
955
955
|
'instType': 'ANY',
|
956
956
|
}
|
957
957
|
channel = 'positions'
|
958
958
|
newPositions = None
|
959
959
|
if symbols is None:
|
960
|
-
arg = {
|
960
|
+
arg: dict = {
|
961
961
|
'channel': 'positions',
|
962
962
|
'instType': 'ANY',
|
963
963
|
}
|
964
964
|
args = [arg]
|
965
|
-
nonSymbolRequest = {
|
965
|
+
nonSymbolRequest: dict = {
|
966
966
|
'op': 'subscribe',
|
967
967
|
'args': args,
|
968
968
|
}
|
@@ -1097,7 +1097,7 @@ class okx(ccxt.async_support.okx):
|
|
1097
1097
|
if uppercaseType == 'SPOT':
|
1098
1098
|
if marginMode is not None:
|
1099
1099
|
uppercaseType = 'MARGIN'
|
1100
|
-
request = {
|
1100
|
+
request: dict = {
|
1101
1101
|
'instType': uppercaseType,
|
1102
1102
|
}
|
1103
1103
|
channel = 'orders-algo' if isStop else 'orders'
|
@@ -1258,7 +1258,7 @@ class okx(ccxt.async_support.okx):
|
|
1258
1258
|
limit = self.safe_integer(self.options, 'tradesLimit', 1000)
|
1259
1259
|
self.myTrades = ArrayCacheBySymbolById(limit)
|
1260
1260
|
myTrades = self.myTrades
|
1261
|
-
symbols = {}
|
1261
|
+
symbols: dict = {}
|
1262
1262
|
for i in range(0, len(filteredOrders)):
|
1263
1263
|
rawTrade = filteredOrders[i]
|
1264
1264
|
trade = self.order_to_trade(rawTrade)
|
@@ -1297,7 +1297,7 @@ class okx(ccxt.async_support.okx):
|
|
1297
1297
|
raise BadRequest(self.id + ' createOrderWs() does not support algo trading. self.options["createOrderWs"]["op"] must be either order or batch-order')
|
1298
1298
|
if (op != 'order') and (op != 'batch-orders'):
|
1299
1299
|
raise BadRequest(self.id + ' createOrderWs() does not support algo trading. self.options["createOrderWs"]["op"] must be either order or privatePostTradeOrder or privatePostTradeOrderAlgo')
|
1300
|
-
request = {
|
1300
|
+
request: dict = {
|
1301
1301
|
'id': messageHash,
|
1302
1302
|
'op': op,
|
1303
1303
|
'args': [args],
|
@@ -1357,7 +1357,7 @@ class okx(ccxt.async_support.okx):
|
|
1357
1357
|
op = None
|
1358
1358
|
op, params = self.handle_option_and_params(params, 'editOrderWs', 'op', 'amend-order')
|
1359
1359
|
args = self.edit_order_request(id, symbol, type, side, amount, price, params)
|
1360
|
-
request = {
|
1360
|
+
request: dict = {
|
1361
1361
|
'id': messageHash,
|
1362
1362
|
'op': op,
|
1363
1363
|
'args': [args],
|
@@ -1382,14 +1382,14 @@ class okx(ccxt.async_support.okx):
|
|
1382
1382
|
messageHash = str(self.nonce())
|
1383
1383
|
clientOrderId = self.safe_string_2(params, 'clOrdId', 'clientOrderId')
|
1384
1384
|
params = self.omit(params, ['clientOrderId', 'clOrdId'])
|
1385
|
-
arg = {
|
1385
|
+
arg: dict = {
|
1386
1386
|
'instId': self.market_id(symbol),
|
1387
1387
|
}
|
1388
1388
|
if clientOrderId is not None:
|
1389
1389
|
arg['clOrdId'] = clientOrderId
|
1390
1390
|
else:
|
1391
1391
|
arg['ordId'] = id
|
1392
|
-
request = {
|
1392
|
+
request: dict = {
|
1393
1393
|
'id': messageHash,
|
1394
1394
|
'op': 'cancel-order',
|
1395
1395
|
'args': [self.extend(arg, params)],
|
@@ -1416,12 +1416,12 @@ class okx(ccxt.async_support.okx):
|
|
1416
1416
|
messageHash = str(self.nonce())
|
1417
1417
|
args = []
|
1418
1418
|
for i in range(0, idsLength):
|
1419
|
-
arg = {
|
1419
|
+
arg: dict = {
|
1420
1420
|
'instId': self.market_id(symbol),
|
1421
1421
|
'ordId': ids[i],
|
1422
1422
|
}
|
1423
1423
|
args.append(arg)
|
1424
|
-
request = {
|
1424
|
+
request: dict = {
|
1425
1425
|
'id': messageHash,
|
1426
1426
|
'op': 'batch-cancel-orders',
|
1427
1427
|
'args': args,
|
@@ -1445,7 +1445,7 @@ class okx(ccxt.async_support.okx):
|
|
1445
1445
|
raise BadRequest(self.id + 'cancelAllOrdersWs is only applicable to Option in Portfolio Margin mode, and MMP privilege is required.')
|
1446
1446
|
url = self.get_url('private', 'private')
|
1447
1447
|
messageHash = str(self.nonce())
|
1448
|
-
request = {
|
1448
|
+
request: dict = {
|
1449
1449
|
'id': messageHash,
|
1450
1450
|
'op': 'mass-cancel',
|
1451
1451
|
'args': [self.extend({
|
@@ -1565,7 +1565,7 @@ class okx(ccxt.async_support.okx):
|
|
1565
1565
|
# if table is None:
|
1566
1566
|
event = self.safe_string_2(message, 'event', 'op')
|
1567
1567
|
if event is not None:
|
1568
|
-
methods = {
|
1568
|
+
methods: dict = {
|
1569
1569
|
# 'info': self.handleSystemStatus,
|
1570
1570
|
# 'book': 'handleOrderBook',
|
1571
1571
|
'login': self.handle_authenticate,
|
@@ -1583,7 +1583,7 @@ class okx(ccxt.async_support.okx):
|
|
1583
1583
|
else:
|
1584
1584
|
arg = self.safe_value(message, 'arg', {})
|
1585
1585
|
channel = self.safe_string(arg, 'channel')
|
1586
|
-
methods = {
|
1586
|
+
methods: dict = {
|
1587
1587
|
'bbo-tbt': self.handle_order_book, # newly added channel that sends tick-by-tick Level 1 data, all API users can subscribe, public depth channel, verification not required
|
1588
1588
|
'books': self.handle_order_book, # all API users can subscribe, public depth channel, verification not required
|
1589
1589
|
'books5': self.handle_order_book, # all API users can subscribe, public depth channel, verification not required, data feeds will be delivered every 100ms(vs. every 200ms now)
|
ccxt/pro/onetrading.py
CHANGED
@@ -91,7 +91,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
91
91
|
messageHash = 'balance'
|
92
92
|
subscribeHash = 'ACCOUNT_HISTORY'
|
93
93
|
bpRemainingQuota = self.safe_integer(self.options, 'bp_remaining_quota', 200)
|
94
|
-
subscribe = {
|
94
|
+
subscribe: dict = {
|
95
95
|
'type': 'SUBSCRIBE',
|
96
96
|
'bp_remaining_quota': bpRemainingQuota,
|
97
97
|
'channels': [
|
@@ -149,7 +149,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
149
149
|
symbol = market['symbol']
|
150
150
|
subscriptionHash = 'MARKET_TICKER'
|
151
151
|
messageHash = 'ticker.' + symbol
|
152
|
-
request = {
|
152
|
+
request: dict = {
|
153
153
|
'type': 'SUBSCRIBE',
|
154
154
|
'channels': [
|
155
155
|
{
|
@@ -174,7 +174,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
174
174
|
symbols = []
|
175
175
|
subscriptionHash = 'MARKET_TICKER'
|
176
176
|
messageHash = 'tickers'
|
177
|
-
request = {
|
177
|
+
request: dict = {
|
178
178
|
'type': 'SUBSCRIBE',
|
179
179
|
'channels': [
|
180
180
|
{
|
@@ -272,7 +272,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
272
272
|
url = self.urls['api']['ws']
|
273
273
|
subscribeHash = 'ACCOUNT_HISTORY'
|
274
274
|
bpRemainingQuota = self.safe_integer(self.options, 'bp_remaining_quota', 200)
|
275
|
-
subscribe = {
|
275
|
+
subscribe: dict = {
|
276
276
|
'type': 'SUBSCRIBE',
|
277
277
|
'bp_remaining_quota': bpRemainingQuota,
|
278
278
|
'channels': [
|
@@ -308,7 +308,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
308
308
|
depth = 0
|
309
309
|
if limit is not None:
|
310
310
|
depth = limit
|
311
|
-
request = {
|
311
|
+
request: dict = {
|
312
312
|
'type': 'SUBSCRIBE',
|
313
313
|
'channels': [
|
314
314
|
{
|
@@ -418,7 +418,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
418
418
|
url = self.urls['api']['ws']
|
419
419
|
subscribeHash = self.safe_string(params, 'channel', 'ACCOUNT_HISTORY')
|
420
420
|
bpRemainingQuota = self.safe_integer(self.options, 'bp_remaining_quota', 200)
|
421
|
-
subscribe = {
|
421
|
+
subscribe: dict = {
|
422
422
|
'type': 'SUBSCRIBE',
|
423
423
|
'bp_remaining_quota': bpRemainingQuota,
|
424
424
|
'channels': [
|
@@ -604,7 +604,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
604
604
|
}, market)
|
605
605
|
|
606
606
|
def parse_trading_order_status(self, status):
|
607
|
-
statuses = {
|
607
|
+
statuses: dict = {
|
608
608
|
'CANCELLED': 'canceled',
|
609
609
|
'SELF_TRADE': 'rejected',
|
610
610
|
'FILLED_FULLY': 'closed',
|
@@ -938,7 +938,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
938
938
|
status = self.parse_ws_order_status(updateType)
|
939
939
|
if updateType == 'ORDER_CLOSED' and filled == 0:
|
940
940
|
status = 'canceled'
|
941
|
-
orderObject = {
|
941
|
+
orderObject: dict = {
|
942
942
|
'id': orderId,
|
943
943
|
'symbol': symbol,
|
944
944
|
'status': status,
|
@@ -968,7 +968,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
968
968
|
client.resolve(self.myTrades, 'myTrades')
|
969
969
|
|
970
970
|
def parse_ws_order_status(self, status):
|
971
|
-
statuses = {
|
971
|
+
statuses: dict = {
|
972
972
|
'ORDER_REJECTED': 'rejected',
|
973
973
|
'ORDER_CLOSED': 'closed',
|
974
974
|
'STOP_ORDER_TRIGGERED': 'triggered',
|
@@ -1037,12 +1037,12 @@ class onetrading(ccxt.async_support.onetrading):
|
|
1037
1037
|
marketIdtimeframes = list(subscription[marketIds[i]].keys())
|
1038
1038
|
for ii in range(0, len(marketIdtimeframes)):
|
1039
1039
|
marketTimeframeId = self.safe_value(timeframes, timeframe)
|
1040
|
-
property = {
|
1040
|
+
property: dict = {
|
1041
1041
|
'instrument_code': marketIds[i],
|
1042
1042
|
'time_granularity': marketTimeframeId,
|
1043
1043
|
}
|
1044
1044
|
properties.append(property)
|
1045
|
-
request = {
|
1045
|
+
request: dict = {
|
1046
1046
|
'type': type,
|
1047
1047
|
'channels': [
|
1048
1048
|
{
|
@@ -1166,7 +1166,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
1166
1166
|
self.handle_error_message(client, message)
|
1167
1167
|
return
|
1168
1168
|
type = self.safe_value(message, 'type')
|
1169
|
-
handlers = {
|
1169
|
+
handlers: dict = {
|
1170
1170
|
'ORDER_BOOK_UPDATE': self.handle_order_book,
|
1171
1171
|
'ORDER_BOOK_SNAPSHOT': self.handle_order_book,
|
1172
1172
|
'ACTIVE_ORDERS_SNAPSHOT': self.handle_orders,
|
@@ -1267,7 +1267,7 @@ class onetrading(ccxt.async_support.onetrading):
|
|
1267
1267
|
authenticated = self.safe_value(client.subscriptions, messageHash)
|
1268
1268
|
if authenticated is None:
|
1269
1269
|
self.check_required_credentials()
|
1270
|
-
request = {
|
1270
|
+
request: dict = {
|
1271
1271
|
'type': 'AUTHENTICATE',
|
1272
1272
|
'api_token': self.apiKey,
|
1273
1273
|
}
|
ccxt/pro/p2b.py
CHANGED
@@ -75,7 +75,7 @@ class p2b(ccxt.async_support.p2b):
|
|
75
75
|
:returns dict: data from the websocket stream
|
76
76
|
"""
|
77
77
|
url = self.urls['api']['ws']
|
78
|
-
subscribe = {
|
78
|
+
subscribe: dict = {
|
79
79
|
'method': name,
|
80
80
|
'params': request,
|
81
81
|
'id': self.milliseconds(),
|
@@ -371,7 +371,7 @@ class p2b(ccxt.async_support.p2b):
|
|
371
371
|
self.handle_pong(client, message)
|
372
372
|
return
|
373
373
|
method = self.safe_string(message, 'method')
|
374
|
-
methods = {
|
374
|
+
methods: dict = {
|
375
375
|
'depth.update': self.handle_order_book,
|
376
376
|
'price.update': self.handle_ticker,
|
377
377
|
'kline.update': self.handle_ohlcv,
|