Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MPP methods key to info endpoint #672

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading