export type GetApiV1FlowSignalsSymbolArgs = {symbol: string, minScore?: number | undefined, intent?: string | undefined, structure?: string | undefined, windowMinutes?: number | undefined, limit?: number | undefined, expiry?: string | undefined}; export type GetApiV1FlowSignalsSymbolOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/flow/signals/{symbol} */ export const getApiV1FlowSignalsSymbol = async (args: GetApiV1FlowSignalsSymbolArgs, options: GetApiV1FlowSignalsSymbolOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.minScore != null) query.append("minScore", String(args.minScore)) if (args.intent != null) query.append("intent", String(args.intent)) if (args.structure != null) query.append("structure", String(args.structure)) if (args.windowMinutes != null) query.append("windowMinutes", String(args.windowMinutes)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.expiry != null) query.append("expiry", String(args.expiry)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/flow/signals/${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 };