Remove demo data fallbacks - use only real Drift account data

- Updated Dashboard.tsx to remove demo data fallbacks
- Updated TradingHistory.tsx to use new Drift trading history endpoint
- Added getTradingHistory method to DriftTradingService
- Created new /api/drift/trading-history endpoint
- Removed fallback demo positions from getPositions method
- All UI components now show only real Drift account data or empty states
- No more hardcoded mock trades or positions
This commit is contained in:
mindesbunister
2025-07-13 00:38:24 +02:00
parent e985a9ec6f
commit 6e75a7175e
6 changed files with 315 additions and 143 deletions

View File

@@ -0,0 +1,30 @@
import { NextResponse } from 'next/server'
import { driftTradingService } from '../../../../lib/drift-trading'
export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url)
const limit = parseInt(searchParams.get('limit') || '50')
console.log('📊 API: Getting Drift trading history...')
const tradingHistory = await driftTradingService.getTradingHistory(limit)
return NextResponse.json({
success: true,
trades: tradingHistory,
count: tradingHistory.length
})
} catch (error: any) {
console.error('❌ API: Error getting trading history:', error)
return NextResponse.json(
{
success: false,
error: error.message,
trades: []
},
{ status: 500 }
)
}
}