import axiosInstance from 'api/axios';
import { GET_EXCHANGES } from 'api/URL';

export interface ExchangeType {
  code: string;
  date: string;
  id: number;
  nominal: number;
  rate: number;
}

const exchanges_api = {
  async getExchanges(): Promise<ExchangeType[]> {
    const data = await axiosInstance.get(GET_EXCHANGES);
    return data.data;
  },
};

export default exchanges_api;
