export type GetApiPublicV1NetworkCollectionIdCommodityGraphArgs = {collectionId: number}; export type GetApiPublicV1NetworkCollectionIdCommodityGraphOptions = {baseUrl?: string | undefined, TokenAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get commodity graph for a collection * * GET /public/v1/network/{collectionId}/commodity-graph */ export const getApiPublicV1NetworkCollectionIdCommodityGraph = async (args: GetApiPublicV1NetworkCollectionIdCommodityGraphArgs, options?: GetApiPublicV1NetworkCollectionIdCommodityGraphOptions) => { const {baseUrl = "https://api.prewave.com", fetch: fetchFn = fetch, TokenAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (TokenAuthentication !== undefined) headers.set("X-Auth-Token", TokenAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/network/${encodeURIComponent(String(args.collectionId))}/commodity-graph${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 res.blob() };