/
sourex
/
CFA
Обзор
Документация
Войти
/
sourex
/
CFA
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/types/api.ts
67 строк
1 KB
unknown
Initial commit: DAP Platform with assets, portfolio and history
23 фев 2026, 17:31
23 фев 2026, 17:31
4461970
Код
Авторство
О чём код?
export interface Asset { id: string; name: string; description: string; contractAddress: string; blockchain: 'Ethereum' | 'Solana' | 'Polygon'; apy: number; minInvestment: string; currency: string; totalSupply: string; availableSupply: string; maturityDate: string; status: 'ACTIVE' | 'CLOSED' | 'COMING_SOON'; } export interface PortfolioItem { assetId: string; assetName: string; balance: string; averageBuyPrice: string; currentValue: string; profitLoss: string; profitLossPercentage: number; } export interface Transaction { id: string; type: 'BUY' | 'SELL' | 'STAKE' | 'CLAIM'; assetName: string; amount: string; price: string; total: string; timestamp: string; status: 'PENDING' | 'SUCCESS' | 'FAILED'; txHash: string; } export interface ApiResponse<T> { items: T[]; total: number; limit: number; offset: number; } export interface BuyAssetRequest { walletAddress: string; amount: string; expectedPrice?: string; } export interface BuyAssetResponse { transactionId: string; txHash: string; status: string; estimatedGas: string; } export interface PortfolioResponse { totalValue: string; items: PortfolioItem[]; } export interface ErrorResponse { code: number; message: string; details?: string; }