From 70a621870490fdb441cbbe20d66c1fa424aa249c Mon Sep 17 00:00:00 2001 From: 0xYYBB | ZYY | Bobo <128128010+the-dev-z@users.noreply.github.com> Date: Wed, 12 Nov 2025 09:59:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20remove=20duplicate=20exchange=20conf?= =?UTF-8?q?iguration=20fields=20(Aster=20&=20Hyperliquid)=20(#921)=20*=20f?= =?UTF-8?q?ix(ui):=20remove=20duplicate=20Aster=20exchange=20form=20render?= =?UTF-8?q?ing=20=E4=BF=AE=E5=BE=A9=20Aster=20=E4=BA=A4=E6=98=93=E6=89=80?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A1=A8=E5=96=AE=E9=87=8D=E8=A4=87=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=95=8F=E9=A1=8C=E3=80=82=20Issue:=20-=20Aster=20?= =?UTF-8?q?=E8=A1=A8=E5=96=AE=E4=BB=A3=E7=A2=BC=E5=9C=A8=20AITradersPage.t?= =?UTF-8?q?sx=20=E4=B8=AD=E5=87=BA=E7=8F=BE=E5=85=A9=E6=AC=A1=EF=BC=88line?= =?UTF-8?q?s=202334=20=E5=92=8C=202559=EF=BC=89=20-=20=E5=B0=8E=E8=87=B4?= =?UTF-8?q?=E7=94=A8=E6=88=B6=E7=95=8C=E9=9D=A2=E9=A1=AF=E7=A4=BA=206=20?= =?UTF-8?q?=E5=80=8B=E8=BC=B8=E5=85=A5=E6=AC=84=E4=BD=8D=EF=BC=88=E6=87=89?= =?UTF-8?q?=E8=A9=B2=E6=98=AF=203=20=E5=80=8B=EF=BC=89=20-=20=E7=94=A8?= =?UTF-8?q?=E6=88=B6=E9=AB=94=E9=A9=97=E6=B7=B7=E4=BA=82=20Fix:=20-=20?= =?UTF-8?q?=E5=88=AA=E9=99=A4=E9=87=8D=E8=A4=87=E7=9A=84=20Aster=20?= =?UTF-8?q?=E8=A1=A8=E5=96=AE=E4=BB=A3=E7=A2=BC=E5=A1=8A=EF=BC=88lines=202?= =?UTF-8?q?559-2710=EF=BC=8C=E5=85=B1=20153=20=E8=A1=8C=EF=BC=89=20-=20?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E7=AC=AC=E4=B8=80=E5=80=8B=E8=A1=A8=E5=96=AE?= =?UTF-8?q?=E5=A1=8A=EF=BC=88lines=202334-2419=EF=BC=89=20-=20=E4=BF=AE?= =?UTF-8?q?=E5=BE=A9=20prettier=20=E6=A0=BC=E5=BC=8F=E5=95=8F=E9=A1=8C=20R?= =?UTF-8?q?esult:=20-=20Aster=20=E9=85=8D=E7=BD=AE=E7=8F=BE=E5=9C=A8?= =?UTF-8?q?=E6=AD=A3=E7=A2=BA=E9=A1=AF=E7=A4=BA=203=20=E5=80=8B=E6=AC=84?= =?UTF-8?q?=E4=BD=8D=EF=BC=9Auser,=20signer,=20private=20key=20-=20Lint=20?= =?UTF-8?q?=E6=AA=A2=E6=9F=A5=E9=80=9A=E9=81=8E=20-=20Hyperliquid=20Agent?= =?UTF-8?q?=20Wallet=20=E7=BF=BB=E8=AD=AF=E5=B7=B2=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=84=A1=E9=9C=80=E4=BF=AE=E6=94=B9=20Technical:=20-=20?= =?UTF-8?q?=E5=88=AA=E9=99=A4=E4=BA=86=E5=AE=8C=E5=85=A8=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E7=9A=84=20JSX=20=E6=A2=9D=E4=BB=B6=E6=B8=B2=E6=9F=93=E5=A1=8A?= =?UTF-8?q?=20-=20=E7=A7=BB=E9=99=A4=E7=A9=BA=E7=99=BD=E8=A1=8C=E4=BB=A5?= =?UTF-8?q?=E7=AC=A6=E5=90=88=20prettier=20=E8=A6=8F=E7=AF=84=20Co-Authore?= =?UTF-8?q?d-By:=20tinkle-community=20=20*=20fix(ui)?= =?UTF-8?q?:=20remove=20legacy=20Hyperliquid=20single=20private=20key=20fi?= =?UTF-8?q?eld=20=E4=BF=AE=E5=BE=A9=20Hyperliquid=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A0=81=E9=9D=A2=E9=A1=AF=E7=A4=BA=E8=88=8A=E7=89=88=E7=A7=81?= =?UTF-8?q?=E9=91=B0=E6=AC=84=E4=BD=8D=E7=9A=84=E5=95=8F=E9=A1=8C=E3=80=82?= =?UTF-8?q?=20Issue:=20-=20Hyperliquid=20=E9=85=8D=E7=BD=AE=E5=90=8C?= =?UTF-8?q?=E6=99=82=E9=A1=AF=E7=A4=BA=E8=88=8A=E7=89=88=E5=92=8C=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=AC=84=E4=BD=8D=20-=20=E8=88=8A=E7=89=88=EF=BC=9A?= =?UTF-8?q?=E5=96=AE=E4=B8=80=E3=80=8C=E7=A7=81=E9=92=A5=E3=80=8D=E6=AC=84?= =?UTF-8?q?=E4=BD=8D=EF=BC=88=E4=B8=8D=E5=AE=89=E5=85=A8=EF=BC=8C=E5=B7=B2?= =?UTF-8?q?=E5=BB=A2=E6=A3=84=EF=BC=89=20-=20=E6=96=B0=E7=89=88=EF=BC=9A?= =?UTF-8?q?=E3=80=8C=E4=BB=A3=E7=90=86=E7=A7=81=E9=92=A5=E3=80=8D+?= =?UTF-8?q?=E3=80=8C=E4=B8=BB=E9=92=B1=E5=8C=85=E5=9C=B0=E5=9D=80=E3=80=8D?= =?UTF-8?q?=EF=BC=88Agent=20Wallet=20=E5=AE=89=E5=85=A8=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=EF=BC=89=20-=20=E7=94=A8=E6=88=B6=E7=9C=8B=E5=88=B0=E9=87=8D?= =?UTF-8?q?=E8=A4=87=E7=9A=84=E6=AC=84=E4=BD=8D=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E9=80=A0=E6=88=90=E6=B7=B7=E6=B7=86=20Root=20Cause:=20-=20AITr?= =?UTF-8?q?adersPage.tsx=20=E5=AD=98=E5=9C=A8=E5=85=A9=E5=80=8B=20Hyperliq?= =?UTF-8?q?uid=20=E6=A2=9D=E4=BB=B6=E6=B8=B2=E6=9F=93=E5=A1=8A=20-=20Lines?= =?UTF-8?q?=202302-2332:=20=E8=88=8A=E7=89=88=E5=96=AE=E7=A7=81=E9=91=B0?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=88=E6=87=89=E5=88=AA=E9=99=A4=EF=BC=89?= =?UTF-8?q?=20-=20Lines=202424-2557:=20=E6=96=B0=E7=89=88=20Agent=20Wallet?= =?UTF-8?q?=20=E6=A8=A1=E5=BC=8F=EF=BC=88=E6=AD=A3=E7=A2=BA=EF=BC=89=20Fix?= =?UTF-8?q?:=20-=20=E5=88=AA=E9=99=A4=E8=88=8A=E7=89=88=20Hyperliquid=20?= =?UTF-8?q?=E5=96=AE=E7=A7=81=E9=91=B0=E6=AC=84=E4=BD=8D=E4=BB=A3=E7=A2=BC?= =?UTF-8?q?=E5=A1=8A=EF=BC=88lines=202302-2332=EF=BC=8C=E5=85=B1=2032=20?= =?UTF-8?q?=E8=A1=8C=EF=BC=89=20-=20=E4=BF=9D=E7=95=99=E6=96=B0=E7=89=88?= =?UTF-8?q?=20Agent=20Wallet=20=E9=85=8D=E7=BD=AE=EF=BC=88=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E7=A7=81=E9=91=B0=20+=20=E4=B8=BB=E9=8C=A2=E5=8C=85?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=EF=BC=89=20-=20=E7=A7=BB=E9=99=A4=20`t('priv?= =?UTF-8?q?ateKey')`=20=E5=92=8C=20`t('hyperliquidPrivateKeyDesc')`=20?= =?UTF-8?q?=E8=88=8A=E7=89=88=E7=BF=BB=E8=AD=AF=E5=BC=95=E7=94=A8=20Result?= =?UTF-8?q?:=20-=20Hyperliquid=20=E9=85=8D=E7=BD=AE=E7=8F=BE=E5=9C=A8?= =?UTF-8?q?=E5=8F=AA=E9=A1=AF=E7=A4=BA=E6=AD=A3=E7=A2=BA=E7=9A=84=20Agent?= =?UTF-8?q?=20Wallet=20=E6=AC=84=E4=BD=8D=20-=20=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20banner=20=E6=AD=A3=E7=A2=BA=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA=20-=20=E7=94=A8=E6=88=B6=E9=AB=94=E9=A9=97=E6=94=B9?= =?UTF-8?q?=E5=96=84=EF=BC=8C=E4=B8=8D=E5=86=8D=E6=B7=B7=E6=B7=86=20Techni?= =?UTF-8?q?cal=20Details:=20-=20=E6=96=B0=E7=89=88=E4=BD=BF=E7=94=A8=20`ap?= =?UTF-8?q?iKey`=20=E5=84=B2=E5=AD=98=20Agent=20Private=20Key=20-=20?= =?UTF-8?q?=E6=96=B0=E7=89=88=E4=BD=BF=E7=94=A8=20`hyperliquidWalletAddr`?= =?UTF-8?q?=20=E5=84=B2=E5=AD=98=20Main=20Wallet=20Address=20-=20=E7=AC=A6?= =?UTF-8?q?=E5=90=88=20Hyperliquid=20Agent=20Wallet=20=E6=9C=80=E4=BD=B3?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=AF=A6=E8=B8=90=20Related:=20-=20=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E5=B7=B2=E4=BF=AE=E5=BE=A9=20Aster=20=E9=87=8D?= =?UTF-8?q?=E8=A4=87=E6=B8=B2=E6=9F=93=E5=95=8F=E9=A1=8C=EF=BC=88commit=20?= =?UTF-8?q?5462eba0=EF=BC=89=20-=20Hyperliquid=20=E7=BF=BB=E8=AD=AF=20key?= =?UTF-8?q?=20=E5=B7=B2=E5=AD=98=E5=9C=A8=E6=96=BC=20translations.ts=20(li?= =?UTF-8?q?nes=20206-216,=201017-1027)=20Co-Authored-By:=20tinkle-communit?= =?UTF-8?q?y=20=20*=20fix(i18n):=20add=20missing=20H?= =?UTF-8?q?yperliquid=20Agent=20Wallet=20translation=20keys=20=E8=A3=9C?= =?UTF-8?q?=E5=85=85=20Hyperliquid=20=E4=BB=A3=E7=90=86=E9=8C=A2=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E7=BF=BB=E8=AD=AF=E6=96=87=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=BE=A9=E5=89=8D=E7=AB=AF=E9=A1=AF=E7=A4=BA?= =?UTF-8?q?=20key=20=E5=90=8D=E7=A8=B1=E7=9A=84=E5=95=8F=E9=A1=8C=E3=80=82?= =?UTF-8?q?=20Changes:=20-=20=E6=96=B0=E5=A2=9E=208=20=E5=80=8B=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E7=BF=BB=E8=AD=AF=20key=20(Agent=20Wallet=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=AA=AA=E6=98=8E)=20-=20=E6=96=B0=E5=A2=9E=208=20?= =?UTF-8?q?=E5=80=8B=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AD=AF=20key=20(?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=8C=A2=E5=8C=85=E9=85=8D=E7=BD=AE=E8=AA=AA?= =?UTF-8?q?=E6=98=8E)=20-=20=E4=BF=AE=E6=AD=A3=20Hyperliquid=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A0=81=E9=9D=A2=E9=A1=AF=E7=A4=BA=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=EF=BC=88=E5=BE=9E=E9=A1=AF=E7=A4=BA=20key=20=E5=90=8D=E7=A8=B1?= =?UTF-8?q?=E6=94=B9=E7=82=BA=E9=A1=AF=E7=A4=BA=E7=BF=BB=E8=AD=AF=E6=96=87?= =?UTF-8?q?=E6=9C=AC=EF=BC=89=20Technical=20Details:=20-=20hyperliquidAgen?= =?UTF-8?q?tWalletTitle:=20Banner=20=E6=A8=99=E9=A1=8C=20-=20hyperliquidAg?= =?UTF-8?q?entWalletDesc:=20=E5=AE=89=E5=85=A8=E8=AA=AA=E6=98=8E=E6=96=87?= =?UTF-8?q?=E5=AD=97=20-=20hyperliquidAgentPrivateKey:=20=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E7=A7=81=E9=91=B0=E6=AC=84=E4=BD=8D=E6=A8=99=E7=B1=A4?= =?UTF-8?q?=20-=20hyperliquidMainWalletAddress:=20=E4=B8=BB=E9=8C=A2?= =?UTF-8?q?=E5=8C=85=E5=9C=B0=E5=9D=80=E6=AC=84=E4=BD=8D=E6=A8=99=E7=B1=A4?= =?UTF-8?q?=20-=20=E7=9B=B8=E6=87=89=E7=9A=84=20placeholder=20=E5=92=8C=20?= =?UTF-8?q?description=20=E6=96=87=E6=9C=AC=20Related=20Issue:=20=E7=94=A8?= =?UTF-8?q?=E6=88=B6=E5=8F=8D=E9=A5=8B=E5=89=8D=E7=AB=AF=E9=A1=AF=E7=A4=BA?= =?UTF-8?q?=20key=20=E5=90=8D=E7=A8=B1=E8=80=8C=E9=9D=9E=E7=BF=BB=E8=AD=AF?= =?UTF-8?q?=E6=96=87=E6=9C=AC=20Co-Authored-By:=20tinkle-community=20=20---------=20Co-authored-by:=20the-dev-z=20=20Co-authored-by:=20tinkle-?= =?UTF-8?q?community=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/AITradersPage.tsx | 187 --------------------------- web/src/i18n/translations.ts | 33 ++++- web/src/lib/api.ts | 1 - 3 files changed, 30 insertions(+), 191 deletions(-) diff --git a/web/src/components/AITradersPage.tsx b/web/src/components/AITradersPage.tsx index 00e96037..13b463ae 100644 --- a/web/src/components/AITradersPage.tsx +++ b/web/src/components/AITradersPage.tsx @@ -2298,39 +2298,6 @@ function ExchangeConfigModal({ )} - {/* Hyperliquid 交易所的字段 */} - {selectedExchange.id === 'hyperliquid' && ( - <> -
- - setApiKey(e.target.value)} - placeholder={t('enterPrivateKey', language)} - className="w-full px-3 py-2 rounded" - style={{ - background: '#0B0E11', - border: '1px solid #2B3139', - color: '#EAECEF', - }} - required - /> -
- {t('hyperliquidPrivateKeyDesc', language)} -
-
- - )} - {/* Aster 交易所的字段 */} {selectedExchange.id === 'aster' && ( <> @@ -2555,160 +2522,6 @@ function ExchangeConfigModal({ )} - - {/* Aster 交易所的字段 */} - {selectedExchange.id === 'aster' && ( - <> -
- - setAsterUser(e.target.value)} - placeholder={t('enterUser', language)} - className="w-full px-3 py-2 rounded" - style={{ - background: '#0B0E11', - border: '1px solid #2B3139', - color: '#EAECEF', - }} - required - /> -
- -
- - setAsterSigner(e.target.value)} - placeholder={t('enterSigner', language)} - className="w-full px-3 py-2 rounded" - style={{ - background: '#0B0E11', - border: '1px solid #2B3139', - color: '#EAECEF', - }} - required - /> -
- -
- -
-
- - - {asterPrivateKey && ( - - )} -
- {asterPrivateKey && ( -
- {t('secureInputHint', language)} -
- )} -
-
- -
-
- - {' '} - {t('securityWarning', language)} - -
-
- {selectedExchange.id === 'aster' && ( -
{t('asterUsdtWarning', language)}
- )} -
{t('exchangeConfigWarning1', language)}
-
{t('exchangeConfigWarning2', language)}
-
{t('exchangeConfigWarning3', language)}
-
-
- - )} )} diff --git a/web/src/i18n/translations.ts b/web/src/i18n/translations.ts index 456005d8..b08ab391 100644 --- a/web/src/i18n/translations.ts +++ b/web/src/i18n/translations.ts @@ -202,6 +202,18 @@ export const translations = { 'Hyperliquid uses private key for trading authentication', hyperliquidWalletAddressDesc: 'Wallet address corresponding to the private key', + // Hyperliquid Agent Wallet (New Security Model) + hyperliquidAgentWalletTitle: 'Hyperliquid Agent Wallet Configuration', + hyperliquidAgentWalletDesc: + 'Use Agent Wallet for secure trading: Agent wallet signs transactions (balance ~0), Main wallet holds funds (never expose private key)', + hyperliquidAgentPrivateKey: 'Agent Private Key', + enterHyperliquidAgentPrivateKey: 'Enter Agent wallet private key', + hyperliquidAgentPrivateKeyDesc: + 'Agent wallet private key for signing transactions (keep balance near 0 for security)', + hyperliquidMainWalletAddress: 'Main Wallet Address', + enterHyperliquidMainWalletAddress: 'Enter Main wallet address', + hyperliquidMainWalletAddressDesc: + 'Main wallet address that holds your trading funds (never expose its private key)', asterUserDesc: 'Main wallet address - The EVM wallet address you use to log in to Aster (Note: Only EVM wallets are supported, Solana wallets are not supported)', asterSignerDesc: @@ -1000,6 +1012,18 @@ export const translations = { enterPassphrase: '输入Passphrase (OKX必填)', hyperliquidPrivateKeyDesc: 'Hyperliquid 使用私钥进行交易认证', hyperliquidWalletAddressDesc: '与私钥对应的钱包地址', + // Hyperliquid 代理钱包 (新安全模型) + hyperliquidAgentWalletTitle: 'Hyperliquid 代理钱包配置', + hyperliquidAgentWalletDesc: + '使用代理钱包安全交易:代理钱包用于签名(餘額~0),主钱包持有资金(永不暴露私钥)', + hyperliquidAgentPrivateKey: '代理私钥', + enterHyperliquidAgentPrivateKey: '输入代理钱包私钥', + hyperliquidAgentPrivateKeyDesc: + '代理钱包私钥,用于签名交易(为了安全应保持余额接近0)', + hyperliquidMainWalletAddress: '主钱包地址', + enterHyperliquidMainWalletAddress: '输入主钱包地址', + hyperliquidMainWalletAddressDesc: + '持有交易资金的主钱包地址(永不暴露其私钥)', asterUserDesc: '主钱包地址 - 您用于登录 Aster 的 EVM 钱包地址(注意:仅支持 EVM 钱包,不支持 Solana 钱包)', asterSignerDesc: @@ -1080,9 +1104,11 @@ export const translations = { promptTemplateNof1: 'NoF1 英文框架', promptTemplateTaroLong: 'Taro 长仓', promptDescDefault: '📊 默认稳健策略', - promptDescDefaultContent: '最大化夏普比率,平衡风险收益,适合新手和长期稳定交易', + promptDescDefaultContent: + '最大化夏普比率,平衡风险收益,适合新手和长期稳定交易', promptDescAdaptive: '🛡️ 保守策略 (v6.0.0)', - promptDescAdaptiveContent: '严格风控,BTC 强制确认,高胜率优先,适合保守型交易者', + promptDescAdaptiveContent: + '严格风控,BTC 强制确认,高胜率优先,适合保守型交易者', promptDescAdaptiveRelaxed: '⚡ 激进策略 (v6.0.0)', promptDescAdaptiveRelaxedContent: '高频交易,BTC 可选确认,追求交易机会,适合波动市场', @@ -1092,7 +1118,8 @@ export const translations = { promptDescNof1Content: 'Hyperliquid 交易所专用,英文提示词,风险调整回报最大化', promptDescTaroLong: '📈 Taro 长仓策略', - promptDescTaroLongContent: '数据驱动决策,多维度验证,持续学习进化,长仓专用', + promptDescTaroLongContent: + '数据驱动决策,多维度验证,持续学习进化,长仓专用', // Loading & Error loading: '加载中...', diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index a2f948ce..39ab8e9e 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -157,7 +157,6 @@ export const api = { if (!res.ok) throw new Error('更新模型配置失败') }, - // 交易所配置接口 async getExchangeConfigs(): Promise { const res = await httpClient.get(`${API_BASE}/exchanges`, getAuthHeaders())