19 lines
695 B
TypeScript
19 lines
695 B
TypeScript
import {test} from 'node:test'
|
|
import assert from 'node:assert'
|
|
import {closeGmxPositionImpl, getClientForAddress} from '../../src/plugins/custom/gmx'
|
|
import {TradeDirection} from '../../src/generated/ManagingApiTypes'
|
|
|
|
test('GMX Position Closing', async (t) => {
|
|
await t.test('should close a long position for BTC', async () => {
|
|
const sdk = await getClientForAddress('0x932167388dD9aad41149b3cA23eBD489E2E2DD78')
|
|
|
|
const result = await closeGmxPositionImpl(
|
|
sdk,
|
|
'GMX',
|
|
TradeDirection.Short
|
|
)
|
|
console.log('Position closing result:', result)
|
|
assert.ok(result, 'Position closing result should be defined')
|
|
})
|
|
})
|