From 781c7ddeeea2f06b64e6c214964e0fec4701ffd2 Mon Sep 17 00:00:00 2001 From: tangmengqiu <1124090103@qq.com> Date: Mon, 3 Nov 2025 23:43:06 -0500 Subject: [PATCH] fix --- web/src/components/AITradersPage.tsx | 34 +++------------------------- web/src/i18n/translations.ts | 4 ---- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/web/src/components/AITradersPage.tsx b/web/src/components/AITradersPage.tsx index f3364551..c1a2fc5a 100644 --- a/web/src/components/AITradersPage.tsx +++ b/web/src/components/AITradersPage.tsx @@ -1163,9 +1163,6 @@ function ExchangeConfigModal({ const [passphrase, setPassphrase] = useState(''); const [testnet, setTestnet] = useState(false); - // Hyperliquid 特定字段 - const [hyperliquidWalletAddr, setHyperliquidWalletAddr] = useState(''); - // Aster 特定字段 const [asterUser, setAsterUser] = useState(''); const [asterSigner, setAsterSigner] = useState(''); @@ -1181,10 +1178,7 @@ function ExchangeConfigModal({ setSecretKey(selectedExchange.secretKey || ''); setPassphrase(''); // Don't load existing passphrase for security setTestnet(selectedExchange.testnet || false); - - // Hyperliquid 字段 - setHyperliquidWalletAddr(selectedExchange.hyperliquidWalletAddr || ''); - + // Aster 字段 setAsterUser(selectedExchange.asterUser || ''); setAsterSigner(selectedExchange.asterSigner || ''); @@ -1201,8 +1195,8 @@ function ExchangeConfigModal({ if (!apiKey.trim() || !secretKey.trim()) return; await onSave(selectedExchangeId, apiKey.trim(), secretKey.trim(), testnet); } else if (selectedExchange?.id === 'hyperliquid') { - if (!apiKey.trim()) return; // 只验证私钥,钱包地址可选(会自动生成) - await onSave(selectedExchangeId, apiKey.trim(), '', testnet, hyperliquidWalletAddr.trim()); + if (!apiKey.trim()) return; // 只验证私钥,钱包地址自动从私钥生成 + await onSave(selectedExchangeId, apiKey.trim(), '', testnet, ''); // 传空字符串,后端自动生成地址 } else if (selectedExchange?.id === 'aster') { if (!asterUser.trim() || !asterSigner.trim() || !asterPrivateKey.trim()) return; await onSave(selectedExchangeId, '', '', testnet, undefined, asterUser.trim(), asterSigner.trim(), asterPrivateKey.trim()); @@ -1356,28 +1350,6 @@ function ExchangeConfigModal({ {t('hyperliquidPrivateKeyDesc', language)} - -
- - setHyperliquidWalletAddr(e.target.value)} - placeholder="0x... (留空将自动从私钥生成 / Leave blank to auto-generate)" - className="w-full px-3 py-2 rounded" - style={{ background: '#0B0E11', border: '1px solid #2B3139', color: '#EAECEF' }} - /> -
- {hyperliquidWalletAddr.trim() - ? t('hyperliquidWalletAddressDesc', language) - : t('hyperliquidWalletAddressAutoGenerate', language)} -
-
)} diff --git a/web/src/i18n/translations.ts b/web/src/i18n/translations.ts index 607c420f..99a11cac 100644 --- a/web/src/i18n/translations.ts +++ b/web/src/i18n/translations.ts @@ -194,8 +194,6 @@ export const translations = { enterPassphrase: 'Enter Passphrase (Required for OKX)', hyperliquidPrivateKeyDesc: 'Hyperliquid uses private key for trading authentication', hyperliquidWalletAddressDesc: 'Wallet address corresponding to the private key', - hyperliquidWalletAddressAutoGenerate: 'Leave blank to automatically generate wallet address from private key', - optional: 'Optional', testnetDescription: 'Enable to connect to exchange test environment for simulated trading', securityWarning: 'Security Warning', saveConfiguration: 'Save Configuration', @@ -610,8 +608,6 @@ export const translations = { enterPassphrase: '输入Passphrase (OKX必填)', hyperliquidPrivateKeyDesc: 'Hyperliquid 使用私钥进行交易认证', hyperliquidWalletAddressDesc: '与私钥对应的钱包地址', - hyperliquidWalletAddressAutoGenerate: '留空将自动从私钥生成钱包地址', - optional: '可选', testnetDescription: '启用后将连接到交易所测试环境,用于模拟交易', securityWarning: '安全提示', saveConfiguration: '保存配置',