|
Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
|
#include <otc_api.hpp>
|
explicit |
|
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:
| side | makerAmount | takerAmount |
|---|---|---|
| BUY | USDT (wei) | shares (wei) |
| SELL | shares (wei) | USDT (wei) |
| Request side | Response side (Integer) | Response quoteType |
|---|---|---|
| BUY | 0 | "Bid" |
| SELL | 1 | "Ask" |
|
inline |
Asynchronous create_otc_blocktrade().
Completes with void(std::exception_ptr, common::RestApiResponse<CreateOtcBlocktradeResponse>).
|
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:
|
inline |
Asynchronous fulfil_otc_blocktrade().
Completes with void(std::exception_ptr, common::RestApiResponse<FulfilOtcBlocktradeResponse>).
|
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:
|
inline |
Asynchronous get_otc_blocktrade_detail().
Completes with void(std::exception_ptr, common::RestApiResponse<GetOtcBlocktradeDetailResponse>).
|
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:
|
inline |
Asynchronous get_otc_blocktrade_events().
Completes with void(std::exception_ptr, common::RestApiResponse<GetOtcBlocktradeEventsResponse>).
|
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:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| type | STRING | YES | Asset type. Enum: USDT, SHARE |
| tokenId | STRING | NO | Outcome token id (present for SHARE entries only) |
|
inline |
Asynchronous get_otc_reserved_balances().
Completes with void(std::exception_ptr, common::RestApiResponse<GetOtcReservedBalancesResponse>).
|
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:
|
inline |
Asynchronous list_otc_blocktrades().
Completes with void(std::exception_ptr, common::RestApiResponse<ListOtcBlocktradesResponse>).
|
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:
|
inline |
Asynchronous preview_otc_blocktrade().
Completes with void(std::exception_ptr, common::RestApiResponse<PreviewOtcBlocktradeResponse>).
|
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:
|
inline |
Asynchronous remove_otc_blocktrades().
Completes with void(std::exception_ptr, common::RestApiResponse<RemoveOtcBlocktradesResponse>).