From 48f544b1f5e2f4a917e211846fd19ca972f0dfa8 Mon Sep 17 00:00:00 2001 From: dekun Date: Tue, 13 Oct 2026 19:18:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=E5=BF=AB=E7=85=A7=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E6=9C=9F=E6=9D=83=E6=A0=87=E7=9A=84=E7=99=BD=E5=90=8D=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E4=BE=9B=E4=B8=AD=E6=8E=A7=E6=9D=A1=E4=BB=B6=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E5=B8=81=E7=A7=8D=E8=BF=87=E6=BB=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- lib/hub/hub_bridge_register.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/hub/hub_bridge_register.py b/lib/hub/hub_bridge_register.py index 96cea1f..b113cc2 100644 --- a/lib/hub/hub_bridge_register.py +++ b/lib/hub/hub_bridge_register.py @@ -153,6 +153,16 @@ def _enrich_hub_protocol(snap: dict[str, Any], *, app_module: Any) -> dict[str, } ) + _allowed = out.get("options_allowed_underlys") + if not isinstance(_allowed, list) or not _allowed: + _u0 = str(out.get("options_underly") or "ETH").strip().upper() or "ETH" + _allowed = [_u0] if _u0 in ("ETH", "BTC") else ["ETH", "BTC"] + else: + _allowed = [ + str(x).strip().upper() + for x in _allowed + if str(x).strip().upper() in ("ETH", "BTC") + ] or ["ETH", "BTC"] out["instance"] = { "label": label, "mode": mode, @@ -160,7 +170,9 @@ def _enrich_hub_protocol(snap: dict[str, Any], *, app_module: Any) -> dict[str, "account_label": out.get("account_label") or "", "margin_mode": out.get("options_margin_mode") or "coin", "underly": out.get("options_underly") or "ETH", + "allowed_underlys": _allowed, } + out["options_allowed_underlys"] = _allowed funding_usdt = out.get("funding_usdt") trading_usdt = out.get("trading_usdt") funding_usdc = out.get("funding_usdc")