export type ApiStrategyOrderType = 'limit' | 'dca' | 'vca'; export type DeleteApiV1StrategiesCancelAllArgs = {type?: ApiStrategyOrderType | undefined}; export type DeleteApiV1StrategiesCancelAllOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel all strategy orders. For internal usage only. * * DELETE /v1/strategies/cancel/all */ export const deleteApiV1StrategiesCancelAll = async (args: DeleteApiV1StrategiesCancelAllArgs, options?: DeleteApiV1StrategiesCancelAllOptions) => { const {baseUrl = "https://backend.swap.coffee", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.type != null) query.append("type", String(args.type)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/strategies/cancel/all${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };