refactor: db-only credits and admin controls

Remove blockchain dependence from credit flow:
- watch credits now DB-only
- webhook earnings now DB-only
- wallet balance now DB-only
- admin bonus/adjustment routes operate on DB totals

Add admin adjustment API for account control.
Keep Solana service file unused for now; safe to delete later.
This commit is contained in:
2026-04-22 13:05:48 -04:00
parent 86a8c7d89a
commit 8ec91acc25
5 changed files with 327 additions and 470 deletions
+2
View File
@@ -87,6 +87,8 @@ export const adminApi = {
updateUser: (id: string, data: any) => api.put(`/admin/users/${id}`, data),
grantBonus: (userId: string, amount: number, reason?: string) =>
api.post(`/admin/users/${userId}/bonus`, { amount, reason }),
adjustUser: (userId: string, amount: number, reason?: string) =>
api.post(`/wallet/admin/${userId}/adjust`, { amount, reason }),
getAnalytics: () => api.get("/admin/analytics"),
getAllTransactions: (page = 1, limit = 50) =>
api.get(`/transactions/admin/all?page=${page}&limit=${limit}`),