ignore the unit field, the mints we allow are only sats anyways.

This commit is contained in:
Danny Morabito 2024-11-26 20:09:18 +01:00
parent 8aa8c2752b
commit 4a177547fb
Signed by: dannym
GPG key ID: 7CC8056A5A04557E

View file

@ -30,8 +30,6 @@ export class TokenInfo {
const tokens = decodedTokenData.token; const tokens = decodedTokenData.token;
const amount = tokens.flatMap(t => t.proofs).reduce((c, x) => c + x.amount, 0); 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) if(decodedTokenData.token.length === 0)
throw new InvalidTokenException('Invalid token format. We only accept tokens with at least one proof'); 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)) if (tokens.slice(1).some(t => t.mint !== tokens[0].mint))