Skip to content

Add GetQuoteTtl Method to Management RPC#874

Open
KvngMikey wants to merge 10 commits intocashubtc:mainfrom
KvngMikey:get-quote-ttl
Open

Add GetQuoteTtl Method to Management RPC#874
KvngMikey wants to merge 10 commits intocashubtc:mainfrom
KvngMikey:get-quote-ttl

Conversation

@KvngMikey
Copy link
Contributor

@KvngMikey KvngMikey commented Jan 21, 2026

FIXES #787

SUMMARY

Adds a GetQuoteTtl method to the mint management RPC, allowing operators to retrieve the expiry(ttl) timestamp for a specific mint or melt quote.

Previously, quote TTLs could be updated via UpdateQuoteTtl, but there was no way to query the active values beforehand. This enables operational inspection of quote lifetime without querying the HTTP API or directly accessing the database.

Changes

  • Extend management.proto with:

    • GetQuoteTtlRequest { quote_id }

    • GetQuoteTtlResponse { expiry }

  • Regenerate gRPC Python bindings

  • Implement GetQuoteTtl handler in management_rpc.py

    • Looks up the quote by ID

    • For mint_quote expiry is not stored, decode Bolt11 invoice and compute expiry, otherwise lookup melt_quote and return stored expiry.

    • Returns NotFound if the quote does not exist

Manual Verification:

  • start the mint
  • create a mint quote.
  • copy the quoteId and query the getQuoteTTL with that ID.

@ye0man ye0man added this to nutshell Jan 21, 2026
@github-project-automation github-project-automation bot moved this to Backlog in nutshell Jan 21, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 0% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.02%. Comparing base (8748b99) to head (cc8b824).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cashu/mint/management_rpc/protos/management_pb2.py 0.00% 35 Missing ⚠️
cashu/mint/management_rpc/management_rpc.py 0.00% 21 Missing ⚠️
.../mint/management_rpc/protos/management_pb2_grpc.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #874       +/-   ##
===========================================
+ Coverage   50.02%   63.02%   +12.99%     
===========================================
  Files          89       89               
  Lines       10545    10625       +80     
===========================================
+ Hits         5275     6696     +1421     
+ Misses       5270     3929     -1341     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@a1denvalu3 a1denvalu3 moved this from Backlog to Ready to merge in nutshell Feb 13, 2026
@KvngMikey
Copy link
Contributor Author

@callebtc - this is also ready...

cc @a1denvalu3

@ye0man ye0man added this to the 0.20.0 milestone Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to merge

Development

Successfully merging this pull request may close these issues.

Feature Request: Add GetQuoteTtl Method to Management RPC

3 participants