bitget 0.0.82__py3-none-any.whl → 0.0.83__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.
- bitget/ccxt/__init__.py +1 -1
- bitget/ccxt/async_support/__init__.py +1 -1
- bitget/ccxt/async_support/base/exchange.py +1 -1
- bitget/ccxt/base/exchange.py +7 -1
- bitget/ccxt/pro/__init__.py +1 -1
- bitget/ccxt/pro/bitget.py +179 -51
- {bitget-0.0.82.dist-info → bitget-0.0.83.dist-info}/METADATA +2 -2
- {bitget-0.0.82.dist-info → bitget-0.0.83.dist-info}/RECORD +9 -9
- {bitget-0.0.82.dist-info → bitget-0.0.83.dist-info}/WHEEL +0 -0
bitget/ccxt/__init__.py
CHANGED
bitget/ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.5.
|
7
|
+
__version__ = '4.5.1'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2337,6 +2337,12 @@ class Exchange(object):
|
|
2337
2337
|
# return the first index of the cache that can be applied to the orderbook or -1 if not possible
|
2338
2338
|
return -1
|
2339
2339
|
|
2340
|
+
def arrays_concat(self, arraysOfArrays: List[Any]):
|
2341
|
+
result = []
|
2342
|
+
for i in range(0, len(arraysOfArrays)):
|
2343
|
+
result = self.array_concat(result, arraysOfArrays[i])
|
2344
|
+
return result
|
2345
|
+
|
2340
2346
|
def find_timeframe(self, timeframe, timeframes=None):
|
2341
2347
|
if timeframes is None:
|
2342
2348
|
timeframes = self.timeframes
|
bitget/ccxt/pro/__init__.py
CHANGED
bitget/ccxt/pro/bitget.py
CHANGED
@@ -54,10 +54,14 @@ class bitget(bitgetAsync):
|
|
54
54
|
'ws': {
|
55
55
|
'public': 'wss://ws.bitget.com/v2/ws/public',
|
56
56
|
'private': 'wss://ws.bitget.com/v2/ws/private',
|
57
|
+
'utaPublic': 'wss://ws.bitget.com/v3/ws/public',
|
58
|
+
'utaPrivate': 'wss://ws.bitget.com/v3/ws/private',
|
57
59
|
},
|
58
60
|
'demo': {
|
59
61
|
'public': 'wss://wspap.bitget.com/v2/ws/public',
|
60
62
|
'private': 'wss://wspap.bitget.com/v2/ws/private',
|
63
|
+
'utaPublic': 'wss://wspap.bitget.com/v3/ws/public',
|
64
|
+
'utaPrivate': 'wss://wspap.bitget.com/v3/ws/private',
|
61
65
|
},
|
62
66
|
},
|
63
67
|
},
|
@@ -109,7 +113,9 @@ class bitget(bitgetAsync):
|
|
109
113
|
},
|
110
114
|
})
|
111
115
|
|
112
|
-
def get_inst_type(self, market, params={}):
|
116
|
+
def get_inst_type(self, market, uta: bool = False, params={}):
|
117
|
+
if (uta is None) or not uta:
|
118
|
+
uta, params = self.handle_option_and_params(params, 'getInstType', 'uta', False)
|
113
119
|
instType = None
|
114
120
|
if market is None:
|
115
121
|
instType, params = self.handleProductTypeAndParams(None, params)
|
@@ -120,6 +126,8 @@ class bitget(bitgetAsync):
|
|
120
126
|
instypeAux = None
|
121
127
|
instypeAux, params = self.handle_option_and_params(params, 'getInstType', 'instType', instType)
|
122
128
|
instType = instypeAux
|
129
|
+
if uta:
|
130
|
+
instType = instType.lower()
|
123
131
|
return [instType, params]
|
124
132
|
|
125
133
|
async def watch_ticker(self, symbol: str, params={}) -> Ticker:
|
@@ -128,9 +136,11 @@ class bitget(bitgetAsync):
|
|
128
136
|
|
129
137
|
https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
|
130
138
|
https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
|
139
|
+
https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
|
131
140
|
|
132
141
|
:param str symbol: unified symbol of the market to watch the ticker for
|
133
142
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
143
|
+
:param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
|
134
144
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
135
145
|
"""
|
136
146
|
await self.load_markets()
|
@@ -138,12 +148,16 @@ class bitget(bitgetAsync):
|
|
138
148
|
symbol = market['symbol']
|
139
149
|
messageHash = 'ticker:' + symbol
|
140
150
|
instType = None
|
141
|
-
|
151
|
+
uta = None
|
152
|
+
uta, params = self.handle_option_and_params(params, 'watchTicker', 'uta', False)
|
153
|
+
instType, params = self.get_inst_type(market, uta, params)
|
142
154
|
args: dict = {
|
143
155
|
'instType': instType,
|
144
|
-
'channel': 'ticker',
|
145
|
-
'instId': market['id'],
|
146
156
|
}
|
157
|
+
topicOrChannel = 'topic' if uta else 'channel'
|
158
|
+
symbolOrInstId = 'symbol' if uta else 'instId'
|
159
|
+
args[topicOrChannel] = 'ticker'
|
160
|
+
args[symbolOrInstId] = market['id']
|
147
161
|
return await self.watch_public(messageHash, args, params)
|
148
162
|
|
149
163
|
async def un_watch_ticker(self, symbol: str, params={}) -> Any:
|
@@ -166,16 +180,20 @@ class bitget(bitgetAsync):
|
|
166
180
|
|
167
181
|
https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
|
168
182
|
https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
|
183
|
+
https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
|
169
184
|
|
170
185
|
:param str[] symbols: unified symbol of the market to watch the tickers for
|
171
186
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
187
|
+
:param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
|
172
188
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
173
189
|
"""
|
174
190
|
await self.load_markets()
|
175
191
|
symbols = self.market_symbols(symbols, None, False)
|
176
192
|
market = self.market(symbols[0])
|
177
193
|
instType = None
|
178
|
-
|
194
|
+
uta = None
|
195
|
+
uta, params = self.handle_option_and_params(params, 'watchTickers', 'uta', False)
|
196
|
+
instType, params = self.get_inst_type(market, uta, params)
|
179
197
|
topics = []
|
180
198
|
messageHashes = []
|
181
199
|
for i in range(0, len(symbols)):
|
@@ -183,9 +201,11 @@ class bitget(bitgetAsync):
|
|
183
201
|
marketInner = self.market(symbol)
|
184
202
|
args: dict = {
|
185
203
|
'instType': instType,
|
186
|
-
'channel': 'ticker',
|
187
|
-
'instId': marketInner['id'],
|
188
204
|
}
|
205
|
+
topicOrChannel = 'topic' if uta else 'channel'
|
206
|
+
symbolOrInstId = 'symbol' if uta else 'instId'
|
207
|
+
args[topicOrChannel] = 'ticker'
|
208
|
+
args[symbolOrInstId] = marketInner['id']
|
189
209
|
topics.append(args)
|
190
210
|
messageHashes.append('ticker:' + symbol)
|
191
211
|
tickers = await self.watch_public_multiple(messageHashes, topics, params)
|
@@ -196,6 +216,8 @@ class bitget(bitgetAsync):
|
|
196
216
|
return self.filter_by_array(self.tickers, 'symbol', symbols)
|
197
217
|
|
198
218
|
def handle_ticker(self, client: Client, message):
|
219
|
+
#
|
220
|
+
# default
|
199
221
|
#
|
200
222
|
# {
|
201
223
|
# "action": "snapshot",
|
@@ -226,6 +248,29 @@ class bitget(bitgetAsync):
|
|
226
248
|
# "ts": 1701842994341
|
227
249
|
# }
|
228
250
|
#
|
251
|
+
# uta
|
252
|
+
#
|
253
|
+
# {
|
254
|
+
# "action": "snapshot",
|
255
|
+
# "arg": {"instType": "spot", topic: "ticker", symbol: "BTCUSDT"},
|
256
|
+
# "data": [
|
257
|
+
# {
|
258
|
+
# "highPrice24h": "120255.61",
|
259
|
+
# "lowPrice24h": "116145.88",
|
260
|
+
# "openPrice24h": "118919.38",
|
261
|
+
# "lastPrice": "119818.83",
|
262
|
+
# "turnover24h": "215859996.272276",
|
263
|
+
# "volume24h": "1819.756798",
|
264
|
+
# "bid1Price": "119811.26",
|
265
|
+
# "ask1Price": "119831.18",
|
266
|
+
# "bid1Size": "0.008732",
|
267
|
+
# "ask1Size": "0.004297",
|
268
|
+
# "price24hPcnt": "0.02002"
|
269
|
+
# }
|
270
|
+
# ],
|
271
|
+
# "ts": 1753230479687
|
272
|
+
# }
|
273
|
+
#
|
229
274
|
self.handle_bid_ask(client, message)
|
230
275
|
ticker = self.parse_ws_ticker(message)
|
231
276
|
symbol = ticker['symbol']
|
@@ -304,56 +349,85 @@ class bitget(bitgetAsync):
|
|
304
349
|
# "ts": 1701843962812
|
305
350
|
# }
|
306
351
|
#
|
352
|
+
# uta
|
353
|
+
#
|
354
|
+
# {
|
355
|
+
# "action": "snapshot",
|
356
|
+
# "arg": {"instType": "spot", topic: "ticker", symbol: "BTCUSDT"},
|
357
|
+
# "data": [
|
358
|
+
# {
|
359
|
+
# "highPrice24h": "120255.61",
|
360
|
+
# "lowPrice24h": "116145.88",
|
361
|
+
# "openPrice24h": "118919.38",
|
362
|
+
# "lastPrice": "119818.83",
|
363
|
+
# "turnover24h": "215859996.272276",
|
364
|
+
# "volume24h": "1819.756798",
|
365
|
+
# "bid1Price": "119811.26",
|
366
|
+
# "ask1Price": "119831.18",
|
367
|
+
# "bid1Size": "0.008732",
|
368
|
+
# "ask1Size": "0.004297",
|
369
|
+
# "price24hPcnt": "0.02002"
|
370
|
+
# }
|
371
|
+
# ],
|
372
|
+
# "ts": 1753230479687
|
373
|
+
# }
|
374
|
+
#
|
307
375
|
arg = self.safe_value(message, 'arg', {})
|
308
376
|
data = self.safe_value(message, 'data', [])
|
309
377
|
ticker = self.safe_value(data, 0, {})
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
378
|
+
utaTimestamp = self.safe_integer(message, 'ts')
|
379
|
+
timestamp = self.safe_integer(ticker, 'ts', utaTimestamp)
|
380
|
+
instType = self.safe_string_lower(arg, 'instType')
|
381
|
+
marketType = 'spot' if (instType == 'spot') else 'contract'
|
382
|
+
utaMarketId = self.safe_string(arg, 'symbol')
|
383
|
+
marketId = self.safe_string(ticker, 'instId', utaMarketId)
|
314
384
|
market = self.safe_market(marketId, market, None, marketType)
|
315
|
-
close = self.
|
316
|
-
changeDecimal = self.safe_string(ticker, 'change24h')
|
317
|
-
change = Precise.string_mul(changeDecimal, '100')
|
385
|
+
close = self.safe_string_2(ticker, 'lastPr', 'lastPrice')
|
386
|
+
changeDecimal = self.safe_string(ticker, 'change24h', '')
|
387
|
+
change = self.safe_string(ticker, 'price24hPcnt', Precise.string_mul(changeDecimal, '100'))
|
318
388
|
return self.safe_ticker({
|
319
389
|
'symbol': market['symbol'],
|
320
390
|
'timestamp': timestamp,
|
321
391
|
'datetime': self.iso8601(timestamp),
|
322
|
-
'high': self.
|
323
|
-
'low': self.
|
324
|
-
'bid': self.
|
325
|
-
'bidVolume': self.
|
326
|
-
'ask': self.
|
327
|
-
'askVolume': self.
|
392
|
+
'high': self.safe_string_2(ticker, 'high24h', 'highPrice24h'),
|
393
|
+
'low': self.safe_string_2(ticker, 'low24h', 'lowPrice24h'),
|
394
|
+
'bid': self.safe_string_2(ticker, 'bidPr', 'bid1Price'),
|
395
|
+
'bidVolume': self.safe_string_2(ticker, 'bidSz', 'bid1Size'),
|
396
|
+
'ask': self.safe_string_2(ticker, 'askPr', 'ask1Price'),
|
397
|
+
'askVolume': self.safe_string_2(ticker, 'askSz', 'ask1Size'),
|
328
398
|
'vwap': None,
|
329
|
-
'open': self.
|
399
|
+
'open': self.safe_string_2(ticker, 'open24h', 'openPrice24h'),
|
330
400
|
'close': close,
|
331
401
|
'last': close,
|
332
402
|
'previousClose': None,
|
333
403
|
'change': None,
|
334
404
|
'percentage': change,
|
335
405
|
'average': None,
|
336
|
-
'baseVolume': self.
|
337
|
-
'quoteVolume': self.
|
406
|
+
'baseVolume': self.safe_string_2(ticker, 'baseVolume', 'volume24h'),
|
407
|
+
'quoteVolume': self.safe_string_2(ticker, 'quoteVolume', 'turnover24h'),
|
338
408
|
'info': ticker,
|
339
409
|
}, market)
|
340
410
|
|
341
411
|
async def watch_bids_asks(self, symbols: Strings = None, params={}) -> Tickers:
|
342
412
|
"""
|
413
|
+
watches best bid & ask for symbols
|
343
414
|
|
344
415
|
https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
|
345
416
|
https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
|
417
|
+
https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
|
346
418
|
|
347
|
-
watches best bid & ask for symbols
|
348
419
|
:param str[] symbols: unified symbol of the market to fetch the ticker for
|
349
420
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
421
|
+
:param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
|
350
422
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
351
423
|
"""
|
352
424
|
await self.load_markets()
|
353
425
|
symbols = self.market_symbols(symbols, None, False)
|
354
426
|
market = self.market(symbols[0])
|
355
427
|
instType = None
|
356
|
-
|
428
|
+
uta = None
|
429
|
+
uta, params = self.handle_option_and_params(params, 'watchBidsAsks', 'uta', False)
|
430
|
+
instType, params = self.get_inst_type(market, uta, params)
|
357
431
|
topics = []
|
358
432
|
messageHashes = []
|
359
433
|
for i in range(0, len(symbols)):
|
@@ -361,9 +435,11 @@ class bitget(bitgetAsync):
|
|
361
435
|
marketInner = self.market(symbol)
|
362
436
|
args: dict = {
|
363
437
|
'instType': instType,
|
364
|
-
'channel': 'ticker',
|
365
|
-
'instId': marketInner['id'],
|
366
438
|
}
|
439
|
+
topicOrChannel = 'topic' if uta else 'channel'
|
440
|
+
symbolOrInstId = 'symbol' if uta else 'instId'
|
441
|
+
args[topicOrChannel] = 'ticker'
|
442
|
+
args[symbolOrInstId] = marketInner['id']
|
367
443
|
topics.append(args)
|
368
444
|
messageHashes.append('bidask:' + symbol)
|
369
445
|
tickers = await self.watch_public_multiple(messageHashes, topics, params)
|
@@ -384,19 +460,21 @@ class bitget(bitgetAsync):
|
|
384
460
|
arg = self.safe_value(message, 'arg', {})
|
385
461
|
data = self.safe_value(message, 'data', [])
|
386
462
|
ticker = self.safe_value(data, 0, {})
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
463
|
+
utaTimestamp = self.safe_integer(message, 'ts')
|
464
|
+
timestamp = self.safe_integer(ticker, 'ts', utaTimestamp)
|
465
|
+
instType = self.safe_string_lower(arg, 'instType')
|
466
|
+
marketType = 'spot' if (instType == 'spot') else 'contract'
|
467
|
+
utaMarketId = self.safe_string(arg, 'symbol')
|
468
|
+
marketId = self.safe_string(ticker, 'instId', utaMarketId)
|
391
469
|
market = self.safe_market(marketId, market, None, marketType)
|
392
470
|
return self.safe_ticker({
|
393
471
|
'symbol': market['symbol'],
|
394
472
|
'timestamp': timestamp,
|
395
473
|
'datetime': self.iso8601(timestamp),
|
396
|
-
'ask': self.
|
397
|
-
'askVolume': self.
|
398
|
-
'bid': self.
|
399
|
-
'bidVolume': self.
|
474
|
+
'ask': self.safe_string_2(ticker, 'askPr', 'ask1Price'),
|
475
|
+
'askVolume': self.safe_string_2(ticker, 'askSz', 'ask1Size'),
|
476
|
+
'bid': self.safe_string_2(ticker, 'bidPr', 'bid1Price'),
|
477
|
+
'bidVolume': self.safe_string_2(ticker, 'bidSz', 'bid1Size'),
|
400
478
|
'info': ticker,
|
401
479
|
}, market)
|
402
480
|
|
@@ -421,7 +499,7 @@ class bitget(bitgetAsync):
|
|
421
499
|
interval = self.safe_string(timeframes, timeframe)
|
422
500
|
messageHash = 'candles:' + timeframe + ':' + symbol
|
423
501
|
instType = None
|
424
|
-
instType, params = self.get_inst_type(market, params)
|
502
|
+
instType, params = self.get_inst_type(market, False, params)
|
425
503
|
args: dict = {
|
426
504
|
'instType': instType,
|
427
505
|
'channel': 'candle' + interval,
|
@@ -569,7 +647,7 @@ class bitget(bitgetAsync):
|
|
569
647
|
market = self.market(symbol)
|
570
648
|
messageHash = 'unsubscribe:' + messageHashTopic + ':' + market['symbol']
|
571
649
|
instType = None
|
572
|
-
instType, params = self.get_inst_type(market, params)
|
650
|
+
instType, params = self.get_inst_type(market, False, params)
|
573
651
|
args: dict = {
|
574
652
|
'instType': instType,
|
575
653
|
'channel': channel,
|
@@ -602,7 +680,7 @@ class bitget(bitgetAsync):
|
|
602
680
|
symbol = symbols[i]
|
603
681
|
market = self.market(symbol)
|
604
682
|
instType = None
|
605
|
-
instType, params = self.get_inst_type(market, params)
|
683
|
+
instType, params = self.get_inst_type(market, False, params)
|
606
684
|
args: dict = {
|
607
685
|
'instType': instType,
|
608
686
|
'channel': channel,
|
@@ -760,7 +838,7 @@ class bitget(bitgetAsync):
|
|
760
838
|
symbol = symbols[i]
|
761
839
|
market = self.market(symbol)
|
762
840
|
instType = None
|
763
|
-
instType, params = self.get_inst_type(market, params)
|
841
|
+
instType, params = self.get_inst_type(market, False, params)
|
764
842
|
args: dict = {
|
765
843
|
'instType': instType,
|
766
844
|
'channel': 'trade',
|
@@ -944,7 +1022,7 @@ class bitget(bitgetAsync):
|
|
944
1022
|
symbols = self.market_symbols(symbols)
|
945
1023
|
if not self.is_empty(symbols):
|
946
1024
|
market = self.get_market_from_symbols(symbols)
|
947
|
-
instType, params = self.get_inst_type(market, params)
|
1025
|
+
instType, params = self.get_inst_type(market, False, params)
|
948
1026
|
messageHash = instType + ':positions' + messageHash
|
949
1027
|
args: dict = {
|
950
1028
|
'instType': instType,
|
@@ -1139,7 +1217,7 @@ class bitget(bitgetAsync):
|
|
1139
1217
|
if market is None and type == 'spot':
|
1140
1218
|
instType = 'SPOT'
|
1141
1219
|
else:
|
1142
|
-
instType, params = self.get_inst_type(market, params)
|
1220
|
+
instType, params = self.get_inst_type(market, False, params)
|
1143
1221
|
if type == 'spot' and (symbol is not None):
|
1144
1222
|
subscriptionHash = subscriptionHash + ':' + symbol
|
1145
1223
|
if isTrigger:
|
@@ -1490,7 +1568,7 @@ class bitget(bitgetAsync):
|
|
1490
1568
|
if market is None and type == 'spot':
|
1491
1569
|
instType = 'spot'
|
1492
1570
|
else:
|
1493
|
-
instType, params = self.get_inst_type(market, params)
|
1571
|
+
instType, params = self.get_inst_type(market, False, params)
|
1494
1572
|
subscriptionHash = 'fill:' + instType
|
1495
1573
|
args: dict = {
|
1496
1574
|
'instType': instType,
|
@@ -1711,12 +1789,21 @@ class bitget(bitgetAsync):
|
|
1711
1789
|
client.resolve(self.balance, messageHash)
|
1712
1790
|
|
1713
1791
|
async def watch_public(self, messageHash, args, params={}):
|
1714
|
-
|
1792
|
+
uta = None
|
1793
|
+
url = None
|
1794
|
+
uta, params = self.handle_option_and_params(params, 'watchPublic', 'uta', False)
|
1795
|
+
if uta:
|
1796
|
+
url = self.urls['api']['ws']['utaPublic']
|
1797
|
+
else:
|
1798
|
+
url = self.urls['api']['ws']['public']
|
1715
1799
|
sandboxMode = self.safe_bool_2(self.options, 'sandboxMode', 'sandbox', False)
|
1716
1800
|
if sandboxMode:
|
1717
1801
|
instType = self.safe_string(args, 'instType')
|
1718
1802
|
if (instType != 'SCOIN-FUTURES') and (instType != 'SUSDT-FUTURES') and (instType != 'SUSDC-FUTURES'):
|
1719
|
-
|
1803
|
+
if uta:
|
1804
|
+
url = self.urls['api']['demo']['utaPublic']
|
1805
|
+
else:
|
1806
|
+
url = self.urls['api']['demo']['public']
|
1720
1807
|
request: dict = {
|
1721
1808
|
'op': 'subscribe',
|
1722
1809
|
'args': [args],
|
@@ -1725,12 +1812,21 @@ class bitget(bitgetAsync):
|
|
1725
1812
|
return await self.watch(url, messageHash, message, messageHash)
|
1726
1813
|
|
1727
1814
|
async def un_watch_public(self, messageHash, args, params={}):
|
1728
|
-
|
1815
|
+
uta = None
|
1816
|
+
url = None
|
1817
|
+
uta, params = self.handle_option_and_params(params, 'unWatchPublic', 'uta', False)
|
1818
|
+
if uta:
|
1819
|
+
url = self.urls['api']['ws']['utaPublic']
|
1820
|
+
else:
|
1821
|
+
url = self.urls['api']['ws']['public']
|
1729
1822
|
sandboxMode = self.safe_bool_2(self.options, 'sandboxMode', 'sandbox', False)
|
1730
1823
|
if sandboxMode:
|
1731
1824
|
instType = self.safe_string(args, 'instType')
|
1732
1825
|
if (instType != 'SCOIN-FUTURES') and (instType != 'SUSDT-FUTURES') and (instType != 'SUSDC-FUTURES'):
|
1733
|
-
|
1826
|
+
if uta:
|
1827
|
+
url = self.urls['api']['demo']['utaPublic']
|
1828
|
+
else:
|
1829
|
+
url = self.urls['api']['demo']['public']
|
1734
1830
|
request: dict = {
|
1735
1831
|
'op': 'unsubscribe',
|
1736
1832
|
'args': [args],
|
@@ -1739,13 +1835,22 @@ class bitget(bitgetAsync):
|
|
1739
1835
|
return await self.watch(url, messageHash, message, messageHash)
|
1740
1836
|
|
1741
1837
|
async def watch_public_multiple(self, messageHashes, argsArray, params={}):
|
1742
|
-
|
1838
|
+
uta = None
|
1839
|
+
url = None
|
1840
|
+
uta, params = self.handle_option_and_params(params, 'watchPublicMultiple', 'uta', False)
|
1841
|
+
if uta:
|
1842
|
+
url = self.urls['api']['ws']['utaPublic']
|
1843
|
+
else:
|
1844
|
+
url = self.urls['api']['ws']['public']
|
1743
1845
|
sandboxMode = self.safe_bool_2(self.options, 'sandboxMode', 'sandbox', False)
|
1744
1846
|
if sandboxMode:
|
1745
1847
|
argsArrayFirst = self.safe_dict(argsArray, 0, {})
|
1746
1848
|
instType = self.safe_string(argsArrayFirst, 'instType')
|
1747
1849
|
if (instType != 'SCOIN-FUTURES') and (instType != 'SUSDT-FUTURES') and (instType != 'SUSDC-FUTURES'):
|
1748
|
-
|
1850
|
+
if uta:
|
1851
|
+
url = self.urls['api']['demo']['utaPublic']
|
1852
|
+
else:
|
1853
|
+
url = self.urls['api']['demo']['public']
|
1749
1854
|
request: dict = {
|
1750
1855
|
'op': 'subscribe',
|
1751
1856
|
'args': argsArray,
|
@@ -1874,6 +1979,29 @@ class bitget(bitgetAsync):
|
|
1874
1979
|
# ]
|
1875
1980
|
# }
|
1876
1981
|
#
|
1982
|
+
# uta
|
1983
|
+
#
|
1984
|
+
# {
|
1985
|
+
# "action": "snapshot",
|
1986
|
+
# "arg": {"instType": "spot", topic: "ticker", symbol: "BTCUSDT"},
|
1987
|
+
# "data": [
|
1988
|
+
# {
|
1989
|
+
# "highPrice24h": "120255.61",
|
1990
|
+
# "lowPrice24h": "116145.88",
|
1991
|
+
# "openPrice24h": "118919.38",
|
1992
|
+
# "lastPrice": "119818.83",
|
1993
|
+
# "turnover24h": "215859996.272276",
|
1994
|
+
# "volume24h": "1819.756798",
|
1995
|
+
# "bid1Price": "119811.26",
|
1996
|
+
# "ask1Price": "119831.18",
|
1997
|
+
# "bid1Size": "0.008732",
|
1998
|
+
# "ask1Size": "0.004297",
|
1999
|
+
# "price24hPcnt": "0.02002"
|
2000
|
+
# }
|
2001
|
+
# ],
|
2002
|
+
# "ts": 1753230479687
|
2003
|
+
# }
|
2004
|
+
#
|
1877
2005
|
if self.handle_error_message(client, message):
|
1878
2006
|
return
|
1879
2007
|
content = self.safe_string(message, 'message')
|
@@ -1908,7 +2036,7 @@ class bitget(bitgetAsync):
|
|
1908
2036
|
'account-crossed': self.handle_balance,
|
1909
2037
|
}
|
1910
2038
|
arg = self.safe_value(message, 'arg', {})
|
1911
|
-
topic = self.
|
2039
|
+
topic = self.safe_value_2(arg, 'channel', 'topic', '')
|
1912
2040
|
method = self.safe_value(methods, topic)
|
1913
2041
|
if method is not None:
|
1914
2042
|
method(client, message)
|
@@ -1984,7 +2112,7 @@ class bitget(bitgetAsync):
|
|
1984
2112
|
arg = self.safe_dict(message, 'arg', {})
|
1985
2113
|
instType = self.safe_string_lower(arg, 'instType')
|
1986
2114
|
type = 'spot' if (instType == 'spot') else 'contract'
|
1987
|
-
instId = self.
|
2115
|
+
instId = self.safe_string_2(arg, 'instId', 'symbol')
|
1988
2116
|
market = self.safe_market(instId, None, None, type)
|
1989
2117
|
symbol = market['symbol']
|
1990
2118
|
messageHash = 'unsubscribe:ticker:' + market['symbol']
|
@@ -2045,7 +2173,7 @@ class bitget(bitgetAsync):
|
|
2045
2173
|
argsList = [self.safe_dict(message, 'arg', {})]
|
2046
2174
|
for i in range(0, len(argsList)):
|
2047
2175
|
arg = argsList[i]
|
2048
|
-
channel = self.
|
2176
|
+
channel = self.safe_string_2(arg, 'channel', 'topic')
|
2049
2177
|
if channel == 'books':
|
2050
2178
|
# for now only unWatchOrderBook is supporteod
|
2051
2179
|
self.handle_order_book_un_subscription(client, message)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bitget
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.83
|
4
4
|
Summary: bitget crypto exchange api client
|
5
5
|
Project-URL: Homepage, https://github.com/ccxt/ccxt
|
6
6
|
Project-URL: Issues, https://github.com/ccxt/ccxt
|
@@ -780,7 +780,7 @@ You can also construct custom requests to available "implicit" endpoints
|
|
780
780
|
### WS Unified
|
781
781
|
|
782
782
|
- `describe(self)`
|
783
|
-
- `get_inst_type(self, market, params={})`
|
783
|
+
- `get_inst_type(self, market, uta: bool = False, params={})`
|
784
784
|
- `watch_ticker(self, symbol: str, params={})`
|
785
785
|
- `un_watch_ticker(self, symbol: str, params={})`
|
786
786
|
- `watch_tickers(self, symbols: Strings = None, params={})`
|
@@ -1,11 +1,11 @@
|
|
1
1
|
bitget/__init__.py,sha256=D5tG1_AjwXjMim3CPnCuWSheOXtq4vlSwVCS5ZG1bMQ,246
|
2
|
-
bitget/ccxt/__init__.py,sha256=
|
2
|
+
bitget/ccxt/__init__.py,sha256=4_7eXUwJaMdUAIlJcew66pxnNVFJDGu-PBLxRtYidBU,6130
|
3
3
|
bitget/ccxt/bitget.py,sha256=btIwpfkEJ1nXEMKHVxd1hykPMyivAwPj-ym2N_LdzlM,518995
|
4
4
|
bitget/ccxt/abstract/bitget.py,sha256=U3sRAK3oQJt2ujn-S0ci05HnOIHEad7CJvpDeTQfrYY,101038
|
5
|
-
bitget/ccxt/async_support/__init__.py,sha256=
|
5
|
+
bitget/ccxt/async_support/__init__.py,sha256=y9ZrW7UzPg7mopE9Q63g3aqwaEaBh1MiQDznStp7OXM,4863
|
6
6
|
bitget/ccxt/async_support/bitget.py,sha256=5LkBlqAw2FAK_qGza5hsVf0U0Hycxd6I4_SURsoJM74,521002
|
7
7
|
bitget/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
|
8
|
-
bitget/ccxt/async_support/base/exchange.py,sha256=
|
8
|
+
bitget/ccxt/async_support/base/exchange.py,sha256=F8astaio1v_0MuDn3pjKByPR6NdwB1lSvDE71auAnA8,121268
|
9
9
|
bitget/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
|
10
10
|
bitget/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
|
11
11
|
bitget/ccxt/async_support/base/ws/cache.py,sha256=xf2VOtfUwloxSlIQ39M1RGZHWQzyS9IGhB5NX6cDcAc,8370
|
@@ -17,11 +17,11 @@ bitget/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9pr
|
|
17
17
|
bitget/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
|
18
18
|
bitget/ccxt/base/decimal_to_precision.py,sha256=3XI30u9YudHbTA438397u5rkdlXa3atxwZEfUus3C4k,6803
|
19
19
|
bitget/ccxt/base/errors.py,sha256=OGhWNvNtRlJOzFx-n1x3ZjTnaPpfWH0Vc0xACS-MeDw,5012
|
20
|
-
bitget/ccxt/base/exchange.py,sha256=
|
20
|
+
bitget/ccxt/base/exchange.py,sha256=uA5L1S85RqI7H9tDUkHTeqUBX_HzGD3tMl4Y7r4y_eU,334337
|
21
21
|
bitget/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
|
22
22
|
bitget/ccxt/base/types.py,sha256=Gvbogh9i7pPH7Z18xesYeDPribqqwq8uKpOv-YODFBs,11505
|
23
|
-
bitget/ccxt/pro/__init__.py,sha256=
|
24
|
-
bitget/ccxt/pro/bitget.py,sha256=
|
23
|
+
bitget/ccxt/pro/__init__.py,sha256=5QAb6_6trT3XLDYpo-vIu_eTHgvbGf4hTIB62I2ui90,4177
|
24
|
+
bitget/ccxt/pro/bitget.py,sha256=iyabgKu-8rQdeHpQVOP3C_1NDx6JKQJfT5CYoywGP48,96558
|
25
25
|
bitget/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
|
26
26
|
bitget/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
|
27
27
|
bitget/ccxt/static_dependencies/ecdsa/__init__.py,sha256=Xaj0G79BLtBt2YZcOOMV8qOlQZ7fIJznNiHhiEEZfQA,594
|
@@ -281,6 +281,6 @@ bitget/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
|
|
281
281
|
bitget/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
|
282
282
|
bitget/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
283
283
|
bitget/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
|
284
|
-
bitget-0.0.
|
285
|
-
bitget-0.0.
|
286
|
-
bitget-0.0.
|
284
|
+
bitget-0.0.83.dist-info/METADATA,sha256=sV5rMcxAG_DfD3R5DA0G1ctPgE9uAGLRQD0xjAYNgyc,44874
|
285
|
+
bitget-0.0.83.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
286
|
+
bitget-0.0.83.dist-info/RECORD,,
|
File without changes
|