Pybit

Latest version: v5.7.0

Safety actively analyzes 629855 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 13

2.1.1

Added
- USDC perpetual `WebSocket` and `HTTP` classes
- USDT perpetual `extended_user_trade_records()` method

Modified
- Expose all WebSocket arguments to users (fixing the previous "wonky and unintuitive" implementation by simplifying the inheritance design)
- See below release candidates for details.

2.1.1rc0

Modified
- Added arg (`trace_logging`) to enable websocket-client's trace logging, which reveals extra debug information regarding the websocket connection, including the raw sent & received messages
- Note: the code implementation is a little wonky and unintuitive, and will be refined as much as possible before the proper release - although the functionality will remain the same.

2.1.0

Fixed
- The processing of `instrument_info` WebSocket messages so that the user receive a `"type": "snapshot"` every time, rather than having to do their own delta/snapshot processing
- Fix `AttributeError: '_FuturesWebSocketManager' object has no attribute 'endpoint'` when attempting reconnect

2.0.1

Added
- `record_request_time` arg to `HTTP` classes which, if true, returns the response dictionary in a tuple with the request elapsed time - as recorded by `requests`

Changed
- `websocket_example.py` to demonstrate callbacks clearly
- the license to reflect the transition to bybit-exchange

Fixed
- `JSONDecodeError` when trying to subscribe to a spot private WebSocket stream

2.0.0

Added
- New modules for each API as part of a restructuring effort: `inverse_perpetual.py`, `usdt_perpetual.py`, `spot.py`, and more
- see the [README](https://github.com/bybit-exchange/pybit/blob/master/README.md) for how to import these new modules
- `HTTP` and `WebSocket` classes within each applicable module
- These classes use inheritance to reflect the structure of the Bybit APIs - due to the division of endpoints along the lines of different market types
- This means that different classes can share their common endpoints, such as `api_key_info()`, whilst keeping their distinctive endpoints like `get_active_order()` separate

Changed
- `WebSocket` functionality to use callbacks instead of polling
- This means that instead of polling `ws.fetch()` for your latest WebSocket messages, you can now simply define a function (`my_callback_function`), and pass this as an argument upon subscribing to your chosen topic
- see the [example file](https://github.com/bybit-exchange/pybit/blob/master/examples/websocket_example.py) for more information
- This also removes the need to remember topic names and JSON formats, as you now directly call a class method to subscribe
- There is also a `custom_topic_stream` method which can be used if a new WebSocket topic has been released by Bybit, but it's not been added to `pybit` yet
- `HTTP` classes will now instantiate a new HTTP session for each API (Spot (`spot.HTTP`), Account Asset (`account_asset.HTTP`), etc)
- this is due to the restructuring of `pybit` to use class inheritance
- Generally, the restructuring has allowed a great amount of segregation of the internal code to occur, which will allow for easier future development

Removed
- The `WebSocket` class from the `__init__.py` file, which was imported like so: `from pybit import WebSocket`
- This is because of the aforementioned functionality changes, which also have the potential to improve performance (as a core no longer needs to be occupied polling `ws.fetch()`)
- However, the `HTTP` class was not removed from `__init__.py` in an effort to provide a unified alternative
- Despite this, we would recommend preferring the market-specific modules

1.3.6

Changed
- Added `query_trading_fee_rate()`

Page 6 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.