Update Site source

This commit is contained in:
Meghdad committed 2026-10-12 23:45:51 +03:30
1 parent 3144a675e6
commit d34e9e3901
13 files changed
+180 -48

No files matched your search

+4 -2
View File
@@ -3,9 +3,11 @@ export const siteOrigin = 'https://siphoned-guild-vault.meghdad-social.chatgpt.s
export async function ledgerSnapshot(rows: {date:string;player:string;reason:string;amount:number}[]) {
const players = summarize(rows);
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(rows.map(identity).sort().join('\n')));
const revision = Array.from(new Uint8Array(digest)).map(n=>n.toString(16).padStart(2,'0')).join('').slice(0,20);
const hash = Array.from(new Uint8Array(digest)).map(n=>n.toString(16).padStart(2,'0')).join('').slice(0,20);
const revision = `fa-v2-${hash}`;
return {
revision,
recent: rows.slice(0,4),
shareUrl: `${siteOrigin}/?v=${revision}`,
imageUrl: `${siteOrigin}/api/share-image?v=${revision}`,
players,
@@ -14,6 +16,6 @@ export async function ledgerSnapshot(rows: {date:string;player:string;reason:str
withdrawals: rows.reduce((n,r)=>n+Math.max(0,-r.amount),0),
low: players.filter(p=>p.balance<minimum),
count: rows.length,
latest: rows[0]?.date || 'No transactions yet',
latest: rows[0]?.date || 'هنوز تراکنشی ثبت نشده',
};
}