feat: add method to quote responses - #2178
Merged
thesimplekid merged 2 commits intoJul 6, 2026
Merged
Conversation
cdk-bot
reviewed
Jun 30, 2026
cdk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Verified findings approved for disclosure:
- Required
methodfield breaks quote response deserialization from older mints (high) - Wallets built from this PR cannot create or check quotes against existing mints that still emit the previous quote response shape withoutmethod, causing mint/melt operations to fail during response deserialization.
Additional locations included in summary:- crates/cashu/src/nuts/nut23.rs:268
- crates/cashu/src/nuts/nut25.rs:50
- crates/cashu/src/nuts/nut04.rs:403
- crates/cashu/src/nuts/nut05.rs:501
- crates/cashu/src/nuts/nut30.rs:46
- crates/cashu/src/nuts/nut30.rs:175
asmogo
force-pushed
the
feat/add-method-field-to-quote-responses
branch
from
July 1, 2026 13:44
e8ab903 to
f2bfbf8
Compare
cdk-bot
reviewed
Jul 1, 2026
cdk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Verified findings approved for disclosure:
- Custom WebSocket quote notifications do not backfill the new required method field (medium) - Custom WebSocket quote notifications from mints that omit the newly-added method field are rejected as parsing errors, while the HTTP fallback path continues to work.
Unanchored locations included in summary:- crates/cdk/src/wallet/subscription.rs:273
- Bolt12 melt responses without method default to Bolt11 through shared type alias (low) - Bolt12 melt quote responses that omit the new method field are recorded as Bolt11, which can misroute or misclassify quote state downstream.
Unanchored locations included in summary:- crates/cashu/src/nuts/nut25.rs:113
crodas
previously approved these changes
Jul 1, 2026
Collaborator
|
Thanks for this @asmogo I'll take it over and rebase and get it merged. |
thesimplekid
force-pushed
the
feat/add-method-field-to-quote-responses
branch
from
July 4, 2026 17:13
f2bfbf8 to
ea6ed42
Compare
Collaborator
3 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2178 +/- ##
==========================================
+ Coverage 72.72% 72.77% +0.04%
==========================================
Files 356 356
Lines 77588 78079 +491
==========================================
+ Hits 56427 56821 +394
- Misses 21161 21258 +97 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
crodas
approved these changes
Jul 4, 2026
thesimplekid
approved these changes
Jul 6, 2026
Add a required `method` field to all mint and melt quote responses (bolt11, bolt12, onchain, and custom) so wallets can tell which payment method a quote belongs to without relying on the request route. For wire compatibility with mints that don't send the field yet, missing values deserialize to the method implied by the response type (bolt11, bolt12, or onchain), and the wallet HTTP client fills in the method for custom responses from the request route. BREAKING CHANGE: quote response structs gain a required `method` field; constructing them now requires providing it.
`MeltQuoteBolt12Response` was a type alias for the bolt11 response, which made melt notifications ambiguous: every bolt12 melt event had to be broadcast to both the bolt11 and bolt12 subscription topics as a workaround. Make it a distinct struct with its own `NotificationPayload` variant and a `method` default of bolt12, and drop the dual-topic broadcast. Also fill the `method` field from the notification kind when websocket payloads omit it, so custom and bolt12 quote notifications from older mints deserialize with the correct method. BREAKING CHANGE: `MeltQuoteBolt12Response` is no longer interchangeable with `MeltQuoteBolt11Response`.
thesimplekid
force-pushed
the
feat/add-method-field-to-quote-responses
branch
from
July 6, 2026 12:32
ea6ed42 to
52ef5d9
Compare
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.
Description
Implementing cashubtc/nuts#387
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just quick-checkbefore committingcrates/cdk-ffi)