export type DeleteApiV1PortfoliosIdWatchesWatchIdArgs = {id: string, watchId: string}; export type DeleteApiV1PortfoliosIdWatchesWatchIdOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stops watching an instrument. Removes only the watch row — any lots on the same * instrument are untouched, so unwatching something you hold simply stops pinning it to the * portfolio once the lots close. * * DELETE /v1/portfolios/{id}/watches/{watchId} */ export const deleteApiV1PortfoliosIdWatchesWatchId = async (args: DeleteApiV1PortfoliosIdWatchesWatchIdArgs, options?: DeleteApiV1PortfoliosIdWatchesWatchIdOptions) => { const {baseUrl = "https://api.equibles.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/portfolios/${encodeURIComponent(String(args.id))}/watches/${encodeURIComponent(String(args.watchId))}${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 };