Download the PHP package carpenstar/bybitapi-sdk-websockets without Composer
On this page you can find all versions of the php package carpenstar/bybitapi-sdk-websockets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bybitapi-sdk-websockets
ByBitAPI - websockets package
[!IMPORTANT] This is an unofficial SDK for interaction with the ByBit exchange. The development is carried out by one person solely on enthusiasm and as far as possible For all questions, you can contact me in Issues, by email: [email protected] or in telegram: @novisad0189
[!IMPORTANT] This package is an extension of bybitapi-sdk-core
Requirements
- PHP >= 7.4
- posix - extension
- pcntl - extension
Install
AVAILABLE CHANNELS | ||||
---|---|---|---|---|
SPOT | ||||
Channel name | Access | View | Offical documentation | Language |
Book Ticker | publicEndpoint | view | view | EN, RU |
Kline | publicEndpoint | view | view | EN, RU |
Order Book | publicEndpoint | view | view | EN, RU |
Public Trade | publicEndpoint | view | view | EN, RU |
Tickers | publicEndpoint | view | view | EN, RU |
DERIVATIVES | ||||
Channel name | Access | View | Offical documentation | Language |
Kline | publicEndpoint | view | view | EN, RU |
Liquidation | publicEndpoint | view | view | EN, RU |
Order Book | publicEndpoint | view | view | EN, RU |
Public Trade | publicEndpoint | view | view | EN, RU |
Tickers | publicEndpoint | view | view | EN, RU |
Application instance
Setting connection parameters
Starting socket server listening
Processing callbacks from a socket server
As a handler for incoming messages, you need to create your own class that will extend the abstract class Carpenstar\ByBitAPI\Core\Objects\WebSockets\Channels\ChannelHandler
The entry point to the business logic zone is the procedure handle($data, TcpConnection $connection) inside which you should implement the processing of incoming data.
[!WARNING] Please note that each time you subscribe to a channel, the first message that comes is a handshake message, which will indicate the connection status, and only the following messages will contain the information you need.
Example of a message handler class:
Handshake - message
Handshake always comes as the first message after you have established a connection to the socket server, so before starting the business logic, it is recommended to make sure that the connection was successful by calling the isSuccess() function, which will return if successful true
All versions of bybitapi-sdk-websockets with dependencies
workerman/workerman Version 4.1.16
carpenstar/bybitapi-sdk-core Version 5.1.*