#!/usr/bin/env node

/**
 * Minimal Drift test
 */

require('dotenv').config();

async function minimalTest() {
  console.log('🧪 Minimal Drift test...');
  
  try {
    console.log('📦 Loading packages...');
    const { Connection, Keypair } = require('@solana/web3.js');
    console.log('✅ @solana/web3.js loaded');
    
    const drift = require('@drift-labs/sdk');
    console.log('✅ @drift-labs/sdk loaded');
    console.log('📋 Available exports:', Object.keys(drift).slice(0, 10).join(', '), '...');
    
    // Test basic classes
    const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
    console.log('✅ Connection created');
    
    const privateKey = JSON.parse(process.env.SOLANA_PRIVATE_KEY);
    const keypair = Keypair.fromSecretKey(Buffer.from(privateKey));
    console.log('✅ Keypair created');
    
    const wallet = new drift.Wallet(keypair);
    console.log('✅ Wallet created');
    
    console.log('🎯 All basic components working!');
    
  } catch (error) {
    console.error('❌ Error:', error.message);
  }
}

minimalTest().catch(console.error);
