feat条件单新建按标的过滤匹配币种的客户端。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -72,6 +72,23 @@ def _candidates_from_snaps(rows: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
transfer_block_msg = str(snap.get("transfer_block_msg") or "").strip()
|
||||
if has_pos and not transfer_block_msg:
|
||||
transfer_block_msg = "期权持仓中禁止划转"
|
||||
allowed_raw = snap.get("options_allowed_underlys")
|
||||
if not isinstance(allowed_raw, list):
|
||||
allowed_raw = inst.get("allowed_underlys")
|
||||
allowed_underlys: list[str] = []
|
||||
if isinstance(allowed_raw, list):
|
||||
for x in allowed_raw:
|
||||
u = str(x or "").strip().upper()
|
||||
if u in ("ETH", "BTC") and u not in allowed_underlys:
|
||||
allowed_underlys.append(u)
|
||||
if not allowed_underlys:
|
||||
# 旧实例未上报白名单:仍显示在 ETH/BTC 下(兼容)
|
||||
allowed_underlys = ["ETH", "BTC"]
|
||||
default_underly = str(
|
||||
snap.get("options_underly") or inst.get("underly") or allowed_underlys[0]
|
||||
).strip().upper()
|
||||
if default_underly not in allowed_underlys:
|
||||
default_underly = allowed_underlys[0]
|
||||
out.append(
|
||||
{
|
||||
"id": row.get("id"),
|
||||
@@ -86,6 +103,8 @@ def _candidates_from_snaps(rows: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
"funding_usdt": funding_usdt,
|
||||
"transfer_blocked": transfer_blocked,
|
||||
"transfer_block_msg": transfer_block_msg,
|
||||
"allowed_underlys": allowed_underlys,
|
||||
"default_underly": default_underly,
|
||||
}
|
||||
)
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user