mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
feat: auto-reuse claw402 wallet for nofxos data — no extra config needed
When a trader uses claw402 as AI provider, the same wallet private key is now automatically used to route nofxos data API calls (AI500, OI, NetFlow, etc.) through claw402 payment as well. Users don't need to configure anything extra — if they already set up claw402 for AI, data APIs automatically go through claw402 too.
This commit is contained in:
@@ -333,7 +333,13 @@ func NewAutoTrader(config AutoTraderConfig, st *store.Store, userID string) (*Au
|
||||
if config.StrategyConfig == nil {
|
||||
return nil, fmt.Errorf("[%s] strategy not configured", config.Name)
|
||||
}
|
||||
strategyEngine := kernel.NewStrategyEngine(config.StrategyConfig)
|
||||
// Pass claw402 wallet key to strategy engine so nofxos data requests
|
||||
// are routed through claw402 (reuses the same wallet as AI calls)
|
||||
var claw402Key string
|
||||
if config.AIModel == "claw402" && config.CustomAPIKey != "" {
|
||||
claw402Key = config.CustomAPIKey
|
||||
}
|
||||
strategyEngine := kernel.NewStrategyEngine(config.StrategyConfig, claw402Key)
|
||||
logger.Infof("✓ [%s] Using strategy engine (strategy configuration loaded)", config.Name)
|
||||
|
||||
return &AutoTrader{
|
||||
|
||||
Reference in New Issue
Block a user