Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::spot::websocket_api::AuthApi Class Reference

#include <auth_api.hpp>

Public Member Functions

 AuthApi (std::shared_ptr< common::WebsocketApi > client)
std::vector< common::WebsocketApiResponse< SessionLogonResponseResult > > session_logon (const SessionLogonParams &params={}) const
 Log in with API key (USER_DATA).
template<class CompletionToken>
auto async_session_logon (const SessionLogonParams &params, CompletionToken &&token) const
 Asynchronous session_logon().
std::vector< common::WebsocketApiResponse< SessionLogoutResponseResult > > session_logout (const SessionLogoutParams &params={}) const
 Log out of the session.
template<class CompletionToken>
auto async_session_logout (const SessionLogoutParams &params, CompletionToken &&token) const
 Asynchronous session_logout().
common::WebsocketApiResponse< SessionStatusResponseResult > session_status (const SessionStatusParams &params={}) const
 Query session status.
template<class CompletionToken>
auto async_session_status (const SessionStatusParams &params, CompletionToken &&token) const
 Asynchronous session_status().

Constructor & Destructor Documentation

◆ AuthApi()

binance::spot::websocket_api::AuthApi::AuthApi ( std::shared_ptr< common::WebsocketApi > client)
explicit

Member Function Documentation

◆ session_logon()

std::vector< common::WebsocketApiResponse< SessionLogonResponseResult > > binance::spot::websocket_api::AuthApi::session_logon ( const SessionLogonParams & params = {}) const
nodiscard

Log in with API key (USER_DATA).

session.logon.

Authenticate WebSocket connection using the provided API key.

After calling session.logon, you can omit apiKey and signature parameters for future requests that require them.

Note that only one API key can be authenticated.

Calling session.logon multiple times changes the current authenticated API key.

Note: Only Ed25519 keys are supported for this feature.

Weight(IP): 2

Security Type: USER_DATA

Notes: Data Source: Memory

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/auth#session-logon

◆ async_session_logon()

template<class CompletionToken>
auto binance::spot::websocket_api::AuthApi::async_session_logon ( const SessionLogonParams & params,
CompletionToken && token ) const
inline

Asynchronous session_logon().

Completes with void(std::exception_ptr, std::vector<common::WebsocketApiResponse<SessionLogonResponseResult>>).

◆ session_logout()

std::vector< common::WebsocketApiResponse< SessionLogoutResponseResult > > binance::spot::websocket_api::AuthApi::session_logout ( const SessionLogoutParams & params = {}) const
nodiscard

Log out of the session.

session.logout.

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 you will have to explicitly provide the apiKey and signature parameters where needed.

Weight(IP): 2

Security Type: NONE

Notes: Data Source: Memory

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/auth#session-logout

◆ async_session_logout()

template<class CompletionToken>
auto binance::spot::websocket_api::AuthApi::async_session_logout ( const SessionLogoutParams & params,
CompletionToken && token ) const
inline

Asynchronous session_logout().

Completes with void(std::exception_ptr, std::vector<common::WebsocketApiResponse<SessionLogoutResponseResult>>).

◆ session_status()

common::WebsocketApiResponse< SessionStatusResponseResult > binance::spot::websocket_api::AuthApi::session_status ( const SessionStatusParams & params = {}) const
nodiscard

Query session status.

session.status.

Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests.

Weight(IP): 2

Security Type: NONE

Notes: Data Source: Memory

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/auth#session-status

◆ async_session_status()

template<class CompletionToken>
auto binance::spot::websocket_api::AuthApi::async_session_status ( const SessionStatusParams & params,
CompletionToken && token ) const
inline

Asynchronous session_status().

Completes with void(std::exception_ptr, common::WebsocketApiResponse<SessionStatusResponseResult>).