import type { KyInstance } from 'ky' import type { PerpCanceledTrade, PerpMarketKey } from '../types.js' export type PerpIsolatedCancelAllInput = PerpMarketKey export type PerpIsolatedCancelAllOutput = PerpCanceledTrade[] type CancelAll = ( input: Readonly ) => Promise export const createCancelAll = (instance: Readonly): CancelAll => { return async ({ instrument, pair }) => { return instance .post('perp/isolated/trades/cancel-all', { json: { instrument, pair } }) .json() } }