From e38127725ac89bcbbf068bb3e1adfee09a759d29 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:12:21 +0100 Subject: [PATCH] add methods key to info endpoitn a la https://github.com/cashubtc/nuts/pull/190 --- cashu/mint/features.py | 2 +- cashu/wallet/mint_info.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cashu/mint/features.py b/cashu/mint/features.py index 85e8f71b..f216de9d 100644 --- a/cashu/mint/features.py +++ b/cashu/mint/features.py @@ -76,7 +76,7 @@ def mint_features(self) -> Dict[int, Union[List[Any], Dict[str, Any]]]: ) if mpp_features: - mint_features[MPP_NUT] = mpp_features + mint_features[MPP_NUT] = dict(methods=mpp_features) # specify which websocket features are supported # these two are supported by default diff --git a/cashu/wallet/mint_info.py b/cashu/wallet/mint_info.py index ccd00087..a9154c8b 100644 --- a/cashu/wallet/mint_info.py +++ b/cashu/wallet/mint_info.py @@ -31,10 +31,10 @@ def supports_mpp(self, method: str, unit: Unit) -> bool: if not self.nuts: return False nut_15 = self.nuts.get(MPP_NUT) - if not nut_15 or not self.supports_nut(MPP_NUT): + if not nut_15 or not self.supports_nut(MPP_NUT) or not nut_15.get("methods"): return False - for entry in nut_15: + for entry in nut_15["methods"]: entry_obj = Nut15MppSupport.parse_obj(entry) if entry_obj.method == method and entry_obj.unit == unit.name: return True