mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-19 18:14:19 +01:00
add methods key to info endpoitn a la https://github.com/cashubtc/nuts/pull/190 (#672)
This commit is contained in:
@@ -76,7 +76,7 @@ class LedgerFeatures(SupportsBackends):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if mpp_features:
|
if mpp_features:
|
||||||
mint_features[MPP_NUT] = mpp_features
|
mint_features[MPP_NUT] = dict(methods=mpp_features)
|
||||||
|
|
||||||
# specify which websocket features are supported
|
# specify which websocket features are supported
|
||||||
# these two are supported by default
|
# these two are supported by default
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ class MintInfo(BaseModel):
|
|||||||
if not self.nuts:
|
if not self.nuts:
|
||||||
return False
|
return False
|
||||||
nut_15 = self.nuts.get(MPP_NUT)
|
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
|
return False
|
||||||
|
|
||||||
for entry in nut_15:
|
for entry in nut_15["methods"]:
|
||||||
entry_obj = Nut15MppSupport.parse_obj(entry)
|
entry_obj = Nut15MppSupport.parse_obj(entry)
|
||||||
if entry_obj.method == method and entry_obj.unit == unit.name:
|
if entry_obj.method == method and entry_obj.unit == unit.name:
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user