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

#include <otc_api.hpp>

Public Member Functions

 OtcApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< CreateOtcBlocktradeResponse > create_otc_blocktrade (const CreateOtcBlocktradeParams &params) const
 Create OTC Blocktrade (PREDICTION_TRADE).
template<class CompletionToken>
auto async_create_otc_blocktrade (const CreateOtcBlocktradeParams &params, CompletionToken &&token) const
 Asynchronous create_otc_blocktrade().
common::RestApiResponse< FulfilOtcBlocktradeResponse > fulfil_otc_blocktrade (const FulfilOtcBlocktradeParams &params) const
 Fulfil OTC Blocktrade (PREDICTION_TRADE).
template<class CompletionToken>
auto async_fulfil_otc_blocktrade (const FulfilOtcBlocktradeParams &params, CompletionToken &&token) const
 Asynchronous fulfil_otc_blocktrade().
common::RestApiResponse< GetOtcBlocktradeDetailResponse > get_otc_blocktrade_detail (const GetOtcBlocktradeDetailParams &params) const
 Get OTC Blocktrade Detail (PREDICTION_TRADE).
template<class CompletionToken>
auto async_get_otc_blocktrade_detail (const GetOtcBlocktradeDetailParams &params, CompletionToken &&token) const
 Asynchronous get_otc_blocktrade_detail().
common::RestApiResponse< GetOtcBlocktradeEventsResponse > get_otc_blocktrade_events (const GetOtcBlocktradeEventsParams &params={}) const
 Get OTC Blocktrade Events (PREDICTION_TRADE).
template<class CompletionToken>
auto async_get_otc_blocktrade_events (const GetOtcBlocktradeEventsParams &params, CompletionToken &&token) const
 Asynchronous get_otc_blocktrade_events().
common::RestApiResponse< GetOtcReservedBalancesResponse > get_otc_reserved_balances (const GetOtcReservedBalancesParams &params) const
 Get OTC Reserved Balances (PREDICTION_TRADE).
template<class CompletionToken>
auto async_get_otc_reserved_balances (const GetOtcReservedBalancesParams &params, CompletionToken &&token) const
 Asynchronous get_otc_reserved_balances().
common::RestApiResponse< ListOtcBlocktradesResponse > list_otc_blocktrades (const ListOtcBlocktradesParams &params={}) const
 List OTC Blocktrades (PREDICTION_TRADE).
template<class CompletionToken>
auto async_list_otc_blocktrades (const ListOtcBlocktradesParams &params, CompletionToken &&token) const
 Asynchronous list_otc_blocktrades().
common::RestApiResponse< PreviewOtcBlocktradeResponse > preview_otc_blocktrade (const PreviewOtcBlocktradeParams &params) const
 Preview OTC Blocktrade (PREDICTION_TRADE).
template<class CompletionToken>
auto async_preview_otc_blocktrade (const PreviewOtcBlocktradeParams &params, CompletionToken &&token) const
 Asynchronous preview_otc_blocktrade().
common::RestApiResponse< RemoveOtcBlocktradesResponse > remove_otc_blocktrades (const RemoveOtcBlocktradesParams &params) const
 Remove OTC Blocktrades (PREDICTION_TRADE).
template<class CompletionToken>
auto async_remove_otc_blocktrades (const RemoveOtcBlocktradesParams &params, CompletionToken &&token) const
 Asynchronous remove_otc_blocktrades().

Constructor & Destructor Documentation

◆ OtcApi()

binance::w3w_prediction::rest_api::OtcApi::OtcApi ( std::shared_ptr< common::RestClient > client)
explicit

Member Function Documentation

◆ create_otc_blocktrade()

common::RestApiResponse< CreateOtcBlocktradeResponse > binance::w3w_prediction::rest_api::OtcApi::create_otc_blocktrade ( const CreateOtcBlocktradeParams & params) const
nodiscard

