Big refactoring
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
import apiClient from './client';
|
||||
import type { TradeSetup } from '../lib/types';
|
||||
|
||||
export function list() {
|
||||
return apiClient.get<TradeSetup[]>('trades').then((r) => r.data);
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user