fix: remove duplicate fetchAPI in api.ts

This commit is contained in:
root 2026-02-27 10:11:32 +00:00
parent 11667d4faa
commit 052e5a0541

View File

@ -64,6 +64,16 @@ export interface SnapshotsResponse {
data: SnapshotItem[]; data: SnapshotItem[];
} }
export interface KBar {
time: number;
open: number; high: number; low: number; close: number;
price_open: number; price_high: number; price_low: number; price_close: number;
}
export interface KlineResponse {
symbol: string; interval: string; count: number; data: KBar[];
}
export interface YtdStats { export interface YtdStats {
annualized: number; annualized: number;
count: number; count: number;
@ -74,16 +84,6 @@ export interface YtdStatsResponse {
ETH: YtdStats; ETH: YtdStats;
} }
async function fetchAPI<T>(path: string): Promise<T> {
time: number;
open: number; high: number; low: number; close: number;
price_open: number; price_high: number; price_low: number; price_close: number;
}
export interface KlineResponse {
symbol: string; interval: string; count: number; data: KBar[];
}
async function fetchAPI<T>(path: string): Promise<T> { async function fetchAPI<T>(path: string): Promise<T> {
const res = await fetch(`${API_BASE}${path}`, { cache: "no-store" }); const res = await fetch(`${API_BASE}${path}`, { cache: "no-store" });
if (!res.ok) throw new Error(`API error ${res.status}`); if (!res.ok) throw new Error(`API error ${res.status}`);