|
Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
|
A connection to the W3WPrediction WebSocket streams, returned connected by WebsocketStreams::connect(). More...
#include <websocket_streams.hpp>
Public Member Functions | |
| const common::WebsocketStreamsConfig & | configuration () const noexcept |
| void | disconnect () |
| template<class CompletionToken> | |
| auto | async_disconnect (CompletionToken &&token) |
| bool | is_connected () const |
| void | ping_server () |
| Sends a ping frame on every open connection. | |
| template<class F> | |
| common::Subscription | on_event (F &&callback) |
| Registers a lifecycle callback (common::WebsocketEvent). | |
| common::WebsocketStreamHandle | stream (std::string name, std::optional< common::StreamId > id={}, std::optional< std::string > url_path={}) |
| Subscribes to a stream by its name, for streams the SDK does not wrap yet, and returns a handle for its callbacks (payloads as boost::json::value). | |
| void | subscribe (const std::vector< std::string > &streams, std::optional< common::StreamId > id={}, const std::optional< std::string > &url_path={}) |
| Subscribes to raw stream names. Messages are delivered to handles from stream(). | |
| void | unsubscribe (const std::vector< std::string > &streams, std::optional< common::StreamId > id={}, const std::optional< std::string > &url_path={}) |
| bool | is_subscribed (const std::string &stream) const |
| template<class CompletionToken> | |
| auto | async_wait_subscribed (std::string stream, std::optional< std::string > url_path, CompletionToken &&token) |
| Completes once the server has acknowledged the subscription of stream; see common::WebsocketStreams::async_wait_subscribed. | |
| void | wait_subscribed (std::string stream, std::optional< std::string > url_path={}, std::optional< std::chrono::milliseconds > timeout={}) |
| common::WebsocketStream< BatchClaimPartiallySucceededResponse > | batch_claim_partially_succeeded () const |
| Batch claim partially succeeded. | |
| common::WebsocketStream< FundTransferFailedResponse > | fund_transfer_failed () const |
| Fund transfer failed. | |
| common::WebsocketStream< FundTransferSucceededResponse > | fund_transfer_succeeded () const |
| Fund transfer succeeded. | |
| common::WebsocketStream< LimitOrderFullyFilledResponse > | limit_order_fully_filled () const |
| Limit order fully filled. | |
| common::WebsocketStream< LimitOrderPartiallyFilledResponse > | limit_order_partially_filled () const |
| Limit order partially filled. | |
| common::WebsocketStream< LimitOrderSubmissionFailedResponse > | limit_order_submission_failed () const |
| Limit order submission failed. | |
| common::WebsocketStream< LimitOrderSubmittedSuccessfullyResponse > | limit_order_submitted_successfully () const |
| Limit order submitted successfully. | |
| common::WebsocketStream< MarketBuyOrderFailedResponse > | market_buy_order_failed () const |
| Market buy order failed / expired. | |
| common::WebsocketStream< MarketBuyOrderFullyFilledResponse > | market_buy_order_fully_filled () const |
| Market buy order fully filled. | |
| common::WebsocketStream< MarketResolutionNotificationResponse > | market_resolution_notification () const |
| Market resolution notification. | |
| common::WebsocketStream< MarketSellOrderFailedExpiredResponse > | market_sell_order_failed_expired () const |
| Market sell order failed / expired. | |
| common::WebsocketStream< MarketSellOrderFullyFilledResponse > | market_sell_order_fully_filled () const |
| Market sell order fully filled. | |
| common::WebsocketStream< PredictionOrderBookByMarketIdResponse > | prediction_order_book_by_market_id (const PredictionOrderBookByMarketIdParams ¶ms) const |
| Prediction Order Book by marketId. | |
| common::WebsocketStream< RewardClaimFailedResponse > | reward_claim_failed () const |
| Reward claim failed. | |
| common::WebsocketStream< RewardClaimSucceededResponse > | reward_claim_succeeded () const |
| Reward claim succeeded. | |
Friends | |
| class | WebsocketStreams |
A connection to the W3WPrediction WebSocket streams, returned connected by WebsocketStreams::connect().
Cheap to copy: copies share one common::WebsocketStreams (connection pool and executor), which reconnects, renews its connections and resubscribes until disconnect().
|
inlinenodiscardnoexcept |
|
inline |
|
inline |
|
inlinenodiscard |
|
inline |
Sends a ping frame on every open connection.
|
inline |
Registers a lifecycle callback (common::WebsocketEvent).
Destroying the returned subscription removes it.
|
inlinenodiscard |
Subscribes to a stream by its name, for streams the SDK does not wrap yet, and returns a handle for its callbacks (payloads as boost::json::value).
Data arriving before the first callback is added is kept for it (up to 1000 messages).
|
inline |
Subscribes to raw stream names. Messages are delivered to handles from stream().
|
inline |
|
inlinenodiscard |
|
inline |
Completes once the server has acknowledged the subscription of stream; see common::WebsocketStreams::async_wait_subscribed.
|
inline |
|
inlinenodiscard |
Batch claim partially succeeded.
web3_prediction_pm_claim_partial_success.
Pushed when only part of a batch claim succeeds. Only pushId is included — call the REST API for details.
Update Speed: Real-time
|
inlinenodiscard |
Fund transfer failed.
web3_prediction_pm_transfer_fail.
Pushed when a fund transfer fails.
Update Speed: Real-time
|
inlinenodiscard |
Fund transfer succeeded.
web3_prediction_pm_transfer_success.
Pushed when a fund transfer into or out of the prediction wallet succeeds. The direction and the token are not included (currently USDT only).
Update Speed: Real-time
|
inlinenodiscard |
Limit order fully filled.
web3_prediction_pm_limit_order_filled.
Pushed when a limit order is fully filled.
Update Speed: Real-time
|
inlinenodiscard |
Limit order partially filled.
web3_prediction_pm_limit_order_partial_fill.
Pushed on each new partial fill of a limit order. One order can be pushed several times, so always remove duplicates by pushId.
Update Speed: Real-time
|
inlinenodiscard |
Limit order submission failed.
web3_prediction_pm_limit_submit_fail.
Pushed when a limit order is rejected when placed. No amount is included.
Update Speed: Real-time
|
inlinenodiscard |
Limit order submitted successfully.
web3_prediction_pm_limit_submit_success.
Pushed when the user's limit order is successfully placed on the order book.
Update Speed: Real-time
|
inlinenodiscard |
Market buy order failed / expired.
web3_prediction_pm_market_buy_fail.
Pushed when the user's market buy order fails or expires.
Update Speed: Real-time
|
inlinenodiscard |
Market buy order fully filled.
web3_prediction_pm_market_buy_success.
Pushed when the user's market buy order is fully filled.
Update Speed: Real-time
|
inlinenodiscard |
Market resolution notification.
web3_prediction_pm_market_close.
Pushed when a market is resolved, to every user holding a position in it, win or lose. No amount or outcome is included — call the REST API for the user's profit and loss.
Update Speed: Real-time
|
inlinenodiscard |
Market sell order failed / expired.
web3_prediction_pm_market_sell_fail.
Pushed when the user's market sell order fails or expires.
Update Speed: Real-time
|
inlinenodiscard |
Market sell order fully filled.
web3_prediction_pm_market_sell_success.
Pushed when the user's market sell order is fully filled.
Update Speed: Real-time
|
inlinenodiscard |
Prediction Order Book by marketId.
web3_prediction_orderbook_<marketId>.
Order book (bid/ask) updates for one market. Only active markets are pushed.
Update Speed: Real-time
|
inlinenodiscard |
Reward claim failed.
web3_prediction_pm_claim_fail.
Pushed when a claim fails completely — a single claim, or every item of a batch. For a batch, only the first failed item's amount and outcome are included.
Update Speed: Real-time
|
inlinenodiscard |
Reward claim succeeded.
web3_prediction_pm_claim_success.
Pushed when a claim fully succeeds — a single claim, or every item of a batch. Only the total is reported; no market title or outcome is included.
Update Speed: Real-time
|
friend |