File size: 408 Bytes
8ae2973
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Currency exchange rate endpoint."""

from fastapi import APIRouter

from ..config import CURRENCY_SYMBOLS, EXCHANGE_RATES

router = APIRouter(prefix="/api/currency", tags=["currency"])


@router.get("/rates")
async def get_rates():
    """Return all exchange rates (USD base) with symbols."""
    return {
        "base": "USD",
        "rates": EXCHANGE_RATES,
        "symbols": CURRENCY_SYMBOLS,
    }