export type GetApiV1FlowZeroDteHeatmapSymbolArgs = {symbol: string, bar?: string | undefined, bar_size?: string | undefined, metric?: string | undefined, mode?: string | undefined, minutes?: number | undefined}; export type GetApiV1FlowZeroDteHeatmapSymbolOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/flow/zero-dte/heatmap/{symbol} */ export const getApiV1FlowZeroDteHeatmapSymbol = async (args: GetApiV1FlowZeroDteHeatmapSymbolArgs, options: GetApiV1FlowZeroDteHeatmapSymbolOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.bar != null) query.append("bar", String(args.bar)) if (args.bar_size != null) query.append("bar_size", String(args.bar_size)) if (args.metric != null) query.append("metric", String(args.metric)) if (args.mode != null) query.append("mode", String(args.mode)) if (args.minutes != null) query.append("minutes", String(args.minutes)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/flow/zero-dte/heatmap/${encodeURIComponent(String(args.symbol))}${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 };