feat(V2): migrazione sentiment completa (read-only, env ignored)

- exchanges/sentiment/{client,fetchers,tools}.py: SentimentClient wrapper stateless (cryptopanic_key, lunarcrush_key)
- routers/sentiment.py: 9 tool POST sotto /mcp-sentiment (news, social, funding, OI, liquidations, cointegration)
- exchanges/__init__.py: branch builder per sentiment (env ignored)
- tests/unit/exchanges/sentiment: migrato test_fetchers, scartato test_server_acl V1-only
- tests/unit/test_exchanges_builder.py: aggiunto test_build_client_sentiment_no_env_distinction
- fetchers.py: env var lookup allineato a LUNARCRUSH_KEY (con fallback LUNARCRUSH_API_KEY)

241 test passano.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
AdrianoDev
2026-04-30 18:46:48 +02:00
parent 88bd4e7bde
commit f56df197e1
9 changed files with 1253 additions and 0 deletions
@@ -0,0 +1,21 @@
"""SentimentClient: contenitore credenziali per data provider sentiment.
Sentiment è un read-only data provider (CryptoPanic, LunarCrush, aggregazioni
multi-exchange di funding/OI da endpoint pubblici). Nessun testnet/mainnet,
nessuna sessione HTTP persistente — i `fetchers.py` aprono client httpx ad-hoc
tramite `cerbero_mcp.common.http.async_client`. Questo wrapper esiste solo per
uniformità con il pattern degli altri exchange (DeribitClient/BybitClient/...)
e per essere istanziato dal `ClientRegistry`.
"""
from __future__ import annotations
class SentimentClient:
"""Wrapper credenziali CryptoPanic/LunarCrush. Stateless, no HTTP session."""
def __init__(self, *, cryptopanic_key: str = "", lunarcrush_key: str = "") -> None:
self.cryptopanic_key = cryptopanic_key
self.lunarcrush_key = lunarcrush_key
async def aclose(self) -> None: # pragma: no cover - no-op, no resources
return None