Repository navigation
Support CLINK offer quantity and payer-data discovery - #1077
Merged
Merged
Conversation
shocknet-justin
marked this pull request as ready for review
November 6, 2026 18:51
- Introduced `assertNoReservedOfferPayerData` function to validate payer data fields. - Updated `ManagementManager` and `OfferManager` to utilize the new validation. - Enhanced tests to ensure reserved fields are correctly rejected during offer creation and updates.
This was referenced Nov 9, 2026
boufni95
approved these changes
Nov 9, 2026
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
Adds quantity support to CLINK Offers and a distinct, recoverable response for missing or invalid required payer data.
Aligned with:
Payer Data
Missing or invalid required payer fields now return offer code 6, with the full list of required field names and no invoice. Wallets can collect or correct those fields and retry.
Malformed offer requests remain code 1. This includes malformed JSON, which previously returned code 6 through the shared transport. Other CLINK operations retain their existing error codes.
Quantity and Pricing
When an offer requires
quantity:amount_satsas the price per unit.An unsolicited quantity does not change pricing or reach seller fulfillment data. Offers that do not require quantity retain their existing amount semantics.
The spec also defines quantity for host-resolved variable pricing, where the encoded offer may contain no satoshi price. This PR supports Pub’s existing fixed and spontaneous pricing paths; it does not introduce a variable-pricing engine.
Seller Fulfillment
Accepted quantity is retained as a number in invoice payer data and is available to seller callback URL templates alongside the total amount.
The existing
GetUserOfferInvoicesRPC retains its string-map contract, returning quantity as a string there.Release Coordination
Targets
dash2.The SDK dependency and lockfile are intentionally unchanged because SDK 1.8 has not been released. Pub uses a local quantity-aware request type until that dependency is updated.
Update the SDK dependency on
dash2after 1.8 is published and before the Pub release merge.Testing
Optional Manage Callbacks
SDK: shocknet/ClinkSDK#37
Spec: shocknet/CLINK#18