Add confirm dialogs and busy states for swap/transfer all actions.

Use available (free) balances for full-amount ops, support sub-account scope, and show clear success/failure feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-12 09:10:29 +08:00
parent 5eb9b9f5c5
commit 44657e0484
7 changed files with 261 additions and 60 deletions
+7 -1
View File
@@ -296,7 +296,13 @@ def register_options_routes(app: Flask, cfg: dict[str, Any]) -> None:
if ex is None:
return jsonify({"ok": False, "msg": err})
force = (request.args.get("force") or "").strip().lower() in ("1", "true", "yes")
bal = cfg["fetch_options_balances"](ex, force=force)
scope = (request.args.get("scope") or "main").strip().lower()
bal = cfg["fetch_options_balances"](
ex,
force=force,
scope=scope,
sub_acct=cfg.get("sub_account_name") or "",
)
return jsonify({"ok": True, **bal, "trade_budget": cfg["trade_budget"]})
@app.route("/api/options/chain")