Skip to main content

get_lv2_related_exchange

Function get_lv2_related_exchange 

Source
pub async fn get_lv2_related_exchange(
    backend: &BackendConn,
    stock_id: u64,
    broker_id_list: &[u32],
    has_pt_orderbook_permission: bool,
) -> Result<Vec<CryptoExchangeInfo>>
Expand description

发 CMD18012 GetLv2RelatedExchange, 解析 response 成 Vec<CryptoExchangeInfo>.

入参:

  • stock_id: crypto 综合报价 stock_id (e.g. BTCUSDT 的内部 ID)
  • broker_id_list: 单 broker 时长度 1, multi-broker 时 N>=1; 空 list == C++ “无 broker_id_list 字段” 等价.
  • has_pt_orderbook_permission: caller 传入 cc_pt_orderbook_qot_right == QOT_RIGHT_LEVEL1 的 boolean. false 时过滤 exchange_name == "PT" 条目.

失败模式:

  • 网络错误 / decode 错 → Err (caller log + fallback BBO-only)
  • ret != 0 → Err with backend ret 字段

行为对齐 C++ NNBiz_Qot_CryptoExchange::OnReply_GetLv2RelatedExchange 全 path, 包括 PT 过滤 (line 123-126).