import { client } from "./client"; import { components } from "../generated/api"; type ExchangeResponse = components["schemas"]["ExchangeResponse"]; /** * Trades API endpoints (user-facing) */ export const tradesApi = { /** * Get all trades for the current user */ getTrades(): Promise { return client.get("/api/trades"); }, /** * Get a specific trade by public ID */ getTrade(publicId: string): Promise { return client.get(`/api/trades/${encodeURIComponent(publicId)}`); }, /** * Cancel a trade */ cancelTrade(publicId: string): Promise { return client.post(`/api/trades/${encodeURIComponent(publicId)}/cancel`, {}); }, };