fix(payments): surface payment preimage on send result [AMB-2789]#25
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.).
|
Yes, expected. These send functions are node-direct — they call the customer's own LND/litd REST with the decrypted admin macaroon (self-custody), so the preimage is read straight from the node's payment stream. The lnd path does the same; it's symmetric. Our GraphQL API does expose So the node stream is the only place a self-custody send's preimage exists today; API parity is tracked in AMB-2790. |
b17e063 to
6cda008
Compare
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