Create OTC Blocktrade (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/create.

Create an OTC blocktrade as the maker (BID to buy outcome shares with USDT, or ASK to sell outcome shares for USDT). The maker wallet is resolved server-side by userId; signing is done server-side via SAS typedDataSign. Returns orderId and a one-time secretToken to share out-of-band with the intended taker.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.
  • Side & Amount Rules:
side makerAmount takerAmount
BUY USDT (wei) shares (wei)
SELL shares (wei) USDT (wei)
  • "Note on <tt>side</tt> encoding: this request uses a string enum (<tt>BUY</tt>/<tt>SELL</tt>). Responses from Get Blocktrade Detail / Preview / List return <tt>side</tt> as an integer and also include a <tt>quoteType</tt> string — both encode the same concept."
Request side Response side (Integer) Response quoteType
BUY 0 "Bid"
SELL 1 "Ask"

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#create-otc-blocktrade

◆ async_create_otc_blocktrade()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_create_otc_blocktrade ( const CreateOtcBlocktradeParams & params,
CompletionToken && token ) const
inline

Asynchronous create_otc_blocktrade().

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

◆ fulfil_otc_blocktrade()

common::RestApiResponse< FulfilOtcBlocktradeResponse > binance::w3w_prediction::rest_api::OtcApi::fulfil_otc_blocktrade ( const FulfilOtcBlocktradeParams & params) const
nodiscard

Fulfil OTC Blocktrade (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/fulfil.

Fulfil an open maker blocktrade as the taker, using the secretToken the maker shared out-of-band. All-or-nothing fill (no partial fill); the taker order is the server-derived symmetric inverse of the maker order.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#fulfil-otc-blocktrade

◆ async_fulfil_otc_blocktrade()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_fulfil_otc_blocktrade ( const FulfilOtcBlocktradeParams & params,
CompletionToken && token ) const
inline

Asynchronous fulfil_otc_blocktrade().

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

◆ get_otc_blocktrade_detail()

common::RestApiResponse< GetOtcBlocktradeDetailResponse > binance::w3w_prediction::rest_api::OtcApi::get_otc_blocktrade_detail ( const GetOtcBlocktradeDetailParams & params) const
nodiscard

Get OTC Blocktrade Detail (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/detail.

Query the maker's own blocktrade by orderId. Returns full order data including status and secretToken.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#get-otc-blocktrade-detail

◆ async_get_otc_blocktrade_detail()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_get_otc_blocktrade_detail ( const GetOtcBlocktradeDetailParams & params,
CompletionToken && token ) const
inline

Asynchronous get_otc_blocktrade_detail().

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

◆ get_otc_blocktrade_events()

common::RestApiResponse< GetOtcBlocktradeEventsResponse > binance::w3w_prediction::rest_api::OtcApi::get_otc_blocktrade_events ( const GetOtcBlocktradeEventsParams & params = {}) const
nodiscard

Get OTC Blocktrade Events (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/events.

Paginated feed of blocktrade lifecycle and settlement events (CREATE, FULFIL, MATCH_SUBMIT, MATCH_SUCCESS, EXPIRE, FAILED, etc.).

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#get-otc-blocktrade-events

◆ async_get_otc_blocktrade_events()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_get_otc_blocktrade_events ( const GetOtcBlocktradeEventsParams & params,
CompletionToken && token ) const
inline

Asynchronous get_otc_blocktrade_events().

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

◆ get_otc_reserved_balances()

common::RestApiResponse< GetOtcReservedBalancesResponse > binance::w3w_prediction::rest_api::OtcApi::get_otc_reserved_balances ( const GetOtcReservedBalancesParams & params) const
nodiscard

Get OTC Reserved Balances (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/reserved-balances.

Query PredictFun reserved balances for the caller's bound wallet — these are funds locked by the caller's open OTC blocktrade orders (maker BID locks USDT, maker ASK locks shares). Not tied to a specific blocktrade id; the path nesting under otc/blocktrade reflects the cause of the lock, not a per-order query. Returns one entry per requested asset, aligned with the request order. Pass {type:"USDT"} for reserved USDT, or {type:"SHARE", tokenId:"..."} for a specific outcome token's reserved shares.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.
  • AssetQuery:
Name Type Mandatory Description
type STRING YES Asset type. Enum: USDT, SHARE
tokenId STRING NO Outcome token id (present for SHARE entries only)

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#get-otc-reserved-balances

◆ async_get_otc_reserved_balances()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_get_otc_reserved_balances ( const GetOtcReservedBalancesParams & params,
CompletionToken && token ) const
inline

Asynchronous get_otc_reserved_balances().

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

◆ list_otc_blocktrades()

common::RestApiResponse< ListOtcBlocktradesResponse > binance::w3w_prediction::rest_api::OtcApi::list_otc_blocktrades ( const ListOtcBlocktradesParams & params = {}) const
nodiscard

List OTC Blocktrades (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/list.

List the maker's own blocktrades with optional status filter and cursor pagination.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#list-otc-blocktrades

◆ async_list_otc_blocktrades()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_list_otc_blocktrades ( const ListOtcBlocktradesParams & params,
CompletionToken && token ) const
inline

Asynchronous list_otc_blocktrades().

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

◆ preview_otc_blocktrade()

common::RestApiResponse< PreviewOtcBlocktradeResponse > binance::w3w_prediction::rest_api::OtcApi::preview_otc_blocktrade ( const PreviewOtcBlocktradeParams & params) const
nodiscard

Preview OTC Blocktrade (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/preview.

Inspect an open blocktrade by secretToken (no orderId needed). Taker uses this to preview the maker order before fulfilling. Returns the same shape as Get Blocktrade Detail, but orderId is null and secretToken is never returned from this endpoint.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#preview-otc-blocktrade

◆ async_preview_otc_blocktrade()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_preview_otc_blocktrade ( const PreviewOtcBlocktradeParams & params,
CompletionToken && token ) const
inline

Asynchronous preview_otc_blocktrade().

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

◆ remove_otc_blocktrades()

common::RestApiResponse< RemoveOtcBlocktradesResponse > binance::w3w_prediction::rest_api::OtcApi::remove_otc_blocktrades ( const RemoveOtcBlocktradesParams & params) const
nodiscard

Remove OTC Blocktrades (PREDICTION_TRADE).

POST /sapi/v1/w3w/wallet/prediction/otc/blocktrade/remove.

Cancel open or fulfilled-but-unsettled blocktrades. Terminal orders (already MATCHED/CANCELLED/EXPIRED/FAILED) are returned in noop instead of removed.

Weight(IP): 200

Security Type: PREDICTION_TRADE

Notes:

  • Restricted to authorized market makers. Requests from unauthorized accounts are rejected — contact BD to request access.

See https://developers.binance.com/en/docs/catalog/web3-wallet-prediction-trading/api/rest-api/otc#remove-otc-blocktrades

◆ async_remove_otc_blocktrades()

template<class CompletionToken>
auto binance::w3w_prediction::rest_api::OtcApi::async_remove_otc_blocktrades ( const RemoveOtcBlocktradesParams & params,
CompletionToken && token ) const
inline

Asynchronous remove_otc_blocktrades().

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