import type { KyInstance } from 'ky' import type { PerpCanceledTrade, PerpMarketKey } from '../types.js' export interface PerpIsolatedCancelTradeInput extends PerpMarketKey { id: string } export type PerpIsolatedCancelOutput = PerpCanceledTrade type Cancel = ( input: Readonly ) => Promise export const createCancel = (instance: Readonly): Cancel => { return async ({ id, instrument, pair }) => { return instance .post('perp/isolated/trade/cancel', { json: { id, instrument, pair } }) .json() } }