import { lotteryRequest } from "@/lib/lottery-http";
import type { PlayEffectivePayload } from "@/types/api/play-effective";

export type GetPlayEffectiveParams = {
  /** 不传则后端取首个可下注币种（通常为 NPR） */
  currency?: string;
};

/**
 * `GET /api/v1/play/effective`（公开；无需登录）。
 * 对齐阶段 4：生效玩法目录 + 赔率快照 + 封顶样本。
 */
export function getPlayEffective(
  params?: GetPlayEffectiveParams,
): Promise<PlayEffectivePayload> {
  return lotteryRequest.get<PlayEffectivePayload>(
    `/play/effective`,
    {
      params:
        params?.currency !== undefined && params.currency !== ""
          ? { currency: params.currency }
          : undefined,
    },
  );
}
