feat(V2): migrazione hyperliquid completa

- exchanges/hyperliquid/{client,leverage_cap,tools}.py
- routers/hyperliquid.py con 16 endpoint /mcp-hyperliquid/tools/*
- builder hyperliquid in exchanges/__init__.py
- test migrati: test_client, test_leverage_cap (skip V1: server_acl, environment_info)
- test builder hyperliquid (testnet vs mainnet base_url)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
AdrianoDev
2026-04-30 18:35:46 +02:00
parent 5e42ce9c69
commit 8dbaf3a0e4
10 changed files with 1438 additions and 0 deletions
+21
View File
@@ -50,6 +50,27 @@ async def test_build_client_bybit_returns_correct_env(monkeypatch):
assert c_live.testnet is False
@pytest.mark.asyncio
async def test_build_client_hyperliquid_returns_correct_env(monkeypatch):
from tests.unit.test_settings import _minimal_env
for k, v in _minimal_env().items():
monkeypatch.setenv(k, v)
from cerbero_mcp.settings import Settings
from cerbero_mcp.exchanges import build_client
s = Settings()
c_test = await build_client(s, "hyperliquid", "testnet")
c_live = await build_client(s, "hyperliquid", "mainnet")
assert c_test is not c_live
assert c_test.testnet is True
assert c_live.testnet is False
assert "test" in c_test.base_url.lower()
assert "test" not in c_live.base_url.lower()
@pytest.mark.asyncio
async def test_build_client_unknown_exchange_raises(monkeypatch):
from tests.unit.test_settings import _minimal_env