export type GetApiApiAccountingTaxCsvV1Args = {token: string, date_start: string, date_end: string, coldkey: string}; export type GetApiApiAccountingTaxCsvV1Options = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/accounting/tax_csv/v1 */ export const getApiApiAccountingTaxCsvV1 = async (args: GetApiApiAccountingTaxCsvV1Args, options?: GetApiApiAccountingTaxCsvV1Options) => { const {baseUrl = "https://api.taostats.io", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) if (args.date_start != null) query.append("date_start", String(args.date_start)) if (args.date_end != null) query.append("date_end", String(args.date_end)) if (args.coldkey != null) query.append("coldkey", String(args.coldkey)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/api/accounting/tax_csv/v1${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 };