export type GetApiApiDtaoStakeBalancePortfolioV1Args = {coldkey: string, hotkey?: string | undefined, netuid?: number | undefined, balance_min?: string | undefined, balance_max?: string | undefined, balance_as_tao_min?: string | undefined, balance_as_tao_max?: string | undefined, page?: number | undefined, limit?: number | undefined, order?: 'netuid_asc, netuid_desc, subnet_rank_asc, subnet_rank_desc, balance_asc, balance_desc, balance_as_tao_asc, balance_as_tao_desc' | undefined}; export type GetApiApiDtaoStakeBalancePortfolioV1Options = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/dtao/stake_balance/portfolio/v1 */ export const getApiApiDtaoStakeBalancePortfolioV1 = async (args: GetApiApiDtaoStakeBalancePortfolioV1Args, options?: GetApiApiDtaoStakeBalancePortfolioV1Options) => { const {baseUrl = "https://api.taostats.io", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.coldkey != null) query.append("coldkey", String(args.coldkey)) if (args.hotkey != null) query.append("hotkey", String(args.hotkey)) if (args.netuid != null) query.append("netuid", String(args.netuid)) if (args.balance_min != null) query.append("balance_min", String(args.balance_min)) if (args.balance_max != null) query.append("balance_max", String(args.balance_max)) if (args.balance_as_tao_min != null) query.append("balance_as_tao_min", String(args.balance_as_tao_min)) if (args.balance_as_tao_max != null) query.append("balance_as_tao_max", String(args.balance_as_tao_max)) 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/stake_balance/portfolio/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 (await res.json()) as unknown };