From 87b624706be54bc37b66aa3011a856d2b89250d2 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 22 May 2024 22:21:33 +0200 Subject: [PATCH] nuts optionsl mint info --- cashu/wallet/mint_info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cashu/wallet/mint_info.py b/cashu/wallet/mint_info.py index 5133a08f..30ec3f6d 100644 --- a/cashu/wallet/mint_info.py +++ b/cashu/wallet/mint_info.py @@ -13,7 +13,7 @@ class MintInfo(BaseModel): description_long: Optional[str] contact: Optional[List[List[str]]] motd: Optional[str] - nuts: Dict[int, Any] + nuts: Optional[Dict[int, Any]] def __str__(self): return f"{self.name} ({self.description})" @@ -24,6 +24,8 @@ def supports_nut(self, nut: int) -> bool: return nut in self.nuts def supports_mpp(self, method: str, unit: Unit) -> bool: + if not self.nuts: + return False nut_15 = self.nuts.get(15) if not nut_15 or not self.supports_nut(15): return False