182 Commits

Author SHA1 Message Date
daywalker90
d03cf820a8 clnrest: add clnrest-register-path method for dynamic paths
Changelog-Added: clnrest: add clnrest-register-path rpc method to register dynamic paths
2026-01-19 12:55:57 +10:30
ShahanaFarooqui
54af71c5b3 doc: Added doc schemas with description and update proto 2025-12-19 15:28:46 -08:00
nazarevsky
bcdce8f40d cln-rpc: update schema, update proto for xpay payer_note field 2025-12-18 12:47:06 -08:00
Rusty Russell
ea0b8040c2 doc: include delnetworkevent in generated documentation, and grpc.
Also added missing "added" annotation.  This meant that I had to manually
change contrib/msggen/msggen/patch.py to insert that added notation where it
was missing from .msggen.json.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-None: introduced this release.
2025-11-24 14:31:02 +10:30
daywalker90
d125b3c720 msggen: add missing methods from v25.12
Changelog-None
2025-11-21 13:51:28 +10:30
daywalker90
ab73388902 msggen: add missing methods from v25.09 2025-11-21 13:51:28 +10:30
Rusty Russell
b74d32f6c4 lightningd: add withhold option to fundchannel_complete.
This is just a polite way of telling us that if we close, don't bother broadcasting
since we didn't broadcast the funding tx.

Changelog-Added: JSON-RPC: `fundchannel_complete` new parameter `withhold` (default false).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-19 07:23:39 +10:30
Rusty Russell
39349965a6 lightningd: add withheld flag to listpeerchannels and listclosedchannels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listpeerchannels` `funding` object `withheld` flag, and `listclosedchannels` `funding_withheld` flags, indicating fundchannel_complete was called with the `withheld` parameter true.
2025-11-19 07:23:39 +10:30
Rusty Russell
1102d8063e askrene: add optional layers to reservations.
We have the issue of aliases: xpay uses scids like 0x0x0 for
routehints and blinded paths, and then can apply reservations to them.  But
generally, reservations are *global*, so we need to differentiate.

Changelog-Added: Plugins: `askrene-reserve` and `askrene-unreserve` can take an optional `layer` inside `path` elements.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-17 13:52:54 +10:30
Lagrang3
4f1c8806d7 askrene: add askrene-bias-node rpc
Changelog-Added: askrene-bias-node: an RPC command to set a bias on node's outgoing or incoming channels.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2025-11-13 15:15:27 +10:30
Lagrang3
5769beb1db askrene: add timestamp to biases
We add one more field to biases: "timestamp".
With the timestamp variable old biases can be removed with the
askrene-age command.

Changelog-Added: Plugins: askrene channel biases now have an associated timestamp, and are timed out by askrene-age

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2025-11-13 15:15:27 +10:30
Rusty Russell
ec05e5da91 autoclean: clean network events (30 days by default).
We also document this in the listnetworkevents command itself.

The test_autoclean_once was getting repetitive, so I cleaned that
up too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: `autoclean` will remove networkevents after 30 days by default.
2025-11-12 13:58:43 +10:30
Rusty Russell
3b332948dd lightningd: implement listnetworkevents.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-12 13:58:43 +10:30
Sangbida Chaudhuri
de9c6305a1 exposesecret: Add support for mnemonic-based HSM secrets
Update the exposesecret plugin to work with the new unified HSM secret
format that supports BIP39 mnemonics.

Changelog-Added - exposesecret now has a mnemonic field
2025-10-26 12:37:58 +10:30
Rusty Russell
54444e4337 BOLT12: Update recurrence to latest spec draft.
Changes:
* Fields renumbered to their draft values + billion.
* offer_recurrence now comes in compulsory or optional (backwards compat) flavors.
* `proportional_amount` is now inside `offer_recurrence_base` not `offer_recurrence_paywindow`.
* New field `invreq_recurrence_cancel`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: Draft specification for recurring offers changed: old recurring offers will no longer work.
2025-10-01 15:31:30 +09:30
Rusty Russell
6c626b124b lightningd: add chainmoves and channelmoves to wait command.
Only makes sense to wait on creation, since they neither are deleted
nor updated.

We also enhance the list commands to take the standard index options.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `wait`: new subsystems `chainmoves` and `channelmoves`.
2025-08-19 13:37:50 +09:30
Rusty Russell
9680404fc4 doc/schemas: add websocket to type in doc/schemas/notification/connect.json
This is done by tests/test_connection.py::test_websocket:

```
{
  "jsonrpc": "2.0",
  "method": "connect",
  "params": {
    "connect": {
      "id": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f",
      "direction": "in",
      "address": {
        "type": "websocket",
        "subtype": "ipv4",
        "address": "127.0.0.1",
        "port": 59412
      }
    }
  }
}
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-08-18 10:01:07 +09:30
Lagrang3
0c5c7a5334 askrene: add maxparts
Changelog-Added: askrene: add a new parameter maxparts to getroutes that limits the number of routes in the solution.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2025-08-15 16:13:19 +09:30
daywalker90
e3e41163e2 cln-bip353: add plugin that fetches payment instructions from human readable addresses
Changelog-Add: new plugin cln-bip353 that can fetch BIP-353 payment instructions from human readable addresses
2025-08-14 18:41:23 +09:30
daywalker90
529337a5fb msggen: add signmessagewithkey
Changelog-None
2025-05-15 13:04:13 +02:00
Lagrang3
a90de8dcc7 sendonion: add total_amount_msat parameter
Changelog-Added: sendonion: a new paramter total_amount_msat to make MPP payments with sendpay and sendonion compatible.

