feat: payment routes + ranked queue endpoint + app wiring

Add /api/payments router (connect-wallet, wallet-status, create-invoice,
check, submit-cashu, winnings, claim, disconnect-wallet). Add ranked
queue endpoints to /api/queue. Mount payments router in app.ts with
orphan payment recovery on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-08 01:26:11 +00:00
co-authored by Claude Opus 4.6
parent e046cb13eb
commit 460564a8ee
3 changed files with 247 additions and 0 deletions
+8
View File
@@ -7,12 +7,14 @@ import { queueRouter } from './routes/queue.js'
import { authRouter } from './routes/auth.js'
import { docsRouter } from './routes/docs.js'
import { betsRouter } from './routes/bets.js'
import { paymentsRouter } from './routes/payments.js'
import { rateLimit } from './middleware/rate-limit.js'
import { existsSync, readFileSync } from 'fs'
import { join, dirname } from 'path'
import { fileURLToPath } from 'url'
import { cleanupOrphanedFights } from './engine/orchestrator.js'
import { recoverOrphanedPayments } from './engine/payments.js'
export const app = new Hono()
@@ -37,6 +39,7 @@ app.route('/api/fights', fightsRouter)
app.route('/api/queue', queueRouter)
app.route('/api/docs', docsRouter)
app.route('/api/bets', betsRouter)
app.route('/api/payments', paymentsRouter)
// In production, serve the frontend SPA
const __dirname = dirname(fileURLToPath(import.meta.url))
@@ -107,3 +110,8 @@ cleanupOrphanedFights().then(() => {
}).catch(err => {
console.error('[botfights] cleanup error:', err)
})
// Recover orphaned payments on startup
recoverOrphanedPayments().catch(err => {
console.error('[botfights] payment recovery error:', err)
})