axyenniu daily reward page
This commit is contained in:
@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user