Skip to content

xpay: add sendamount#9100

Open
Lagrang3 wants to merge 7 commits intoElementsProject:masterfrom
Lagrang3:xpay-include-fees
Open

xpay: add sendamount#9100
Lagrang3 wants to merge 7 commits intoElementsProject:masterfrom
Lagrang3:xpay-include-fees

Conversation

@Lagrang3
Copy link
Copy Markdown
Collaborator

@Lagrang3 Lagrang3 commented Apr 29, 2026

Add sendamount command, to make a payment specifying the desired amount to send instead of the amount to be received.

This is a feature asked for in issue #8353.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

@Lagrang3 Lagrang3 added this to the 26.06 milestone Apr 29, 2026
Change the name of attempt->deliver to attempt->amount,
do not assume that amount is the "desired delivery", since it might be
the "desired send" depending on the payment context.

Use helpers to get the fees and deliver amount from an attempt.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Change the name of payment->full_amount to payment->mpp_amount,
to make clear that this refers to the value needed in the last
hop payload for MPP payments to coordinate.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Don't assume that payment->amount means the desired delivery amount.
Use a helper instead when we need that.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Add an includefees flag to payment to indicate the desire for this
payment to be a "send amount" kind instead of "receive amount".

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
for the final hop payload, which for normal xpay payments is known in
advanced but not for sendamount payments (includefees flag on).

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
that only applies to sendamount payments (includefees flag on).

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
@Lagrang3 Lagrang3 force-pushed the xpay-include-fees branch 2 times, most recently from f036095 to 162bdbe Compare April 30, 2026 08:22
@Lagrang3 Lagrang3 marked this pull request as ready for review April 30, 2026 08:22
@Lagrang3 Lagrang3 force-pushed the xpay-include-fees branch from 162bdbe to 8be1d8a Compare April 30, 2026 09:25
@Lagrang3 Lagrang3 requested a review from cdecker as a code owner April 30, 2026 09:25
@cdecker
Copy link
Copy Markdown
Member

cdecker commented Apr 30, 2026

Yay, native drain command in xpay 🚀⚡

@daywalker90
Copy link
Copy Markdown
Collaborator

For sendamount to generate documentation it needs to be added to doc/Makefile like this:

        doc/renepaystatus.7 \
        doc/reserveinputs.7 \
        doc/sendamount.7 \
        doc/sendcustommsg.7 \
        doc/sendinvoice.7 \

Yay, native drain command in xpay 🚀⚡

💀 😂

Comment thread doc/schemas/sendamount.json Outdated
"resources": [
"Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
],
"examples": [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI complains about formatting here. It wants the brackets in the same line, if the array is empty.

Changelog-Added: sendamount command, to make a payment specifying the desired amount to send instead of the amount to be received.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
@Lagrang3 Lagrang3 force-pushed the xpay-include-fees branch from 8be1d8a to 28f5083 Compare April 30, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants