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

#include <general_api.hpp>

Public Member Functions

 GeneralApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< 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::RestApiResponse< ExecutionRulesResponse > 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::RestApiResponse< boost::json::value > ping () const
 Test connectivity.
template<class CompletionToken>
auto async_ping (CompletionToken &&token) const
 Asynchronous ping().
common::RestApiResponse< TimeResponse > time () const
 Check server time.
template<class CompletionToken>
auto async_time (CompletionToken &&token) const
 Asynchronous time().

Constructor & Destructor Documentation

◆ GeneralApi()

binance::spot::rest_api::GeneralApi::GeneralApi ( std::shared_ptr< common::RestClient > client)
explicit

Member Function Documentation

◆ exchange_info()

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

Exchange information.

GET /api/v3/exchangeInfo.

Current exchange trading rules 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.
  • permissions can support single or multiple values (e.g. SPOT, ["MARGIN","LEVERAGED"]). This cannot be used in combination with symbol or symbols.
  • If permissions parameter not provided, all symbols that have either SPOT, MARGIN, or LEVERAGED permission will be exposed.
    • To display symbols with any permission you need to specify them explicitly in permissions: (e.g. ["SPOT","MARGIN",...].). See Account and Symbol Permissions for the full list.

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/rest-api/general#exchange-info

◆ async_exchange_info()

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

Asynchronous exchange_info().

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

◆ execution_rules()

common::RestApiResponse< ExecutionRulesResponse > binance::spot::rest_api::GeneralApi::execution_rules ( const ExecutionRulesParams & params = {}) const
nodiscard

Query Execution Rules.

GET /api/v3/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/rest-api/general#execution-rules

◆ async_execution_rules()

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

Asynchronous execution_rules().

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

◆ ping()

common::RestApiResponse< boost::json::value > binance::spot::rest_api::GeneralApi::ping ( ) const
nodiscard

Test connectivity.

GET /api/v3/ping.

Test connectivity to the Rest API.

Weight(IP): 1

Security Type: NONE

Notes: Data Source: Memory

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

◆ async_ping()

template<class CompletionToken>
auto binance::spot::rest_api::GeneralApi::async_ping ( CompletionToken && token) const
inline

Asynchronous ping().

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

◆ time()

common::RestApiResponse< TimeResponse > binance::spot::rest_api::GeneralApi::time ( ) const
nodiscard

Check server time.

GET /api/v3/time.

Test connectivity to the Rest 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/rest-api/general#time

◆ async_time()

template<class CompletionToken>
auto binance::spot::rest_api::GeneralApi::async_time ( CompletionToken && token) const
inline

Asynchronous time().

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