mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-12 07:16:56 +08:00
fix
This commit is contained in:
@@ -1163,9 +1163,6 @@ function ExchangeConfigModal({
|
|||||||
const [passphrase, setPassphrase] = useState('');
|
const [passphrase, setPassphrase] = useState('');
|
||||||
const [testnet, setTestnet] = useState(false);
|
const [testnet, setTestnet] = useState(false);
|
||||||
|
|
||||||
// Hyperliquid 特定字段
|
|
||||||
const [hyperliquidWalletAddr, setHyperliquidWalletAddr] = useState('');
|
|
||||||
|
|
||||||
// Aster 特定字段
|
// Aster 特定字段
|
||||||
const [asterUser, setAsterUser] = useState('');
|
const [asterUser, setAsterUser] = useState('');
|
||||||
const [asterSigner, setAsterSigner] = useState('');
|
const [asterSigner, setAsterSigner] = useState('');
|
||||||
@@ -1181,10 +1178,7 @@ function ExchangeConfigModal({
|
|||||||
setSecretKey(selectedExchange.secretKey || '');
|
setSecretKey(selectedExchange.secretKey || '');
|
||||||
setPassphrase(''); // Don't load existing passphrase for security
|
setPassphrase(''); // Don't load existing passphrase for security
|
||||||
setTestnet(selectedExchange.testnet || false);
|
setTestnet(selectedExchange.testnet || false);
|
||||||
|
|
||||||
// Hyperliquid 字段
|
|
||||||
setHyperliquidWalletAddr(selectedExchange.hyperliquidWalletAddr || '');
|
|
||||||
|
|
||||||
// Aster 字段
|
// Aster 字段
|
||||||
setAsterUser(selectedExchange.asterUser || '');
|
setAsterUser(selectedExchange.asterUser || '');
|
||||||
setAsterSigner(selectedExchange.asterSigner || '');
|
setAsterSigner(selectedExchange.asterSigner || '');
|
||||||
@@ -1201,8 +1195,8 @@ function ExchangeConfigModal({
|
|||||||
if (!apiKey.trim() || !secretKey.trim()) return;
|
if (!apiKey.trim() || !secretKey.trim()) return;
|
||||||
await onSave(selectedExchangeId, apiKey.trim(), secretKey.trim(), testnet);
|
await onSave(selectedExchangeId, apiKey.trim(), secretKey.trim(), testnet);
|
||||||
} else if (selectedExchange?.id === 'hyperliquid') {
|
} else if (selectedExchange?.id === 'hyperliquid') {
|
||||||
if (!apiKey.trim()) return; // 只验证私钥,钱包地址可选(会自动生成)
|
if (!apiKey.trim()) return; // 只验证私钥,钱包地址自动从私钥生成
|
||||||
await onSave(selectedExchangeId, apiKey.trim(), '', testnet, hyperliquidWalletAddr.trim());
|
await onSave(selectedExchangeId, apiKey.trim(), '', testnet, ''); // 传空字符串,后端自动生成地址
|
||||||
} else if (selectedExchange?.id === 'aster') {
|
} else if (selectedExchange?.id === 'aster') {
|
||||||
if (!asterUser.trim() || !asterSigner.trim() || !asterPrivateKey.trim()) return;
|
if (!asterUser.trim() || !asterSigner.trim() || !asterPrivateKey.trim()) return;
|
||||||
await onSave(selectedExchangeId, '', '', testnet, undefined, asterUser.trim(), asterSigner.trim(), asterPrivateKey.trim());
|
await onSave(selectedExchangeId, '', '', testnet, undefined, asterUser.trim(), asterSigner.trim(), asterPrivateKey.trim());
|
||||||
@@ -1356,28 +1350,6 @@ function ExchangeConfigModal({
|
|||||||
{t('hyperliquidPrivateKeyDesc', language)}
|
{t('hyperliquidPrivateKeyDesc', language)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-semibold mb-2" style={{ color: '#EAECEF' }}>
|
|
||||||
{t('walletAddress', language)}
|
|
||||||
<span className="text-xs font-normal ml-2" style={{ color: '#848E9C' }}>
|
|
||||||
({t('optional', language)})
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
value={hyperliquidWalletAddr}
|
|
||||||
onChange={(e) => 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' }}
|
|
||||||
/>
|
|
||||||
<div className="text-xs mt-1" style={{ color: '#848E9C' }}>
|
|
||||||
{hyperliquidWalletAddr.trim()
|
|
||||||
? t('hyperliquidWalletAddressDesc', language)
|
|
||||||
: t('hyperliquidWalletAddressAutoGenerate', language)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -194,8 +194,6 @@ export const translations = {
|
|||||||
enterPassphrase: 'Enter Passphrase (Required for OKX)',
|
enterPassphrase: 'Enter Passphrase (Required for OKX)',
|
||||||
hyperliquidPrivateKeyDesc: 'Hyperliquid uses private key for trading authentication',
|
hyperliquidPrivateKeyDesc: 'Hyperliquid uses private key for trading authentication',
|
||||||
hyperliquidWalletAddressDesc: 'Wallet address corresponding to the private key',
|
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',
|
testnetDescription: 'Enable to connect to exchange test environment for simulated trading',
|
||||||
securityWarning: 'Security Warning',
|
securityWarning: 'Security Warning',
|
||||||
saveConfiguration: 'Save Configuration',
|
saveConfiguration: 'Save Configuration',
|
||||||
@@ -610,8 +608,6 @@ export const translations = {
|
|||||||
enterPassphrase: '输入Passphrase (OKX必填)',
|
enterPassphrase: '输入Passphrase (OKX必填)',
|
||||||
hyperliquidPrivateKeyDesc: 'Hyperliquid 使用私钥进行交易认证',
|
hyperliquidPrivateKeyDesc: 'Hyperliquid 使用私钥进行交易认证',
|
||||||
hyperliquidWalletAddressDesc: '与私钥对应的钱包地址',
|
hyperliquidWalletAddressDesc: '与私钥对应的钱包地址',
|
||||||
hyperliquidWalletAddressAutoGenerate: '留空将自动从私钥生成钱包地址',
|
|
||||||
optional: '可选',
|
|
||||||
testnetDescription: '启用后将连接到交易所测试环境,用于模拟交易',
|
testnetDescription: '启用后将连接到交易所测试环境,用于模拟交易',
|
||||||
securityWarning: '安全提示',
|
securityWarning: '安全提示',
|
||||||
saveConfiguration: '保存配置',
|
saveConfiguration: '保存配置',
|
||||||
|
|||||||
Reference in New Issue
Block a user