mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-17 17:34:39 +08:00
feat: improve Hyperliquid agent wallet config UX and guidance
This commit is contained in:
@@ -915,33 +915,39 @@ export function ExchangeConfigModal({
|
|||||||
{/* Hyperliquid 交易所的字段 */}
|
{/* Hyperliquid 交易所的字段 */}
|
||||||
{currentExchangeType === 'hyperliquid' && (
|
{currentExchangeType === 'hyperliquid' && (
|
||||||
<>
|
<>
|
||||||
{/* 安全提示 banner */}
|
{/* 操作指引 banner */}
|
||||||
<div
|
<div
|
||||||
className="p-3 rounded mb-4"
|
className="p-4 rounded mb-4"
|
||||||
style={{
|
style={{
|
||||||
background: 'rgba(240, 185, 11, 0.1)',
|
background: 'rgba(88, 166, 255, 0.1)',
|
||||||
border: '1px solid rgba(240, 185, 11, 0.3)',
|
border: '1px solid rgba(88, 166, 255, 0.3)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex items-start gap-2">
|
<div
|
||||||
<span style={{ color: '#F0B90B', fontSize: '16px' }}>
|
className="text-sm font-semibold mb-2"
|
||||||
🔐
|
style={{ color: '#58a6ff' }}
|
||||||
</span>
|
>
|
||||||
<div className="flex-1">
|
{t('hyperliquidAgentWalletTitle', language)}
|
||||||
<div
|
|
||||||
className="text-sm font-semibold mb-1"
|
|
||||||
style={{ color: '#F0B90B' }}
|
|
||||||
>
|
|
||||||
{t('hyperliquidAgentWalletTitle', language)}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="text-xs"
|
|
||||||
style={{ color: '#848E9C', lineHeight: '1.5' }}
|
|
||||||
>
|
|
||||||
{t('hyperliquidAgentWalletDesc', language)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
className="text-xs mb-3"
|
||||||
|
style={{ color: '#c9d1d9', lineHeight: '1.6' }}
|
||||||
|
>
|
||||||
|
{t('hyperliquidAgentWalletDesc', language)}
|
||||||
|
</div>
|
||||||
|
<a
|
||||||
|
href="https://app.hyperliquid.xyz/API"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="inline-flex items-center gap-2 px-3 py-2 rounded text-sm font-medium transition-all hover:scale-105"
|
||||||
|
style={{
|
||||||
|
background: 'rgba(88, 166, 255, 0.2)',
|
||||||
|
color: '#58a6ff',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ExternalLink className="w-4 h-4" />
|
||||||
|
{t('hyperliquidAgentWalletLinkText', language)}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Agent Private Key 字段 */}
|
{/* Agent Private Key 字段 */}
|
||||||
@@ -952,57 +958,36 @@ export function ExchangeConfigModal({
|
|||||||
>
|
>
|
||||||
{t('hyperliquidAgentPrivateKey', language)}
|
{t('hyperliquidAgentPrivateKey', language)}
|
||||||
</label>
|
</label>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex gap-2">
|
||||||
<div className="flex gap-2">
|
<input
|
||||||
<input
|
type="password"
|
||||||
type="text"
|
value={apiKey}
|
||||||
value={maskSecret(apiKey)}
|
onChange={(e) => setApiKey(e.target.value)}
|
||||||
readOnly
|
placeholder={t(
|
||||||
placeholder={t(
|
'enterHyperliquidAgentPrivateKey',
|
||||||
'enterHyperliquidAgentPrivateKey',
|
language
|
||||||
language
|
|
||||||
)}
|
|
||||||
className="w-full px-3 py-2 rounded"
|
|
||||||
style={{
|
|
||||||
background: '#0B0E11',
|
|
||||||
border: '1px solid #2B3139',
|
|
||||||
color: '#EAECEF',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => setSecureInputTarget('hyperliquid')}
|
|
||||||
className="px-3 py-2 rounded text-xs font-semibold transition-all hover:scale-105"
|
|
||||||
style={{
|
|
||||||
background: '#F0B90B',
|
|
||||||
color: '#000',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{apiKey
|
|
||||||
? t('secureInputReenter', language)
|
|
||||||
: t('secureInputButton', language)}
|
|
||||||
</button>
|
|
||||||
{apiKey && (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => setApiKey('')}
|
|
||||||
className="px-3 py-2 rounded text-xs font-semibold transition-all hover:scale-105"
|
|
||||||
style={{
|
|
||||||
background: '#1B1F2B',
|
|
||||||
color: '#848E9C',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t('secureInputClear', language)}
|
|
||||||
</button>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
className="w-full px-3 py-2 rounded"
|
||||||
{apiKey && (
|
style={{
|
||||||
<div className="text-xs" style={{ color: '#848E9C' }}>
|
background: '#0B0E11',
|
||||||
{t('secureInputHint', language)}
|
border: '1px solid #2B3139',
|
||||||
</div>
|
color: '#EAECEF',
|
||||||
)}
|
}}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setSecureInputTarget('hyperliquid')}
|
||||||
|
className="px-3 py-2 rounded text-xs font-semibold transition-all hover:scale-105"
|
||||||
|
style={{
|
||||||
|
background: '#2B3139',
|
||||||
|
color: '#848E9C',
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
}}
|
||||||
|
title={language === 'zh' ? '分段安全输入(可选)' : 'Staged secure input (optional)'}
|
||||||
|
>
|
||||||
|
{language === 'zh' ? '安全输入' : 'Secure'}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="text-xs mt-1"
|
className="text-xs mt-1"
|
||||||
|
|||||||
@@ -347,17 +347,19 @@ export const translations = {
|
|||||||
hyperliquidWalletAddressDesc:
|
hyperliquidWalletAddressDesc:
|
||||||
'Wallet address corresponding to the private key',
|
'Wallet address corresponding to the private key',
|
||||||
// Hyperliquid Agent Wallet (New Security Model)
|
// Hyperliquid Agent Wallet (New Security Model)
|
||||||
hyperliquidAgentWalletTitle: 'Hyperliquid Agent Wallet Configuration',
|
hyperliquidAgentWalletTitle: 'How to get Agent Wallet?',
|
||||||
hyperliquidAgentWalletDesc:
|
hyperliquidAgentWalletDesc:
|
||||||
'Use Agent Wallet for secure trading: Agent wallet signs transactions (balance ~0), Main wallet holds funds (never expose private key)',
|
'Go to Hyperliquid → More → API → Create Agent Wallet. The Agent Wallet can only trade, cannot withdraw funds.',
|
||||||
hyperliquidAgentPrivateKey: 'Agent Private Key',
|
hyperliquidAgentWalletLink: 'https://app.hyperliquid.xyz/API',
|
||||||
enterHyperliquidAgentPrivateKey: 'Enter Agent wallet private key',
|
hyperliquidAgentWalletLinkText: 'Go to Hyperliquid to create Agent Wallet →',
|
||||||
|
hyperliquidAgentPrivateKey: 'Agent Wallet Private Key',
|
||||||
|
enterHyperliquidAgentPrivateKey: '0x... (64 hex characters)',
|
||||||
hyperliquidAgentPrivateKeyDesc:
|
hyperliquidAgentPrivateKeyDesc:
|
||||||
'Agent wallet private key for signing transactions (keep balance near 0 for security)',
|
'Private key shown when creating Agent Wallet. Only has trading permission, cannot withdraw.',
|
||||||
hyperliquidMainWalletAddress: 'Main Wallet Address',
|
hyperliquidMainWalletAddress: 'Main Wallet Address',
|
||||||
enterHyperliquidMainWalletAddress: 'Enter Main wallet address',
|
enterHyperliquidMainWalletAddress: '0x... (your main wallet)',
|
||||||
hyperliquidMainWalletAddressDesc:
|
hyperliquidMainWalletAddressDesc:
|
||||||
'Main wallet address that holds your trading funds (never expose its private key)',
|
'The wallet address you use to log in Hyperliquid (holds your funds)',
|
||||||
// Aster API Pro Configuration
|
// Aster API Pro Configuration
|
||||||
asterApiProTitle: 'Aster API Pro Wallet Configuration',
|
asterApiProTitle: 'Aster API Pro Wallet Configuration',
|
||||||
asterApiProDesc:
|
asterApiProDesc:
|
||||||
@@ -1548,16 +1550,17 @@ export const translations = {
|
|||||||
hyperliquidPrivateKeyDesc: 'Hyperliquid 使用私钥进行交易认证',
|
hyperliquidPrivateKeyDesc: 'Hyperliquid 使用私钥进行交易认证',
|
||||||
hyperliquidWalletAddressDesc: '与私钥对应的钱包地址',
|
hyperliquidWalletAddressDesc: '与私钥对应的钱包地址',
|
||||||
// Hyperliquid 代理钱包 (新安全模型)
|
// Hyperliquid 代理钱包 (新安全模型)
|
||||||
hyperliquidAgentWalletTitle: 'Hyperliquid 代理钱包配置',
|
hyperliquidAgentWalletTitle: '如何获取代理钱包?',
|
||||||
hyperliquidAgentWalletDesc:
|
hyperliquidAgentWalletDesc:
|
||||||
'使用代理钱包安全交易:代理钱包用于签名(餘額~0),主钱包持有资金(永不暴露私钥)',
|
'打开 Hyperliquid → 右上角 More → API → Create Agent Wallet 创建代理钱包。代理钱包只能交易,无法提现。',
|
||||||
hyperliquidAgentPrivateKey: '代理私钥',
|
hyperliquidAgentWalletLink: 'https://app.hyperliquid.xyz/API',
|
||||||
enterHyperliquidAgentPrivateKey: '输入代理钱包私钥',
|
hyperliquidAgentWalletLinkText: '去 Hyperliquid 创建代理钱包 →',
|
||||||
hyperliquidAgentPrivateKeyDesc: '代理钱包仅有交易权限,无法提现',
|
hyperliquidAgentPrivateKey: '代理钱包私钥',
|
||||||
|
enterHyperliquidAgentPrivateKey: '0x... (64位十六进制)',
|
||||||
|
hyperliquidAgentPrivateKeyDesc: '创建代理钱包时显示的私钥,只能交易,无法提现',
|
||||||
hyperliquidMainWalletAddress: '主钱包地址',
|
hyperliquidMainWalletAddress: '主钱包地址',
|
||||||
enterHyperliquidMainWalletAddress: '输入主钱包地址',
|
enterHyperliquidMainWalletAddress: '0x... (你的主钱包地址)',
|
||||||
hyperliquidMainWalletAddressDesc:
|
hyperliquidMainWalletAddressDesc: '你登录 Hyperliquid 时使用的钱包地址(资金所在钱包)',
|
||||||
'持有交易资金的主钱包地址(永不暴露其私钥)',
|
|
||||||
// Aster API Pro 配置
|
// Aster API Pro 配置
|
||||||
asterApiProTitle: 'Aster API Pro 代理钱包配置',
|
asterApiProTitle: 'Aster API Pro 代理钱包配置',
|
||||||
asterApiProDesc:
|
asterApiProDesc:
|
||||||
|
|||||||
Reference in New Issue
Block a user