Class WebSocketApiAuth
- java.lang.Object
-
- com.bybit.api.client.websocket.api.WebSocketApiAuth
-
- All Implemented Interfaces:
WebSocketApiModule
public class WebSocketApiAuth extends Object implements WebSocketApiModule
Authentication requests
All requests under the Authentication requests section of the WebSocket API documentation will be implemented in this class.
Response will be returned as callback.
-
-
Constructor Summary
Constructors Constructor Description WebSocketApiAuth(WebSocketApiRequestHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidlogon(org.json.JSONObject parameters)Authenticate WebSocket connection using the provided API key.
After calling session.logon, future requests under same connection won't send apiKey and signature parameters.voidlogout(org.json.JSONObject parameters)Forget the API key previously authenticated.voidstatus(org.json.JSONObject parameters)Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests.
-
-
-
Constructor Detail
-
WebSocketApiAuth
public WebSocketApiAuth(WebSocketApiRequestHandler handler)
-
-
Method Detail
-
logon
public void logon(org.json.JSONObject parameters)
Authenticate WebSocket connection using the provided API key.
After calling session.logon, future requests under same connection won't send apiKey and signature parameters.
Calling session.logon multiple times changes the current authenticated API key.- Parameters:
parameters- JSONObject composed by key-value pairs:
recvWindow -- optional/int -- The value cannot be greater than 60000
requestId -- optional/String or int- See Also:
- https://binance-docs.github.io/apidocs/websocket_api/en/#log-in-with-api-key-signed
-
status
public void status(org.json.JSONObject parameters)
Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests.- Parameters:
parameters- JSONObject composed by key-value pairs:
requestId -- optional/String or int- See Also:
- https://binance-docs.github.io/apidocs/websocket_api/en/#query-session-status
-
logout
public void logout(org.json.JSONObject parameters)
Forget the API key previously authenticated. If the connection is not authenticated, this request does nothing.
Note that the WebSocket connection stays open after session.logout request.
You can continue using the connection, but now the requests will send the apiKey and signature parameters where is needed.- Parameters:
parameters- JSONObject composed by key-value pairs:
requestId -- optional/String or int- See Also:
- https://binance-docs.github.io/apidocs/websocket_api/en/#log-out-of-the-session
-
-