export type GetApiV1FlowStocksOutliersArgs = {limit?: number | undefined, minTrades?: number | undefined, windowMinutes?: number | undefined}; export type GetApiV1FlowStocksOutliersOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/flow/stocks/outliers */ export const getApiV1FlowStocksOutliers = async (args: GetApiV1FlowStocksOutliersArgs, options: GetApiV1FlowStocksOutliersOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.limit != null) query.append("limit", String(args.limit)) if (args.minTrades != null) query.append("minTrades", String(args.minTrades)) if (args.windowMinutes != null) query.append("windowMinutes", String(args.windowMinutes)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/flow/stocks/outliers${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };