forked from niXman/binapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerated_endpoints.hpp
More file actions
445 lines (433 loc) · 31.3 KB
/
generated_endpoints.hpp
File metadata and controls
445 lines (433 loc) · 31.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
// SPDX-License-Identifier: Apache-2.0
//
// binapi2 USD-M Futures client library.
/// @file
/// @brief Endpoint registry: compile-time metadata for every Binance USD-M Futures REST endpoint.
///
/// Each inline constexpr endpoint_metadata instance describes a single REST endpoint's
/// HTTP method, URL path, security level, and signing/timestamp requirements.
/// These are referenced by endpoint_traits specializations and by named service methods
/// for endpoints that share a request type.
#pragma once
#include <binapi2/fapi/types/enums.hpp>
#include <boost/beast/http/verb.hpp>
#include <string_view>
namespace binapi2::fapi::rest {
/// @brief Compile-time description of a single Binance REST endpoint.
///
/// Used by endpoint_traits and service methods to drive request construction.
struct endpoint_metadata
{
std::string_view name; ///< Human-readable endpoint name (for logging/diagnostics).
boost::beast::http::verb method; ///< HTTP method (GET, POST, PUT, DELETE).
std::string_view path; ///< URL path (e.g. "/fapi/v1/order").
types::security_type_t security; ///< Binance security level (none, market_data, trade, user_data, user_stream).
bool signed_request; ///< Whether the request must be HMAC-SHA256 signed.
bool requires_timestamp; ///< Whether a timestamp parameter must be appended.
bool allows_recv_window; ///< Whether the recvWindow parameter is accepted.
};
inline constexpr endpoint_metadata ping_endpoint{
"ping", boost::beast::http::verb::get, "/fapi/v1/ping", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata server_time_endpoint{
"server_time", boost::beast::http::verb::get, "/fapi/v1/time", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata exchange_info_endpoint{
"exchange_info", boost::beast::http::verb::get, "/fapi/v1/exchangeInfo", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata order_book_endpoint{
"order_book", boost::beast::http::verb::get, "/fapi/v1/depth", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata recent_trades_endpoint{
"recent_trades", boost::beast::http::verb::get, "/fapi/v1/trades", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata aggregate_trades_endpoint{
"aggregate_trades", boost::beast::http::verb::get, "/fapi/v1/aggTrades", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata klines_endpoint{
"klines", boost::beast::http::verb::get, "/fapi/v1/klines", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata continuous_klines_endpoint{ "continuous_klines",
boost::beast::http::verb::get,
"/fapi/v1/continuousKlines",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata index_price_klines_endpoint{ "index_price_klines",
boost::beast::http::verb::get,
"/fapi/v1/indexPriceKlines",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata mark_price_klines_endpoint{ "mark_price_klines",
boost::beast::http::verb::get,
"/fapi/v1/markPriceKlines",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata premium_index_klines_endpoint{ "premium_index_klines",
boost::beast::http::verb::get,
"/fapi/v1/premiumIndexKlines",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata book_ticker_endpoint{
"book_ticker", boost::beast::http::verb::get, "/fapi/v1/ticker/bookTicker", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata price_ticker_endpoint{
"price_ticker", boost::beast::http::verb::get, "/fapi/v1/ticker/price", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata ticker_24hr_endpoint{
"ticker_24hr", boost::beast::http::verb::get, "/fapi/v1/ticker/24hr", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata mark_price_endpoint{
"mark_price", boost::beast::http::verb::get, "/fapi/v1/premiumIndex", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata funding_rate_history_endpoint{ "funding_rate_history",
boost::beast::http::verb::get,
"/fapi/v1/fundingRate",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata funding_rate_info_endpoint{
"funding_rate_info", boost::beast::http::verb::get, "/fapi/v1/fundingInfo", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata open_interest_endpoint{
"open_interest", boost::beast::http::verb::get, "/fapi/v1/openInterest", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata open_interest_statistics_endpoint{ "open_interest_statistics",
boost::beast::http::verb::get,
"/futures/data/openInterestHist",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata top_long_short_account_ratio_endpoint{ "top_long_short_account_ratio",
boost::beast::http::verb::get,
"/futures/data/topLongShortAccountRatio",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata top_trader_long_short_ratio_endpoint{ "top_trader_long_short_ratio",
boost::beast::http::verb::get,
"/futures/data/topLongShortPositionRatio",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata long_short_ratio_endpoint{ "long_short_ratio",
boost::beast::http::verb::get,
"/futures/data/globalLongShortAccountRatio",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata taker_buy_sell_volume_endpoint{ "taker_buy_sell_volume",
boost::beast::http::verb::get,
"/futures/data/takerlongshortRatio",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata historical_trades_endpoint{ "historical_trades",
boost::beast::http::verb::get,
"/fapi/v1/historicalTrades",
types::security_type_t::market_data,
false,
false,
false };
inline constexpr endpoint_metadata account_information_endpoint{
"account_information", boost::beast::http::verb::get, "/fapi/v3/account", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata account_balances_endpoint{
"account_balances", boost::beast::http::verb::get, "/fapi/v3/balance", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata position_risk_endpoint{
"position_risk", boost::beast::http::verb::get, "/fapi/v2/positionRisk", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata start_listen_key_endpoint{ "start_listen_key",
boost::beast::http::verb::post,
"/fapi/v1/listenKey",
types::security_type_t::user_stream,
false,
false,
false };
inline constexpr endpoint_metadata keepalive_listen_key_endpoint{ "keepalive_listen_key",
boost::beast::http::verb::put,
"/fapi/v1/listenKey",
types::security_type_t::user_stream,
false,
false,
false };
inline constexpr endpoint_metadata close_listen_key_endpoint{ "close_listen_key",
boost::beast::http::verb::delete_,
"/fapi/v1/listenKey",
types::security_type_t::user_stream,
false,
false,
false };
inline constexpr endpoint_metadata new_order_endpoint{
"new_order", boost::beast::http::verb::post, "/fapi/v1/order", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata modify_order_endpoint{
"modify_order", boost::beast::http::verb::put, "/fapi/v1/order", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata cancel_order_endpoint{
"cancel_order", boost::beast::http::verb::delete_, "/fapi/v1/order", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata query_order_endpoint{
"query_order", boost::beast::http::verb::get, "/fapi/v1/order", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata basis_endpoint{
"basis", boost::beast::http::verb::get, "/futures/data/basis", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata price_ticker_v2_endpoint{
"price_ticker_v2", boost::beast::http::verb::get, "/fapi/v2/ticker/price", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata delivery_price_endpoint{
"delivery_price", boost::beast::http::verb::get, "/futures/data/delivery-price", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata composite_index_info_endpoint{ "composite_index_info",
boost::beast::http::verb::get,
"/fapi/v1/indexInfo",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata index_constituents_endpoint{ "index_constituents",
boost::beast::http::verb::get,
"/fapi/v1/constituents",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata asset_index_endpoint{
"asset_index", boost::beast::http::verb::get, "/fapi/v1/assetIndex", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata insurance_fund_endpoint{ "insurance_fund",
boost::beast::http::verb::get,
"/fapi/v1/insuranceBalance",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata adl_risk_endpoint{
"adl_risk", boost::beast::http::verb::get, "/fapi/v1/symbolAdlRisk", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata rpi_depth_endpoint{
"rpi_depth", boost::beast::http::verb::get, "/fapi/v1/rpiDepth", types::security_type_t::none, false, false, false
};
inline constexpr endpoint_metadata trading_schedule_endpoint{ "trading_schedule",
boost::beast::http::verb::get,
"/fapi/v1/tradingSchedule",
types::security_type_t::none,
false,
false,
false };
inline constexpr endpoint_metadata test_order_endpoint{
"test_order", boost::beast::http::verb::post, "/fapi/v1/order/test", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata batch_orders_endpoint{
"batch_orders", boost::beast::http::verb::post, "/fapi/v1/batchOrders", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata modify_batch_orders_endpoint{
"modify_batch_orders", boost::beast::http::verb::put, "/fapi/v1/batchOrders", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata cancel_batch_orders_endpoint{ "cancel_batch_orders",
boost::beast::http::verb::delete_,
"/fapi/v1/batchOrders",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata cancel_all_open_orders_endpoint{ "cancel_all_open_orders",
boost::beast::http::verb::delete_,
"/fapi/v1/allOpenOrders",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata auto_cancel_endpoint{
"auto_cancel", boost::beast::http::verb::post, "/fapi/v1/countdownCancelAll", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata query_open_order_endpoint{
"query_open_order", boost::beast::http::verb::get, "/fapi/v1/openOrder", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata all_open_orders_endpoint{
"all_open_orders", boost::beast::http::verb::get, "/fapi/v1/openOrders", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata all_orders_endpoint{
"all_orders", boost::beast::http::verb::get, "/fapi/v1/allOrders", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata position_risk_v3_endpoint{
"position_risk_v3", boost::beast::http::verb::get, "/fapi/v3/positionRisk", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata adl_quantile_endpoint{
"adl_quantile", boost::beast::http::verb::get, "/fapi/v1/adlQuantile", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata force_orders_endpoint{
"force_orders", boost::beast::http::verb::get, "/fapi/v1/forceOrders", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata account_trades_endpoint{
"account_trades", boost::beast::http::verb::get, "/fapi/v1/userTrades", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata change_position_mode_endpoint{ "change_position_mode",
boost::beast::http::verb::post,
"/fapi/v1/positionSide/dual",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata change_multi_assets_endpoint{ "change_multi_assets",
boost::beast::http::verb::post,
"/fapi/v1/multiAssetsMargin",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata change_leverage_endpoint{
"change_leverage", boost::beast::http::verb::post, "/fapi/v1/leverage", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata change_margin_type_endpoint{
"change_margin_type", boost::beast::http::verb::post, "/fapi/v1/marginType", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata modify_isolated_margin_endpoint{ "modify_isolated_margin",
boost::beast::http::verb::post,
"/fapi/v1/positionMargin",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata position_margin_history_endpoint{ "position_margin_history",
boost::beast::http::verb::get,
"/fapi/v1/positionMargin/history",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata order_modify_history_endpoint{ "order_modify_history",
boost::beast::http::verb::get,
"/fapi/v1/orderAmendment",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata new_algo_order_endpoint{
"new_algo_order", boost::beast::http::verb::post, "/fapi/v1/algoOrder", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata cancel_algo_order_endpoint{ "cancel_algo_order",
boost::beast::http::verb::delete_,
"/fapi/v1/algoOrder",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata query_algo_order_endpoint{
"query_algo_order", boost::beast::http::verb::get, "/fapi/v1/algoOrder", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata all_algo_orders_endpoint{
"all_algo_orders", boost::beast::http::verb::get, "/fapi/v1/allAlgoOrders", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata open_algo_orders_endpoint{
"open_algo_orders", boost::beast::http::verb::get, "/fapi/v1/openAlgoOrders", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata cancel_all_algo_orders_endpoint{ "cancel_all_algo_orders",
boost::beast::http::verb::delete_,
"/fapi/v1/algoOpenOrders",
types::security_type_t::trade,
true,
true,
true };
inline constexpr endpoint_metadata account_config_endpoint{
"account_config", boost::beast::http::verb::get, "/fapi/v1/accountConfig", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata symbol_config_endpoint{
"symbol_config", boost::beast::http::verb::get, "/fapi/v1/symbolConfig", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata get_multi_assets_mode_endpoint{ "get_multi_assets_mode",
boost::beast::http::verb::get,
"/fapi/v1/multiAssetsMargin",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata get_position_mode_endpoint{
"get_position_mode", boost::beast::http::verb::get, "/fapi/v1/positionSide/dual", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata income_history_endpoint{
"income_history", boost::beast::http::verb::get, "/fapi/v1/income", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata leverage_brackets_endpoint{
"leverage_brackets", boost::beast::http::verb::get, "/fapi/v1/leverageBracket", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata commission_rate_endpoint{
"commission_rate", boost::beast::http::verb::get, "/fapi/v1/commissionRate", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata rate_limit_order_endpoint{
"rate_limit_order", boost::beast::http::verb::get, "/fapi/v1/rateLimit/order", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata download_id_transaction_endpoint{ "download_id_transaction",
boost::beast::http::verb::get,
"/fapi/v1/income/asyn",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata download_link_transaction_endpoint{ "download_link_transaction",
boost::beast::http::verb::get,
"/fapi/v1/income/asyn/id",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata download_id_order_endpoint{
"download_id_order", boost::beast::http::verb::get, "/fapi/v1/order/asyn", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata download_link_order_endpoint{ "download_link_order",
boost::beast::http::verb::get,
"/fapi/v1/order/asyn/id",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata download_id_trade_endpoint{
"download_id_trade", boost::beast::http::verb::get, "/fapi/v1/trade/asyn", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata download_link_trade_endpoint{ "download_link_trade",
boost::beast::http::verb::get,
"/fapi/v1/trade/asyn/id",
types::security_type_t::user_data,
true,
true,
true };
inline constexpr endpoint_metadata get_bnb_burn_endpoint{
"get_bnb_burn", boost::beast::http::verb::get, "/fapi/v1/feeBurn", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata toggle_bnb_burn_endpoint{
"toggle_bnb_burn", boost::beast::http::verb::post, "/fapi/v1/feeBurn", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata quantitative_rules_endpoint{
"quantitative_rules", boost::beast::http::verb::get, "/fapi/v1/apiTradingStatus", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata convert_get_quote_endpoint{
"convert_get_quote", boost::beast::http::verb::post, "/fapi/v1/convert/getQuote", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata convert_accept_quote_endpoint{
"convert_accept_quote", boost::beast::http::verb::post, "/fapi/v1/convert/acceptQuote", types::security_type_t::trade, true, true, true
};
inline constexpr endpoint_metadata convert_order_status_endpoint{
"convert_order_status", boost::beast::http::verb::get, "/fapi/v1/convert/orderStatus", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata pm_account_info_endpoint{
"pm_account_info", boost::beast::http::verb::get, "/fapi/v1/pmAccountInfo", types::security_type_t::user_data, true, true, true
};
inline constexpr endpoint_metadata tradfi_perps_endpoint{
"tradfi_perps", boost::beast::http::verb::post, "/fapi/v1/stock/contract", types::security_type_t::trade, true, true, true
};
} // namespace binapi2::fapi::rest