fix: keep exchange API only in env config, remove from system settings.
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Vendored
-21
@@ -258,27 +258,6 @@ def ui_allowed_keys(exchange_key: str) -> frozenset[str]:
|
||||
return frozenset(keys)
|
||||
|
||||
|
||||
def build_exchange_api_group(
|
||||
exchange_key: str,
|
||||
example_path: str,
|
||||
env_path: str,
|
||||
) -> dict[str, Any]:
|
||||
"""系统设置「交易所 API」专用:仅交易所与实盘字段."""
|
||||
schema = _schema_field_map(example_path)
|
||||
values = env_get_all(read_env_lines(env_path))
|
||||
ex = (exchange_key or "").strip().lower()
|
||||
live_fields = _EXCHANGE_LIVE_FIELDS.get(ex, _EXCHANGE_LIVE_FIELDS["okx"])
|
||||
fields = [
|
||||
_build_field(key, label, note, schema, values)
|
||||
for key, label, note in live_fields
|
||||
]
|
||||
return {
|
||||
"title": "交易所 API",
|
||||
"fields": fields,
|
||||
"has_restart": any(f.get("restart_required") for f in fields),
|
||||
}
|
||||
|
||||
|
||||
def build_env_ui_payload(
|
||||
exchange_key: str,
|
||||
example_path: str,
|
||||
|
||||
Reference in New Issue
Block a user