feat: add username availability check API endpoint

feat: create user image retrieval API endpoint

feat: enhance coin page with dynamic data fetching and improved UI

feat: implement coin creation form with validation and submission logic

feat: add user settings page with profile update functionality
This commit is contained in:
Face 2025-05-23 16:26:02 +03:00
parent 9aa4ba157b
commit 16ad425bb5
48 changed files with 3030 additions and 326 deletions

View file

@ -0,0 +1,30 @@
import { writable } from 'svelte/store';
export interface PortfolioData {
baseCurrencyBalance: number;
totalCoinValue: number;
totalValue: number;
coinHoldings: Array<{
symbol: string;
quantity: number;
currentPrice: number;
value: number;
}>;
currency: string;
}
export const PORTFOLIO_DATA = writable<PortfolioData | null>(null);
export async function fetchPortfolioData() {
try {
const response = await fetch('/api/portfolio/total');
if (response.ok) {
const data = await response.json();
PORTFOLIO_DATA.set(data);
return data;
}
} catch (error) {
console.error('Failed to fetch portfolio data:', error);
}
return null;
}