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

test('GMX Orders Closing', async (t) => {
  await t.test('should close all orders for BTC', async () => {
    const sdk = await getClientForAddress('0x0b4A132cb6ed8fa66953bf61a53D0B91DaCaAd78')

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