fix admin balance display

This commit is contained in:
jwinterm
2026-02-17 20:21:32 -05:00
parent 320d1a3b1f
commit d56ad7599b
2 changed files with 18 additions and 7 deletions
+6
View File
@@ -1180,6 +1180,10 @@ app.get('/api/admin/stats/overview', adminAuth, asyncHandler(async (req, res) =>
const payout = payoutStats.rows[0];
const game = gameStats.rows[0];
const cryptoType = gameModeManager.cryptoType || process.env.CRYPTO_TYPE || 'WOW';
const { inferCurrencyDecimals, getDecimalDivisor } = require('./game/helpers/gameModeUtils');
const atomicDivisor = getDecimalDivisor(inferCurrencyDecimals(cryptoType));
res.json({
totalUsers: parseInt(user.total_users) || 0,
totalGamesPlayed: parseInt(user.total_games) || 0,
@@ -1189,6 +1193,8 @@ app.get('/api/admin/stats/overview', adminAuth, asyncHandler(async (req, res) =>
failedPayouts: parseInt(payout.failed_payouts) || 0,
completedPayouts: parseInt(payout.completed_payouts) || 0,
walletBalance: walletBalance,
cryptoType,
atomicDivisor,
last24h: {
games: parseInt(game.games_24h) || 0,
wins: parseInt(game.wins_24h) || 0,