[ Reordered to put new parameter at the end --RR ]
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2025-05-13 15:00:50 +09:30
Rusty Russell
e20efa17e2 msggen: regenerate.
Somehow GitHub's "Enable auto-merge" merged the PR without it actually passing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-05-08 13:10:41 +09:30
Rusty Russell
6bf36915fd lightningd: support index/start/end pagination for listhtlcs.
Changelog-Added: JSON-RPC: `listhtlcs` supports `index`, `start` and `end` parameters for pagination support.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-04-29 09:38:20 +09:30
Rusty Russell
7ba6263c48 lightningd: add created_index and updated_index to listhtlcs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listhtlcs` has `created_index` and `updated_index` fields.
2025-04-29 09:38:20 +09:30
Rusty Russell
9636553c16 lightningd: wait interface for htlcs indexes.
Note that documentation says invoice expiries can batch, but that's no
longer true, so delete it.  Usually, we miss a number because the
change is too fast.

This adds the wait interface, but it doesn't actually fire until the next
commit, which wires it into the db code.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `wait` now supports the `htlcs` (`listhtlcs`) subsystem.
2025-04-29 09:38:20 +09:30
Rusty Russell
db104aae92 lightningd: improve wait API by making details fields per-subsystem.
It makes the schema simpler, and indeed, expressable by GRPC.

Changelog-Added: JSON-RPC: `wait` now has separate `invoices`, `forwards` and `sendpays` objects for each subsystem.
Changelog-Deprecated: JSON-RPC: `wait` reply `details` object: use subsytem specific object instead.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-04-29 09:38:20 +09:30
Rusty Russell
8974375de8 lightningd: add short_channel_id option to listpeerchannels.
Requested-by: @whitslack
Closes: https://github.com/ElementsProject/lightning/issues/8233
Changelog-Added: JSON-RPC: `listpeerchannels` now has a `short_channel_id` parameter for just listing a specific channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-04-28 14:13:12 +09:30
daywalker90
05f0100e7d msggen: comply with grpc and rust naming conventions
Changelog-Changed: Some enums, structs, functions in pyln-grpc-proto/cln-grpc/cln-rpc
have been slightly renamed so they follow grpc and rust's naming convention
2025-02-27 11:53:48 -06:00
daywalker90
3e461036b3 msggen: add InjectOnionMessage
Changelog-None
2025-02-27 11:53:48 -06:00
daywalker90
5dab24ff38 msggen: add channel_state_changed notification
Changelog-None
2025-02-27 11:53:48 -06:00
Rusty Russell
5a80223f3e setconfig: add transient option.
Changelog-Added: JSON-RPC: `setconfig` now has a `transient` flag which means it won't rewrite your config file.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-02-24 19:38:37 +10:30
Lagrang3
fe4d5036c2 add max_htlc_value_in_flight_msat to listpeerchan
Changelog-Added: JSON-RPC: `listpeerchannels` new output fields `their_max_total_htlc_out_msat` and `our_max_total_htlc_out_msat` as the value of `max_htlc_value_in_flight` (as of BOLT02) set by the local and remote nodes on channel creation.

Changelog-Deprecated: JSON-RPC: `listpeerchannels` value `max_total_htlc_in_msat`: use `our_max_total_htlc_out_msat` instead to follow spec naming convention.
2025-02-21 17:03:36 -06:00
Rusty Russell
c22cc11af5 fetchinvoice: allow user to specify bip353 name corresponding to how they got offer.
Changelog-Added: JSON-RPC: `fetchinvoice` BIP 353 name support (`bip353`).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-02-11 20:19:01 -06:00
Rusty Russell
ba3e85bb43 decode: handle new bip353 fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-02-11 20:19:01 -06:00
Rusty Russell
b78b3232e3 lightningd: implement unblacklist.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `blacklistrune` now has an option to un-blacklist (`relist`).
2025-02-05 16:43:09 -06:00
michael1011
060368bb0a xpay: add maxdelay parameter
Changelog-Added: Plugins: `xpay` now supports a `maxdelay` parameter for better `xpay-handle-pay` compatibility.
2025-01-22 12:19:47 -08:00
Rusty Russell
80c43ec97d injectpaymentionion: allow specification of actual amount which reaches destination.
This appears in listsendpays / listpays, and is useful information (if we know!).

This doesn't fix old payments, but means that xpay can use this for new payments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-12-17 08:14:45 +10:30
Rusty Russell
aaca16d313 doc: fix injectpaymentonion schema.
I used an unknown arg and it didn't complain.  injectpaymentonion's schema predated
the sweep which fixed up use of "additionalProperties".

Indeed, we were missing some properties!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-12-17 08:14:45 +10:30
daywalker90
2ba05ef2b8 msggen: add missing rpc commands new to 24.11
Changelog-None
2024-11-28 17:39:26 +10:30
Alex Myers
dc878dc937 lightningd: add option for minimum seeker autoconnect peers
Changelog-added: Added option --autoconnect-seeker-peers, allowing seeker to reach out to new nodes for additional gossip.
2024-11-22 15:21:45 +10:30
Vincenzo Palazzo
6f0dbbb20f bolt12: allow to inject payer_metadata
Payer metadata is a field that controls the payer ID
provided during the fetchinvoice process.

There are use cases where this is highly useful, such as
proving that the payer has paid for the correct item.

Imagine visiting a merchant's website to pay for multiple offers, where
one of these offers is a default offer (with no description and no set amount).

In this scenario, the merchant could claim not to have received
payment for a specific item. Since the same offer may be used to
fetch invoices for different products, there needs to be a way to
identify which product the invoice corresponds to.

With this commit, it will be possible to inject payer metadata,
which helps solve the issue described above.

For example, possible payer metadata could be `to_hex(b"{payer_node_id}.{product_id}.{created_at}")`.

Changelog-Added: JSON-RPC: `fetchinvoice` allows setting invreq_metadata via `payer_metadata` parameter.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-11-19 22:54:22 +01:00
Rusty Russell
1b413502e0 lightningd: deprecate experimental-offers option.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: Config: `experimental-offers` (it's now the default).
2024-11-18 10:42:54 +01:00
Dusty Daemon
809f3b01d9 close: Print multiple txs; Fixes #6467
Changelog-Changed: `close` now outputs txs & txids of all closing transactions (splice candidates can cause there to be multiple).
2024-11-17 16:04:06 +10:30
daywalker90
c4e67c0b96 add listing options to listpays
Changelog-Added: JSON-RPC: `listpays` has `index`, `start` and `limit` parameters for listing control.
2024-11-12 10:43:37 +01:00
Dusty Daemon
73ad8eaa31 splice: Allow splice_update to return signatures
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.

Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.

Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
2024-11-12 06:42:52 +10:30
Dusty Daemon
b03f299c9b splice: Modify splice_signed to work with multiple channels
`splice_signed` now searchs the PSBT for channel ids

Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
2024-11-12 06:42:52 +10:30
Rusty Russell
7b2c791dcf doc: fix up missing fields from schemas.
This allows the next patch (which makes the schemas stricter) to not
break our tests.

We add some missing fields (including dev fields, but they're empty and hidden),
and add a few minor clarifications and a spelling fix.  Most of these are new
schemas for this release, so no mention in Changelog.

Here is the difference in the man pages:

    --- doc/lightning-askrene-inform-channel.7.md.old	2024-10-29 17:33:07.714521584 +1030
    +++ doc/lightning-askrene-inform-channel.7.md	2024-10-29 17:42:37.434280109 +1030
    @@ -24,6 +24,8 @@
     - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
    +- **layer** (string): The name of the layer to apply this change to.
    +- **timestamp** (u64): The UNIX timestamp when this constraint was created.
     - **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
    --- doc/lightning-askrene-listlayers.7.md.old	2024-10-29 17:33:07.716521571 +1030
    +++ doc/lightning-askrene-listlayers.7.md	2024-10-29 17:42:37.424280316 +1030
    @@ -29,13 +29,16 @@
     - **channel\_updates** (array of objects):
    +  - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction this update applies to.
    +  - **enabled** (boolean, optional): True if this can be used, false otherwise.
       - **htlc\_minimum\_msat** (msat, optional): The minimum value allowed in this direction.
       - **htlc\_maximum\_msat** (msat, optional): The maximum value allowed in this direction.
       - **fee\_base\_msat** (msat, optional): The base fee to apply to use the channel in this direction.
       - **fee\_proportional\_millionths** (u32, optional): The proportional fee (in parts per million) to apply to use the channel in this direction.
    -  - **delay** (u16, optional): The CLTV delay required for this direction.
    +  - **cltv\_expiry\_delta** (u16, optional): The CLTV delay required for this direction.
     - **constraints** (array of objects):
       - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
    +  - **timestamp** (u64, optional): The UNIX timestamp when this constraint was created.
       - **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
    --- doc/lightning-askrene-listreservations.7.md.old	2024-10-29 17:33:07.719521550 +1030
    +++ doc/lightning-askrene-listreservations.7.md	2024-10-29 17:42:37.428280233 +1030
    @@ -16,7 +16,7 @@
    -On success, an object containing **layers** is returned. It is an array of objects, where each object contains:
    +On success, an object containing **reservations** is returned. It is an array of objects, where each object contains:
    --- doc/lightning-autoclean-status.7.md.old	2024-10-29 17:33:07.732521462 +1030
    +++ doc/lightning-autoclean-status.7.md	2024-10-29 17:42:37.441279965 +1030
    @@ -9,7 +9,7 @@
     
    -The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem.
    +The **autoclean-status** RPC command tells you about the status of the autoclean plugin, optionally for only one subsystem.
     
    --- doc/lightning-renepay.7.md.old	2024-10-29 17:33:07.927520140 +1030
    +++ doc/lightning-renepay.7.md	2024-10-29 17:42:37.996268504 +1030
    @@ -58,6 +58,9 @@
     - **status** (string) (one of "complete", "pending", "failed"): Status of payment.
    +- **bolt11** (string, optional): The bolt11 invoice paid. *(added v23.08)*
    +- **bolt12** (string, optional): The bolt12 invoice paid. *(added v23.08)*
    +- **groupid** (u64, optional): The groupid used for these payment parts (as can be seen in listsendpays) *(added v23.08)*
     - **destination** (pubkey, optional): The final destination of the payment.
    --- doc/lightning-sendonion.7.md.old	2024-10-29 17:33:07.937520073 +1030
    +++ doc/lightning-sendonion.7.md	2024-10-29 17:42:37.957269309 +1030
    @@ -22,7 +22,7 @@
    -- **first\_hop** (object): Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute*.:
    +- **first\_hop** (object): Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute* (so fields not mentioned here are ignored).:
    
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `renepay` return fields documented in schema (`bolt11`, `bolt12` and `groupid`)
2024-10-30 15:39:12 +10:30
Rusty Russell
fd717c71af global: deprecate old names in JSON fields, add new ones.
Changelog-Added: JSON-RPC: `decode` now used modern BOLT 4 language for blinded paths, `first_path_key`.
Changelog-Deprecated: JSON-RPC: `decode` `blinding` in blinded path: use `first_path_key`.
Changelog-Added: Plugins: `onion_message_recv` and `onion_message_recv_secret` hooks now used modern BOLT 4 language for blinded paths, `first_path_key`.
Changelog-Deprecated: JSON-RPC: `onion_message_recv` and `onion_message_recv_secret` hooks `blinding` in blinded path: use `first_path_key`.
2024-10-16 07:14:32 +10:30
Se7enZ
f9e28b9bfa keysend: Add maxfee to keysend for consistency with pay. ([#7227])
Changelog-Added: keysend: Add `maxfee` to keysend for consistency with pay. ([#7227])
2024-10-14 11:58:00 +02:00
Lagrang3
9afc10bf99 renepay: add cli option exclude
msggen cannot handle the complex type in renepay-exclude,
therefore I added a rule override for it, just like pay-exclude.

```
msggen cln-grpc/proto/node.proto
Traceback (most recent call last):
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/__main__.py", line 131, in <module>
    main()
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/__main__.py", line 115, in main
    run()
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/__main__.py", line 72, in run
    service = load_jsonrpc_service(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/utils/utils.py", line 241, in load_jsonrpc_service
    methods = [load_jsonrpc_method(name) for name in grpc_method_names]
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/utils/utils.py", line 209, in load_jsonrpc_method
    request = CompositeField.from_js(schema["methods"][rpc_name]['request'], path=name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/model.py", line 297, in from_js
    field = ArrayField.from_js(fpath, ftype)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/model.py", line 464, in from_js
    itemtype = UnionField.from_js(child_js, path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/model.py", line 393, in from_js
    itemtype = PrimitiveField(
               ^^^^^^^^^^^^^^^
TypeError: PrimitiveField.__init__() missing 2 required positional arguments: 'added' and 'deprecated'
```

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Changelog-EXPERIMENTAL: renepay: add cli option "exclude" to manually disable channels and nodes.
2024-08-12 22:44:58 -07:00