diff --git a/crypto_monitor_binance/app.py b/crypto_monitor_binance/app.py index e39769a..f8cd21d 100644 --- a/crypto_monitor_binance/app.py +++ b/crypto_monitor_binance/app.py @@ -411,7 +411,7 @@ _APP_STARTED_AT = time.time() _RECONCILE_FLAT_STREAK = {} KLINE_TIMEFRAME = os.getenv("KLINE_TIMEFRAME", "5m") FULL_MARGIN_BUFFER_RATIO = float(os.getenv("FULL_MARGIN_BUFFER_RATIO", "0.98")) -TRANSFER_CCY = os.getenv("TRANSFER_CCY", "USDT") +TRANSFER_CCY = (os.getenv("TRANSFER_CCY", "USDT") or "USDT").strip().upper() or "USDT" UPLOAD_FOLDER = resolve_path(os.getenv("UPLOAD_DIR", "static/images")) ORDER_CHART_ENABLED = os.getenv("ORDER_CHART_ENABLED", "true").lower() == "true" ORDER_CHART_TFS = [x.strip() for x in (os.getenv("ORDER_CHART_TFS", "4h,1h,15m,5m") or "").split(",") if x.strip()] diff --git a/crypto_monitor_gate/app.py b/crypto_monitor_gate/app.py index dfb48ad..9ca6eaa 100644 --- a/crypto_monitor_gate/app.py +++ b/crypto_monitor_gate/app.py @@ -404,7 +404,7 @@ KLINE_TIMEFRAME = os.getenv("KLINE_TIMEFRAME", "5m") _APP_STARTED_AT = time.time() _RECONCILE_FLAT_STREAK = {} FULL_MARGIN_BUFFER_RATIO = float(os.getenv("FULL_MARGIN_BUFFER_RATIO", "0.98")) -TRANSFER_CCY = os.getenv("TRANSFER_CCY", "USDT") +TRANSFER_CCY = (os.getenv("TRANSFER_CCY", "USDT") or "USDT").strip().upper() or "USDT" UPLOAD_FOLDER = resolve_path(os.getenv("UPLOAD_DIR", "static/images")) ORDER_CHART_ENABLED = os.getenv("ORDER_CHART_ENABLED", "true").lower() == "true" ORDER_CHART_TFS = [x.strip() for x in (os.getenv("ORDER_CHART_TFS", "4h,1h,15m,5m") or "").split(",") if x.strip()] diff --git a/crypto_monitor_okx/app.py b/crypto_monitor_okx/app.py index 217d6be..799181c 100644 --- a/crypto_monitor_okx/app.py +++ b/crypto_monitor_okx/app.py @@ -384,7 +384,7 @@ BREAKEVEN_EXCHANGE_MIN_INTERVAL_SEC = max( _BREAKEVEN_LAST_EX_SYNC: dict[int, float] = {} KLINE_TIMEFRAME = os.getenv("KLINE_TIMEFRAME", "5m") FULL_MARGIN_BUFFER_RATIO = float(os.getenv("FULL_MARGIN_BUFFER_RATIO", "0.98")) -TRANSFER_CCY = os.getenv("TRANSFER_CCY", "USDT") +TRANSFER_CCY = (os.getenv("TRANSFER_CCY", "USDT") or "USDT").strip().upper() or "USDT" OKX_POSITION_INST_TYPE = os.getenv("OKX_POSITION_INST_TYPE", "SWAP") EXCHANGE_POSITION_SYNC_FROM_BJ = (os.getenv("EXCHANGE_POSITION_SYNC_FROM_BJ") or "").strip() EXCHANGE_POSITION_HISTORY_LIMIT = max(50, min(1000, int(os.getenv("EXCHANGE_POSITION_HISTORY_LIMIT", "200")))) diff --git a/lib/exchange/gate_transfer_lib.py b/lib/exchange/gate_transfer_lib.py index 2adcb46..fd0b257 100644 --- a/lib/exchange/gate_transfer_lib.py +++ b/lib/exchange/gate_transfer_lib.py @@ -22,6 +22,7 @@ def execute_transfer_usdt( ) -> tuple[bool, str, Any]: if amount <= 0: return False, "划转金额必须大于0", None + ccy = (transfer_ccy or "USDT").strip().upper() or "USDT" ok_live, reason = ensure_live_ready() if not ok_live: return False, reason, None @@ -31,7 +32,7 @@ def execute_transfer_usdt( except Exception: pass try: - resp = exchange.transfer(transfer_ccy, float(amount), from_account, to_account) + resp = exchange.transfer(ccy, float(amount), from_account, to_account) return True, "划转成功", resp except Exception as e: msg = str(e)