import { test } from 'node:test'
import assert from 'node:assert'
import { getClientForAddress, getGmxTradeImpl } from '../../src/plugins/custom/gmx'
import { Ticker } from '../../src/generated/ManagingApiTypes'

test('GMX get trade', async (t) => {
  await t.test('should get trade for BTC', async () => {
    const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78')

    const result = await getGmxTradeImpl(
      sdk,
      Ticker.BTC
    )
    console.log('Orders result:', result)
    assert.ok(result, 'Orders closing result should be defined')
  })
})
