Files
signal-platform/frontend/src/api/trades.ts
T
Dennis Thiessen 0a011d4ce9
Deploy / lint (push) Failing after 21s
Deploy / test (push) Has been skipped
Deploy / deploy (push) Has been skipped
Big refactoring
2026-03-03 15:20:18 +01:00

21 lines
694 B
TypeScript

import apiClient from './client';
import type { TradeSetup } from '../lib/types';
export interface TradeListParams {
direction?: 'long' | 'short';
min_confidence?: number;
recommended_action?: 'LONG_HIGH' | 'LONG_MODERATE' | 'SHORT_HIGH' | 'SHORT_MODERATE' | 'NEUTRAL';
}
export function list(params?: TradeListParams) {
return apiClient.get<TradeSetup[]>('trades', { params }).then((r) => r.data);
}
export function bySymbol(symbol: string) {
return apiClient.get<TradeSetup[]>(`trades/${symbol.toUpperCase()}`).then((r) => r.data);
}
export function history(symbol: string) {
return apiClient.get<TradeSetup[]>(`trades/${symbol.toUpperCase()}/history`).then((r) => r.data);
}