From 4a177547fb21f231adfbac01425d53e779a21aba Mon Sep 17 00:00:00 2001 From: Danny Morabito Date: Tue, 26 Nov 2024 20:09:18 +0100 Subject: [PATCH] ignore the unit field, the mints we allow are only sats anyways. --- src/cashu.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cashu.ts b/src/cashu.ts index 9a81472..0a8cbc2 100644 --- a/src/cashu.ts +++ b/src/cashu.ts @@ -30,8 +30,6 @@ export class TokenInfo { const tokens = decodedTokenData.token; const amount = tokens.flatMap(t => t.proofs).reduce((c, x) => c + x.amount, 0); - if (decodedTokenData.unit !== 'sat') - throw new InvalidTokenException('Invalid token format. We only accept tokens denominated in sats'); if(decodedTokenData.token.length === 0) throw new InvalidTokenException('Invalid token format. We only accept tokens with at least one proof'); if (tokens.slice(1).some(t => t.mint !== tokens[0].mint))