export type GetApiBapiV3RewardsPaymentsArgs = {eventType?: string | undefined, keyword?: string | undefined, orderBy?: string | undefined, orderId?: string | undefined, pageNo?: number | undefined, pageSize?: number | undefined, status?: string | undefined}; export type GetApiBapiV3RewardsPaymentsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 리워드 결제 로그 목록 조회 * * GET /bapi/v3/rewards/payments */ export const getApiBapiV3RewardsPayments = async (args: GetApiBapiV3RewardsPaymentsArgs, options?: GetApiBapiV3RewardsPaymentsOptions) => { 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.eventType != null) query.append("eventType", String(args.eventType)) if (args.keyword != null) query.append("keyword", String(args.keyword)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.orderId != null) query.append("orderId", String(args.orderId)) if (args.pageNo != null) query.append("pageNo", String(args.pageNo)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (args.status != null) query.append("status", String(args.status)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/bapi/v3/rewards/payments${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() };