Files
trading_bot_v3/test-direct-service.mjs
mindesbunister de45349baa Restore working dashboard and TradingView analysis
- Fixed layout conflicts by removing minimal layout.tsx in favor of complete layout.js
- Restored original AI Analysis page with full TradingView integration
- Connected enhanced screenshot API to real TradingView automation service
- Fixed screenshot gallery to handle both string and object formats
- Added image serving API route for screenshot display
- Resolved hydration mismatch issues with suppressHydrationWarning
- All navigation pages working (Analysis, Trading, Automation, Settings)
- TradingView automation successfully capturing screenshots from AI and DIY layouts
- Docker Compose v2 compatibility ensured

Working features:
- Homepage with hero section and status cards
- Navigation menu with Trading Bot branding
- Real TradingView screenshot capture
- AI-powered chart analysis
- Multi-layout support (AI + DIY module)
- Screenshot gallery with image serving
- API endpoints for balance, status, screenshots, trading
2025-07-14 14:21:19 +02:00

33 lines
1.0 KiB
JavaScript

import { DriftTradingService } from './lib/drift-trading.js'
async function testDirectBalance() {
console.log('🔍 Testing direct balance retrieval...')
try {
const driftService = new DriftTradingService()
console.log('🔐 Attempting login...')
const loginResult = await driftService.login()
console.log('✅ Login result:', loginResult)
if (loginResult.isLoggedIn && loginResult.userAccountExists) {
console.log('💰 Getting account balance...')
const balance = await driftService.getAccountBalance()
console.log('📊 Balance result:', balance)
console.log('📈 Getting positions...')
const positions = await driftService.getPositions()
console.log('📊 Positions result:', positions)
} else {
console.log('❌ Login failed or account does not exist')
}
} catch (error) {
console.error('❌ Error:', error)
}
}
testDirectBalance()
.then(() => console.log('✅ Test completed'))
.catch(error => console.error('❌ Test failed:', error))