Skip to main content

futu_mcp/handlers/trade/
mod.rs

1//! mcp/handlers/trade — 拆 trade.rs 986 → trade/{mod, 6 新子, 4 已有}.rs
2//! (v1.4.110 CC Batch O)
3//!
4//! 已有 sub-mod (历史拆): account_flag / bond / cash_log / margin_info
5//!
6//! 本次新加 6 sub-mod:
7//! - `helpers`    : parse_* (4) + build_header_* (2) — 跨 trade sub-mod 共用
8//! - `accounts`   : list_accounts_filtered + AccountOut + 3 visible helper
9//! - `funds`      : get_funds_with_currency + 3 Out type
10//! - `positions`  : get_positions + PositionOut + cost_basis_method 推导
11//! - `orders`     : orders / deals / max_trd_qtys / order_fee / history_orders
12//! - `misc`       : history_deals / margin_ratio / sub_acc_push / acc_cash_flow
13
14mod account_flag;
15mod accounts;
16mod bond;
17mod cash_log;
18mod funds;
19mod helpers;
20mod margin_info;
21mod misc;
22mod orders;
23mod positions;
24
25#[cfg(test)]
26mod tests;
27
28// hoist trade super scope for tests.rs use super::*
29
30// ===== existing 4 sub-mod re-exports (不变) =====
31pub use account_flag::get_account_flag;
32pub use bond::{
33    get_bond_answer_state, get_bond_position_list, get_bond_single_asset, get_bond_total_asset,
34    get_bond_trade_reminder,
35};
36pub use cash_log::{CashLogInput, get_biz_group, get_cash_detail, get_cash_log};
37pub use margin_info::get_margin_info;
38
39// ===== 6 新 sub-mod re-exports =====
40
41// helpers re-export 给 existing sub-mod (bond / margin_info / cash_log 用 super::parse_*)
42pub use accounts::list_accounts_filtered;
43pub use funds::get_funds_with_currency;
44pub(super) use helpers::{parse_trd_env, parse_trd_env_int};
45pub use misc::{get_acc_cash_flow, get_history_deals, get_margin_ratio, sub_acc_push};
46pub use orders::{
47    HistoryQueryInput, MaxTrdQtysInput, get_deals, get_history_orders, get_max_trd_qtys,
48    get_order_fee, get_orders,
49};
50pub use positions::get_positions;
51
52#[cfg(test)]
53pub(super) use accounts::{AccountOut, caller_visible_accounts, visible_card_num_for_account};
54#[cfg(test)]
55pub(super) use positions::derive_cost_basis_method_hint;