export type GetApiApiV1HederaHoldingsArgs = {accountId: string, projectId: number}; export type GetApiApiV1HederaHoldingsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 프로젝트별 온체인 토큰 정보 조회 * * GET /api/v1/hedera/holdings */ export const getApiApiV1HederaHoldings = async (args: GetApiApiV1HederaHoldingsArgs, options?: GetApiApiV1HederaHoldingsOptions) => { const {baseUrl = "https://api.wincl.io:443", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.accountId != null) query.append("accountId", String(args.accountId)) if (args.projectId != null) query.append("projectId", String(args.projectId)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/hedera/holdings${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() };