feat: scaffold frontend pnpm monorepo with apps (admin, web) and shared packages (types, api-client, ui)

This commit is contained in:
Bot
2026-08-30 23:55:17 +08:00
parent 874b421f39
commit 1e9b9bd0b2
11 changed files with 193 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { Market, Order, Position, GovernanceConfig } from '@wtfx/types';
export class WtfxApiClient {
private baseUrl: string;
constructor(baseUrl: string) {
this.baseUrl = baseUrl;
}
async getMarkets(): Promise<Market[]> {
const res = await fetch(`${this.baseUrl}/api/v1/markets`);
return res.json();
}
async getMarket(marketAddress: string): Promise<Market> {
const res = await fetch(`${this.baseUrl}/api/v1/markets/${marketAddress}`);
return res.json();
}
async getPositions(userAddress: string): Promise<Position[]> {
const res = await fetch(`${this.baseUrl}/api/v1/positions?user=${userAddress}`);
return res.json();
}
async getGovernanceConfig(): Promise<GovernanceConfig> {
const res = await fetch(`${this.baseUrl}/api/v1/governance`);
return res.json();
}
}