import { NextResponse } from 'next/server'

export async function GET() {
  try {
    // Mock balance data from Bitquery
    const balanceData = {
      totalBalance: 15234.50,
      availableBalance: 12187.60,
      positions: [
        { symbol: 'SOL', amount: 10.5, value: 1513.16, price: 144.11 },
        { symbol: 'ETH', amount: 2.3, value: 5521.15, price: 2400.50 },
        { symbol: 'BTC', amount: 0.12, value: 8068.08, price: 67234.00 }
      ]
    }

    return NextResponse.json(balanceData)
  } catch (error) {
    return NextResponse.json({
      error: 'Failed to fetch balance',
      message: error instanceof Error ? error.message : 'Unknown error'
    }, { status: 500 })
  }
}
