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

#include <general_api.hpp>

Public Member Functions

 GeneralApi (std::shared_ptr< common::WebsocketApi > client)
common::WebsocketApiResponse< ExchangeInfoResponse > exchange_info (const ExchangeInfoParams &params={}) const
 Exchange information.
template<class CompletionToken>
auto async_exchange_info (const ExchangeInfoParams &params, CompletionToken &&token) const
 Asynchronous exchange_info().
common::WebsocketApiResponse< ExecutionRulesResponseResult > execution_rules (const ExecutionRulesParams &params={}) const
 Query Execution Rules.
template<class CompletionToken>
auto async_execution_rules (const ExecutionRulesParams &params, CompletionToken &&token) const
 Asynchronous execution_rules().
common::WebsocketApiResponse< boost::json::value > ping (const PingParams &params={}) const
 Test connectivity.
template<class CompletionToken>
auto async_ping (const PingParams &params, CompletionToken &&token) const
 Asynchronous ping().
common::WebsocketApiResponse< TimeResponseResult > time (const TimeParams &params={}) const
 Check server time.
template<class CompletionToken>
auto async_time (const TimeParams &params, CompletionToken &&token) const
 Asynchronous time().

Constructor & Destructor Documentation

◆ GeneralApi()

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

Member Function Documentation

◆ exchange_info()

common::WebsocketApiResponse< ExchangeInfoResponse > binance::spot::websocket_api::GeneralApi::exchange_info ( const ExchangeInfoParams & params = {}) const
nodiscard

Exchange information.

exchangeInfo.

Query current exchange trading rules, rate limits, and symbol information.

Weight(IP): 20

Security Type: NONE

Notes: Data Source: Memory

Notes:

  • If the value provided to symbol or symbols do not exist, the endpoint will throw an error saying the symbol is invalid.
  • All parameters are optional.
  • Only one of symbol, symbols, permissions parameters can be specified.
  • Without parameters, exchangeInfo displays all symbols with ["SPOT", "MARGIN", "LEVERAGED"] permissions.
    • In order to list all active symbols on the exchange, you need to explicitly request all permissions.
  • permissions accepts either a list of permissions, or a single permission name. E.g. "SPOT".

Examples of Symbol Permissions Interpretation from the Response:

  • [["A","B"]] means you may place an order if your account has either permission "A" or permission "B".
  • [["A"],["B"]] means you can place an order if your account has permission "A" and permission "B".
  • [["A"],["B","C"]] means you can place an order if your account has permission "A" and permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".)

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/general#exchange-info

◆ async_exchange_info()

template<class CompletionToken>
auto binance::spot::websocket_api::GeneralApi::async_exchange_info ( const ExchangeInfoParams & params,
CompletionToken && token ) const
inline

Asynchronous exchange_info().

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

◆ execution_rules()

common::WebsocketApiResponse< ExecutionRulesResponseResult > binance::spot::websocket_api::GeneralApi::execution_rules ( const ExecutionRulesParams & params = {}) const
nodiscard

Query Execution Rules.

executionRules.

Query execution rules for symbols.

Weight: Parameter Weight
symbol 2
symbols 2 for each symbol, capped at a max of 40
symbolStatus 40
None 40

Security Type: NONE

Notes: Data Source: Memory

Note: No combination of multiple parameters is allowed.

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/general#execution-rules

◆ async_execution_rules()

template<class CompletionToken>
auto binance::spot::websocket_api::GeneralApi::async_execution_rules ( const ExecutionRulesParams & params,
CompletionToken && token ) const
inline

Asynchronous execution_rules().

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

◆ ping()

common::WebsocketApiResponse< boost::json::value > binance::spot::websocket_api::GeneralApi::ping ( const PingParams & params = {}) const
nodiscard

Test connectivity.

ping.

Test connectivity to the WebSocket API.

Note: You can use regular WebSocket ping frames to test connectivity as well, WebSocket API will respond with pong frames as soon as possible. ping request along with time is a safe way to test request-response handling in your application.

Weight(IP): 1

Security Type: NONE

Notes: Data Source: Memory

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/general#ping

◆ async_ping()

template<class CompletionToken>
auto binance::spot::websocket_api::GeneralApi::async_ping ( const PingParams & params,
CompletionToken && token ) const
inline

Asynchronous ping().

Completes with void(std::exception_ptr, common::WebsocketApiResponse<boost::json::value>).

◆ time()

common::WebsocketApiResponse< TimeResponseResult > binance::spot::websocket_api::GeneralApi::time ( const TimeParams & params = {}) const
nodiscard

Check server time.

time.

Test connectivity to the WebSocket API and get the current server time.

Weight(IP): 1

Security Type: NONE

Notes: Data Source: Memory

See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/ws-api/general#time

◆ async_time()

template<class CompletionToken>
auto binance::spot::websocket_api::GeneralApi::async_time ( const TimeParams & params,
CompletionToken && token ) const
inline

Asynchronous time().

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