import {test} from 'node:test'
import assert from 'node:assert'
import {initAddressImpl} from '../../src/plugins/custom/privy'

test('Privy Wallet Initialization', async (t) => {
  await t.test('should initialize a wallet address for GMX trading', async () => {
    const address = '0x0b4a132cb6ed8fa66953bf61a53d0b91dacaad78'

    const result = await initAddressImpl(address)
    
    console.log('Wallet initialization result:', result)
    
    // Verify the result structure
    assert.ok(result, 'Wallet initialization result should be defined')
    assert.ok(result.usdcHash, 'USDC hash should be defined')
    assert.ok(result.orderVaultHash, 'Order vault hash should be defined')
    assert.ok(result.exchangeRouterHash, 'Exchange router hash should be defined')
    assert.ok(result.wethSyntheticsRouterHash, 'WETH synthetics router hash should be defined')
    
    // Verify all hashes are strings
    assert.strictEqual(typeof result.usdcHash, 'string', 'USDC hash should be a string')
    assert.strictEqual(typeof result.orderVaultHash, 'string', 'Order vault hash should be a string')
    assert.strictEqual(typeof result.exchangeRouterHash, 'string', 'Exchange router hash should be a string')
    assert.strictEqual(typeof result.wethSyntheticsRouterHash, 'string', 'WETH synthetics router hash should be a string')
  })
})
