mirror of
https://github.com/luxfi/broker.git
synced 2026-09-24 00:25:18 +00:00
feat: auto-register Kraken and Gemini in public-data mode for local dev
When ENVIRONMENT=local or ENABLE_PUBLIC_DATA is set, register Kraken and Gemini without API keys. Their public endpoints provide real-time crypto prices without authentication.
This commit is contained in:
@@ -122,6 +122,13 @@ func RegisterFromEnv(registry *provider.Registry) int {
|
||||
}))
|
||||
slog.Info("provider registered", "name", "kraken")
|
||||
n++
|
||||
} else if os.Getenv("ENABLE_PUBLIC_DATA") != "" || os.Getenv("ENVIRONMENT") == "local" {
|
||||
// Kraken public API works without keys for market data (read-only).
|
||||
registry.Register(kraken.New(kraken.Config{
|
||||
BaseURL: envOr("KRAKEN_BASE_URL", kraken.ProdURL),
|
||||
}))
|
||||
slog.Info("provider registered", "name", "kraken", "mode", "public-data")
|
||||
n++
|
||||
}
|
||||
|
||||
if key := os.Getenv("GEMINI_API_KEY"); key != "" {
|
||||
@@ -132,6 +139,13 @@ func RegisterFromEnv(registry *provider.Registry) int {
|
||||
}))
|
||||
slog.Info("provider registered", "name", "gemini")
|
||||
n++
|
||||
} else if os.Getenv("ENABLE_PUBLIC_DATA") != "" || os.Getenv("ENVIRONMENT") == "local" {
|
||||
// Gemini public API works without keys for market data (read-only).
|
||||
registry.Register(gemini.New(gemini.Config{
|
||||
BaseURL: envOr("GEMINI_BASE_URL", gemini.ProdURL),
|
||||
}))
|
||||
slog.Info("provider registered", "name", "gemini", "mode", "public-data")
|
||||
n++
|
||||
}
|
||||
|
||||
if key := os.Getenv("FIREBLOCKS_API_KEY"); key != "" {
|
||||
|
||||
Reference in New Issue
Block a user