Stage 03.1 - mock exchange integration
This commit is contained in:
37
app/src/integrations/exchange/mock_data.py
Normal file
37
app/src/integrations/exchange/mock_data.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from src.integrations.exchange.models import BalanceSummary, ExchangeHealth, TickerPrice
|
||||
|
||||
|
||||
def mock_exchange_health() -> ExchangeHealth:
|
||||
return ExchangeHealth(
|
||||
ok=True,
|
||||
mode="mock",
|
||||
message="Биржа работает в mock mode. Реальный API пока не подключен.",
|
||||
)
|
||||
|
||||
|
||||
def mock_ticker_price(symbol: str) -> TickerPrice:
|
||||
symbol = symbol.upper().strip()
|
||||
fake_prices = {
|
||||
"BTCUSDT": 68425.10,
|
||||
"ETHUSDT": 3521.44,
|
||||
"BNBUSDT": 612.33,
|
||||
}
|
||||
price = fake_prices.get(symbol, 100.00)
|
||||
updated_at = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
|
||||
return TickerPrice(
|
||||
symbol=symbol,
|
||||
price=price,
|
||||
source="mock",
|
||||
updated_at=updated_at,
|
||||
)
|
||||
|
||||
|
||||
def mock_balance_summary() -> list[BalanceSummary]:
|
||||
return [
|
||||
BalanceSummary(currency="USDT", available=1500.00, locked=0.0, source="mock"),
|
||||
BalanceSummary(currency="BTC", available=0.025, locked=0.0, source="mock"),
|
||||
]
|
||||
Reference in New Issue
Block a user