import axios, { AxiosResponse } from 'axios'; export interface ExchangeData { base: string; rates: { USD: number; EUR: number; }; date: string; } /** * Fetches latest exchange rates for USD and EUR relative to the given base currency */ export const getExchangeRates = async ( base: string ): Promise => { const response: AxiosResponse = await axios.get( `/exchange?base=${encodeURIComponent(base)}` ); return response.data; };