Skip to main content

futu_core/
proto_id.rs

1//! FutuOpenD API 协议 ID 常量
2//!
3//! 对应 C++ 中 `FTAPI_Define_ProtoID.h` 的定义。客户端与 OpenD 网关之间的
4//! 通信协议标识。
5//!
6//! **Stable API** — 所有常量均为稳定 ABI,外部 binary 可依赖。新增常量不算
7//! breaking;修改已有常量值 = breaking(C++ 对齐约束下不应发生)。
8
9// ========== 连接管理 ==========
10pub const INIT_CONNECT: u32 = 1001;
11pub const GET_GLOBAL_STATE: u32 = 1002;
12pub const NOTIFY: u32 = 1003;
13pub const KEEP_ALIVE: u32 = 1004;
14
15// ========== 额度查询 ==========
16pub const GET_USED_QUOTA: u32 = 1010;
17
18// ========== 行情协议 ==========
19pub const QOT_SUB: u32 = 3001;
20pub const QOT_REG_QOT_PUSH: u32 = 3002;
21pub const QOT_GET_SUB_INFO: u32 = 3003;
22pub const QOT_GET_BASIC_QOT: u32 = 3004;
23pub const QOT_UPDATE_BASIC_QOT: u32 = 3005;
24pub const QOT_GET_KL: u32 = 3006;
25pub const QOT_UPDATE_KL: u32 = 3007;
26pub const QOT_GET_RT: u32 = 3008;
27pub const QOT_UPDATE_RT: u32 = 3009;
28pub const QOT_GET_TICKER: u32 = 3010;
29pub const QOT_UPDATE_TICKER: u32 = 3011;
30pub const QOT_GET_ORDER_BOOK: u32 = 3012;
31pub const QOT_UPDATE_ORDER_BOOK: u32 = 3013;
32pub const QOT_GET_BROKER: u32 = 3014;
33pub const QOT_UPDATE_BROKER: u32 = 3015;
34pub const QOT_GET_ORDER_DETAIL: u32 = 3016;
35pub const QOT_UPDATE_ORDER_DETAIL: u32 = 3017;
36
37pub const QOT_GET_HISTORY_KL: u32 = 3100;
38pub const QOT_GET_HISTORY_KL_POINTS: u32 = 3101;
39pub const QOT_REQUEST_HISTORY_KL: u32 = 3103;
40
41pub const QOT_GET_TRADE_DATE: u32 = 3200;
42pub const QOT_GET_SUSPEND: u32 = 3201;
43pub const QOT_GET_STATIC_INFO: u32 = 3202;
44pub const QOT_GET_SECURITY_SNAPSHOT: u32 = 3203;
45pub const QOT_GET_PLATE_SET: u32 = 3204;
46pub const QOT_GET_PLATE_SECURITY: u32 = 3205;
47pub const QOT_GET_REFERENCE: u32 = 3206;
48pub const QOT_GET_OWNER_PLATE: u32 = 3207;
49pub const QOT_GET_HOLDING_CHANGE_LIST: u32 = 3208;
50pub const QOT_GET_OPTION_CHAIN: u32 = 3209;
51pub const QOT_GET_REHAB: u32 = 3702;
52
53// 新版 API
54pub const QOT_GET_WARRANT: u32 = 3210;
55pub const QOT_GET_CAPITAL_FLOW: u32 = 3211;
56pub const QOT_GET_CAPITAL_DISTRIBUTION: u32 = 3212;
57pub const QOT_GET_USER_SECURITY: u32 = 3213;
58pub const QOT_MODIFY_USER_SECURITY: u32 = 3214;
59pub const QOT_STOCK_FILTER: u32 = 3215;
60pub const QOT_GET_CODE_CHANGE: u32 = 3216;
61pub const QOT_GET_IPO_LIST: u32 = 3217;
62pub const QOT_GET_FUTURE_INFO: u32 = 3218;
63pub const QOT_REQUEST_TRADE_DATE: u32 = 3219;
64pub const QOT_SET_PRICE_REMINDER: u32 = 3220;
65pub const QOT_GET_PRICE_REMINDER: u32 = 3221;
66pub const QOT_GET_USER_SECURITY_GROUP: u32 = 3222;
67pub const QOT_GET_MARKET_STATE: u32 = 3223;
68pub const QOT_GET_OPTION_EXPIRATION_DATE: u32 = 3224;
69// Futu OpenAPI 10.6 QOT fundamental data / screen APIs.
70pub const QOT_GET_FINANCIALS_EARNINGS_PRICE_MOVE: u32 = 3225;
71pub const QOT_GET_FINANCIALS_EARNINGS_PRICE_HISTORY: u32 = 3226;
72pub const QOT_GET_FINANCIALS_STATEMENTS: u32 = 3227;
73pub const QOT_GET_FINANCIALS_REVENUE_BREAKDOWN: u32 = 3228;
74pub const QOT_GET_RESEARCH_ANALYST_CONSENSUS: u32 = 3229;
75pub const QOT_GET_RESEARCH_RATING_SUMMARY: u32 = 3230;
76pub const QOT_GET_RESEARCH_MORNINGSTAR_REPORT: u32 = 3231;
77pub const QOT_GET_VALUATION_DETAIL: u32 = 3232;
78pub const QOT_GET_VALUATION_PLATE_STOCK_LIST: u32 = 3233;
79pub const QOT_GET_CORPORATE_ACTIONS_DIVIDENDS: u32 = 3234;
80pub const QOT_GET_CORPORATE_ACTIONS_BUYBACKS: u32 = 3235;
81pub const QOT_GET_CORPORATE_ACTIONS_STOCK_SPLITS: u32 = 3236;
82pub const QOT_GET_SHAREHOLDERS_OVERVIEW: u32 = 3237;
83pub const QOT_GET_SHAREHOLDERS_HOLDING_CHANGES: u32 = 3238;
84pub const QOT_GET_SHAREHOLDERS_HOLDER_DETAIL: u32 = 3239;
85pub const QOT_GET_SHAREHOLDERS_INSTITUTIONAL: u32 = 3240;
86pub const QOT_GET_INSIDER_HOLDER_LIST: u32 = 3241;
87pub const QOT_GET_INSIDER_TRADE_LIST: u32 = 3242;
88pub const QOT_GET_COMPANY_PROFILE: u32 = 3243;
89pub const QOT_GET_COMPANY_EXECUTIVES: u32 = 3244;
90pub const QOT_GET_COMPANY_EXECUTIVE_BACKGROUND: u32 = 3245;
91pub const QOT_GET_COMPANY_OPERATIONAL_EFFICIENCY: u32 = 3246;
92pub const QOT_GET_TOP_TEN_BUY_SELL_BROKERS: u32 = 3247;
93pub const QOT_GET_DAILY_SHORT_VOLUME: u32 = 3248;
94pub const QOT_GET_SHORT_INTEREST: u32 = 3249;
95pub const QOT_GET_OPTION_VOLATILITY: u32 = 3250;
96pub const QOT_GET_OPTION_EXERCISE_PROBABILITY: u32 = 3251;
97pub const QOT_STOCK_SCREEN: u32 = 3252;
98pub const QOT_OPTION_SCREEN: u32 = 3253;
99pub const QOT_WARRANT_SCREEN: u32 = 3254;
100pub const QOT_GET_OPTION_QUOTE: u32 = 3255;
101pub const QOT_GET_OPTION_STRATEGY: u32 = 3256;
102pub const QOT_GET_OPTION_STRATEGY_ANALYSIS: u32 = 3257;
103pub const QOT_GET_OPTION_STRATEGY_SPREAD: u32 = 3258;
104/// Indicator public FTAPI lifecycle.
105///
106/// Ref: owned C++ source `APIServerCS_Define_ProtoID.h:140-142`. These are
107/// wire ABI identities, not server-configurable values; replace only when the
108/// upstream public FTAPI protocol changes.
109pub const QOT_GET_INDICATOR_LIST: u32 = 3259;
110pub const QOT_REQUEST_INDICATOR_CALC: u32 = 3260;
111pub const QOT_PUSH_INDICATOR_CALC: u32 = 3261;
112/// Search quote/news. Ref: C++ `APIServerCS_Define_ProtoID.h:144-145`.
113pub const QOT_GET_SEARCH_QUOTE: u32 = 3262;
114pub const QOT_GET_SEARCH_NEWS: u32 = 3263;
115pub const QOT_GET_OPTION_MARKET_STATISTIC: u32 = 3301;
116pub const QOT_GET_OPTION_UNDERLYING_RANK: u32 = 3305;
117pub const QOT_GET_OPTION_RANK: u32 = 3306;
118pub const QOT_GET_OPTION_EVENT: u32 = 3307;
119pub const QOT_GET_OPTION_EVENT_ALERT: u32 = 3308;
120pub const QOT_SET_OPTION_EVENT_ALERT: u32 = 3309;
121pub const QOT_GET_OPTION_ZERO_DTE_SCREENER: u32 = 3311;
122pub const QOT_GET_OPTION_ZERO_DTE_CONTRACT: u32 = 3312;
123pub const QOT_GET_OPTION_EARNINGS_SCREENER: u32 = 3313;
124pub const QOT_GET_OPTION_SELLER_SCREENER: u32 = 3314;
125pub const QOT_GET_OPTION_UNDERLYING_HIS_STATISTIC: u32 = 3302;
126pub const QOT_GET_OPTION_UNDERLYING_OVERVIEW: u32 = 3303;
127pub const QOT_GET_OPTION_UNDERLYING_HIS_VOLATILITY: u32 = 3304;
128// Futu OpenAPI 10.7+ QOT calendar, macro, rank, and hot-list APIs.
129// Ref: C++ feature/2606 `APIServerCS_Define_ProtoID.h` lists public QOT
130// 3401-3433. Rust stages them incrementally, with each shipped subset wired
131// through EndpointSpec/REST/MCP/CLI guards before release.
132pub const QOT_GET_EARNINGS_CALENDAR: u32 = 3401;
133pub const QOT_GET_MACRO_INDICATOR_LIST: u32 = 3402;
134pub const QOT_GET_MACRO_INDICATOR_HISTORY: u32 = 3403;
135pub const QOT_GET_FED_WATCH_TARGET_RATE: u32 = 3404;
136pub const QOT_GET_FED_WATCH_DOT_PLOT: u32 = 3405;
137pub const QOT_GET_EARNINGS_BEAT_RANK: u32 = 3406;
138pub const QOT_GET_DIVIDEND_RANK: u32 = 3407;
139pub const QOT_GET_DIVIDEND_CALENDAR: u32 = 3408;
140pub const QOT_GET_ECONOMIC_CALENDAR: u32 = 3409;
141pub const QOT_GET_US_PRE_MARKET_RANK: u32 = 3410;
142pub const QOT_GET_US_AFTER_HOURS_RANK: u32 = 3411;
143pub const QOT_GET_US_OVERNIGHT_RANK: u32 = 3412;
144pub const QOT_GET_TOP_MOVERS_RANK: u32 = 3413;
145pub const QOT_GET_HOT_LIST: u32 = 3414;
146pub const QOT_GET_SHORT_SELLING_RANK: u32 = 3415;
147pub const QOT_GET_PERIOD_CHANGE_RANK: u32 = 3416;
148pub const QOT_GET_HIGH_DIVIDEND_SOE_RANK: u32 = 3417;
149pub const QOT_GET_INSTITUTION_LIST: u32 = 3418;
150pub const QOT_GET_INSTITUTION_PROFILE: u32 = 3419;
151pub const QOT_GET_INSTITUTION_DISTRIBUTION: u32 = 3420;
152pub const QOT_GET_INSTITUTION_HOLDING_CHANGE: u32 = 3421;
153pub const QOT_GET_INSTITUTION_HOLDING_LIST: u32 = 3422;
154pub const QOT_GET_ARK_FUND_HOLDING: u32 = 3423;
155pub const QOT_GET_ARK_STOCK_DYNAMIC: u32 = 3424;
156pub const QOT_GET_ARK_ACTIVE_TRANSACTION: u32 = 3425;
157pub const QOT_GET_RATING_CHANGE: u32 = 3426;
158pub const QOT_GET_INDUSTRIAL_CHAIN_LIST: u32 = 3427;
159pub const QOT_GET_INDUSTRIAL_CHAIN_DETAIL: u32 = 3428;
160pub const QOT_GET_INDUSTRIAL_CHAIN_BY_PLATE: u32 = 3429;
161pub const QOT_GET_INDUSTRIAL_PLATE_INFO: u32 = 3430;
162pub const QOT_GET_INDUSTRIAL_PLATE_STOCK: u32 = 3431;
163pub const QOT_GET_HEAT_MAP_DATA: u32 = 3432;
164pub const QOT_GET_RISE_FALL_DISTRIBUTION: u32 = 3433;
165// Futu OpenAPI 10.9.6918 Event Contract public ABI.
166// Ref: C++ release/2607 APIServerCS_Define_ProtoID.h and
167// IAPIServer.cpp:132-146,302-316.
168pub const QOT_GET_EVENT_CONTRACT_CATEGORY: u32 = 3434;
169pub const QOT_FILTER_COMPETITION: u32 = 3435;
170pub const QOT_GET_EVENT_CONTRACT_SERIES_LIST: u32 = 3436;
171pub const QOT_GET_EVENT_CONTRACT_EVENT_LIST: u32 = 3437;
172pub const QOT_GET_EVENT_CONTRACT: u32 = 3438;
173pub const QOT_GET_EVENT_CONTRACT_MILESTONE_LIST: u32 = 3439;
174pub const QOT_GET_EVENT_CONTRACT_SNAPSHOT: u32 = 3445;
175pub const QOT_GET_EVENT_CONTRACT_ORDER_BOOK: u32 = 3446;
176pub const QOT_GET_EVENT_CONTRACT_KLINE: u32 = 3447;
177pub const QOT_GET_EVENT_CONTRACT_TICKER: u32 = 3448;
178pub const QOT_UPDATE_EVENT_CONTRACT_ORDER_BOOK: u32 = 3450;
179pub const QOT_UPDATE_EVENT_CONTRACT_KLINE: u32 = 3451;
180pub const QOT_UPDATE_EVENT_CONTRACT_TICKER: u32 = 3452;
181pub const QOT_GET_EVENT_CONTRACT_COMBO_LIST: u32 = 3453;
182pub const QOT_GET_EVENT_CONTRACT_COMBO_RFQ: u32 = 3454;
183pub const QOT_SUB_EVENT_CONTRACT: u32 = 3455;
184pub const QOT_REQUEST_HISTORY_EVENT_CONTRACT_KL: u32 = 3456;
185/// v1.8 daemon-local public extension IDs. These are guarded against the pinned official
186/// `APIServerCS_Define_ProtoID.h` snapshot by `futu-command-spec` at build time.
187pub const QOT_GET_SECURITY_TRADING_SESSIONS: u32 = 0x7F10_0001;
188pub const QOT_GET_MARKET_TRADING_SESSIONS: u32 = 0x7F10_0002;
189pub const QOT_GET_HOT_NEWS: u32 = 0x7F10_0003;
190pub const QOT_GET_LATEST_NEWS: u32 = 0x7F10_0004;
191pub const QOT_GET_WATCHLIST_NEWS: u32 = 0x7F10_0005;
192pub const QOT_GET_WATCHLIST_ANNOUNCEMENT: u32 = 0x7F10_0006;
193pub const QOT_GET_WATCHLIST_RATING: u32 = 0x7F10_0007;
194pub const QOT_GET_STOCK_NEWS: u32 = 0x7F10_0008;
195pub const QOT_ETF_SCREEN: u32 = 0x7F10_0009;
196pub const QOT_FUND_SCREEN: u32 = 0x7F10_000A;
197pub const QOT_FUTURE_SCREEN: u32 = 0x7F10_000B;
198pub const QOT_BOND_SCREEN: u32 = 0x7F10_000C;
199pub const QOT_GET_KLINE_PATTERN: u32 = 0x7F10_000D;
200pub const QOT_GET_KLINE_PATTERN_STATISTICS: u32 = 0x7F10_000E;
201pub const QOT_GET_KLINE_PATTERN_STOCKS: u32 = 0x7F10_000F;
202pub const QOT_GET_KLINE_PATTERN_PERFORMANCE: u32 = 0x7F10_0010;
203pub const QOT_GET_KLINE_PATTERN_CATALOG: u32 = 0x7F10_0011;
204pub const QOT_GET_STOCK_NOTE_LABELS: u32 = 0x7F10_0012;
205pub const QOT_GET_STOCK_NOTES: u32 = 0x7F10_0013;
206pub const QOT_SET_STOCK_NOTE: u32 = 0x7F10_0014;
207pub const QOT_UPDATE_STOCK_NOTE: u32 = 0x7F10_0015;
208
209/// Daemon-local v1.8 pre-order account-impact preview extension.
210pub const TRD_PREVIEW_ORDER_IMPACT: u32 = 22_711;
211/// Daemon-local v1.8 customer+broker-area performance extensions.
212pub const TRD_GET_ASSET_TREND: u32 = 22_712;
213pub const TRD_GET_YIELD_TREND: u32 = 22_713;
214pub const TRD_GET_RETURN_CALENDAR: u32 = 22_714;
215/// Daemon-local v1.8 cache-only order relation graph extension.
216pub const TRD_GET_ORDER_RELATIONS: u32 = 22_715;
217/// v1.8 position-related corporate-action risk projection.
218pub const TRD_GET_POSITION_CORPORATE_ACTIONS: u32 = 22_716;
219/// v1.8 guarded atomic BFF group-order mutations.
220pub const TRD_PLACE_ORDER_GROUP: u32 = 22_717;
221pub const TRD_MODIFY_ORDER_GROUP: u32 = 22_718;
222pub const TRD_CANCEL_ORDER_GROUP: u32 = 22_719;
223pub const TRD_DELETE_ORDER_GROUP: u32 = 22_720;
224/// v1.8 guarded complete algorithm-order mutations and execution logs.
225pub const TRD_PLACE_ALGO_ORDER: u32 = 22_721;
226pub const TRD_MODIFY_ALGO_ORDER: u32 = 22_722;
227pub const TRD_GET_ALGO_ORDER_LOGS: u32 = 22_723;
228/// v1.8 guarded server-atomic position actions.
229pub const TRD_REVERSE_POSITION: u32 = 22_724;
230pub const TRD_ROLL_POSITION: u32 = 22_725;
231pub const TRD_CLEAR_FUTURES_POSITIONS: u32 = 22_726;
232pub const TRD_BATCH_CLOSE_POSITIONS: u32 = 22_727;
233pub const QOT_GET_TECHNICAL_UNUSUAL: u32 = 3801;
234pub const QOT_GET_FINANCIAL_UNUSUAL: u32 = 3802;
235pub const QOT_GET_DERIVATIVE_UNUSUAL: u32 = 3803;
236pub const QOT_UPDATE_PRICE_REMINDER: u32 = 3019;
237/// C++ `FTAPI_ProtoID_Qot_UpdateOptionEvent`.
238/// Ref: `APIServerCS_Define_ProtoID.h:156`.
239pub const QOT_UPDATE_OPTION_EVENT: u32 = 3310;
240pub const QOT_REQUEST_HISTORY_KL_QUOTA: u32 = 3104;
241pub const QOT_REQUEST_REHAB: u32 = 3105;
242
243// 其他
244pub const VERIFICATION: u32 = 1006;
245pub const GET_USER_INFO: u32 = 1005;
246pub const GET_DELAY_STATISTICS: u32 = 1007;
247pub const TEST_CMD: u32 = 1008;
248pub const REMOTE_CMD: u32 = 1009;
249
250// NN/MM token enablement and binding-state query, useful for unlock-trade diagnostics.
251pub const GET_TOKEN_STATE: u32 = 1326;
252
253// Risk-free-rate query for option pricing; returns HK / US / JP rates.
254pub const QOT_GET_RISK_FREE_RATE: u32 = 20231;
255
256// Mobile/moomoo financial calendar view query; internal/extension backend
257// command used by legacy Rust-only financial-calendar surfaces. Public
258// OpenAPI earnings calendar is QOT_GET_EARNINGS_CALENDAR (3401).
259pub const QOT_GET_FINANCIAL_CALENDAR_VIEW_INTERNAL: u32 = 20025;
260// Mobile/moomoo target-stock financial calendar search.
261// Rust OpenD read-only extension; backend/platform CMD20426.
262pub const QOT_SEARCH_TARGET_FINANCIAL_CALENDAR: u32 = 20426;
263
264// Spread-table query for quote price increments.
265pub const QOT_GET_SPREAD_TABLE: u32 = 6503;
266
267// Ticker-statistic summary query.
268pub const QOT_GET_TICKER_STATISTIC: u32 = 6365;
269// Ticker-statistic detail query; returns statistic rows plus pagination metadata.
270pub const QOT_GET_TICKER_STATISTIC_DETAIL: u32 = 6366;
271
272// ========== 交易协议 ==========
273pub const TRD_GET_ACC_LIST: u32 = 2001;
274pub const TRD_UNLOCK_TRADE: u32 = 2005;
275pub const TRD_SUB_ACC_PUSH: u32 = 2008;
276
277/// Rust-daemon local public proto_id for CLI/raw TCP account-push unsubscribe.
278///
279/// C++/backend only defines `TRD_SUB_ACC_PUSH` (2008) with `acc_id_list`; it has
280/// no sub/unsub discriminator. Rust therefore needs a daemon-local routing id
281/// for account-push unsubscribe. This low-bit id is intentionally public-reachable
282/// for `futucli unsub-acc-push`; it must not be forwarded to backend.
283pub const TRD_UNSUB_ACC_PUSH_LOCAL: u32 = 0x7FFF_0000 | TRD_SUB_ACC_PUSH;
284
285/// Daemon-internal proto_id for `/api/unsub-acc-push`.
286///
287/// **不是真 backend cmd_id** — backend `Trd_SubAccPush` proto 只有
288/// `acc_id_list`, 没有 sub/unsub 区分. daemon 用此 internal proto_id 路由到
289/// `UnsubAccPushHandler` (调 `unsubscribe_trd_acc` 真撤订阅), 不发 backend.
290///
291/// **0x80000000 标记 bit**: 内部合成 ID, 不与真 backend cmd_id 冲突. 真
292/// backend 看到此 ID 会 reject (但不会到达 backend, daemon-local handler
293/// 直接处理). REST `/api/unsub-acc-push` routes to this daemon-local handler.
294pub const TRD_UNSUB_ACC_PUSH_INTERNAL: u32 = 0x8000_0000 | 2008;
295
296// 交易新版 API
297pub const TRD_GET_MARGIN_RATIO: u32 = 2223;
298pub const TRD_GET_ORDER_FEE: u32 = 2225;
299pub const TRD_FLOW_SUMMARY: u32 = 2226;
300
301// Cash log, cash detail, and business-group query endpoints.
302pub const TRD_GET_CASH_LOG: u32 = 22701; // mobile clt_cmd 3000
303pub const TRD_GET_CASH_DETAIL: u32 = 22702; // mobile clt_cmd 3001
304pub const TRD_GET_BIZ_GROUP: u32 = 22703; // mobile clt_cmd 3002
305
306// Margin-account information per market.
307pub const TRD_GET_MARGIN_INFO: u32 = 22704;
308// Backend NN command IDs for per-market margin-info routing.
309
310// Account compliance flags for product access, risk assessment, and opt-in status.
311pub const TRD_GET_ACCOUNT_FLAG: u32 = 22705; // FTAPI client→daemon
312
313// Bond holdings and bond trade-preparation endpoints.
314// Only HK / US / SG bond accounts normally return data; other accounts may return empty.
315pub const TRD_GET_BOND_TOTAL_ASSET: u32 = 22706; // 账户债券总持仓
316pub const TRD_GET_BOND_SINGLE_ASSET: u32 = 22707; // 单只债券持仓
317pub const TRD_GET_BOND_POSITION_LIST: u32 = 22708; // 账户债券持仓列表
318pub const TRD_GET_BOND_ANSWER_STATE: u32 = 22709; // 是否需要答题
319pub const TRD_GET_BOND_TRADE_REMINDER: u32 = 22710; // 交易提醒 (是否可买/复杂/高风险等)
320// daemon→backend NN cmd_id (mobile clt_cmd_* 同号)
321
322pub const TRD_GET_FUNDS: u32 = 2101;
323pub const TRD_GET_POSITION_LIST: u32 = 2102;
324pub const TRD_GET_MAX_TRD_QTYS: u32 = 2111;
325pub const TRD_GET_COMBO_MAX_TRD_QTYS: u32 = 2112;
326pub const TRD_GET_ORDER_LIST: u32 = 2201;
327pub const TRD_PLACE_ORDER: u32 = 2202;
328pub const TRD_MODIFY_ORDER: u32 = 2205;
329pub const TRD_UPDATE_ORDER: u32 = 2208;
330pub const TRD_GET_ORDER_FILL_LIST: u32 = 2211;
331pub const TRD_UPDATE_ORDER_FILL: u32 = 2218;
332pub const TRD_GET_HISTORY_ORDER_LIST: u32 = 2221;
333pub const TRD_GET_HISTORY_ORDER_FILL_LIST: u32 = 2222;
334pub const TRD_PLACE_COMBO_ORDER: u32 = 2227;
335pub const TRD_RECONFIRM_ORDER: u32 = 2237;
336pub const TRD_NOTIFY: u32 = 2240;
337
338/// **Stable API** — 判断协议 ID 是否为推送类型。
339///
340/// 跨 futu-net / futu-server 共享判定,避免两处独立 match 漂移。
341#[must_use]
342pub fn is_push_proto(proto_id: u32) -> bool {
343    matches!(
344        proto_id,
345        NOTIFY
346            | QOT_UPDATE_BASIC_QOT
347            | QOT_UPDATE_KL
348            | QOT_UPDATE_RT
349            | QOT_UPDATE_TICKER
350            | QOT_UPDATE_ORDER_BOOK
351            | QOT_UPDATE_BROKER
352            | QOT_UPDATE_ORDER_DETAIL
353            | QOT_UPDATE_PRICE_REMINDER
354            | QOT_UPDATE_OPTION_EVENT
355            | QOT_PUSH_INDICATOR_CALC
356            | TRD_UPDATE_ORDER
357            | TRD_UPDATE_ORDER_FILL
358            | TRD_NOTIFY
359    )
360}
361
362#[cfg(test)]
363mod tests;