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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user