export type GetApiApiBlockEmissionV1Args = {block_start?: number | undefined, block_end?: number | undefined, timestamp_start?: number | undefined, timestamp_end?: number | undefined, limit?: number | undefined, page?: number | undefined, order?: string | undefined}; export type GetApiApiBlockEmissionV1Options = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/block/emission/v1 */ export const getApiApiBlockEmissionV1 = async (args: GetApiApiBlockEmissionV1Args, options?: GetApiApiBlockEmissionV1Options) => { const {baseUrl = "https://api.taostats.io", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.block_start != null) query.append("block_start", String(args.block_start)) if (args.block_end != null) query.append("block_end", String(args.block_end)) if (args.timestamp_start != null) query.append("timestamp_start", String(args.timestamp_start)) if (args.timestamp_end != null) query.append("timestamp_end", String(args.timestamp_end)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.page != null) query.append("page", String(args.page)) if (args.order != null) query.append("order", String(args.order)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/api/block/emission/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 };