export type GetApiApiDtaoValidatorYieldHistoryV1Args = {hotkey?: string | undefined, netuid?: number | undefined, min_stake?: number | undefined, timestamp_start?: number | undefined, timestamp_end?: number | undefined, page?: number | undefined, limit?: number | undefined, order?: ('netuid_asc' | 'netuid_desc' | 'name_asc' | 'name_desc' | 'stake_asc' | 'stake_desc' | 'one_hour_apy_asc' | 'ne_hour_apy_desc' | 'one_day_apy_asc' | 'one_day_apy_desc' | 'seven_day_apy_asc' | 'seven_day_apy_desc' | 'thirty_day_apy_asc' | 'thirty_day_apy_desc' | 'timestamp_asc' | 'timestamp_desc') | undefined}; export type GetApiApiDtaoValidatorYieldHistoryV1Options = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/dtao/validator/yield/history/v1 */ export const getApiApiDtaoValidatorYieldHistoryV1 = async (args: GetApiApiDtaoValidatorYieldHistoryV1Args, options?: GetApiApiDtaoValidatorYieldHistoryV1Options) => { const {baseUrl = "https://api.taostats.io", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.hotkey != null) query.append("hotkey", String(args.hotkey)) if (args.netuid != null) query.append("netuid", String(args.netuid)) if (args.min_stake != null) query.append("min_stake", String(args.min_stake)) 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.page != null) query.append("page", String(args.page)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.order != null) query.append("order", String(args.order)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/api/dtao/validator/yield/history/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 };