Upgrade to cashu-ts v4 and drop unused deps.

Adapt amount handling for v4 Amount objects, replace axios/uuid with fetch and crypto.randomUUID, and remove dead helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michilis
2026-07-23 03:46:59 +00:00
co-authored by Cursor
parent bd18271957
commit 449a8dda0d
9 changed files with 696 additions and 1197 deletions
+2 -14
View File
@@ -33,18 +33,6 @@ app.use(cors({
optionsSuccessStatus: 200
}));
// Additional middleware for Swagger UI preflight requests
app.use((req, res, next) => {
if (req.method === 'OPTIONS') {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET', 'POST', 'OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type', 'Authorization', 'Accept', 'Origin', 'X-Requested-With');
res.status(200).end();
return;
}
next();
});
// Debug endpoint to test CORS
app.get('/api/cors-test', (req, res) => {
res.json({
@@ -93,7 +81,7 @@ const rateLimitMap = new Map();
const RATE_LIMIT = parseInt(process.env.RATE_LIMIT) || 100;
function rateLimit(req, res, next) {
const clientId = req.ip || req.connection.remoteAddress;
const clientId = req.ip || req.socket.remoteAddress;
const now = Date.now();
const windowStart = now - 60000;
@@ -159,7 +147,7 @@ app.use('/api', lightningRoutes);
app.use('/api', healthRoutes);
// 404 handler
app.use('*', (req, res) => {
app.use((req, res) => {
res.status(404).json({
success: false,
error: 'Endpoint not found'