- {getShortName(selectedExchange.name)}
+ {selectedExchange && (
+
+
+
+ {getExchangeIcon(selectedExchange.id, {
+ width: 32,
+ height: 32,
+ })}
-
- {selectedExchange.type.toUpperCase()} •{' '}
- {selectedExchange.id}
+
+
+ {getShortName(selectedExchange.name)}
+
+
+ {selectedExchange.type.toUpperCase()} •{' '}
+ {selectedExchange.id}
+
-
- )}
+ )}
- {selectedExchange && (
- <>
- {/* Binance 和其他 CEX 交易所的字段 */}
- {(selectedExchange.id === 'binance' ||
- selectedExchange.type === 'cex') &&
- selectedExchange.id !== 'hyperliquid' &&
- selectedExchange.id !== 'aster' && (
- <>
- {/* 币安用户配置提示 (D1 方案) */}
- {selectedExchange.id === 'binance' && (
-
setShowBinanceGuide(!showBinanceGuide)}
- >
-
-
-
ℹ️
-
- 币安用户必读:
- 使用「现货与合约交易」API,不要用「统一账户 API」
+ {selectedExchange && (
+ <>
+ {/* Binance 和其他 CEX 交易所的字段 */}
+ {(selectedExchange.id === 'binance' ||
+ selectedExchange.type === 'cex') &&
+ selectedExchange.id !== 'hyperliquid' &&
+ selectedExchange.id !== 'aster' && (
+ <>
+ {/* 币安用户配置提示 (D1 方案) */}
+ {selectedExchange.id === 'binance' && (
+ setShowBinanceGuide(!showBinanceGuide)}
+ >
+
+
+ ℹ️
+
+ 币安用户必读:
+ 使用「现货与合约交易」API,不要用「统一账户
+ API」
+
+
+
+ {showBinanceGuide ? '▲' : '▼'}
-
- {showBinanceGuide ? '▲' : '▼'}
-
-
- {/* 展开的详细说明 */}
- {showBinanceGuide && (
- e.stopPropagation()}
- >
-
- 原因:统一账户 API
- 权限结构不同,会导致订单提交失败
-
-
-
- 正确配置步骤:
-
-
- -
- 登录币安 → 个人中心 → API 管理
-
- -
- 创建 API → 选择「
- 系统生成的 API 密钥」
-
- -
- 勾选「现货与合约交易」(
-
- 不选统一账户
-
- )
-
- -
- IP 限制选「无限制」或添加服务器
- IP
-
-
-
-
e.stopPropagation()}
>
- 💡 多资产模式用户注意:
- 如果您开启了多资产模式,将强制使用全仓模式。建议关闭多资产模式以支持逐仓交易。
-
+
+ 原因:统一账户 API
+ 权限结构不同,会导致订单提交失败
+
-
- 📖 查看币安官方教程 ↗
-
-
- )}
-
- )}
+
+ 正确配置步骤:
+
+
+ -
+ 登录币安 → 个人中心 →{' '}
+ API 管理
+
+ -
+ 创建 API → 选择「
+ 系统生成的 API 密钥」
+
+ -
+ 勾选「现货与合约交易」(
+
+ 不选统一账户
+
+ )
+
+ -
+ IP 限制选「无限制
+ 」或添加服务器 IP
+
+
-
-
- setApiKey(e.target.value)}
- placeholder={t('enterAPIKey', language)}
- className="w-full px-3 py-2 rounded"
- style={{
- background: '#0B0E11',
- border: '1px solid #2B3139',
- color: '#EAECEF',
- }}
- required
- />
-
+
+ 💡 多资产模式用户注意:
+ 如果您开启了多资产模式,将强制使用全仓模式。建议关闭多资产模式以支持逐仓交易。
+
-
-
- setSecretKey(e.target.value)}
- placeholder={t('enterSecretKey', language)}
- className="w-full px-3 py-2 rounded"
- style={{
- background: '#0B0E11',
- border: '1px solid #2B3139',
- color: '#EAECEF',
- }}
- required
- />
-
+
+ 📖 查看币安官方教程 ↗
+
+
+ )}
+
+ )}
- {selectedExchange.id === 'okx' && (
setPassphrase(e.target.value)}
- placeholder={t('enterPassphrase', language)}
+ value={apiKey}
+ onChange={(e) => setApiKey(e.target.value)}
+ placeholder={t('enterAPIKey', language)}
className="w-full px-3 py-2 rounded"
style={{
background: '#0B0E11',
@@ -2142,62 +2139,232 @@ function ExchangeConfigModal({
required
/>
- )}
- {/* Binance 白名单IP提示 */}
- {selectedExchange.id === 'binance' && (
-
-
+
-
- {t('whitelistIPDesc', language)}
-
-
- {loadingIP ? (
-
- {t('loadingServerIP', language)}
-
- ) : serverIP && serverIP.public_ip ? (
-
-
- {serverIP.public_ip}
-
-
-
- ) : null}
+ {t('secretKey', language)}
+
+
setSecretKey(e.target.value)}
+ placeholder={t('enterSecretKey', language)}
+ className="w-full px-3 py-2 rounded"
+ style={{
+ background: '#0B0E11',
+ border: '1px solid #2B3139',
+ color: '#EAECEF',
+ }}
+ required
+ />
- )}
+
+ {selectedExchange.id === 'okx' && (
+
+
+ setPassphrase(e.target.value)}
+ placeholder={t('enterPassphrase', language)}
+ className="w-full px-3 py-2 rounded"
+ style={{
+ background: '#0B0E11',
+ border: '1px solid #2B3139',
+ color: '#EAECEF',
+ }}
+ required
+ />
+
+ )}
+
+ {/* Binance 白名单IP提示 */}
+ {selectedExchange.id === 'binance' && (
+
+
+ {t('whitelistIP', language)}
+
+
+ {t('whitelistIPDesc', language)}
+
+
+ {loadingIP ? (
+
+ {t('loadingServerIP', language)}
+
+ ) : serverIP && serverIP.public_ip ? (
+
+
+ {serverIP.public_ip}
+
+
+
+ ) : null}
+
+ )}
+ >
+ )}
+
+ {/* 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' && (
+ <>
+
+
+ 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
+ />
+
+
+
+
+ setAsterPrivateKey(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
+ />
+
>
)}
@@ -2451,56 +2618,44 @@ function ExchangeConfigModal({
)}