NUT-04/05: add amount, unit, request to melt and mint quote responses (#719)

* add amount, unit, request to melt and mint responses

* make new fields optional to not break compat with old mints

* make new flags optional for backwards compat
This commit is contained in:
callebtc
2025-03-08 18:23:34 +00:00
committed by GitHub
parent 3ab1e1dfb2
commit bae4855915
6 changed files with 41 additions and 2 deletions

View File

@@ -141,6 +141,8 @@ class PostMintQuoteRequest(BaseModel):
class PostMintQuoteResponse(BaseModel):
quote: str # quote id
request: str # input payment request
amount: Optional[int] # output amount (optional for backwards compat pre 0.16.6)
unit: Optional[str] # output unit (optional for backwards compat pre 0.16.6)
state: Optional[str] # state of the quote (optional for backwards compat)
expiry: Optional[int] # expiry of the quote
pubkey: Optional[str] = None # NUT-20 quote lock pubkey
@@ -222,6 +224,10 @@ class PostMeltQuoteRequest(BaseModel):
class PostMeltQuoteResponse(BaseModel):
quote: str # quote id
amount: int # input amount
unit: Optional[str] # input unit (optional for backwards compat pre 0.16.6)
request: Optional[
str
] # output payment request (optional for backwards compat pre 0.16.6)
fee_reserve: int # input fee reserve
paid: Optional[bool] = (
None # whether the request has been paid # DEPRECATED as per NUT PR #136