cuongitl / python-bitget

An unofficial Python3 library to interact with bitget.com - full support for all API's endpoints. Buy me a coffee: https://buymeacoffee.com/cuongitl
https://python-bitget.readthedocs.io/en/latest/index.html
32 stars 9 forks source link

Compatibility with the bitget API v2 #29

Open YVINEE opened 4 weeks ago

YVINEE commented 4 weeks ago

Discussed in https://github.com/cuongitl/python-bitget/discussions/28

Originally posted by **YVINEE** October 15, 2024 Hi, To be compatible with the bitget API v2, there is a little change to do. Indeed, we have already the possibility to set the websocket url to 'wss://ws.bitget.com/v2/ws/private' in this way: ``` websocket_client = BitgetWsClient(ws_url='wss://ws.bitget.com/v2/ws/private', api_key=json_config['apiKey'], api_secret=json_config['secret'], passphrase=json_config['password'], verbose=True) \ .error_listener(handel_error) \ .build() channels = [SubscribeReq('SPOT', 'orders', coin + 'USDT')] ``` The only problem is when we subscribe SPOT is transformed in spot (lowercase) which generate the error 30016 Param error. Could you change the line : `chanel.inst_type = str(chanel.inst_type).lower()` by `chanel.inst_type = str(chanel.inst_type)` in the file stream.py in order to solve this problem. Thanks, Yann
alawn-wang commented 1 week ago

This repo supports API v2? or you supoorted new version by yourself?