bitget 0.0.79__py3-none-any.whl → 0.0.81__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/abstract/bitget.py +6 -0
- bitget/ccxt/async_support/__init__.py +1 -1
- bitget/ccxt/async_support/base/exchange.py +44 -9
- bitget/ccxt/async_support/base/ws/client.py +3 -1
- bitget/ccxt/async_support/bitget.py +2040 -561
- bitget/ccxt/base/errors.py +0 -6
- bitget/ccxt/base/exchange.py +11 -9
- bitget/ccxt/base/types.py +1 -0
- bitget/ccxt/bitget.py +2040 -561
- bitget/ccxt/pro/__init__.py +1 -1
- bitget/ccxt/pro/bitget.py +3 -3
- {bitget-0.0.79.dist-info → bitget-0.0.81.dist-info}/METADATA +13 -3
- {bitget-0.0.79.dist-info → bitget-0.0.81.dist-info}/RECORD +15 -15
- {bitget-0.0.79.dist-info → bitget-0.0.81.dist-info}/WHEEL +0 -0
bitget/ccxt/__init__.py
CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
|
|
26
26
|
|
27
27
|
# ----------------------------------------------------------------------------
|
28
28
|
|
29
|
-
__version__ = '4.4.
|
29
|
+
__version__ = '4.4.100'
|
30
30
|
|
31
31
|
# ----------------------------------------------------------------------------
|
32
32
|
|
bitget/ccxt/abstract/bitget.py
CHANGED
@@ -525,6 +525,7 @@ class ImplicitAPI:
|
|
525
525
|
private_common_get_v2_common_trade_rate = privateCommonGetV2CommonTradeRate = Entry('v2/common/trade-rate', ['private', 'common'], 'GET', {'cost': 2})
|
526
526
|
private_uta_get_v3_account_assets = privateUtaGetV3AccountAssets = Entry('v3/account/assets', ['private', 'uta'], 'GET', {'cost': 1})
|
527
527
|
private_uta_get_v3_account_settings = privateUtaGetV3AccountSettings = Entry('v3/account/settings', ['private', 'uta'], 'GET', {'cost': 1})
|
528
|
+
private_uta_get_v3_account_deposit_records = privateUtaGetV3AccountDepositRecords = Entry('v3/account/deposit-records', ['private', 'uta'], 'GET', {'cost': 2})
|
528
529
|
private_uta_get_v3_account_financial_records = privateUtaGetV3AccountFinancialRecords = Entry('v3/account/financial-records', ['private', 'uta'], 'GET', {'cost': 1})
|
529
530
|
private_uta_get_v3_account_repayable_coins = privateUtaGetV3AccountRepayableCoins = Entry('v3/account/repayable-coins', ['private', 'uta'], 'GET', {'cost': 2})
|
530
531
|
private_uta_get_v3_account_payment_coins = privateUtaGetV3AccountPaymentCoins = Entry('v3/account/payment-coins', ['private', 'uta'], 'GET', {'cost': 2})
|
@@ -543,7 +544,9 @@ class ImplicitAPI:
|
|
543
544
|
private_uta_get_v3_position_history_position = privateUtaGetV3PositionHistoryPosition = Entry('v3/position/history-position', ['private', 'uta'], 'GET', {'cost': 1})
|
544
545
|
private_uta_get_v3_trade_order_info = privateUtaGetV3TradeOrderInfo = Entry('v3/trade/order-info', ['private', 'uta'], 'GET', {'cost': 1})
|
545
546
|
private_uta_get_v3_trade_unfilled_orders = privateUtaGetV3TradeUnfilledOrders = Entry('v3/trade/unfilled-orders', ['private', 'uta'], 'GET', {'cost': 1})
|
547
|
+
private_uta_get_v3_trade_unfilled_strategy_orders = privateUtaGetV3TradeUnfilledStrategyOrders = Entry('v3/trade/unfilled-strategy-orders', ['private', 'uta'], 'GET', {'cost': 1})
|
546
548
|
private_uta_get_v3_trade_history_orders = privateUtaGetV3TradeHistoryOrders = Entry('v3/trade/history-orders', ['private', 'uta'], 'GET', {'cost': 1})
|
549
|
+
private_uta_get_v3_trade_history_strategy_orders = privateUtaGetV3TradeHistoryStrategyOrders = Entry('v3/trade/history-strategy-orders', ['private', 'uta'], 'GET', {'cost': 1})
|
547
550
|
private_uta_get_v3_trade_fills = privateUtaGetV3TradeFills = Entry('v3/trade/fills', ['private', 'uta'], 'GET', {'cost': 1})
|
548
551
|
private_uta_get_v3_user_sub_list = privateUtaGetV3UserSubList = Entry('v3/user/sub-list', ['private', 'uta'], 'GET', {'cost': 2})
|
549
552
|
private_uta_get_v3_user_sub_api_list = privateUtaGetV3UserSubApiList = Entry('v3/user/sub-api-list', ['private', 'uta'], 'GET', {'cost': 2})
|
@@ -555,8 +558,11 @@ class ImplicitAPI:
|
|
555
558
|
private_uta_post_v3_account_max_open_available = privateUtaPostV3AccountMaxOpenAvailable = Entry('v3/account/max-open-available', ['private', 'uta'], 'POST', {'cost': 4})
|
556
559
|
private_uta_post_v3_ins_loan_bind_uid = privateUtaPostV3InsLoanBindUid = Entry('v3/ins-loan/bind-uid', ['private', 'uta'], 'POST', {'cost': 6.6667})
|
557
560
|
private_uta_post_v3_trade_place_order = privateUtaPostV3TradePlaceOrder = Entry('v3/trade/place-order', ['private', 'uta'], 'POST', {'cost': 2})
|
561
|
+
private_uta_post_v3_trade_place_strategy_order = privateUtaPostV3TradePlaceStrategyOrder = Entry('v3/trade/place-strategy-order', ['private', 'uta'], 'POST', {'cost': 2})
|
558
562
|
private_uta_post_v3_trade_modify_order = privateUtaPostV3TradeModifyOrder = Entry('v3/trade/modify-order', ['private', 'uta'], 'POST', {'cost': 2})
|
563
|
+
private_uta_post_v3_trade_modify_strategy_order = privateUtaPostV3TradeModifyStrategyOrder = Entry('v3/trade/modify-strategy-order', ['private', 'uta'], 'POST', {'cost': 2})
|
559
564
|
private_uta_post_v3_trade_cancel_order = privateUtaPostV3TradeCancelOrder = Entry('v3/trade/cancel-order', ['private', 'uta'], 'POST', {'cost': 2})
|
565
|
+
private_uta_post_v3_trade_cancel_strategy_order = privateUtaPostV3TradeCancelStrategyOrder = Entry('v3/trade/cancel-strategy-order', ['private', 'uta'], 'POST', {'cost': 2})
|
560
566
|
private_uta_post_v3_trade_place_batch = privateUtaPostV3TradePlaceBatch = Entry('v3/trade/place-batch', ['private', 'uta'], 'POST', {'cost': 4})
|
561
567
|
private_uta_post_v3_trade_batch_modify_order = privateUtaPostV3TradeBatchModifyOrder = Entry('v3/trade/batch-modify-order', ['private', 'uta'], 'POST', {'cost': 2})
|
562
568
|
private_uta_post_v3_trade_cancel_batch = privateUtaPostV3TradeCancelBatch = Entry('v3/trade/cancel-batch', ['private', 'uta'], 'POST', {'cost': 4})
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.4.
|
5
|
+
__version__ = '4.4.100'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -54,6 +54,15 @@ __all__ = [
|
|
54
54
|
]
|
55
55
|
|
56
56
|
# -----------------------------------------------------------------------------
|
57
|
+
# --- PROTO BUF IMPORTS
|
58
|
+
try:
|
59
|
+
from ccxt.protobuf.mexc import PushDataV3ApiWrapper_pb2
|
60
|
+
from google.protobuf.json_format import MessageToDict
|
61
|
+
except ImportError:
|
62
|
+
PushDataV3ApiWrapper_pb2 = None
|
63
|
+
MessageToDict = None
|
64
|
+
|
65
|
+
# -----------------------------------------------------------------------------
|
57
66
|
|
58
67
|
|
59
68
|
class Exchange(BaseExchange):
|
@@ -418,6 +427,7 @@ class Exchange(BaseExchange):
|
|
418
427
|
'verbose': self.verbose,
|
419
428
|
'throttle': Throttler(self.tokenBucket, self.asyncio_loop),
|
420
429
|
'asyncio_loop': self.asyncio_loop,
|
430
|
+
'decompressBinary': self.safe_bool(self.options, 'decompressBinary', True),
|
421
431
|
}, ws_options)
|
422
432
|
# we use aiohttp instead of fastClient now because of this
|
423
433
|
# https://github.com/ccxt/ccxt/pull/25995
|
@@ -573,6 +583,31 @@ class Exchange(BaseExchange):
|
|
573
583
|
return '0e-00'
|
574
584
|
return format(n, 'g')
|
575
585
|
|
586
|
+
def decode_proto_msg(self, data):
|
587
|
+
if not MessageToDict:
|
588
|
+
raise NotSupported(self.id + ' requires protobuf to decode messages, please install it with `pip install "protobuf==5.29.3"`')
|
589
|
+
message = PushDataV3ApiWrapper_pb2.PushDataV3ApiWrapper()
|
590
|
+
message.ParseFromString(data)
|
591
|
+
dict_msg = MessageToDict(message)
|
592
|
+
# {
|
593
|
+
# "channel":"spot@public.kline.v3.api.pb@BTCUSDT@Min1",
|
594
|
+
# "symbol":"BTCUSDT",
|
595
|
+
# "symbolId":"2fb942154ef44a4ab2ef98c8afb6a4a7",
|
596
|
+
# "createTime":"1754735110559",
|
597
|
+
# "publicSpotKline":{
|
598
|
+
# "interval":"Min1",
|
599
|
+
# "windowStart":"1754735100",
|
600
|
+
# "openingPrice":"117792.45",
|
601
|
+
# "closingPrice":"117805.32",
|
602
|
+
# "highestPrice":"117814.63",
|
603
|
+
# "lowestPrice":"117792.45",
|
604
|
+
# "volume":"0.13425465",
|
605
|
+
# "amount":"15815.77",
|
606
|
+
# "windowEnd":"1754735160"
|
607
|
+
# }
|
608
|
+
# }
|
609
|
+
return dict_msg
|
610
|
+
|
576
611
|
# ########################################################################
|
577
612
|
# ########################################################################
|
578
613
|
# ########################################################################
|
@@ -742,13 +777,13 @@ class Exchange(BaseExchange):
|
|
742
777
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
|
743
778
|
raise NotSupported(self.id + ' transfer() is not supported yet')
|
744
779
|
|
745
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
780
|
+
async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}):
|
746
781
|
raise NotSupported(self.id + ' withdraw() is not supported yet')
|
747
782
|
|
748
783
|
async def create_deposit_address(self, code: str, params={}):
|
749
784
|
raise NotSupported(self.id + ' createDepositAddress() is not supported yet')
|
750
785
|
|
751
|
-
async def set_leverage(self, leverage:
|
786
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
752
787
|
raise NotSupported(self.id + ' setLeverage() is not supported yet')
|
753
788
|
|
754
789
|
async def fetch_leverage(self, symbol: str, params={}):
|
@@ -797,7 +832,7 @@ class Exchange(BaseExchange):
|
|
797
832
|
async def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
798
833
|
raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
|
799
834
|
|
800
|
-
async def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
835
|
+
async def fetch_open_interest_history(self, symbol: str, timeframe: str = '1h', since: Int = None, limit: Int = None, params={}):
|
801
836
|
raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
|
802
837
|
|
803
838
|
async def fetch_open_interest(self, symbol: str, params={}):
|
@@ -1182,7 +1217,7 @@ class Exchange(BaseExchange):
|
|
1182
1217
|
async def fetch_position_mode(self, symbol: Str = None, params={}):
|
1183
1218
|
raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
|
1184
1219
|
|
1185
|
-
async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
1220
|
+
async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1186
1221
|
"""
|
1187
1222
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
1188
1223
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1204,7 +1239,7 @@ class Exchange(BaseExchange):
|
|
1204
1239
|
return await self.create_order(symbol, type, side, amount, price, params)
|
1205
1240
|
raise NotSupported(self.id + ' createTrailingAmountOrder() is not supported yet')
|
1206
1241
|
|
1207
|
-
async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
1242
|
+
async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1208
1243
|
"""
|
1209
1244
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
1210
1245
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1226,7 +1261,7 @@ class Exchange(BaseExchange):
|
|
1226
1261
|
return await self.create_order_ws(symbol, type, side, amount, price, params)
|
1227
1262
|
raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
|
1228
1263
|
|
1229
|
-
async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
1264
|
+
async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1230
1265
|
"""
|
1231
1266
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
1232
1267
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1248,7 +1283,7 @@ class Exchange(BaseExchange):
|
|
1248
1283
|
return await self.create_order(symbol, type, side, amount, price, params)
|
1249
1284
|
raise NotSupported(self.id + ' createTrailingPercentOrder() is not supported yet')
|
1250
1285
|
|
1251
|
-
async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
1286
|
+
async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
1252
1287
|
"""
|
1253
1288
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
1254
1289
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -1815,7 +1850,7 @@ class Exchange(BaseExchange):
|
|
1815
1850
|
else:
|
1816
1851
|
raise NotSupported(self.id + ' fetchFundingInterval() is not supported yet')
|
1817
1852
|
|
1818
|
-
async def fetch_mark_ohlcv(self, symbol, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
1853
|
+
async def fetch_mark_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
1819
1854
|
"""
|
1820
1855
|
fetches historical mark price candlestick data containing the open, high, low, and close price of a market
|
1821
1856
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
@@ -50,6 +50,7 @@ class Client(object):
|
|
50
50
|
connecting = False
|
51
51
|
asyncio_loop: BaseEventLoop = None
|
52
52
|
ping_looper = None
|
53
|
+
decompressBinary = True # decompress binary messages by default
|
53
54
|
|
54
55
|
def __init__(self, url, on_message_callback, on_error_callback, on_close_callback, on_connected_callback, config={}):
|
55
56
|
defaults = {
|
@@ -218,7 +219,8 @@ class Client(object):
|
|
218
219
|
if self.verbose:
|
219
220
|
self.log(iso8601(milliseconds()), 'message', data)
|
220
221
|
if isinstance(data, bytes):
|
221
|
-
|
222
|
+
if self.decompressBinary:
|
223
|
+
data = data.decode()
|
222
224
|
# decoded = json.loads(data) if is_json_encoded_object(data) else data
|
223
225
|
decode = None
|
224
226
|
if is_json_encoded_object(data):
|