export type GetApiV1ScreenerDebugSymbolSymbolExpiriesArgs = {symbol: string}; export type GetApiV1ScreenerDebugSymbolSymbolExpiriesOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/screener/debug/symbol/{symbol}/expiries */ export const getApiV1ScreenerDebugSymbolSymbolExpiries = async (args: GetApiV1ScreenerDebugSymbolSymbolExpiriesArgs, options: GetApiV1ScreenerDebugSymbolSymbolExpiriesOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/screener/debug/symbol/${encodeURIComponent(String(args.symbol))}/expiries${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 };