axyenniu daily reward page

This commit is contained in:
aurinex
2025-12-13 16:18:47 +05:00
parent 226f5c1393
commit 712ae70e2a
13 changed files with 835 additions and 49 deletions

View File

@ -499,6 +499,36 @@ export interface DailyClaimResponse {
reason?: string;
}
export interface DailyDaysResponse {
ok: boolean;
days: string[]; // YYYY-MM-DD (по ЕКБ)
count: number;
}
export async function fetchDailyClaimDays(limit = 120): Promise<DailyDaysResponse> {
const { accessToken, clientToken } = getAuthTokens();
if (!accessToken || !clientToken) {
throw new Error('Нет токенов авторизации');
}
const params = new URLSearchParams({
accessToken,
clientToken,
limit: String(limit),
});
const response = await fetch(
`${API_BASE_URL}/users/daily/days?${params.toString()}`,
);
if (!response.ok) {
throw new Error('Не удалось получить дни ежедневных наград');
}
return await response.json();
}
export async function fetchDailyStatus(): Promise<DailyStatusResponse> {
const { accessToken, clientToken } = getAuthTokens();