import apiClient from './client';
import type { Ticker } from '../lib/types';

export function list() {
  return apiClient.get<Ticker[]>('tickers').then((r) => r.data);
}

export function create(symbol: string) {
  return apiClient.post<Ticker>('tickers', { symbol }).then((r) => r.data);
}

export function deleteTicker(symbol: string) {
  return apiClient
    .delete<{ message: string }>(`tickers/${symbol}`)
    .then((r) => r.data);
}
