Skip to content

Commit

Permalink
add methods key to info endpoitn a la cashubtc/nuts#190 (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc authored Nov 15, 2024
1 parent 6a4f1bd commit 901b167
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cashu/mint/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cashu/wallet/mint_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 901b167

Please sign in to comment.