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:
+3
-3
@@ -30,7 +30,7 @@ const cashu = require('../components/cashu');
|
||||
* $ref: '#/components/responses/InternalServerError'
|
||||
*/
|
||||
router.post('/decode', async (req, res) => {
|
||||
const { token } = req.body;
|
||||
const { token } = req.body ?? {};
|
||||
|
||||
if (!token) {
|
||||
return res.status(400).json({
|
||||
@@ -48,8 +48,8 @@ router.post('/decode', async (req, res) => {
|
||||
}
|
||||
|
||||
const decoded = await cashu.parseToken(token);
|
||||
const mintUrl = await cashu.getTokenMintUrl(token);
|
||||
|
||||
const mintUrl = decoded.mint;
|
||||
|
||||
let spent = false;
|
||||
try {
|
||||
const spendabilityCheck = await cashu.checkTokenSpendable(token);
|
||||
|
||||
Reference in New Issue
Block a user