returnformatTraderCreationError("The exchange account you selected was not found","Please go to \"Settings > Exchange Config\" and add an available account first, then come back to create the bot"),
fmt.Sprintf("Exchange account \"%s\" uses type %s, which is not supported in the current version",exchangeDisplayName(exchange),exchange.ExchangeType),
"Please switch to an exchange account supported by the current version, then create the bot again",
return"trader.reason.hyperliquid_init_failed","Hyperliquid account initialization failed; please confirm the private key, main wallet address, and Agent Wallet configuration are correct"
casestrings.Contains(lower,"failed to initialize aster trader"):
return"trader.reason.hyperliquid_agent_balance_too_high","The Hyperliquid Agent Wallet balance is too high and does not meet the current security requirements"
casestrings.Contains(lower,"failed to initialize account"):
return"trader.reason.exchange_account_init_failed","交易所账户初始化失败,请确认钱包地址和 API Key 是否匹配"
return"trader.reason.exchange_account_init_failed","Exchange account initialization failed; please confirm the wallet address and API Key match"
returnformatTraderCreationError("The bot configuration was saved, but the runtime instance failed to initialize","Please check that the model, strategy, and exchange configuration are complete, then try again")
returnfmt.Sprintf("Bot \"%s\" has been saved, but it has not yet passed the pre-start validation. Please check the model, strategy, and exchange configuration first, then click start after fixing them.",traderName)
returnfmt.Sprintf("Bot \"%s\" has been saved, but it cannot start for now. Please check the model, strategy, and exchange configuration first, then click start after fixing them.",traderName)
returnfmt.Sprintf("Bot \"%s\" has been saved, but it cannot start for now, because: %s. Please check the model, strategy, and exchange configuration first, then click start after fixing them.",traderName,reason)
returnfmt.Sprintf("Failed to start the bot this time: bot \"%s\" cannot start for now. Please check the model, strategy, and exchange configuration, then click start again.",traderName)
returnfmt.Sprintf("Failed to start the bot this time: bot \"%s\" cannot start for now. Please check the model, strategy, and exchange configuration, then click start again.",traderName)
returnfmt.Sprintf("Failed to start the bot this time: bot \"%s\" cannot start for now, because: %s. Please check the model, strategy, and exchange configuration, then click start again.",traderName,reason)
SafeBadRequestWithDetails(c,traderCreationRequestError("The submitted information is incomplete or has an invalid format"),"trader.create.invalid_request",nil)
return
}
@@ -344,7 +344,7 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
fmt.Sprintf("The trading pair %s has an invalid format; only USDT perpetuals or Hyperliquid XYZ USDC instruments (SYMBOL-USDC) are currently supported",symbol),
SafeBadRequestWithDetails(c,formatTraderCreationError("还没有找到你选择的 AI 模型","请前往「设置 > 模型配置」先添加并启用一个可用模型,再回来创建机器人"),"trader.create.model_not_found",nil)
SafeBadRequestWithDetails(c,formatTraderCreationError("The AI model you selected was not found","Please go to \"Settings > Model Config\" to add and enable an available model first, then come back to create the bot"),"trader.create.model_not_found",nil)
return
}
SafeError(c,http.StatusInternalServerError,
formatTraderCreationError("暂时无法读取你的 AI 模型配置","请稍后重试;如果问题持续,再检查本地服务是否正常"),
formatTraderCreationError("Unable to read your AI model configuration for now","Please retry later; if the problem persists, check whether the local service is running normally"),
SafeBadRequestWithDetails(c,formatTraderCreationError("You have not selected a trading strategy yet","Please select a strategy first, then continue creating the bot"),"trader.create.strategy_required",nil)
return
}
@@ -387,11 +387,11 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
SafeBadRequestWithDetails(c,formatTraderCreationError("The strategy you selected does not exist or has been deleted","Please select another available strategy, then continue creating the bot"),"trader.create.strategy_not_found",nil)
formatTraderCreationError("Unable to read the strategy configuration you selected for now","Please retry later; if the problem persists, check whether the local service is running normally"),
err,
)
return
@@ -445,7 +445,7 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
formatTraderCreationError("Unable to read your exchange configuration for now","Please retry later; if the problem persists, check whether the local service is running normally"),
err,
)
return
@@ -469,9 +469,9 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
publicMsg:=SanitizeError(err,formatTraderCreationError("The bot configuration was not saved successfully","Please check the name, model, strategy, and exchange configuration, then try again"))
ifpublicMsg==formatTraderCreationError("The bot configuration was not saved successfully","Please check the name, model, strategy, and exchange configuration, then try again"){
statusCode=http.StatusInternalServerError
}
SafeError(c,statusCode,publicMsg,err)
@@ -781,8 +781,8 @@ func (s *Server) handleStartTrader(c *gin.Context) {
@@ -818,25 +818,25 @@ func (s *Server) handleStartTrader(c *gin.Context) {
}
// Check AI model
iffullCfg.AIModel==nil{
SafeBadRequestWithDetails(c,formatTraderStartError("这个机器人关联的 AI 模型不存在","请前往「设置 > 模型配置」检查后,再重新点击启动"),"trader.start.model_not_found",mapStringPairs("trader_name",traderName))
SafeBadRequestWithDetails(c,formatTraderStartError("The AI model associated with this bot does not exist","Please go to \"Settings > Model Config\" to check, then click start again"),"trader.start.model_not_found",mapStringPairs("trader_name",traderName))
SafeBadRequestWithDetails(c,formatTraderStartError("The exchange account associated with this bot does not exist","Please go to \"Settings > Exchange Config\" to check, then click start again"),"trader.start.exchange_not_found",mapStringPairs("trader_name",traderName))
@@ -229,7 +229,7 @@ func (s *Server) createDefaultStrategies(userID string, lang string) error {
}
locales:=map[string]strategyLocale{
"zh":{
defaultStrategy:strategyI18n{"NOFX Claw402 自动策略","唯一内置策略:每轮读取 Claw402.ai 榜单,逐个拉取 Signal Lab 与成本/清算热力图,再结合原始 K 线决策。"},
defaultStrategy:strategyI18n{"NOFX Claw402 Auto Strategy","The only built-in strategy: read the Claw402.ai board each cycle, fetch Signal Lab and cost/liquidation heatmap per candidate, then decide with raw candles."},
},
"en":{
defaultStrategy:strategyI18n{"NOFX Claw402 Auto Strategy","The only built-in strategy: read the Claw402.ai board each cycle, fetch Signal Lab and cost/liquidation heatmap per candidate, then decide with raw candles."},
@@ -318,8 +318,8 @@ func (s *Server) createDefaultStrategies(userID string, lang string) error {
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.