Open
Conversation
580e2a9 to
7e34ab2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #878 +/- ##
===========================================
+ Coverage 50.02% 65.71% +15.68%
===========================================
Files 89 92 +3
Lines 10545 11123 +578
===========================================
+ Hits 5275 7309 +2034
+ Misses 5270 3814 -1456 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3 tasks
01ea43f to
983aa3f
Compare
KvngMikey
approved these changes
Feb 5, 2026
| CLEAR_AUTH_NUT = 21 | ||
| BLIND_AUTH_NUT = 22 | ||
| METHOD_BOLT11_NUT = 23 | ||
| BATCH_NUT = 333 |
Contributor
There was a problem hiding this comment.
i'm guessing this '333' is a placeholder as the nut says 'xx'... can we document that this is a placeholder so i remember to come back and update it ?
Contributor
|
just the little doc update to clarify on otherwise LGTM. |
- Add BATCH_NUT (333) constant
- Update LedgerFeatures to advertise batch support
- Add PostMintQuoteCheckRequest, PostMintBatchRequest, PostMintBatchResponse models
- Implement batch DB operations in LedgerCrud and DbWriteHelper
- Implement check_mint_quotes and mint_batch in Ledger with atomic transaction support
- Add /v1/mint/quote/{method}/check and /v1/mint/{method}/batch endpoints
- Add comprehensive tests in tests/mint/test_mint_batch.py
- Add tests for get_mint_quotes - Add tests for update_mint_quotes_state - Add tests for _set_mint_quotes_pending (success/failure) - Add tests for _unset_mint_quotes_pending (success/failure)
- Add QuoteNotFoundError (code 20010) for unknown quotes - Implement all-or-nothing error handling in check_mint_quotes - Preserve quote order with ORDER BY CASE in get_mint_quotes - Add mint_max_batch_size setting for operator configuration - Add max batch size validation in both check and mint endpoints - Use settings.mint_max_batch_size in mint info instead of hardcoded 100
cf3cba0 to
1a51605
Compare
The ORDER BY CASE with parameters doesn't work properly with PostgreSQL. Now we fetch quotes and sort them in Python to preserve request order.
Per NUT-333 spec, the order of quotes in the request MUST be preserved in the response.
- Add supports_batch_mint() and get_max_batch_size() to MintInfo - Add check_mint_quotes() and mint_batch() to V1API - Add Wallet.check_mint_quotes() and Wallet.mint_batch() wrappers - Update NpubCash.mint_quotes() to use batch when mint supports it - Add fallback to sequential minting if batch fails
- Add tests for MintInfo.supports_batch_mint() and get_max_batch_size() - Add tests for NpubCash batch vs sequential mint selection - Add test for sequential fallback on batch failure
- Move MintInfo batch tests to test_mint_batch.py - Move wallet batch tests to test_mint_batch.py - Delete separate test files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implemented NUT-XX Batch Minting specification.
This PR adds support for:
POST /v1/mint/quote/{method}/check: Batch checking of quote states.POST /v1/mint/{method}/batch: Atomic batch minting of multiple quotes.The implementation ensures that all quotes in a batch are processed atomically. If any verification fails or any quote cannot be minted, the entire batch is rejected.