Skip to content

feat(core): add payment request receive saga#172

Draft
Egge21M wants to merge 10 commits into
masterfrom
feat/receive-requests
Draft

feat(core): add payment request receive saga#172
Egge21M wants to merge 10 commits into
masterfrom
feat/receive-requests

Conversation

@Egge21M
Copy link
Copy Markdown
Collaborator

@Egge21M Egge21M commented May 11, 2026

Summary

  • add the Phase 1 incoming payment-request receive saga and API methods under paymentRequests.incoming
  • support in-band/manual PaymentRequestPayload claiming through the normal receive operation pipeline with dedupe, source metadata, history metadata, and recovery handling
  • persist payment-request receive operations/attempts across memory, SQLite, Expo SQLite, and IndexedDB adapters
  • extend adapter contract tests and add a changeset for the new public API/persistence surface

Scope

This PR implements the core Phase 1 slice from PAYMENT_REQUEST_RECEIVE_PLAN.md.

Included:

  • request creation, activation, cancellation, lookup, listing, manual payload claim, and payload ingestion
  • child ReceiveOperationService linkage for mint interaction and proof persistence
  • request/attempt persistence in core memory repos and all persistent adapters
  • receive source metadata and receive-history metadata for payment-request-backed receives

Not included:

  • live Nostr transport plugin or NIP-17 relay subscription/unwrap support
  • outgoing Nostr delivery parity
  • full NUT-10 validation, DLEQ policy hardening, multi-unit receive support, expiration policy, or app docs
  • atomic parent-attempt/child-receive writes; the implementation uses idempotency, request locking, and recovery reconciliation instead

Tests

  • bun run typecheck in packages/core
  • bun run build in packages/core
  • bun run test:unit -- test/unit/PaymentRequestReceiveService.test.ts test/unit/PaymentRequestsApi.test.ts in packages/core (642 pass)
  • bun run typecheck in packages/sqlite3, packages/sqlite-bun, packages/expo-sqlite, and packages/indexeddb
  • sqlite3/sqlite-bun/expo-sqlite contract and schema tests
  • bun run build in packages/adapter-tests
  • git diff --check

Notes

  • IndexedDB browser contract tests could not run locally because the Playwright Chromium binary is not installed.
  • gh auth is invalid locally, so this draft PR was opened through the GitHub connector.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 1813e34

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 93.69748% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.18%. Comparing base (74cf660) to head (1813e34).

Files with missing lines Patch % Lines
...ages/core/services/PaymentRequestReceiveService.ts 93.44% 49 Missing ⚠️
...es/memory/MemoryPaymentRequestReceiveRepository.ts 92.17% 9 Missing ⚠️
packages/core/api/PaymentRequestsApi.ts 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   79.84%   80.18%   +0.33%     
==========================================
  Files         108      111       +3     
  Lines       11783    12863    +1080     
==========================================
+ Hits         9408    10314     +906     
- Misses       2375     2549     +174     
Flag Coverage Δ
core-unit 82.27% <93.69%> (+1.04%) ⬆️

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 changed the title feat(core): add payment request receive operations feat(core): add payment request receive saga May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant