1use axum::extract::{Json, State};
4use serde_json::Value;
5
6use futu_core::proto_id;
7
8use super::*;
9
10mod unusual;
11pub use unusual::{get_derivative_unusual, get_financial_unusual, get_technical_unusual};
12
13pub async fn get_plate_set(
14 State(state): State<RestState>,
15 Json(body): Json<Value>,
16) -> RawApiResult {
17 adapter::proto_request_raw::<qot_get_plate_set::Request, qot_get_plate_set::Response>(
18 &state,
19 proto_id::QOT_GET_PLATE_SET,
20 Some(body),
21 )
22 .await
23}
24
25pub async fn get_plate_security(
27 State(state): State<RestState>,
28 Json(body): Json<Value>,
29) -> RawApiResult {
30 adapter::proto_request_raw::<qot_get_plate_security::Request, qot_get_plate_security::Response>(
31 &state,
32 proto_id::QOT_GET_PLATE_SECURITY,
33 Some(body),
34 )
35 .await
36}
37
38pub async fn get_reference(
40 State(state): State<RestState>,
41 Json(body): Json<Value>,
42) -> RawApiResult {
43 adapter::proto_request_raw::<qot_get_reference::Request, qot_get_reference::Response>(
44 &state,
45 proto_id::QOT_GET_REFERENCE,
46 Some(body),
47 )
48 .await
49}
50
51pub async fn get_owner_plate(
53 State(state): State<RestState>,
54 Json(body): Json<Value>,
55) -> RawApiResult {
56 adapter::proto_request_raw::<qot_get_owner_plate::Request, qot_get_owner_plate::Response>(
57 &state,
58 proto_id::QOT_GET_OWNER_PLATE,
59 Some(body),
60 )
61 .await
62}
63
64pub async fn get_option_chain(
66 State(state): State<RestState>,
67 Json(body): Json<Value>,
68) -> RawApiResult {
69 adapter::proto_request_raw::<qot_get_option_chain::Request, qot_get_option_chain::Response>(
70 &state,
71 proto_id::QOT_GET_OPTION_CHAIN,
72 Some(body),
73 )
74 .await
75}
76
77pub async fn get_option_quote(
79 State(state): State<RestState>,
80 Json(body): Json<Value>,
81) -> RawApiResult {
82 adapter::proto_request_raw::<qot_get_option_quote::Request, qot_get_option_quote::Response>(
83 &state,
84 proto_id::QOT_GET_OPTION_QUOTE,
85 Some(body),
86 )
87 .await
88}
89
90pub async fn get_option_strategy(
92 State(state): State<RestState>,
93 Json(body): Json<Value>,
94) -> RawApiResult {
95 adapter::proto_request_raw::<
96 qot_get_option_strategy::Request,
97 qot_get_option_strategy::Response,
98 >(&state, proto_id::QOT_GET_OPTION_STRATEGY, Some(body))
99 .await
100}
101
102pub async fn get_option_strategy_analysis(
104 State(state): State<RestState>,
105 Json(body): Json<Value>,
106) -> RawApiResult {
107 adapter::proto_request_raw::<
108 qot_get_option_strategy_analysis::Request,
109 qot_get_option_strategy_analysis::Response,
110 >(
111 &state,
112 proto_id::QOT_GET_OPTION_STRATEGY_ANALYSIS,
113 Some(body),
114 )
115 .await
116}
117
118pub async fn get_option_strategy_spread(
120 State(state): State<RestState>,
121 Json(body): Json<Value>,
122) -> RawApiResult {
123 adapter::proto_request_raw::<
124 qot_get_option_strategy_spread::Request,
125 qot_get_option_strategy_spread::Response,
126 >(&state, proto_id::QOT_GET_OPTION_STRATEGY_SPREAD, Some(body))
127 .await
128}
129
130pub async fn get_warrant(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
132 adapter::proto_request_raw::<qot_get_warrant::Request, qot_get_warrant::Response>(
133 &state,
134 proto_id::QOT_GET_WARRANT,
135 Some(body),
136 )
137 .await
138}
139
140pub async fn get_capital_flow(
142 State(state): State<RestState>,
143 Json(body): Json<Value>,
144) -> RawApiResult {
145 adapter::proto_request_raw::<qot_get_capital_flow::Request, qot_get_capital_flow::Response>(
146 &state,
147 proto_id::QOT_GET_CAPITAL_FLOW,
148 Some(body),
149 )
150 .await
151}
152
153pub async fn get_capital_distribution(
155 State(state): State<RestState>,
156 Json(body): Json<Value>,
157) -> RawApiResult {
158 adapter::proto_request_raw::<
159 qot_get_capital_distribution::Request,
160 qot_get_capital_distribution::Response,
161 >(&state, proto_id::QOT_GET_CAPITAL_DISTRIBUTION, Some(body))
162 .await
163}
164
165pub async fn get_company_profile(
167 State(state): State<RestState>,
168 Json(body): Json<Value>,
169) -> RawApiResult {
170 adapter::proto_request_raw::<qot_get_company_profile::Request, qot_get_company_profile::Response>(
171 &state,
172 proto_id::QOT_GET_COMPANY_PROFILE,
173 Some(body),
174 )
175 .await
176}
177
178pub async fn get_company_executives(
180 State(state): State<RestState>,
181 Json(body): Json<Value>,
182) -> RawApiResult {
183 adapter::proto_request_raw::<
184 qot_get_company_executives::Request,
185 qot_get_company_executives::Response,
186 >(&state, proto_id::QOT_GET_COMPANY_EXECUTIVES, Some(body))
187 .await
188}
189
190pub async fn get_company_executive_background(
192 State(state): State<RestState>,
193 Json(body): Json<Value>,
194) -> RawApiResult {
195 adapter::proto_request_raw::<
196 qot_get_company_executive_background::Request,
197 qot_get_company_executive_background::Response,
198 >(
199 &state,
200 proto_id::QOT_GET_COMPANY_EXECUTIVE_BACKGROUND,
201 Some(body),
202 )
203 .await
204}
205
206pub async fn get_company_operational_efficiency(
208 State(state): State<RestState>,
209 Json(body): Json<Value>,
210) -> RawApiResult {
211 adapter::proto_request_raw::<
212 qot_get_company_operational_efficiency::Request,
213 qot_get_company_operational_efficiency::Response,
214 >(
215 &state,
216 proto_id::QOT_GET_COMPANY_OPERATIONAL_EFFICIENCY,
217 Some(body),
218 )
219 .await
220}
221
222pub async fn get_financials_earnings_price_move(
224 State(state): State<RestState>,
225 Json(body): Json<Value>,
226) -> RawApiResult {
227 adapter::proto_request_raw::<
228 qot_get_financials_earnings_price_move::Request,
229 qot_get_financials_earnings_price_move::Response,
230 >(
231 &state,
232 proto_id::QOT_GET_FINANCIALS_EARNINGS_PRICE_MOVE,
233 Some(body),
234 )
235 .await
236}
237
238pub async fn get_financials_earnings_price_history(
240 State(state): State<RestState>,
241 Json(body): Json<Value>,
242) -> RawApiResult {
243 adapter::proto_request_raw::<
244 qot_get_financials_earnings_price_history::Request,
245 qot_get_financials_earnings_price_history::Response,
246 >(
247 &state,
248 proto_id::QOT_GET_FINANCIALS_EARNINGS_PRICE_HISTORY,
249 Some(body),
250 )
251 .await
252}
253
254pub async fn get_financials_statements(
256 State(state): State<RestState>,
257 Json(body): Json<Value>,
258) -> RawApiResult {
259 adapter::proto_request_raw::<
260 qot_get_financials_statements::Request,
261 qot_get_financials_statements::Response,
262 >(&state, proto_id::QOT_GET_FINANCIALS_STATEMENTS, Some(body))
263 .await
264}
265
266pub async fn get_financials_revenue_breakdown(
268 State(state): State<RestState>,
269 Json(body): Json<Value>,
270) -> RawApiResult {
271 adapter::proto_request_raw::<
272 qot_get_financials_revenue_breakdown::Request,
273 qot_get_financials_revenue_breakdown::Response,
274 >(
275 &state,
276 proto_id::QOT_GET_FINANCIALS_REVENUE_BREAKDOWN,
277 Some(body),
278 )
279 .await
280}
281
282pub async fn get_research_analyst_consensus(
284 State(state): State<RestState>,
285 Json(body): Json<Value>,
286) -> RawApiResult {
287 adapter::proto_request_raw::<
288 qot_get_research_analyst_consensus::Request,
289 qot_get_research_analyst_consensus::Response,
290 >(
291 &state,
292 proto_id::QOT_GET_RESEARCH_ANALYST_CONSENSUS,
293 Some(body),
294 )
295 .await
296}
297
298pub async fn get_research_rating_summary(
300 State(state): State<RestState>,
301 Json(body): Json<Value>,
302) -> RawApiResult {
303 adapter::proto_request_raw::<
304 qot_get_research_rating_summary::Request,
305 qot_get_research_rating_summary::Response,
306 >(
307 &state,
308 proto_id::QOT_GET_RESEARCH_RATING_SUMMARY,
309 Some(body),
310 )
311 .await
312}
313
314pub async fn get_research_morningstar_report(
316 State(state): State<RestState>,
317 Json(body): Json<Value>,
318) -> RawApiResult {
319 adapter::proto_request_raw::<
320 qot_get_research_morningstar_report::Request,
321 qot_get_research_morningstar_report::Response,
322 >(
323 &state,
324 proto_id::QOT_GET_RESEARCH_MORNINGSTAR_REPORT,
325 Some(body),
326 )
327 .await
328}
329
330pub async fn get_valuation_detail(
332 State(state): State<RestState>,
333 Json(body): Json<Value>,
334) -> RawApiResult {
335 adapter::proto_request_raw::<
336 qot_get_valuation_detail::Request,
337 qot_get_valuation_detail::Response,
338 >(&state, proto_id::QOT_GET_VALUATION_DETAIL, Some(body))
339 .await
340}
341
342pub async fn get_valuation_plate_stock_list(
344 State(state): State<RestState>,
345 Json(body): Json<Value>,
346) -> RawApiResult {
347 adapter::proto_request_raw::<
348 qot_get_valuation_plate_stock_list::Request,
349 qot_get_valuation_plate_stock_list::Response,
350 >(
351 &state,
352 proto_id::QOT_GET_VALUATION_PLATE_STOCK_LIST,
353 Some(body),
354 )
355 .await
356}
357
358pub async fn get_corporate_actions_buybacks(
360 State(state): State<RestState>,
361 Json(body): Json<Value>,
362) -> RawApiResult {
363 adapter::proto_request_raw::<
364 qot_get_corporate_actions_buybacks::Request,
365 qot_get_corporate_actions_buybacks::Response,
366 >(
367 &state,
368 proto_id::QOT_GET_CORPORATE_ACTIONS_BUYBACKS,
369 Some(body),
370 )
371 .await
372}
373
374pub async fn get_corporate_actions_dividends(
376 State(state): State<RestState>,
377 Json(body): Json<Value>,
378) -> RawApiResult {
379 adapter::proto_request_raw::<
380 qot_get_corporate_actions_dividends::Request,
381 qot_get_corporate_actions_dividends::Response,
382 >(
383 &state,
384 proto_id::QOT_GET_CORPORATE_ACTIONS_DIVIDENDS,
385 Some(body),
386 )
387 .await
388}
389
390pub async fn get_corporate_actions_stock_splits(
392 State(state): State<RestState>,
393 Json(body): Json<Value>,
394) -> RawApiResult {
395 adapter::proto_request_raw::<
396 qot_get_corporate_actions_stock_splits::Request,
397 qot_get_corporate_actions_stock_splits::Response,
398 >(
399 &state,
400 proto_id::QOT_GET_CORPORATE_ACTIONS_STOCK_SPLITS,
401 Some(body),
402 )
403 .await
404}
405
406pub async fn get_daily_short_volume(
408 State(state): State<RestState>,
409 Json(body): Json<Value>,
410) -> RawApiResult {
411 adapter::proto_request_raw::<
412 qot_get_daily_short_volume::Request,
413 qot_get_daily_short_volume::Response,
414 >(&state, proto_id::QOT_GET_DAILY_SHORT_VOLUME, Some(body))
415 .await
416}
417
418pub async fn get_short_interest(
420 State(state): State<RestState>,
421 Json(body): Json<Value>,
422) -> RawApiResult {
423 adapter::proto_request_raw::<qot_get_short_interest::Request, qot_get_short_interest::Response>(
424 &state,
425 proto_id::QOT_GET_SHORT_INTEREST,
426 Some(body),
427 )
428 .await
429}
430
431pub async fn get_top_ten_buy_sell_brokers(
433 State(state): State<RestState>,
434 Json(body): Json<Value>,
435) -> RawApiResult {
436 adapter::proto_request_raw::<
437 qot_get_top_ten_buy_sell_brokers::Request,
438 qot_get_top_ten_buy_sell_brokers::Response,
439 >(
440 &state,
441 proto_id::QOT_GET_TOP_TEN_BUY_SELL_BROKERS,
442 Some(body),
443 )
444 .await
445}
446
447pub async fn get_shareholders_overview(
449 State(state): State<RestState>,
450 Json(body): Json<Value>,
451) -> RawApiResult {
452 adapter::proto_request_raw::<
453 qot_get_shareholders_overview::Request,
454 qot_get_shareholders_overview::Response,
455 >(&state, proto_id::QOT_GET_SHAREHOLDERS_OVERVIEW, Some(body))
456 .await
457}
458
459pub async fn get_shareholders_holding_changes(
461 State(state): State<RestState>,
462 Json(body): Json<Value>,
463) -> RawApiResult {
464 adapter::proto_request_raw::<
465 qot_get_shareholders_holding_changes::Request,
466 qot_get_shareholders_holding_changes::Response,
467 >(
468 &state,
469 proto_id::QOT_GET_SHAREHOLDERS_HOLDING_CHANGES,
470 Some(body),
471 )
472 .await
473}
474
475pub async fn get_shareholders_holder_detail(
477 State(state): State<RestState>,
478 Json(body): Json<Value>,
479) -> RawApiResult {
480 adapter::proto_request_raw::<
481 qot_get_shareholders_holder_detail::Request,
482 qot_get_shareholders_holder_detail::Response,
483 >(
484 &state,
485 proto_id::QOT_GET_SHAREHOLDERS_HOLDER_DETAIL,
486 Some(body),
487 )
488 .await
489}
490
491pub async fn get_shareholders_institutional(
493 State(state): State<RestState>,
494 Json(body): Json<Value>,
495) -> RawApiResult {
496 adapter::proto_request_raw::<
497 qot_get_shareholders_institutional::Request,
498 qot_get_shareholders_institutional::Response,
499 >(
500 &state,
501 proto_id::QOT_GET_SHAREHOLDERS_INSTITUTIONAL,
502 Some(body),
503 )
504 .await
505}
506
507pub async fn get_insider_holder_list(
509 State(state): State<RestState>,
510 Json(body): Json<Value>,
511) -> RawApiResult {
512 adapter::proto_request_raw::<
513 qot_get_insider_holder_list::Request,
514 qot_get_insider_holder_list::Response,
515 >(&state, proto_id::QOT_GET_INSIDER_HOLDER_LIST, Some(body))
516 .await
517}
518
519pub async fn get_insider_trade_list(
521 State(state): State<RestState>,
522 Json(body): Json<Value>,
523) -> RawApiResult {
524 adapter::proto_request_raw::<
525 qot_get_insider_trade_list::Request,
526 qot_get_insider_trade_list::Response,
527 >(&state, proto_id::QOT_GET_INSIDER_TRADE_LIST, Some(body))
528 .await
529}
530
531pub async fn get_option_volatility(
533 State(state): State<RestState>,
534 Json(body): Json<Value>,
535) -> RawApiResult {
536 adapter::proto_request_raw::<
537 qot_get_option_volatility::Request,
538 qot_get_option_volatility::Response,
539 >(&state, proto_id::QOT_GET_OPTION_VOLATILITY, Some(body))
540 .await
541}
542
543pub async fn get_option_exercise_probability(
545 State(state): State<RestState>,
546 Json(body): Json<Value>,
547) -> RawApiResult {
548 adapter::proto_request_raw::<
549 qot_get_option_exercise_probability::Request,
550 qot_get_option_exercise_probability::Response,
551 >(
552 &state,
553 proto_id::QOT_GET_OPTION_EXERCISE_PROBABILITY,
554 Some(body),
555 )
556 .await
557}
558
559pub async fn stock_screen(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
561 adapter::proto_request_raw::<qot_stock_screen::Request, qot_stock_screen::Response>(
562 &state,
563 proto_id::QOT_STOCK_SCREEN,
564 Some(body),
565 )
566 .await
567}
568
569pub async fn option_screen(
571 State(state): State<RestState>,
572 Json(body): Json<Value>,
573) -> RawApiResult {
574 adapter::proto_request_raw::<qot_option_screen::Request, qot_option_screen::Response>(
575 &state,
576 proto_id::QOT_OPTION_SCREEN,
577 Some(body),
578 )
579 .await
580}
581
582pub async fn warrant_screen(
584 State(state): State<RestState>,
585 Json(body): Json<Value>,
586) -> RawApiResult {
587 adapter::proto_request_raw::<qot_warrant_screen::Request, qot_warrant_screen::Response>(
588 &state,
589 proto_id::QOT_WARRANT_SCREEN,
590 Some(body),
591 )
592 .await
593}
594
595pub async fn get_user_security(
597 State(state): State<RestState>,
598 Json(body): Json<Value>,
599) -> RawApiResult {
600 adapter::proto_request_raw::<qot_get_user_security::Request, qot_get_user_security::Response>(
601 &state,
602 proto_id::QOT_GET_USER_SECURITY,
603 Some(body),
604 )
605 .await
606}
607
608pub async fn stock_filter(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
610 adapter::proto_request_raw::<qot_stock_filter::Request, qot_stock_filter::Response>(
611 &state,
612 proto_id::QOT_STOCK_FILTER,
613 Some(body),
614 )
615 .await
616}
617
618pub async fn get_ipo_list(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
620 adapter::proto_request_raw::<qot_get_ipo_list::Request, qot_get_ipo_list::Response>(
621 &state,
622 proto_id::QOT_GET_IPO_LIST,
623 Some(body),
624 )
625 .await
626}
627
628pub async fn get_future_info(
630 State(state): State<RestState>,
631 Json(body): Json<Value>,
632) -> RawApiResult {
633 adapter::proto_request_raw::<qot_get_future_info::Request, qot_get_future_info::Response>(
634 &state,
635 proto_id::QOT_GET_FUTURE_INFO,
636 Some(body),
637 )
638 .await
639}
640
641pub async fn get_market_state(
643 State(state): State<RestState>,
644 Json(body): Json<Value>,
645) -> RawApiResult {
646 adapter::proto_request_raw::<qot_get_market_state::Request, qot_get_market_state::Response>(
647 &state,
648 proto_id::QOT_GET_MARKET_STATE,
649 Some(body),
650 )
651 .await
652}
653
654pub async fn request_history_kl(
656 State(state): State<RestState>,
657 Json(body): Json<Value>,
658) -> RawApiResult {
659 adapter::proto_request_raw::<qot_request_history_kl::Request, qot_request_history_kl::Response>(
660 &state,
661 proto_id::QOT_REQUEST_HISTORY_KL,
662 Some(body),
663 )
664 .await
665}
666
667pub async fn request_trading_days(
671 State(state): State<RestState>,
672 Json(body): Json<Value>,
673) -> RawApiResult {
674 adapter::proto_request_raw::<qot_request_trade_date::Request, qot_request_trade_date::Response>(
675 &state,
676 proto_id::QOT_REQUEST_TRADE_DATE,
677 Some(body),
678 )
679 .await
680}
681
682pub async fn request_rehab(
684 State(state): State<RestState>,
685 Json(body): Json<Value>,
686) -> RawApiResult {
687 adapter::proto_request_raw::<qot_request_rehab::Request, qot_request_rehab::Response>(
688 &state,
689 proto_id::QOT_REQUEST_REHAB,
690 Some(body),
691 )
692 .await
693}
694
695pub async fn get_suspend(State(state): State<RestState>, Json(body): Json<Value>) -> RawApiResult {
697 adapter::proto_request_raw::<qot_get_suspend::Request, qot_get_suspend::Response>(
698 &state,
699 proto_id::QOT_GET_SUSPEND,
700 Some(body),
701 )
702 .await
703}
704
705pub async fn request_history_kl_quota(
709 State(state): State<RestState>,
710 Json(body): Json<Value>,
711) -> RawApiResult {
712 adapter::proto_request_raw::<
713 qot_request_history_kl_quota::Request,
714 qot_request_history_kl_quota::Response,
715 >(&state, proto_id::QOT_REQUEST_HISTORY_KL_QUOTA, Some(body))
716 .await
717}
718
719pub async fn get_used_quota(
721 State(state): State<RestState>,
722 Json(body): Json<Value>,
723) -> RawApiResult {
724 adapter::proto_request_raw::<used_quota::Request, used_quota::Response>(
725 &state,
726 proto_id::GET_USED_QUOTA,
727 Some(body),
728 )
729 .await
730}
731
732pub async fn get_holding_change(
734 State(state): State<RestState>,
735 Json(body): Json<Value>,
736) -> RawApiResult {
737 adapter::proto_request_raw::<
738 qot_get_holding_change_list::Request,
739 qot_get_holding_change_list::Response,
740 >(&state, proto_id::QOT_GET_HOLDING_CHANGE_LIST, Some(body))
741 .await
742}
743
744pub async fn modify_user_security(
746 State(state): State<RestState>,
747 Json(body): Json<Value>,
748) -> RawApiResult {
749 adapter::proto_request_raw::<
750 qot_modify_user_security::Request,
751 qot_modify_user_security::Response,
752 >(&state, proto_id::QOT_MODIFY_USER_SECURITY, Some(body))
753 .await
754}
755
756pub async fn get_code_change(
758 State(state): State<RestState>,
759 Json(body): Json<Value>,
760) -> RawApiResult {
761 adapter::proto_request_raw::<qot_get_code_change::Request, qot_get_code_change::Response>(
762 &state,
763 proto_id::QOT_GET_CODE_CHANGE,
764 Some(body),
765 )
766 .await
767}
768
769pub async fn set_price_reminder(
771 State(state): State<RestState>,
772 Json(body): Json<Value>,
773) -> RawApiResult {
774 adapter::proto_request_raw::<qot_set_price_reminder::Request, qot_set_price_reminder::Response>(
775 &state,
776 proto_id::QOT_SET_PRICE_REMINDER,
777 Some(body),
778 )
779 .await
780}
781
782pub async fn get_price_reminder(
784 State(state): State<RestState>,
785 Json(body): Json<Value>,
786) -> RawApiResult {
787 adapter::proto_request_raw::<qot_get_price_reminder::Request, qot_get_price_reminder::Response>(
788 &state,
789 proto_id::QOT_GET_PRICE_REMINDER,
790 Some(body),
791 )
792 .await
793}
794
795pub async fn get_option_expiration_date(
797 State(state): State<RestState>,
798 Json(body): Json<Value>,
799) -> RawApiResult {
800 adapter::proto_request_raw::<
801 qot_get_option_expiration_date::Request,
802 qot_get_option_expiration_date::Response,
803 >(&state, proto_id::QOT_GET_OPTION_EXPIRATION_DATE, Some(body))
804 .await
805}