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")