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