Skip to content

feat: add optimized batch mint finalization#165

Closed
Egge21M wants to merge 5 commits into
masterfrom
feature/batch-minting
Closed

feat: add optimized batch mint finalization#165
Egge21M wants to merge 5 commits into
masterfrom
feature/batch-minting

Conversation

@Egge21M

@Egge21M Egge21M commented May 6, 2026

Copy link
Copy Markdown
Collaborator

This pull request adds output-deferred single minting and optimized BOLT11 batch mint finalization for NUT-29-capable mints.

Problem

Preparing output data at quote creation prevents multiple paid quotes from being combined into better denomination splits. That keeps single 23-sat quotes at 16,4,2,1 each, instead of allowing three quotes to mint as 64,4,1.

Summary

  • Moves single mint output-data creation to execution, persisted before calling the mint.
  • Adds batch attempt persistence and recovery metadata across core and storage adapters.
  • Adds a shared SQLite-backed integration test proving three 23-sat quotes mint into 3 consolidated proofs.
  • Updates the integration mint image to cashubtc/mintd:v0.16.0.
  • Adds .changeset/batch-minting.md.

Verification

  • bun --cwd packages/adapter-tests typecheck
  • bun --cwd packages/core typecheck
  • bun --cwd packages/core test:unit
  • bun --cwd packages/sqlite3 typecheck
  • bun --cwd packages/sqlite-bun typecheck
  • bun --cwd packages/expo-sqlite typecheck
  • bun --cwd packages/indexeddb typecheck
  • ./scripts/test-integration.sh sqlite3
  • targeted batch integration for sqlite3, sqlite-bun, and expo-sqlite

IndexedDB browser integration was skipped because Playwright does not work on this system.

Changeset

  • Added .changeset/batch-minting.md.

@github-project-automation github-project-automation Bot moved this to Backlog in coco May 6, 2026
@changeset-bot

changeset-bot Bot commented May 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3d10d7e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@cashu/coco-core Major
@cashu/coco-indexeddb Major
@cashu/coco-expo-sqlite Major
@cashu/coco-sqlite Major
@cashu/coco-sqlite-bun Major
@cashu/coco-adapter-tests Major
@cashu/coco-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Egge21M Egge21M linked an issue May 6, 2026 that may be closed by this pull request
@Egge21M Egge21M changed the title Feature: Add batch-minting feat: add optimized batch mint finalization May 6, 2026
@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.27939% with 421 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.79%. Comparing base (b3ae3f8) to head (3d10d7e).

Files with missing lines Patch % Lines
...kages/core/operations/mint/MintOperationService.ts 21.93% 242 Missing ⚠️
...ages/core/infra/handlers/mint/MintBolt11Handler.ts 12.50% 91 Missing ⚠️
...itories/memory/MemoryMintBatchAttemptRepository.ts 22.64% 41 Missing ⚠️
...s/core/services/watchers/MintOperationProcessor.ts 68.53% 28 Missing ⚠️
packages/core/services/MintService.ts 10.00% 18 Missing ⚠️
packages/core/operations/mint/MintOperation.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
- Coverage   84.28%   81.79%   -2.49%     
==========================================
  Files         115      117       +2     
  Lines       13922    14543     +621     
==========================================
+ Hits        11734    11896     +162     
- Misses       2188     2647     +459     
Flag Coverage Δ
core-integration 54.62% <ø> (+0.60%) ⬆️
core-unit 84.70% <28.27%> (-2.85%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Egge21M Egge21M force-pushed the feature/batch-minting branch from a6e2385 to 3d10d7e Compare May 19, 2026 11:44
@Egge21M Egge21M closed this Jun 9, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in coco Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat: batch minting

1 participant