export type ApiStrategyOrderType = 'limit' | 'dca' | 'vca'; export type DeleteApiV1StrategiesCancelByTokensFirstSecondArgs = {first: string, second: string, type?: ApiStrategyOrderType | undefined}; export type DeleteApiV1StrategiesCancelByTokensFirstSecondOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel all strategy orders by given token pair. For internal usage only. * * DELETE /v1/strategies/cancel/by-tokens/{first}/{second} */ export const deleteApiV1StrategiesCancelByTokensFirstSecond = async (args: DeleteApiV1StrategiesCancelByTokensFirstSecondArgs, options?: DeleteApiV1StrategiesCancelByTokensFirstSecondOptions) => { 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/by-tokens/${encodeURIComponent(String(args.first))}/${encodeURIComponent(String(args.second))}${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 };