mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
Fix: Nut 05 mint response model (#564)
* change response model of NUT-05 to include payment_preimage and change (NUT-08) * fix tests * crud: same expiry as timestamp * fix expiry handling * add api tests to check new models
This commit is contained in:
@@ -183,6 +183,8 @@ class PostMeltQuoteResponse(BaseModel):
|
||||
paid: bool # whether the request has been paid # DEPRECATED as per NUT PR #136
|
||||
state: str # state of the quote
|
||||
expiry: Optional[int] # expiry of the quote
|
||||
payment_preimage: Optional[str] = None # payment preimage
|
||||
change: Union[List[BlindedSignature], None] = None
|
||||
|
||||
@classmethod
|
||||
def from_melt_quote(self, melt_quote: MeltQuote) -> "PostMeltQuoteResponse":
|
||||
@@ -203,9 +205,9 @@ class PostMeltRequest(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
class PostMeltResponse(BaseModel):
|
||||
class PostMeltResponse_deprecated(BaseModel):
|
||||
paid: Union[bool, None]
|
||||
payment_preimage: Union[str, None]
|
||||
preimage: Union[str, None]
|
||||
change: Union[List[BlindedSignature], None] = None
|
||||
|
||||
|
||||
@@ -217,12 +219,6 @@ class PostMeltRequest_deprecated(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
class PostMeltResponse_deprecated(BaseModel):
|
||||
paid: Union[bool, None]
|
||||
preimage: Union[str, None]
|
||||
change: Union[List[BlindedSignature], None] = None
|
||||
|
||||
|
||||
# ------- API: SPLIT -------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user