import {strict as assert} from 'node:assert';
import {test} from 'node:test';
import {buildClaimParams} from '../../src/generated/gmxsdk/configs/markets.js';

test('Market Claims Test - should generate claim parameters and output market and token addresses', () => {
  const userAddress = "0x0AF60B5C1c349744Ef8fa8c4ed78Ee1A0d392Fe9";
  const claimParams = buildClaimParams(userAddress);
  
  const [marketAddresses, tokenAddresses, account] = claimParams;
  
  console.log('Market Addresses:');
  console.log('[');
  (Array.isArray(marketAddresses) ? marketAddresses : [marketAddresses]).forEach((address, index, arr) => {
    const comma = index < arr.length - 1 ? ',' : '';
    console.log(`  ${address}${comma}`);
  });
  console.log(']');
  
  console.log('\nToken Addresses:');
  console.log('[');
  (Array.isArray(tokenAddresses) ? tokenAddresses : [tokenAddresses]).forEach((address, index, arr) => {
    const comma = index < tokenAddresses.length - 1 ? ',' : '';
    console.log(`  ${address}${comma}`);
  });
  console.log(']');
  
  console.log(`\nUser Address: ${account}`);
  
  // Basic validation
  assert.equal(marketAddresses.length, tokenAddresses.length);
  assert.equal(account, userAddress);
  assert.equal(marketAddresses.length % 2, 0); // Should be even (each market twice)
});
