Add LSP opening fee to LspInvoiceResponse#683
Merged
Conversation
Include the LSP's JIT channel opening fee in the lsp_invoice response so clients can display the negotiated fees when presenting an invoice. The fee is computed from the selected LSP's LSPS2 fee parameters using max(min_fee_msat, ceil(amount * proportional / 1_000_000)). When the node has sufficient incoming capacity and no JIT channel is needed, the fee is reported as 0. Also surfaces the fee through gl-sdk's ReceiveResponse for UniFFI bindings consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
opening_fee_msatfield toLspInvoiceResponseprotobuf messagemax(min_fee_msat, ceil(amount * proportional / 1_000_000))gl-sdk'sReceiveResponsefor UniFFI bindings consumers (Kotlin/Swift/Python)This allows clients (e.g., Breez SDK) to display the negotiated LSP fees when presenting an invoice to the user.
Test plan
test_lsps_plugin_callsupdated and passing — verifiesopening_fee_msat == 1000for a 31337 msat invoice with LSPS2 policymin_fee_msat=1000, proportional=1000🤖 Generated with Claude Code