Skip to content

feat: add preferred_mints to payment requests#1925

Open
a1denvalu3 wants to merge 4 commits into
cashubtc:mainfrom
a1denvalu3:feat/payment-request-preferred-mints
Open

feat: add preferred_mints to payment requests#1925
a1denvalu3 wants to merge 4 commits into
cashubtc:mainfrom
a1denvalu3:feat/payment-request-preferred-mints

Conversation

@a1denvalu3
Copy link
Copy Markdown
Contributor

Summary

  • Add support for preferred_mints to Cashu Payment Requests (NUT-18 and NUT-26)
  • Update PaymentRequest and CreateRequestParams structs with preferred_mints across core, wallet, CLI, and FFI
  • Ensure mints and preferred_mints are mutually exclusive during creation and decoding
  • Update wallet pay_request selection logic to prioritize preferred_mints over fallback mints if they have sufficient balance

@github-project-automation github-project-automation Bot moved this to Backlog in CDK Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 79.53488% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.25%. Comparing base (bdf9dc6) to head (8eae376).

Files with missing lines Patch % Lines
crates/cdk/src/wallet/payment_request.rs 53.44% 27 Missing ⚠️
crates/cashu/src/nuts/nut18/payment_request.rs 86.56% 9 Missing ⚠️
crates/cdk-ffi/src/types/payment_request.rs 78.12% 7 Missing ⚠️
crates/cashu/src/nuts/nut26/error.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1925      +/-   ##
==========================================
+ Coverage   65.14%   65.25%   +0.10%     
==========================================
  Files         329      329              
  Lines       56742    56939     +197     
==========================================
+ Hits        36965    37155     +190     
- Misses      19777    19784       +7     

☔ 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 force-pushed the feat/payment-request-preferred-mints branch from 1366643 to b59c2b7 Compare April 23, 2026 06:58
Copy link
Copy Markdown
Contributor

@lescuer97 lescuer97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The errors in the CLI seem to be clippy and other errors not related to the code

@thesimplekid
Copy link
Copy Markdown
Collaborator

@a1denvalu3
Copy link
Copy Markdown
Contributor Author

a1denvalu3 commented Apr 28, 2026

Can you rebase instead of merge https://github.com/cashubtc/cdk/blob/main/DEVELOPMENT.md#keeping-your-branch-up-to-date please

I usually rebase, but the update button under the PR was too tempting this time.

@a1denvalu3 a1denvalu3 force-pushed the feat/payment-request-preferred-mints branch from d238cdd to bbc1c74 Compare May 6, 2026 11:46
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.

3 participants