Spaces:
Sleeping
Sleeping
Naufal Arhab
fix(audit): refine bybit split-tp breakeven, 1000x chart scaling, and frontend surfacing
075133b Download frontend/src/api/pairs.ts from agus1111/Perps-Terminal: direct link, hf CLI and curl.
- Browser
- Download file 871 Bytes
-
https://huggingface.co/spaces/agus1111/Perps-Terminal/resolve/main/frontend/src/api/pairs.ts
- Command line
-
hf download hf://spaces/agus1111/Perps-Terminal/frontend/src/api/pairs.ts
-
curl -L -o pairs.ts https://huggingface.co/spaces/agus1111/Perps-Terminal/resolve/main/frontend/src/api/pairs.ts
871 Bytes
| import { apiClient } from './client'; | |
| import type { Pair, ValidatePairResult } from '../types'; | |
| export const pairsApi = { | |
| getAll: async (): Promise<Pair[]> => { | |
| const { data } = await apiClient.get<Pair[]>('/api/pairs'); | |
| return data; | |
| }, | |
| validate: async (symbol: string): Promise<ValidatePairResult> => { | |
| const { data } = await apiClient.post<ValidatePairResult>('/api/pairs/validate', { symbol }); | |
| return data; | |
| }, | |
| add: async (symbol: string): Promise<Pair> => { | |
| const { data } = await apiClient.post<Pair>('/api/pairs', { symbol }); | |
| return data; | |
| }, | |
| remove: async (id: number): Promise<void> => { | |
| await apiClient.delete(`/api/pairs/${id}`); | |
| }, | |
| toggleActive: async (id: number, _is_active?: boolean): Promise<Pair> => { | |
| const { data } = await apiClient.patch<Pair>(`/api/pairs/${id}/toggle`); | |
| return data; | |
| }, | |
| }; | |