mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 03:54:21 +01:00
NUT-04: add description (#613)
* NUT-04: add description * skip test for deprecated api * fix for lndgrpc * add test for cli * add two random tests * add max length to request model validator * skip cli test with description for deprecated api * add cli test for invoice command * default value to None
This commit is contained in:
@@ -283,11 +283,15 @@ class LedgerAPI(LedgerAPIDeprecated, object):
|
||||
|
||||
@async_set_httpx_client
|
||||
@async_ensure_mint_loaded
|
||||
async def mint_quote(self, amount: int, unit: Unit) -> PostMintQuoteResponse:
|
||||
async def mint_quote(
|
||||
self, amount: int, unit: Unit, memo: Optional[str] = None
|
||||
) -> PostMintQuoteResponse:
|
||||
"""Requests a mint quote from the server and returns a payment request.
|
||||
|
||||
Args:
|
||||
amount (int): Amount of tokens to mint
|
||||
unit (Unit): Unit of the amount
|
||||
memo (Optional[str], optional): Memo to attach to Lightning invoice. Defaults to None.
|
||||
|
||||
Returns:
|
||||
PostMintQuoteResponse: Mint Quote Response
|
||||
@@ -296,7 +300,7 @@ class LedgerAPI(LedgerAPIDeprecated, object):
|
||||
Exception: If the mint request fails
|
||||
"""
|
||||
logger.trace("Requesting mint: POST /v1/mint/bolt11")
|
||||
payload = PostMintQuoteRequest(unit=unit.name, amount=amount)
|
||||
payload = PostMintQuoteRequest(unit=unit.name, amount=amount, description=memo)
|
||||
resp = await self.httpx.post(
|
||||
join(self.url, "/v1/mint/quote/bolt11"), json=payload.dict()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user