Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::stock_options::rest_api::UserDataStreamsApi Class Reference

#include <user_data_streams_api.hpp>

Public Member Functions

 UserDataStreamsApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< CreateRenewListenKeyResponse > create_renew_listen_key (const CreateRenewListenKeyParams &params={}) const
 Create / Renew Listen Key (USER_STREAM).
template<class CompletionToken>
auto async_create_renew_listen_key (const CreateRenewListenKeyParams &params, CompletionToken &&token) const
 Asynchronous create_renew_listen_key().

Constructor & Destructor Documentation

◆ UserDataStreamsApi()

binance::stock_options::rest_api::UserDataStreamsApi::UserDataStreamsApi ( std::shared_ptr< common::RestClient > client)
explicit

Member Function Documentation

◆ create_renew_listen_key()

common::RestApiResponse< CreateRenewListenKeyResponse > binance::stock_options::rest_api::UserDataStreamsApi::create_renew_listen_key ( const CreateRenewListenKeyParams & params = {}) const
nodiscard

Create / Renew Listen Key (USER_STREAM).

POST /sapi/v1/equity/option/listenKey.

Create or renew the user data stream listenKey.

  • Valid for 1 hour. Calling again renews it (resets to 1 hour) and returns the same key; renewing every 30 minutes is recommended. After expiry, a new key is issued and you must resubscribe with it.
  • Options and stocks share one key. The key is issued per user, not per asset class. This endpoint and /sapi/v1/equity/listenKey return the same key; calling either is enough.
  • Use the key to subscribe to the Order Report V2 Stream.

Weight: 1

Security Type: USER_STREAM

See https://developers.binance.com/en/docs/catalog/advanced-trading-stock-option-trading/api/rest-api/user-data-streams#create-renew-listen-key

◆ async_create_renew_listen_key()

template<class CompletionToken>
auto binance::stock_options::rest_api::UserDataStreamsApi::async_create_renew_listen_key ( const CreateRenewListenKeyParams & params,
CompletionToken && token ) const
inline

Asynchronous create_renew_listen_key().

Completes with void(std::exception_ptr, common::RestApiResponse<CreateRenewListenKeyResponse>).