Skip to content

sdk: Allow setting an invoice expiry in receive - #774

Draft
olegfomenko wants to merge 3 commits into
mainfrom
feature/expose-invoice-expriry
Draft

olegfomenko wants to merge 3 commits into
mainfrom
feature/expose-invoice-expriry

Conversation

@olegfomenko

@olegfomenko olegfomenko commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Add an optional expiry (seconds) to LspInvoiceRequest. The plugin passes it to CLN's invoice when no JIT channel is needed, and forwards it to lsps-lsps2-invoice for JIT channels; CLN ignores it there for now. When choosing LSP fee offers, the plugin now picks the first one with valid_until > now + expiry if expiry was provided; otherwise, the one with valid_until> now + 60sec.

Exposed in gl-sdk Node::receive (default None in Kotlin/Swift/Python), gl-sdk-napi, gl-sdk-cli (--expiry) and glclient lsp_invoice.

BREAKING CHANGE: Rust Node::receive takes a new expiry argument.

DEPENDS ON: ElementsProject/lightning#9755

Add an optional `expiry` (seconds) to `LspInvoiceRequest`. The plugin
passes it to CLN's `invoice` when no JIT channel is needed, and forwards
it to `lsps-lsps2-invoice` for JIT channels; CLN ignores it there for
now. When choosing LSP fee offers, the plugin now picks the one with the
latest `valid_until`.

Exposed in gl-sdk `Node::receive` (default None in Kotlin/Swift/Python),
gl-sdk-napi, gl-sdk-cli (`--expiry`) and glclient `lsp_invoice`.

BREAKING CHANGE: Rust `Node::receive` takes a new `expiry` argument.
@olegfomenko
olegfomenko marked this pull request as draft November 19, 2026 22:46
Oleh Fomenko added 2 commits November 20, 2026 17:12
@olegfomenko
olegfomenko requested review from cdecker and nepet November 20, 2026 18:41
@olegfomenko olegfomenko self-assigned this Nov 20, 2026

This branch has not been deployed

No deployments
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.

1 participant