import { config } from '../src/config/index.js';
import { AlpacaConnector } from '../src/connectors/alpaca.js';
import logger from '../utils/logger.js';

async function checkAlpacaPositions() {
    const exchange = new AlpacaConnector(config.ALPACA_API_KEY, config.ALPACA_API_SECRET);
    try {
        const positions = await exchange.getPositions();
        console.log('--- Current Alpaca Positions ---');
        console.log(JSON.stringify(positions, null, 2));

        const btcPos = await exchange.getPosition('BTC/USD');
        console.log('--- BTC/USD Specific Position ---');
        console.log(JSON.stringify(btcPos, null, 2));
    } catch (err) {
        console.error('Error fetching positions:', err);
    }
}

checkAlpacaPositions();
