Skip to content

gl-sdk: Add list_payments to Node#690

Open
cdecker wants to merge 3 commits intomainfrom
2026w14-list-payments
Open

gl-sdk: Add list_payments to Node#690
cdecker wants to merge 3 commits intomainfrom
2026w14-list-payments

Conversation

@cdecker
Copy link
Copy Markdown
Collaborator

@cdecker cdecker commented Apr 2, 2026

Summary

  • Add list_payments method to gl-sdk Node that fetches invoices (received) and pays (sent) via CLN RPCs, merges them into a unified Payment type, and applies in-memory filtering
  • Supports filtering by payment type, time range, status (failures excluded by default), with offset/limit pagination
  • Part of Breez SDK -> gl-sdk migration: simpler approach using direct RPC calls instead of local SQLite DB

Test plan

  • cargo build -p gl-sdk compiles cleanly
  • 12 new Python tests pass (tests/test_list_payments.py) verifying UniFFI type exposure, enum variants, and record construction
  • Integration test with a live node calling list_payments end-to-end

🤖 Generated with Claude Code

cdecker and others added 3 commits March 11, 2026 18:03
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>
Adds a unified list_payments API that fetches invoices (received) and
pays (sent) via CLN RPCs, merges them into a common Payment type, and
applies in-memory filtering by type, time range, status, with
pagination support. This is part of the migration from Breez SDK.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests verify that all new UniFFI types (ListPaymentsRequest, Payment,
PaymentType, PaymentStatus, PaymentTypeFilter) are correctly exposed
in Python bindings, including field construction and enum variants.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cdecker
Copy link
Copy Markdown
Collaborator Author

cdecker commented Apr 2, 2026

Competing implementation to #689 as I didn't check with existing PRs. Sorry @angelix this was not intended. I review yours, you review mine, and we merge the one that has a nicer list_payments? xD

@angelix
Copy link
Copy Markdown
Contributor

angelix commented Apr 2, 2026

Competing implementation to #689 as I didn't check with existing PRs. Sorry @angelix this was not intended. I review yours, you review mine, and we merge the one that has a nicer list_payments? xD

No worries, merge yours as it includes changes to the node if I understand correctly and I'll create a PR if needed.

My wild guess is that I need some extra stuff from the invoice eg. Destination public key

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.

2 participants