Skip to main content

Module tier_m

Module tier_m 

Source
Expand description

futucli Tier M (mobile-driven extension) commands — v1.4.94 M1 + v1.4.95 U2-A/D/B

11 subcommand 镜像 REST + MCP:

subcommandproto_idmobile cmd用途
cash-log227013000资金明细查询 (M1)
cash-detail227023001单条资金详情 (M1)
biz-group227033002业务分类元数据 (M1)
margin-info227043101/02/07per-account margin (U2-D)
account-flag227055281账户合规标志 (U2-A)
bond-total-asset227069373债券账户总持仓 (U2-B)
bond-single-asset227079374单只债券持仓 (U2-B)
bond-position-list227089375债券持仓列表 (U2-B)
bond-answer-state2270910043是否需答题 (U2-B)
bond-trade-reminder2271010057交易提醒 (U2-B)

§架构

直接 connect_gateway + client.request(proto_id, body), decode Daemon FTAPI wrapper, JSON pretty print. 不走 futu-trd 高层 helper (Tier M handler proto 在 futu-backend::proto_internal 直接定义, 没必要再 wrap 一层).

§输出格式

默认 JSON pretty (OutputFormat::JsonOutputFormat::Table). 11 endpoint 字段较多 + 嵌套结构 (notice_list / margin_info), table view 不易表达, 统一用 JSON. Table format 也 fallback 到 JSON.

Structs§

CashLogCommand
futucli cash-log — 资金明细查询 (mobile-driven, 比 acc-cash-flow 字段更全)

Functions§

dispatch 🔒
共用 helper: 调 daemon + decode generic
parse_env_int 🔒
共用 helper: env 字符串 → trd_env int (0=sim / 1=real).
print_json_pretty 🔒
共用 helper: JSON pretty print (table format fallback to JSON for nested data)
run_account_flag
futucli account-flag — 账户合规标志查询
run_biz_group
futucli biz-group — 业务分类元数据
run_bond_answer_state
futucli bond-answer-state — 是否需答题
run_bond_position_list
futucli bond-position-list — 债券持仓列表
run_bond_single_asset
futucli bond-single-asset — 单只债券持仓
run_bond_total_asset
futucli bond-total-asset — 账户债券总持仓
run_bond_trade_reminder
futucli bond-trade-reminder — 交易提醒
run_cash_detail
futucli cash-detail — 单条资金流水详情
run_cash_log
run_margin_info
futucli margin-info — per-account margin info (HK/US/CN_AH)
validate_bond_market 🔒
共用 helper: parse market (HK/US/SG only)