Hide zero USDT in options balance labels and add swap/transfer all buttons.

Skip 0 balances in header display; fill max funding/trading amount on 全部兑换/全部划转.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-12 08:55:30 +08:00
parent 551c86264a
commit bb53beb22d
9 changed files with 141 additions and 41 deletions
+2 -1
View File
@@ -280,7 +280,8 @@ def register_options_routes(app: Flask, cfg: dict[str, Any]) -> None:
ex, err = _require_options_ex(cfg)
if ex is None:
return jsonify({"ok": False, "msg": err})
bal = cfg["fetch_options_balances"](ex)
force = (request.args.get("force") or "").strip().lower() in ("1", "true", "yes")
bal = cfg["fetch_options_balances"](ex, force=force)
return jsonify({"ok": True, **bal, "trade_budget": cfg["trade_budget"]})
@app.route("/api/options/chain")