fix(payments): surface payment preimage on send result [AMB-2789]#25
Open
wthrajat wants to merge 2 commits into
Open
fix(payments): surface payment preimage on send result [AMB-2789]#25wthrajat wants to merge 2 commits into
wthrajat wants to merge 2 commits into
Conversation
LND and litd return payment_preimage in the send-payment stream but the SDK dropped it. Add preimage to NodePaymentResult and the stream update types, and pass it through in sendLndPayment and sendAssetPayment so callers can use it as proof of payment (L402 etc.).
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.
What this does
The send functions dropped the payment preimage that LND and litd already return in the send-payment stream. This adds it.
Why
The preimage is the proof that a payment went through. It's needed for L402 and any proof-of-payment flow. Before this, the only way to get it was setting
AMBOSS_SDK_DEBUG=1and reading the raw stream by hand. An external builder flagged this as their main blocker.Changes
NodePaymentResultnow has an optionalpreimagefield.payment_preimage.sendLndPaymentandsendAssetPaymentcopy it into the terminal result.No behavior change for existing callers — it's a new optional field.
Linear: AMB-2789