export type DeleteApiV1StrategiesCancelByIdIdArgs = {id: number}; export type DeleteApiV1StrategiesCancelByIdIdOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel strategy order by id. For internal usage only. * * DELETE /v1/strategies/cancel/by-id/{id} */ export const deleteApiV1StrategiesCancelByIdId = async (args: DeleteApiV1StrategiesCancelByIdIdArgs, options?: DeleteApiV1StrategiesCancelByIdIdOptions) => { const {baseUrl = "https://backend.swap.coffee", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/strategies/cancel/by-id/${encodeURIComponent(String(args.id))}${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 };