export type GetApiBapiV1WalletCreditArgs = {sortType?: ('AMOUNT_ASC' | 'AMOUNT_DESC' | 'ASC' | 'DESC' | 'NONE' | 'PRICE_ASC' | 'PRICE_DESC' | 'UNIT_PRICE_ASC' | 'UNIT_PRICE_DESC') | undefined, pageSize: number, pageNum: number, loginId?: string | undefined, projId?: number | undefined, projName?: string | undefined, startDate?: number | undefined, endDate?: number | undefined}; export type GetApiBapiV1WalletCreditOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 유저의 Credit list * * GET /bapi/v1/wallet/credit */ export const getApiBapiV1WalletCredit = async (args: GetApiBapiV1WalletCreditArgs, options?: GetApiBapiV1WalletCreditOptions) => { 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.sortType != null) query.append("sortType", String(args.sortType)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (args.pageNum != null) query.append("pageNum", String(args.pageNum)) if (args.loginId != null) query.append("loginId", String(args.loginId)) if (args.projId != null) query.append("projId", String(args.projId)) if (args.projName != null) query.append("projName", String(args.projName)) if (args.startDate != null) query.append("startDate", String(args.startDate)) if (args.endDate != null) query.append("endDate", String(args.endDate)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/bapi/v1/wallet/credit${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() };